|
| 1 | +using ProcessorService as service from '../../srv/services'; |
| 2 | +using from '../../db/schema'; |
| 3 | + |
| 4 | +annotate service.Incidents with @( |
| 5 | + UI.FieldGroup #GeneratedGroup : { |
| 6 | + $Type : 'UI.FieldGroupType', |
| 7 | + Data : [ |
| 8 | + { |
| 9 | + $Type : 'UI.DataField', |
| 10 | + Value : title, |
| 11 | + }, |
| 12 | + { |
| 13 | + $Type : 'UI.DataField', |
| 14 | + Label : '{i18n>Customer}', |
| 15 | + Value : customer_ID, |
| 16 | + }, |
| 17 | + ], |
| 18 | + }, |
| 19 | + UI.Facets : [ |
| 20 | + { |
| 21 | + $Type : 'UI.CollectionFacet', |
| 22 | + Label : '{i18n>Overview}', |
| 23 | + ID : 'i18nOverview', |
| 24 | + Facets : [ |
| 25 | + { |
| 26 | + $Type : 'UI.ReferenceFacet', |
| 27 | + ID : 'GeneratedFacet1', |
| 28 | + Label : '{i18n>GeneralInformation}', |
| 29 | + Target : '@UI.FieldGroup#GeneratedGroup', |
| 30 | + }, |
| 31 | + { |
| 32 | + $Type : 'UI.ReferenceFacet', |
| 33 | + Label : '{i18n>Details}', |
| 34 | + ID : 'i18nDetails', |
| 35 | + Target : '@UI.FieldGroup#i18nDetails', |
| 36 | + }, |
| 37 | + ], |
| 38 | + }, |
| 39 | + { |
| 40 | + $Type : 'UI.ReferenceFacet', |
| 41 | + Label : '{i18n>Conversation}', |
| 42 | + ID : 'i18nConversation', |
| 43 | + Target : 'conversation/@UI.LineItem#i18nConversation', |
| 44 | + }, |
| 45 | + ], |
| 46 | + UI.LineItem : [ |
| 47 | + { |
| 48 | + $Type : 'UI.DataField', |
| 49 | + Value : title, |
| 50 | + Label : '{i18n>Title}', |
| 51 | + }, |
| 52 | + { |
| 53 | + $Type : 'UI.DataField', |
| 54 | + Value : customer.name, |
| 55 | + Label : '{i18n>Customer}', |
| 56 | + }, |
| 57 | + { |
| 58 | + $Type : 'UI.DataField', |
| 59 | + Value : status.descr, |
| 60 | + Label : '{i18n>Status}', |
| 61 | + Criticality : status.criticality, |
| 62 | + }, |
| 63 | + { |
| 64 | + $Type : 'UI.DataField', |
| 65 | + Value : urgency.descr, |
| 66 | + Label : '{i18n>Urgency}', |
| 67 | + }, |
| 68 | + ], |
| 69 | + UI.SelectionFields : [ |
| 70 | + status_code, |
| 71 | + urgency_code, |
| 72 | + ], |
| 73 | + UI.HeaderInfo : { |
| 74 | + Title : { |
| 75 | + $Type : 'UI.DataField', |
| 76 | + Value : title, |
| 77 | + }, |
| 78 | + TypeName : '', |
| 79 | + TypeNamePlural : '', |
| 80 | + Description : { |
| 81 | + $Type : 'UI.DataField', |
| 82 | + Value : customer.name, |
| 83 | + }, |
| 84 | + TypeImageUrl : 'sap-icon://alert', |
| 85 | + }, |
| 86 | + UI.FieldGroup #i18nDetails : { |
| 87 | + $Type : 'UI.FieldGroupType', |
| 88 | + Data : [ |
| 89 | + { |
| 90 | + $Type : 'UI.DataField', |
| 91 | + Value : status_code, |
| 92 | + }, |
| 93 | + { |
| 94 | + $Type : 'UI.DataField', |
| 95 | + Value : urgency_code, |
| 96 | + }, |
| 97 | + ], |
| 98 | + }, |
| 99 | +); |
| 100 | + |
| 101 | +annotate service.Incidents with { |
| 102 | + customer @( |
| 103 | + Common.ValueList : { |
| 104 | + $Type : 'Common.ValueListType', |
| 105 | + CollectionPath : 'Customers', |
| 106 | + Parameters : [ |
| 107 | + { |
| 108 | + $Type : 'Common.ValueListParameterInOut', |
| 109 | + LocalDataProperty : customer_ID, |
| 110 | + ValueListProperty : 'ID', |
| 111 | + }, |
| 112 | + { |
| 113 | + $Type : 'Common.ValueListParameterDisplayOnly', |
| 114 | + ValueListProperty : 'name', |
| 115 | + }, |
| 116 | + { |
| 117 | + $Type : 'Common.ValueListParameterDisplayOnly', |
| 118 | + ValueListProperty : 'email', |
| 119 | + }, |
| 120 | + ], |
| 121 | + }, |
| 122 | + Common.Text : { |
| 123 | + $value : customer.name, |
| 124 | + ![@UI.TextArrangement] : #TextOnly |
| 125 | + }, |
| 126 | + Common.ValueListWithFixedValues : false, |
| 127 | + ) |
| 128 | +}; |
| 129 | + |
| 130 | +annotate service.Incidents with { |
| 131 | + status @( |
| 132 | + Common.Label : '{i18n>Status}', |
| 133 | + Common.ValueListWithFixedValues : true, |
| 134 | + Common.Text : status.descr, |
| 135 | + ) |
| 136 | +}; |
| 137 | + |
| 138 | +annotate service.Incidents with { |
| 139 | + urgency @( |
| 140 | + Common.Label : '{i18n>Urgency}', |
| 141 | + Common.ValueListWithFixedValues : true, |
| 142 | + Common.Text : urgency.descr, |
| 143 | + ) |
| 144 | +}; |
| 145 | + |
| 146 | +annotate service.Urgency with { |
| 147 | + code @Common.Text : descr |
| 148 | +}; |
| 149 | + |
| 150 | +annotate service.Status with { |
| 151 | + code @Common.Text : descr |
| 152 | +}; |
| 153 | + |
| 154 | +annotate service.Incidents.conversation with @( |
| 155 | + UI.LineItem #i18nConversation : [ |
| 156 | + { |
| 157 | + $Type : 'UI.DataField', |
| 158 | + Value : author, |
| 159 | + Label : '{i18n>Author}', |
| 160 | + }, |
| 161 | + { |
| 162 | + $Type : 'UI.DataField', |
| 163 | + Value : message, |
| 164 | + Label : '{i18n>Message}', |
| 165 | + }, |
| 166 | + { |
| 167 | + $Type : 'UI.DataField', |
| 168 | + Value : timestamp, |
| 169 | + Label : '{i18n>Date}', |
| 170 | + }, |
| 171 | + ] |
| 172 | +); |
| 173 | + |
0 commit comments