@sap/cds-dk 9.4.3 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/bin/compile/index.js +1 -1
- package/bin/export.js +1 -1
- package/bin/help.js +0 -1
- package/bin/import.js +8 -3
- package/bin/repl.js +7 -11
- package/bin/up.js +150 -20
- package/bin/util/containerize.js +66 -25
- package/bin/version.js +4 -4
- package/lib/bind/k8s.js +1 -1
- package/lib/build/plugins/helm/files/templates/_deployment_helpers.tpl +1 -1
- package/lib/build/plugins/helm/index.js +1 -1
- package/lib/build/provider/hana/2migration.js +16 -24
- package/lib/build/provider/hana/index.js +1 -1
- package/lib/build/provider/hana/template/.hdiconfig-all +7 -1
- package/lib/build/provider/hana/template/package.json +1 -1
- package/lib/build/provider/internalBuildPlugin.js +15 -1
- package/lib/build/provider/java/index.js +12 -1
- package/lib/build/provider/mtx-sidecar/index.js +2 -1
- package/lib/build/provider/nodejs/index.js +2 -1
- package/lib/build/util.js +3 -3
- package/lib/compile/to_openapi.js +1 -5
- package/lib/import/common.js +2 -1
- package/lib/import/odata/ParserContext.js +1 -0
- package/lib/import/odata/v4parser.js +48 -3
- package/lib/import/openapi/importOpenAPI.js +6 -1
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +15 -6
- package/lib/init/merge.js +16 -0
- package/lib/init/projectReader.js +19 -4
- package/lib/init/registries/mta.js +2 -2
- package/lib/init/template/ams/index.js +1 -1
- package/lib/init/template/app-frontend/files/app-package.json.hbs +1 -7
- package/lib/init/template/app-frontend/files/ui5.yaml.hbs +20 -1
- package/lib/init/template/app-frontend/index.js +0 -4
- package/lib/init/template/application-logging/index.js +9 -14
- package/lib/init/template/approuter/files/mta.yaml.hbs +0 -2
- package/lib/init/template/approuter/index.js +6 -7
- package/lib/init/template/cloud-logging/index.js +2 -3
- package/lib/init/template/containerize/files/containerize.yaml.hbs +17 -2
- package/lib/init/template/containerize/index.js +0 -4
- package/lib/init/template/data/as-json.js +18 -20
- package/lib/init/template/dynatrace/index.js +0 -2
- package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +16 -1
- package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +20 -0
- package/lib/init/template/github-actions/index.js +5 -8
- package/lib/init/template/hana/files/db/package.json +2 -2
- package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
- package/lib/init/template/hana/index.js +3 -5
- package/lib/init/template/helm/index.js +2 -7
- package/lib/init/template/helm-unified-runtime/index.js +0 -4
- package/lib/init/template/html5-repo/files/app-package.json.hbs +1 -7
- package/lib/init/template/html5-repo/files/ui5.yaml.hbs +20 -1
- package/lib/init/template/html5-repo/index.js +6 -12
- package/lib/init/template/ias/files/values.yaml.hbs +6 -6
- package/lib/init/template/ias/index.js +12 -20
- package/lib/init/template/kyma/index.js +14 -1
- package/lib/init/template/malware-scanner/files/mta.yaml.hbs +3 -1
- package/lib/init/template/malware-scanner/files/values.yaml +3 -1
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -3
- package/lib/init/template/multitenancy/files/values.yaml.hbs +8 -0
- package/lib/init/template/multitenancy/index.js +8 -3
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/pipeline/files/app-package.json.hbs +1 -7
- package/lib/init/template/pipeline/files/ui5.yaml.hbs +20 -1
- package/lib/init/template/pipeline/index.js +1 -2
- package/lib/init/template/portal/files/mta.yaml.hbs +5 -3
- package/lib/init/template/portal/index.js +3 -6
- package/lib/init/template/sample/files/_i18n/i18n_de.properties +12 -0
- package/lib/init/template/sample/files/_i18n/i18n_en.properties +21 -0
- package/lib/init/template/sample/files/_i18n/i18n_fr.properties +20 -0
- package/lib/init/template/sample/files/_i18n/messages_de.properties +34 -0
- package/lib/init/template/sample/files/_i18n/messages_en.properties +34 -0
- package/lib/init/template/sample/files/_i18n/messages_fr.properties +34 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +0 -26
- package/lib/init/template/sample/files/app/_i18n/i18n_en.properties +8 -0
- package/lib/init/template/sample/files/app/admin-authors/fiori-service.cds +52 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n.properties +11 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/manifest.json +130 -0
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +81 -88
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +10 -2
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +24 -48
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +54 -3
- package/lib/init/template/sample/files/app/browse/fiori-service.cds +30 -30
- package/lib/init/template/sample/files/app/browse/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +10 -3
- package/lib/init/template/sample/files/app/browse/webapp/manifest.json +18 -23
- package/lib/init/template/sample/files/app/common.cds +126 -158
- package/lib/init/template/sample/files/app/fiori-apps.html +30 -0
- package/lib/init/template/sample/files/app/genres/fiori-service.cds +33 -0
- package/lib/init/template/sample/files/app/genres/tree-view.cds +42 -0
- package/lib/init/template/sample/files/app/genres/value-help.cds +6 -0
- package/lib/init/template/sample/files/app/genres/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n.properties +4 -0
- package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_de.properties +2 -0
- package/lib/init/template/sample/files/app/genres/webapp/manifest.json +126 -0
- package/lib/init/template/sample/files/app/services.cds +6 -2
- package/lib/init/template/sample/files/db/currencies.cds +13 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +5 -5
- package/lib/init/template/sample/files/db/data/{sap.capire.bookshop-Books_texts.csv → sap.capire.bookshop-Books.texts.csv} +4 -4
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +42 -15
- package/lib/init/template/sample/files/db/data/sap.common-Currencies.csv +12 -0
- package/lib/init/template/sample/files/db/data/sap.common-Currencies.texts.csv +15 -0
- package/lib/init/template/sample/files/db/hana/index.cds +10 -0
- package/lib/init/template/sample/files/db/schema.cds +35 -22
- package/lib/init/template/sample/files/db/sqlite/index.cds +10 -0
- package/lib/init/template/sample/files/package.json.hbs +14 -1
- package/lib/init/template/sample/files/srv/access-control.cds +3 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +3 -2
- package/lib/init/template/sample/files/srv/cat-service.cds +7 -11
- package/lib/init/template/sample/index.js +26 -17
- package/lib/init/template/telemetry/index.js +1 -3
- package/lib/init/template/typescript/files/package.json +1 -1
- package/lib/init/template/workzone-standard/files/mta.yaml.hbs +0 -5
- package/lib/init/template/workzone-standard/index.js +0 -1
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -0
- package/lib/init/template/xsuaa/index.js +3 -5
- package/lib/lint/Linter.js +10 -4
- package/lib/lint/eslintHelp.json +1 -1
- package/lib/mtx/tenant_action.js +12 -4
- package/lib/util/checksum.js +32 -0
- package/lib/util/question.js +60 -7
- package/npm-shrinkwrap.json +59 -35
- package/package.json +2 -2
- package/lib/init/template/app-frontend/files/ui5-deploy.yaml.hbs +0 -25
- package/lib/init/template/github-actions/files/cf-setup/action.yaml +0 -53
- package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +0 -25
- package/lib/init/template/pipeline/files/ui5-deploy.yaml.hbs +0 -25
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +0 -29
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +0 -8
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +0 -3
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +0 -3
- package/lib/init/template/sample/files/app/browse/webapp/Component.js +0 -7
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +0 -3
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +0 -4
- package/lib/init/template/sample/files/app/index.html +0 -32
|
@@ -2,123 +2,69 @@
|
|
|
2
2
|
Common Annotations shared by all apps
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
using {sap.capire.bookshop as my} from '../db/schema';
|
|
6
|
-
using {
|
|
7
|
-
sap.common,
|
|
8
|
-
sap.common.Currencies
|
|
9
|
-
} from '@sap/cds/common';
|
|
5
|
+
using { sap.capire.bookshop as my } from '../db/schema';
|
|
6
|
+
using { sap.common } from '@sap/cds/common';
|
|
10
7
|
|
|
11
8
|
////////////////////////////////////////////////////////////////////////////
|
|
12
9
|
//
|
|
13
10
|
// Books Lists
|
|
14
11
|
//
|
|
15
12
|
annotate my.Books with @(
|
|
16
|
-
Common.SemanticKey: [ID],
|
|
17
|
-
UI
|
|
18
|
-
Identification
|
|
19
|
-
SelectionFields: [
|
|
13
|
+
Common.SemanticKey : [ID],
|
|
14
|
+
UI : {
|
|
15
|
+
Identification : [{ Value: title }],
|
|
16
|
+
SelectionFields : [
|
|
20
17
|
ID,
|
|
21
18
|
author_ID,
|
|
22
19
|
price,
|
|
23
20
|
currency_code
|
|
24
21
|
],
|
|
25
|
-
LineItem
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
Label: '{i18n>Author}'
|
|
33
|
-
},
|
|
34
|
-
{Value: genre.name},
|
|
35
|
-
{Value: stock},
|
|
36
|
-
{Value: price},
|
|
37
|
-
{Value: currency.symbol},
|
|
22
|
+
LineItem : [
|
|
23
|
+
{ Value: ID, Label: '{i18n>Title}' },
|
|
24
|
+
{ Value: author.ID, Label: '{i18n>Author}' },
|
|
25
|
+
{ Value: genre.name },
|
|
26
|
+
{ Value: stock },
|
|
27
|
+
{ Value: price },
|
|
28
|
+
{ Value: currency.symbol },
|
|
38
29
|
]
|
|
39
30
|
}
|
|
40
31
|
) {
|
|
41
|
-
ID
|
|
32
|
+
ID @Common: {
|
|
42
33
|
SemanticObject : 'Books',
|
|
43
|
-
Text
|
|
44
|
-
TextArrangement: #TextOnly
|
|
34
|
+
Text: title,
|
|
35
|
+
TextArrangement : #TextOnly
|
|
45
36
|
};
|
|
46
|
-
author @ValueList.entity: 'Authors';
|
|
37
|
+
author @ValueList.entity : 'Authors';
|
|
47
38
|
};
|
|
48
39
|
|
|
49
|
-
annotate Currencies with {
|
|
50
|
-
symbol @Common.Label: '{i18n>Currency}';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
////////////////////////////////////////////////////////////////////////////
|
|
55
|
-
//
|
|
56
|
-
// Books Elements
|
|
57
|
-
//
|
|
58
|
-
annotate my.Books with {
|
|
59
|
-
ID @title: '{i18n>ID}';
|
|
60
|
-
title @title: '{i18n>Title}';
|
|
61
|
-
genre @title: '{i18n>Genre}' @Common : {
|
|
62
|
-
Text : genre.name,
|
|
63
|
-
TextArrangement: #TextOnly
|
|
64
|
-
};
|
|
65
|
-
author @title: '{i18n>Author}' @Common : {
|
|
66
|
-
Text : author.name,
|
|
67
|
-
TextArrangement: #TextOnly
|
|
68
|
-
};
|
|
69
|
-
price @title: '{i18n>Price}' @Measures.ISOCurrency: currency_code;
|
|
70
|
-
stock @title: '{i18n>Stock}';
|
|
71
|
-
descr @title: '{i18n>Description}' @UI.MultiLineText;
|
|
40
|
+
annotate common.Currencies with {
|
|
41
|
+
symbol @Common.Label : '{i18n>Currency}';
|
|
72
42
|
}
|
|
73
43
|
|
|
74
44
|
////////////////////////////////////////////////////////////////////////////
|
|
75
45
|
//
|
|
76
|
-
//
|
|
46
|
+
// Books Details
|
|
77
47
|
//
|
|
78
|
-
annotate my.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
Value: parent.name,
|
|
86
|
-
Label: '{i18n>MainGenre}'
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
}
|
|
90
|
-
);
|
|
48
|
+
annotate my.Books with @(UI : {HeaderInfo : {
|
|
49
|
+
TypeName : '{i18n>Book}',
|
|
50
|
+
TypeNamePlural : '{i18n>Books}',
|
|
51
|
+
Title : { Value: title },
|
|
52
|
+
Description : { Value: author.name }
|
|
53
|
+
}, });
|
|
91
54
|
|
|
92
|
-
annotate my.Genres with {
|
|
93
|
-
ID @Common.Text: name @Common.TextArrangement: #TextOnly;
|
|
94
|
-
}
|
|
95
55
|
|
|
96
56
|
////////////////////////////////////////////////////////////////////////////
|
|
97
57
|
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
annotate my.Genres with @(UI: {
|
|
101
|
-
Identification: [{Value: name}],
|
|
102
|
-
HeaderInfo : {
|
|
103
|
-
TypeName : '{i18n>Genre}',
|
|
104
|
-
TypeNamePlural: '{i18n>Genres}',
|
|
105
|
-
Title : {Value: name},
|
|
106
|
-
Description : {Value: ID}
|
|
107
|
-
},
|
|
108
|
-
Facets : [{
|
|
109
|
-
$Type : 'UI.ReferenceFacet',
|
|
110
|
-
Label : '{i18n>SubGenres}',
|
|
111
|
-
Target: 'children/@UI.LineItem'
|
|
112
|
-
}, ],
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
////////////////////////////////////////////////////////////////////////////
|
|
116
|
-
//
|
|
117
|
-
// Genres Elements
|
|
58
|
+
// Books Elements
|
|
118
59
|
//
|
|
119
|
-
annotate my.
|
|
120
|
-
ID
|
|
121
|
-
|
|
60
|
+
annotate my.Books with {
|
|
61
|
+
ID @title: '{i18n>ID}';
|
|
62
|
+
title @title: '{i18n>Title}';
|
|
63
|
+
genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
|
|
64
|
+
author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
|
|
65
|
+
price @title: '{i18n>Price}' @Measures.ISOCurrency : currency_code;
|
|
66
|
+
stock @title: '{i18n>Stock}';
|
|
67
|
+
descr @title: '{i18n>Description}' @UI.MultiLineText;
|
|
122
68
|
}
|
|
123
69
|
|
|
124
70
|
////////////////////////////////////////////////////////////////////////////
|
|
@@ -126,23 +72,23 @@ annotate my.Genres with {
|
|
|
126
72
|
// Authors List
|
|
127
73
|
//
|
|
128
74
|
annotate my.Authors with @(
|
|
129
|
-
Common.SemanticKey: [ID],
|
|
130
|
-
UI
|
|
131
|
-
Identification
|
|
132
|
-
SelectionFields: [name],
|
|
133
|
-
LineItem
|
|
134
|
-
{Value: ID},
|
|
135
|
-
{Value: dateOfBirth},
|
|
136
|
-
{Value: dateOfDeath},
|
|
137
|
-
{Value: placeOfBirth},
|
|
138
|
-
{Value: placeOfDeath},
|
|
75
|
+
Common.SemanticKey : [ID],
|
|
76
|
+
UI : {
|
|
77
|
+
Identification : [{ Value: name}],
|
|
78
|
+
SelectionFields : [name],
|
|
79
|
+
LineItem : [
|
|
80
|
+
{ Value: ID },
|
|
81
|
+
{ Value: dateOfBirth },
|
|
82
|
+
{ Value: dateOfDeath },
|
|
83
|
+
{ Value: placeOfBirth },
|
|
84
|
+
{ Value: placeOfDeath },
|
|
139
85
|
],
|
|
140
86
|
}
|
|
141
87
|
) {
|
|
142
|
-
ID
|
|
88
|
+
ID @Common: {
|
|
143
89
|
SemanticObject : 'Authors',
|
|
144
|
-
Text
|
|
145
|
-
TextArrangement: #TextOnly,
|
|
90
|
+
Text: name,
|
|
91
|
+
TextArrangement : #TextOnly,
|
|
146
92
|
};
|
|
147
93
|
};
|
|
148
94
|
|
|
@@ -150,17 +96,17 @@ annotate my.Authors with @(
|
|
|
150
96
|
//
|
|
151
97
|
// Author Details
|
|
152
98
|
//
|
|
153
|
-
annotate my.Authors with @(UI: {
|
|
154
|
-
HeaderInfo: {
|
|
155
|
-
TypeName
|
|
156
|
-
TypeNamePlural: '{i18n>Authors}',
|
|
157
|
-
Title
|
|
158
|
-
Description
|
|
99
|
+
annotate my.Authors with @(UI : {
|
|
100
|
+
HeaderInfo : {
|
|
101
|
+
TypeName : '{i18n>Author}',
|
|
102
|
+
TypeNamePlural : '{i18n>Authors}',
|
|
103
|
+
Title : { Value: name },
|
|
104
|
+
Description : { Value: dateOfBirth }
|
|
159
105
|
},
|
|
160
|
-
Facets
|
|
161
|
-
$Type
|
|
162
|
-
Target: 'books/@UI.LineItem'
|
|
163
|
-
}],
|
|
106
|
+
Facets : [{
|
|
107
|
+
$Type : 'UI.ReferenceFacet',
|
|
108
|
+
Target : 'books/@UI.LineItem'
|
|
109
|
+
}, ],
|
|
164
110
|
});
|
|
165
111
|
|
|
166
112
|
|
|
@@ -182,16 +128,16 @@ annotate my.Authors with {
|
|
|
182
128
|
// Languages List
|
|
183
129
|
//
|
|
184
130
|
annotate common.Languages with @(
|
|
185
|
-
Common.SemanticKey: [code],
|
|
186
|
-
Identification
|
|
187
|
-
UI
|
|
188
|
-
SelectionFields: [
|
|
131
|
+
Common.SemanticKey : [code],
|
|
132
|
+
Identification : [{ Value: code}],
|
|
133
|
+
UI : {
|
|
134
|
+
SelectionFields : [
|
|
189
135
|
name,
|
|
190
136
|
descr
|
|
191
137
|
],
|
|
192
|
-
LineItem
|
|
193
|
-
{Value: code},
|
|
194
|
-
{Value: name},
|
|
138
|
+
LineItem : [
|
|
139
|
+
{ Value: code },
|
|
140
|
+
{ Value: name },
|
|
195
141
|
],
|
|
196
142
|
}
|
|
197
143
|
);
|
|
@@ -200,22 +146,22 @@ annotate common.Languages with @(
|
|
|
200
146
|
//
|
|
201
147
|
// Language Details
|
|
202
148
|
//
|
|
203
|
-
annotate common.Languages with @(UI: {
|
|
204
|
-
HeaderInfo
|
|
205
|
-
TypeName
|
|
206
|
-
TypeNamePlural: '{i18n>Languages}',
|
|
207
|
-
Title
|
|
208
|
-
Description
|
|
149
|
+
annotate common.Languages with @(UI : {
|
|
150
|
+
HeaderInfo : {
|
|
151
|
+
TypeName : '{i18n>Language}',
|
|
152
|
+
TypeNamePlural : '{i18n>Languages}',
|
|
153
|
+
Title : { Value: name },
|
|
154
|
+
Description : { Value: descr }
|
|
209
155
|
},
|
|
210
|
-
Facets
|
|
211
|
-
$Type
|
|
212
|
-
Label
|
|
213
|
-
Target: '@UI.FieldGroup#Details'
|
|
156
|
+
Facets : [{
|
|
157
|
+
$Type : 'UI.ReferenceFacet',
|
|
158
|
+
Label : '{i18n>Details}',
|
|
159
|
+
Target : '@UI.FieldGroup#Details'
|
|
214
160
|
}, ],
|
|
215
|
-
FieldGroup #Details: {Data: [
|
|
216
|
-
{Value: code},
|
|
217
|
-
{Value: name},
|
|
218
|
-
{Value: descr}
|
|
161
|
+
FieldGroup #Details : {Data : [
|
|
162
|
+
{ Value: code },
|
|
163
|
+
{ Value: name },
|
|
164
|
+
{ Value: descr }
|
|
219
165
|
]},
|
|
220
166
|
});
|
|
221
167
|
|
|
@@ -224,17 +170,17 @@ annotate common.Languages with @(UI: {
|
|
|
224
170
|
// Currencies List
|
|
225
171
|
//
|
|
226
172
|
annotate common.Currencies with @(
|
|
227
|
-
Common.SemanticKey: [code],
|
|
228
|
-
Identification
|
|
229
|
-
UI
|
|
230
|
-
SelectionFields: [
|
|
173
|
+
Common.SemanticKey : [code],
|
|
174
|
+
Identification : [{ Value: code}],
|
|
175
|
+
UI : {
|
|
176
|
+
SelectionFields : [
|
|
231
177
|
name,
|
|
232
178
|
descr
|
|
233
179
|
],
|
|
234
|
-
LineItem
|
|
235
|
-
{Value: descr},
|
|
236
|
-
{Value: symbol},
|
|
237
|
-
{Value: code},
|
|
180
|
+
LineItem : [
|
|
181
|
+
{ Value: descr },
|
|
182
|
+
{ Value: symbol },
|
|
183
|
+
{ Value: code },
|
|
238
184
|
],
|
|
239
185
|
}
|
|
240
186
|
);
|
|
@@ -243,22 +189,44 @@ annotate common.Currencies with @(
|
|
|
243
189
|
//
|
|
244
190
|
// Currency Details
|
|
245
191
|
//
|
|
246
|
-
annotate common.Currencies with @(UI: {
|
|
247
|
-
HeaderInfo
|
|
248
|
-
TypeName
|
|
249
|
-
TypeNamePlural: '{i18n>Currencies}',
|
|
250
|
-
Title
|
|
251
|
-
Description
|
|
192
|
+
annotate common.Currencies with @(UI : {
|
|
193
|
+
HeaderInfo : {
|
|
194
|
+
TypeName : '{i18n>Currency}',
|
|
195
|
+
TypeNamePlural : '{i18n>Currencies}',
|
|
196
|
+
Title : { Value: descr },
|
|
197
|
+
Description : { Value: code }
|
|
252
198
|
},
|
|
253
|
-
Facets
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
{
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
199
|
+
Facets : [
|
|
200
|
+
{
|
|
201
|
+
$Type : 'UI.ReferenceFacet',
|
|
202
|
+
Label : '{i18n>Details}',
|
|
203
|
+
Target : '@UI.FieldGroup#Details'
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
$Type : 'UI.ReferenceFacet',
|
|
207
|
+
Label : '{i18n>Extended}',
|
|
208
|
+
Target : '@UI.FieldGroup#Extended'
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
FieldGroup #Details : {Data : [
|
|
212
|
+
{ Value: name },
|
|
213
|
+
{ Value: symbol },
|
|
214
|
+
{ Value: code },
|
|
215
|
+
{ Value: descr }
|
|
216
|
+
]},
|
|
217
|
+
FieldGroup #Extended : {Data : [
|
|
218
|
+
{ Value: numcode },
|
|
219
|
+
{ Value: minor },
|
|
220
|
+
{ Value: exponent }
|
|
221
|
+
]},
|
|
264
222
|
});
|
|
223
|
+
|
|
224
|
+
////////////////////////////////////////////////////////////////////////////
|
|
225
|
+
//
|
|
226
|
+
// Currencies Elements
|
|
227
|
+
//
|
|
228
|
+
annotate common.Currencies with {
|
|
229
|
+
numcode @title: '{i18n>NumCode}';
|
|
230
|
+
minor @title: '{i18n>MinorUnit}';
|
|
231
|
+
exponent @title: '{i18n>Exponent}';
|
|
232
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<title>Bookshop</title>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
window["sap-ushell-config"] = {
|
|
12
|
+
defaultRenderer: "fiori2",
|
|
13
|
+
applications: {},
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script id="sap-ushell-bootstrap" src="https://ui5.sap.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
|
|
18
|
+
<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
|
|
19
|
+
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout" data-sap-ui-compatVersion="edge"
|
|
20
|
+
data-sap-ui-theme="sap_horizon"></script>
|
|
21
|
+
<script>
|
|
22
|
+
sap.ui.getCore().attachInit(() =>
|
|
23
|
+
sap.ushell.Container.createRenderer().placeAt("content")
|
|
24
|
+
);
|
|
25
|
+
</script>
|
|
26
|
+
</head>
|
|
27
|
+
|
|
28
|
+
<body class="sapUiBody" id="content"></body>
|
|
29
|
+
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
using { sap.capire.bookshop.Genres } from '../../db/schema';
|
|
2
|
+
|
|
3
|
+
annotate Genres with @cds.search: {name};
|
|
4
|
+
annotate Genres with @readonly;
|
|
5
|
+
annotate Genres with {
|
|
6
|
+
name @title: '{i18n>Genre}';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Lists
|
|
10
|
+
annotate Genres with @(
|
|
11
|
+
Common.SemanticKey : [name],
|
|
12
|
+
UI.SelectionFields : [name],
|
|
13
|
+
UI.LineItem : [
|
|
14
|
+
{ Value: name, Label: '{i18n>Name}' },
|
|
15
|
+
],
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
// Details
|
|
19
|
+
annotate Genres with @(UI : {
|
|
20
|
+
Identification : [{ Value: name }],
|
|
21
|
+
HeaderInfo : {
|
|
22
|
+
TypeName : '{i18n>Genre}',
|
|
23
|
+
TypeNamePlural : '{i18n>Genres}',
|
|
24
|
+
Title : { Value: name },
|
|
25
|
+
Description : { Value: ID }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Tree Views
|
|
31
|
+
// annotate AdminService.Genres with @hierarchy; // upcomming simplification
|
|
32
|
+
using from './tree-view';
|
|
33
|
+
using from './value-help';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
using { AdminService } from '../../srv/admin-service';
|
|
2
|
+
|
|
3
|
+
////////////////////////////////////////////////////////////////////////////
|
|
4
|
+
//
|
|
5
|
+
// Genres Tree View
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// Tell Fiori about the structure of the hierarchy
|
|
9
|
+
annotate AdminService.Genres with @Aggregation.RecursiveHierarchy #GenresHierarchy : {
|
|
10
|
+
ParentNavigationProperty : parent, // navigates to a node's parent
|
|
11
|
+
NodeProperty : ID, // identifies a node, usually the key
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// Fiori expects the following to be defined explicitly, even though they're always the same
|
|
15
|
+
extend AdminService.Genres with @(
|
|
16
|
+
// The columns expected by Fiori to be present in hierarchy entities
|
|
17
|
+
Hierarchy.RecursiveHierarchy #GenresHierarchy : {
|
|
18
|
+
LimitedDescendantCount : LimitedDescendantCount,
|
|
19
|
+
DistanceFromRoot : DistanceFromRoot,
|
|
20
|
+
DrillState : DrillState,
|
|
21
|
+
LimitedRank : LimitedRank
|
|
22
|
+
},
|
|
23
|
+
// Disallow filtering on these properties from Fiori UIs
|
|
24
|
+
Capabilities.FilterRestrictions.NonFilterableProperties: [
|
|
25
|
+
'LimitedDescendantCount',
|
|
26
|
+
'DistanceFromRoot',
|
|
27
|
+
'DrillState',
|
|
28
|
+
'LimitedRank'
|
|
29
|
+
],
|
|
30
|
+
// Disallow sorting on these properties from Fiori UIs
|
|
31
|
+
Capabilities.SortRestrictions.NonSortableProperties : [
|
|
32
|
+
'LimitedDescendantCount',
|
|
33
|
+
'DistanceFromRoot',
|
|
34
|
+
'DrillState',
|
|
35
|
+
'LimitedRank'
|
|
36
|
+
],
|
|
37
|
+
) columns { // Ensure we can query these fields from database
|
|
38
|
+
null as LimitedDescendantCount : Int16,
|
|
39
|
+
null as DistanceFromRoot : Int16,
|
|
40
|
+
null as DrillState : String,
|
|
41
|
+
null as LimitedRank : Int16,
|
|
42
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Value help with Tree View
|
|
2
|
+
using from '../admin-books/fiori-service';
|
|
3
|
+
annotate AdminService.Books:genre with @Common.ValueList.PresentationVariantQualifier: 'VH';
|
|
4
|
+
annotate AdminService.Genres with @UI.PresentationVariant #VH: {
|
|
5
|
+
RecursiveHierarchyQualifier : 'GenresHierarchy',
|
|
6
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_version": "1.8.0",
|
|
3
|
+
"sap.app": {
|
|
4
|
+
"id": "genres",
|
|
5
|
+
"type": "application",
|
|
6
|
+
"title": "{{appTitle}}",
|
|
7
|
+
"description": "{{appDescription}}",
|
|
8
|
+
"applicationVersion": {
|
|
9
|
+
"version": "1.0.0"
|
|
10
|
+
},
|
|
11
|
+
"dataSources": {
|
|
12
|
+
"AdminService": {
|
|
13
|
+
"uri": "odata/v4/admin/",
|
|
14
|
+
"type": "OData",
|
|
15
|
+
"settings": {
|
|
16
|
+
"odataVersion": "4.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"crossNavigation": {
|
|
21
|
+
"inbounds": {
|
|
22
|
+
"Genres-display": {
|
|
23
|
+
"signature": {
|
|
24
|
+
"parameters": {},
|
|
25
|
+
"additionalParameters": "allowed"
|
|
26
|
+
},
|
|
27
|
+
"title": "{{appTitle}}",
|
|
28
|
+
"subTitle": "{{appDescription}}",
|
|
29
|
+
"semanticObject": "Genres",
|
|
30
|
+
"action": "display"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"sap.ui5": {
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"minUI5Version": "1.136.0",
|
|
38
|
+
"libs": {
|
|
39
|
+
"sap.fe.templates": {}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"models": {
|
|
43
|
+
"i18n": {
|
|
44
|
+
"type": "sap.ui.model.resource.ResourceModel",
|
|
45
|
+
"uri": "i18n/i18n.properties"
|
|
46
|
+
},
|
|
47
|
+
"": {
|
|
48
|
+
"dataSource": "AdminService",
|
|
49
|
+
"settings": {
|
|
50
|
+
"synchronizationMode": "None",
|
|
51
|
+
"operationMode": "Server",
|
|
52
|
+
"autoExpandSelect": true,
|
|
53
|
+
"earlyRequests": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"routing": {
|
|
58
|
+
"routes": [
|
|
59
|
+
{
|
|
60
|
+
"pattern": ":?query:",
|
|
61
|
+
"name": "GenresList",
|
|
62
|
+
"target": "GenresList"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"pattern": "Genres({key}):?query:",
|
|
66
|
+
"name": "GenresDetails",
|
|
67
|
+
"target": "GenresDetails"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"targets": {
|
|
71
|
+
"GenresList": {
|
|
72
|
+
"type": "Component",
|
|
73
|
+
"id": "GenresList",
|
|
74
|
+
"name": "sap.fe.templates.ListReport",
|
|
75
|
+
"options": {
|
|
76
|
+
"settings": {
|
|
77
|
+
"contextPath": "/Genres",
|
|
78
|
+
"liveMode": true,
|
|
79
|
+
"navigation": {
|
|
80
|
+
"Genres": {
|
|
81
|
+
"detail": {
|
|
82
|
+
"route": "GenresDetails"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"controlConfiguration": {
|
|
87
|
+
"@com.sap.vocabularies.UI.v1.LineItem": {
|
|
88
|
+
"tableSettings": {
|
|
89
|
+
"hierarchyQualifier": "GenresHierarchy",
|
|
90
|
+
"type": "TreeTable"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"GenresDetails": {
|
|
98
|
+
"type": "Component",
|
|
99
|
+
"id": "GenresDetails",
|
|
100
|
+
"name": "sap.fe.templates.ObjectPage",
|
|
101
|
+
"options": {
|
|
102
|
+
"settings": {
|
|
103
|
+
"contextPath": "/Genres"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"contentDensities": {
|
|
110
|
+
"compact": true,
|
|
111
|
+
"cozy": true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"sap.ui": {
|
|
115
|
+
"technology": "UI5",
|
|
116
|
+
"deviceTypes": {
|
|
117
|
+
"desktop": true,
|
|
118
|
+
"tablet": true,
|
|
119
|
+
"phone": true
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"sap.fiori": {
|
|
123
|
+
"registrationIds": [],
|
|
124
|
+
"archeType": "transactional"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
2
|
This model controls what gets served to Fiori frontends...
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
using from './
|
|
4
|
+
|
|
5
|
+
using from './admin-authors/fiori-service';
|
|
6
6
|
using from './admin-books/fiori-service';
|
|
7
|
+
using from './browse/fiori-service';
|
|
8
|
+
using from './genres/fiori-service';
|
|
9
|
+
|
|
10
|
+
using from './common';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
using { sap } from '@sap/cds/common';
|
|
2
|
+
|
|
3
|
+
extend sap.common.Currencies with {
|
|
4
|
+
// Currencies.code = ISO 4217 alphabetic three-letter code
|
|
5
|
+
// with the first two letters being equal to ISO 3166 alphabetic country codes
|
|
6
|
+
// See also:
|
|
7
|
+
// [1] https://www.iso.org/iso-4217-currency-codes.html
|
|
8
|
+
// [2] https://www.currency-iso.org/en/home/tables/table-a1.html
|
|
9
|
+
// [3] https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.payments.developer.doc/refs/rpylerl2mst97.htm
|
|
10
|
+
numcode : Integer;
|
|
11
|
+
exponent : Integer; //> e.g. 2 --> 1 Dollar = 10^2 Cent
|
|
12
|
+
minor : String; //> e.g. 'Cent'
|
|
13
|
+
}
|