-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathannotations.cds
More file actions
67 lines (53 loc) · 1.54 KB
/
annotations.cds
File metadata and controls
67 lines (53 loc) · 1.54 KB
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
using { sap } from '@sap/cds/common';
using TodoService from '../../srv';
annotate TodoService.Todo with @(
// Filter Bar
UI.SelectionFields: [ name, status_code ],
// List
UI.LineItem: [
{$Type: 'UI.DataField', Value: name},
{$Type: 'UI.DataField', Value: status_code}
],
//Object Page (details)
UI.Identification: [
{$Type: 'UI.DataField', Value: name},
{$Type: 'UI.DataField', Value: status_code}
],
UI.Facets: [
{$Type: 'UI.ReferenceFacet', Label: '{@i18n>General}', Target: '@UI.Identification'},
{$Type: 'UI.ReferenceFacet', Label: '{@i18n>Translations}', Target: 'texts/@UI.LineItem'}
]
);
annotate TodoService.Todo {
ID @UI.Hidden;
};
annotate TodoService.Todo {
status @Common.Text: status.name @Common.TextArrangement: #TextFirst;
};
annotate TodoService.Todo.texts with @(
UI: {
SelectionFields: [ locale, description ],
Identification: [
{$Type: 'UI.DataField', Value: description}
],
LineItem: [
{$Type: 'UI.DataField', Label: '{@i18n>Locale}', Value: locale},
{$Type: 'UI.DataField', Value: description},
]
}
);
annotate TodoService.Todo.texts {
ID_texts @UI.Hidden
};
annotate TodoService.Todo.texts {
ID @UI.Hidden @Core.Computed: false
};
annotate TodoService.Todo.texts {
locale @ValueList: { entity: 'Languages', type: #fixed }
};
extend service TodoService {
entity Languages as projection on sap.common.Languages excluding {
localized
}
entity Languages.texts as projection on sap.common.Languages.texts;
};