From cca509cd746128100bdc767dba8b7aa6eb957c80 Mon Sep 17 00:00:00 2001 From: Henry Stuifzand Date: Sun, 26 Jul 2026 09:52:23 +0000 Subject: [PATCH] UI Part 1 --- _i18n/i18n.properties | 12 ++++++++ app/incidents/annotations.cds | 48 ++++++++++++++++++++++++------ app/incidents/webapp/manifest.json | 3 +- 3 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 _i18n/i18n.properties diff --git a/_i18n/i18n.properties b/_i18n/i18n.properties new file mode 100644 index 0000000..b98f3d4 --- /dev/null +++ b/_i18n/i18n.properties @@ -0,0 +1,12 @@ + +#XFLD,120: Label for a filter field +Urgency=Urgency + +#XFLD,120: Label for a filter field +Status=Status + +#XFLD,120: Label for a column title +Title=Title + +#XFLD,120: Label for a column title +Customer=Customer diff --git a/app/incidents/annotations.cds b/app/incidents/annotations.cds index 14ec0d4..c72a224 100644 --- a/app/incidents/annotations.cds +++ b/app/incidents/annotations.cds @@ -1,4 +1,6 @@ using ProcessorService as service from '../../srv/services'; +using from '../../db/schema'; + annotate service.Incidents with @( UI.FieldGroup #GeneratedGroup : { $Type : 'UI.FieldGroupType', @@ -33,25 +35,31 @@ annotate service.Incidents with @( }, ], UI.LineItem : [ - { - $Type : 'UI.DataField', - Label : 'customer_ID', - Value : customer_ID, - }, { $Type : 'UI.DataField', Value : title, + Label : '{i18n>Title}', }, { $Type : 'UI.DataField', - Label : 'urgency_code', - Value : urgency_code, + Value : customer.name, + Label : '{i18n>Customer}', }, { $Type : 'UI.DataField', - Label : 'status_code', - Value : status_code, + Value : status.descr, + Label : '{i18n>Status}', + Criticality : status.criticality, }, + { + $Type : 'UI.DataField', + Value : urgency.descr, + Label : '{i18n>Urgency}', + }, + ], + UI.SelectionFields : [ + status_code, + urgency_code, ], ); @@ -85,3 +93,25 @@ annotate service.Incidents with { } }; +annotate service.Incidents with { + status @( + Common.Label : '{i18n>Status}', + Common.ValueListWithFixedValues : true, + ) +}; + +annotate service.Incidents with { + urgency @( + Common.Label : '{i18n>Urgency}', + Common.ValueListWithFixedValues : true, + ) +}; + +annotate service.Urgency with { + code @Common.Text : descr +}; + +annotate service.Status with { + code @Common.Text : descr +}; + diff --git a/app/incidents/webapp/manifest.json b/app/incidents/webapp/manifest.json index ceaf724..51ae1e6 100644 --- a/app/incidents/webapp/manifest.json +++ b/app/incidents/webapp/manifest.json @@ -116,7 +116,8 @@ "type": "ResponsiveTable" } } - } + }, + "initialLoad": "Enabled" } } },