forked from cap-js-community/odata-v2-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathannotations.cds
74 lines (71 loc) · 2.2 KB
/
annotations.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
using test.AnalyticsService from '../../srv/analytics';
annotate AnalyticsService.Header with @(
UI: {
SelectionFields: [ description, country, currency ],
LineItem: [
{$Type: 'UI.DataField', Label: '{i18n>Description}', Value: description},
{$Type: 'UI.DataField', Label: '{i18n>Country}', Value: country},
{$Type: 'UI.DataField', Label: '{i18n>Currency}', Value: currency},
{$Type: 'UI.DataField', Label: '{i18n>Stock}', Value: stock},
{$Type: 'UI.DataField', Label: '{i18n>Price}', Value: price},
],
DataPoint: {
Title: 'Price',
Value: price
},
Chart: {
ChartType: #Donut,
Measures: ['price'],
MeasureAttributes: [{
Measure: 'price',
Role: #Axis1
}],
Dimensions: ['currency'],
DimensionAttributes: [{
Dimension: 'currency',
Role: #Category
}]
}
}
);
annotate AnalyticsService.Header with {
@Common: {
ValueList: {
CollectionPath: 'Country',
Label: '{i18n>Country}',
SearchSupported: true,
Parameters: [
{
$Type: 'Common.ValueListParameterInOut',
LocalDataProperty: 'country',
ValueListProperty: 'code'
},
{
$Type: 'Common.ValueListParameterDisplayOnly',
ValueListProperty: 'descr'
}
]
}
}
country;
@Common: {
ValueListWithFixedValues,
ValueList: {
CollectionPath: 'Currency',
Label: '{i18n>Country}',
SearchSupported: true,
Parameters: [
{
$Type: 'Common.ValueListParameterInOut',
LocalDataProperty: 'currency',
ValueListProperty: 'code'
},
{
$Type: 'Common.ValueListParameterDisplayOnly',
ValueListProperty: 'descr'
}
]
}
}
currency;
};