From 5b251d74ff2a7b469e3d8bdd6181e237b07c093f Mon Sep 17 00:00:00 2001 From: "Kolbowski, Christian" Date: Thu, 27 Jun 2024 14:37:26 +0200 Subject: [PATCH 1/3] UI Annotations updated based on the outcome of the FE tutorial review, the UI annotations are slightly updated: - adding Common.SemanticKey - Moving the conversation facet outside of the collection facet to correspond to the tutorial screenshots - usage of customer_ID and urgency_code with Common.Text and Common.TextArrangement on the LR lineItem annotation instead of the associated description fields --- app/incidents/annotations.cds | 70 +++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/app/incidents/annotations.cds b/app/incidents/annotations.cds index 7b113629..a4dfba6f 100644 --- a/app/incidents/annotations.cds +++ b/app/incidents/annotations.cds @@ -1,6 +1,7 @@ using ProcessorService as service from '../../srv/processor-service'; using from '../../db/schema'; annotate service.Incidents with @( + Common.SemanticKey: [title], UI.FieldGroup #GeneratedGroup : { $Type : 'UI.FieldGroupType', Data : [ @@ -32,35 +33,36 @@ annotate service.Incidents with @( Label : '{i18n>Details}', ID : 'i18nDetails', Target : '@UI.FieldGroup#i18nDetails', - }, - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Conversation}', - ID : 'i18nConversation', - Target : 'conversation/@UI.LineItem#i18nConversation', },], }, + { + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Conversation}', + ID : 'i18nConversation', + Target : 'conversation/@UI.LineItem#i18nConversation', + }, ], UI.LineItem : [ { $Type : 'UI.DataField', Value : title, + Label : '{i18n>Title}', }, { $Type : 'UI.DataField', - Value : customer.name, Label : '{i18n>Customer}', + Value : customer_ID, }, { $Type : 'UI.DataField', - Value : status.descr, Label : '{i18n>Status}', + Value : status_code, Criticality : status.criticality, }, { $Type : 'UI.DataField', - Value : urgency.descr, Label : '{i18n>Urgency}', + Value : urgency_code, }, ], ); @@ -99,11 +101,41 @@ annotate service.Incidents with { annotate service.Incidents with { urgency @Common.Label : '{i18n>Urgency}' }; +annotate service.Incidents with { + status @Common.ValueListWithFixedValues : true +}; +annotate service.Status with { + code @Common.Text : { + $value : descr, + ![@UI.TextArrangement] : #TextOnly, + } +}; annotate service.Incidents with { urgency @Common.ValueListWithFixedValues : true }; annotate service.Urgency with { - code @Common.Text : descr + code @Common.Text : { + $value : descr, + ![@UI.TextArrangement] : #TextOnly, + } +}; +annotate service.Incidents with { + status @Common.Text : { + $value : status.descr, + ![@UI.TextArrangement] : #TextOnly, + } +}; +annotate service.Incidents with { + urgency @Common.Text : { + $value : urgency.descr, + ![@UI.TextArrangement] : #TextOnly, + } +}; +annotate service.Incidents with { + customer @Common.Text : { + $value : customer.name, + ![@UI.TextArrangement] : #TextOnly, + } }; annotate service.Incidents with @( UI.HeaderInfo : { @@ -133,27 +165,9 @@ annotate service.Incidents with @( },], } ); -annotate service.Incidents with { - customer @Common.Text : { - $value : customer.name, - ![@UI.TextArrangement] : #TextOnly, - } -}; annotate service.Incidents with { customer @Common.ValueListWithFixedValues : false }; -annotate service.Incidents with { - status @Common.Text : status.descr -}; -annotate service.Incidents with { - status @Common.ValueListWithFixedValues : true -}; -annotate service.Status with { - code @Common.Text : descr -}; -annotate service.Incidents with { - urgency @Common.Text : urgency.descr -}; annotate service.Incidents.conversation with @( UI.LineItem #i18nConversation : [ { From 8fcc7cc18ff0523af945f45f0202d983fe19ef62 Mon Sep 17 00:00:00 2001 From: "Kolbowski, Christian" Date: Fri, 28 Jun 2024 14:49:12 +0200 Subject: [PATCH 2/3] annotate semantic key separately --- app/incidents/annotations.cds | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/incidents/annotations.cds b/app/incidents/annotations.cds index a4dfba6f..2118c524 100644 --- a/app/incidents/annotations.cds +++ b/app/incidents/annotations.cds @@ -1,7 +1,6 @@ using ProcessorService as service from '../../srv/processor-service'; using from '../../db/schema'; annotate service.Incidents with @( - Common.SemanticKey: [title], UI.FieldGroup #GeneratedGroup : { $Type : 'UI.FieldGroupType', Data : [ @@ -184,3 +183,5 @@ annotate service.Incidents.conversation with @( Label : '{i18n>Date}', },] ); + +annotate service.Incidents with @Common.SemanticKey: [title]; From 556a9237468842d52aede51015c959eff10a2ed3 Mon Sep 17 00:00:00 2001 From: "Kolbowski, Christian" Date: Mon, 8 Jul 2024 11:49:04 +0200 Subject: [PATCH 3/3] UI annotations updated --- _i18n/i18n.properties | 3 +++ app/incidents/annotations.cds | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/_i18n/i18n.properties b/_i18n/i18n.properties index ce292581..ca8b77a9 100644 --- a/_i18n/i18n.properties +++ b/_i18n/i18n.properties @@ -28,3 +28,6 @@ Message=Message #XFLD,120: Label for a column title Date=Date + +#XFLD,120: Label for a column title +Title=Title diff --git a/app/incidents/annotations.cds b/app/incidents/annotations.cds index 2118c524..3fe671d1 100644 --- a/app/incidents/annotations.cds +++ b/app/incidents/annotations.cds @@ -44,7 +44,7 @@ annotate service.Incidents with @( UI.LineItem : [ { $Type : 'UI.DataField', - Value : title, + Value : ID, Label : '{i18n>Title}', }, { @@ -184,4 +184,12 @@ annotate service.Incidents.conversation with @( },] ); -annotate service.Incidents with @Common.SemanticKey: [title]; +annotate service.Incidents with @Common.SemanticKey: [ID]{ + ID @Core.Computed +}; +annotate service.Incidents with { + ID @Common.Text : { + $value : title, + ![@UI.TextArrangement] : #TextOnly, + } +};