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