-
Notifications
You must be signed in to change notification settings - Fork 522
/
Copy pathfiori.cds
97 lines (86 loc) · 2.55 KB
/
fiori.cds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
////////////////////////////////////////////////////////////////////////////
//
// Note: this is designed for the OrdersService being co-located with
// bookshop. It does not work if OrdersService is run as a separate
// process, and is not intended to do so.
//
////////////////////////////////////////////////////////////////////////////
using { OrdersService } from '../srv/orders-service';
@odata.draft.enabled
annotate OrdersService.Orders with @(
UI: {
SelectionFields: [ createdBy ],
LineItem: [
{Value: OrderNo, Label:'{i18n>OrderNo}'},
{Value: buyer, Label:'{i18n>Customer}'},
{Value: currency.symbol, Label:'{i18n>Currency}'},
{Value: createdAt, Label:'{i18n>Date}'},
],
HeaderInfo: {
TypeName: '{i18n>Order}', TypeNamePlural: '{i18n>Orders}',
Title: {
Label: '{i18n>OrderNo}', //A label is possible but it is not considered on the ObjectPage yet
Value: OrderNo
},
Description: {Value: createdBy}
},
Identification: [ //Is the main field group
{Value: createdBy, Label:'{i18n>Customer}'},
{Value: createdAt, Label:'{i18n>Date}'},
{Value: OrderNo },
],
HeaderFacets: [
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Created}', Target: '@UI.FieldGroup#Created'},
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Modified}', Target: '@UI.FieldGroup#Modified'},
],
Facets: [
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
{$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: 'Items/@UI.LineItem'},
],
FieldGroup#Details: {
Data: [
{Value: currency.code, Label:'{i18n>Currency}'}
]
},
FieldGroup#Created: {
Data: [
{Value: createdBy},
{Value: createdAt},
]
},
FieldGroup#Modified: {
Data: [
{Value: modifiedBy},
{Value: modifiedAt},
]
},
},
) {
createdAt @UI.HiddenFilter:false;
createdBy @UI.HiddenFilter:false;
ID @UI.Hidden;
};
annotate OrdersService.Orders.Items with @(
UI: {
LineItem: [
{Value: product_ID, Label:'{i18n>ProductID}'},
{Value: title, Label:'{i18n>ProductTitle}'},
{Value: price, Label:'{i18n>UnitPrice}'},
{Value: quantity, Label:'{i18n>Quantity}'},
],
Identification: [ //Is the main field group
{Value: quantity, Label:'{i18n>Quantity}'},
{Value: title, Label:'{i18n>Product}'},
{Value: price, Label:'{i18n>UnitPrice}'},
],
Facets: [
{$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: '@UI.Identification'},
],
},
) {
quantity @(
Common.FieldControl: #Mandatory
);
ID @UI.Hidden;
up_ @UI.Hidden;
};