diff --git a/.github/ISSUE_TEMPLATE/question--feedback-or-bug-.md b/.github/ISSUE_TEMPLATE/question--feedback-or-bug-.md new file mode 100644 index 00000000..19f10800 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question--feedback-or-bug-.md @@ -0,0 +1,10 @@ +--- +name: Question, feedback or bug? +about: Use our community! +title: '' +labels: '' +assignees: '' + +--- + +Please use our community on https://answers.sap.com/tags/9f13aee1-834c-4105-8e43-ee442775e5ce diff --git a/.mocharc.yml b/.mocharc.yml new file mode 100644 index 00000000..06f6886f --- /dev/null +++ b/.mocharc.yml @@ -0,0 +1 @@ +parallel: true diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 6041b7e8..00000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -@sap:registry=https://npm.sap.com \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index dcc16d69..240b1cf9 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,7 +4,7 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ - // "CDS Editor !", + "SAPSE.vscode-cds", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "mechatroner.rainbow-csv", diff --git a/.vscode/launch.json b/.vscode/launch.json index 37d9ac7f..d0f0e8eb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,24 +6,16 @@ "configurations": [ { "name": "bookshop", - "cwd": "${workspaceFolder}/bookshop", + "command": "cds watch bookshop", "request": "launch", - "type": "node", - "runtimeExecutable": "npx", - "runtimeArgs": ["-n"], - "args": ["--", "cds", "run", "--with-mocks", "--in-memory?"], - "console": "integratedTerminal", + "type": "node-terminal", "skipFiles": ["/**"] }, { - "name": "Fiori App", - "cwd": "${workspaceFolder}/fiori", + "name": "Fiori app", + "command": "cds watch fiori", "request": "launch", - "type": "node", - "runtimeExecutable": "npx", - "runtimeArgs": ["-n"], - "args": ["--", "cds", "run", "--with-mocks", "--in-memory?"], - "console": "integratedTerminal", + "type": "node-terminal", "skipFiles": ["/**"] } ], diff --git a/README.md b/README.md index 294f3191..dd41eff5 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ npx jest ## Get Support Check out the documentation at [https://cap.cloud.sap](https://cap.cloud.sap).
-In case you find a bug or need support, please [open an issue in here](https://github.com/SAP-samples/cloud-cap-samples/issues/new). +In case you have a question, find a bug, or otherwise need support, please use our [community](https://answers.sap.com/tags/9f13aee1-834c-4105-8e43-ee442775e5ce). ## License diff --git a/bookshop/db/data/sap.capire.bookshop-Genres.csv b/bookshop/db/data/sap.capire.bookshop-Genres.csv index 08435ca9..1ea3793b 100644 --- a/bookshop/db/data/sap.capire.bookshop-Genres.csv +++ b/bookshop/db/data/sap.capire.bookshop-Genres.csv @@ -11,6 +11,6 @@ ID;parent_ID;name 19;10;Fairy Tale 20;;Non-Fiction 21;20;Biography -22;20;Autobiography +22;21;Autobiography 23;20;Essay 24;20;Speech diff --git a/common/data/sap.common-Currencies.csv b/common/data/sap.common-Currencies.csv index 63372602..efe4538e 100644 --- a/common/data/sap.common-Currencies.csv +++ b/common/data/sap.common-Currencies.csv @@ -2,7 +2,7 @@ code;symbol;name;descr;numcode;minor;exponent EUR;€;Euro;European Euro;978;Cent;2 USD;$;US Dollar;United States Dollar;840;Cent;2 CAD;$;Canadian Dollar;Canadian Dollar;124;Cent;2 -AUD;$;Australian Dollar;Canadian Dollar;036;Cent;2 +AUD;$;Australian Dollar;Australian Dollar;036;Cent;2 GBP;£;British Pound;Great Britain Pound;826;Penny;2 ILS;₪;Shekel;Israeli New Shekel;376;Agorat;2 INR;₹;Rupee;Indian Rupee;356;Paise;2 diff --git a/fiori/app/_i18n/i18n.properties b/fiori/app/_i18n/i18n.properties index 5d6f03d6..c1d0293f 100644 --- a/fiori/app/_i18n/i18n.properties +++ b/fiori/app/_i18n/i18n.properties @@ -7,7 +7,19 @@ AuthorID = Author ID Stock = Stock Name = Name AuthorName = Author's Name +DateOfBirth = Date of Birth +DateOfDeath = Date of Death +PlaceOfBirth = Place of Birth +PlaceOfDeath = Place of Death Authors = Authors Order = Order Orders = Orders Price = Price + +Genre = Genre +Genres = Genres +SubGenres = Sub Genres + +NumCode = Numeric Code +MinorUnit = Minor Unit +Exponent = Exponent \ No newline at end of file diff --git a/fiori/app/admin/webapp/Component.js b/fiori/app/admin/webapp/Component.js index 18967b84..c3137017 100644 --- a/fiori/app/admin/webapp/Component.js +++ b/fiori/app/admin/webapp/Component.js @@ -1,5 +1,8 @@ -sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("admin.Component", { - metadata:{ manifest:'json' } -})) +sap.ui.define(["sap/fe/core/AppComponent"], function(AppComponent) { + "use strict"; + return AppComponent.extend("admin.Component", { + metadata: { manifest: "json" } + }); +}); /* eslint no-undef:0 */ \ No newline at end of file diff --git a/fiori/app/admin/webapp/manifest.json b/fiori/app/admin/webapp/manifest.json index 574480f1..25047c29 100644 --- a/fiori/app/admin/webapp/manifest.json +++ b/fiori/app/admin/webapp/manifest.json @@ -24,7 +24,7 @@ "sap.ui5": { "dependencies": { "libs": { - "sap.fe": {} + "sap.fe.templates": {} } }, "models": { diff --git a/fiori/app/browse/webapp/Component.js b/fiori/app/browse/webapp/Component.js index 0d8d14b5..7914d295 100644 --- a/fiori/app/browse/webapp/Component.js +++ b/fiori/app/browse/webapp/Component.js @@ -1,5 +1,7 @@ -sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("bookshop.Component", { - metadata:{ manifest:'json' } -})) - +sap.ui.define(["sap/fe/core/AppComponent"], function(AppComponent) { + "use strict"; + return AppComponent.extend("bookshop.Component", { + metadata: { manifest: "json" } + }); +}); /* eslint no-undef:0 */ \ No newline at end of file diff --git a/fiori/app/browse/webapp/manifest.json b/fiori/app/browse/webapp/manifest.json index 4212312e..4a2e0a62 100644 --- a/fiori/app/browse/webapp/manifest.json +++ b/fiori/app/browse/webapp/manifest.json @@ -24,7 +24,7 @@ "sap.ui5": { "dependencies": { "libs": { - "sap.fe": {} + "sap.fe.templates": {} } }, "models": { diff --git a/fiori/app/common.cds b/fiori/app/common.cds index 2cbdd162..614f03b3 100644 --- a/fiori/app/common.cds +++ b/fiori/app/common.cds @@ -1,9 +1,9 @@ /* - Common Annotations shared by all apps + Common Annotations shared by all apps */ using { sap.capire.bookshop as my } from '@capire/bookshop'; - +using { sap.common } from '@capire/common'; //////////////////////////////////////////////////////////////////////////// // @@ -13,7 +13,7 @@ annotate my.Books with @( Common.SemanticKey: [title], UI: { Identification: [{Value:title}], - SelectionFields: [ ID, author_ID, price, currency_code ], + SelectionFields: [ ID, author_ID, price, currency_code ], LineItem: [ {Value: ID}, {Value: title}, @@ -28,25 +28,18 @@ annotate my.Books with @( author @ValueList.entity:'Authors'; }; -annotate my.Authors with @( - UI: { - Identification: [{Value:name}], - } -); - - //////////////////////////////////////////////////////////////////////////// // // Books Details // annotate my.Books with @( UI: { - HeaderInfo: { - TypeName: '{i18n>Book}', - TypeNamePlural: '{i18n>Books}', - Title: {Value: title}, - Description: {Value: author.name} - }, + HeaderInfo: { + TypeName: '{i18n>Book}', + TypeNamePlural: '{i18n>Books}', + Title: {Value: title}, + Description: {Value: author.name} + }, } ); @@ -66,15 +59,199 @@ annotate my.Books with { descr @UI.MultiLineText; } +//////////////////////////////////////////////////////////////////////////// +// +// Genres List +// +annotate my.Genres with @( + Common.SemanticKey: [name], + UI: { + SelectionFields: [ name ], + LineItem:[ + {Value: name}, + {Value: parent.name, Label: 'Main Genre'}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Genre Details +// +annotate my.Genres with @( + UI: { + Identification: [{Value:name}], + HeaderInfo: { + TypeName: '{i18n>Genre}', + TypeNamePlural: '{i18n>Genres}', + Title: {Value: name}, + Description: {Value: ID} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Label: '{i18n>SubGenres}', Target: 'children/@UI.LineItem'}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Genres Elements +// annotate my.Genres with { - name @title: '{i18n>Genre}'; + ID @title: '{i18n>ID}'; + name @title: '{i18n>Genre}'; } +//////////////////////////////////////////////////////////////////////////// +// +// Authors List +// +annotate my.Authors with @( + Common.SemanticKey: [name], + UI: { + Identification: [{Value:name}], + SelectionFields: [ name ], + LineItem:[ + {Value: ID}, + {Value: name}, + {Value: dateOfBirth}, + {Value: dateOfDeath}, + {Value: placeOfBirth}, + {Value: placeOfDeath}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Author Details +// +annotate my.Authors with @( + UI: { + HeaderInfo: { + TypeName: '{i18n>Author}', + TypeNamePlural: '{i18n>Authors}', + Title: {Value: name}, + Description: {Value: dateOfBirth} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Target: 'books/@UI.LineItem'}, + ], + } +); + + //////////////////////////////////////////////////////////////////////////// // // Authors Elements // annotate my.Authors with { ID @title:'{i18n>ID}' @UI.HiddenFilter; - name @title:'{i18n>AuthorName}'; + name @title:'{i18n>Name}'; + dateOfBirth @title:'{i18n>DateOfBirth}'; + dateOfDeath @title:'{i18n>DateOfDeath}'; + placeOfBirth @title:'{i18n>PlaceOfBirth}'; + placeOfDeath @title:'{i18n>PlaceOfDeath}'; +} + +//////////////////////////////////////////////////////////////////////////// +// +// Languages List +// +annotate common.Languages with @( + Common.SemanticKey: [code], + Identification: [{Value:code}], + UI: { + SelectionFields: [ name, descr ], + LineItem:[ + {Value: code}, + {Value: name}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Language Details +// +annotate common.Languages with @( + UI: { + HeaderInfo: { + TypeName: '{i18n>Language}', + TypeNamePlural: '{i18n>Languages}', + Title: {Value: name}, + Description: {Value: descr} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'}, + ], + FieldGroup#Details: { + Data: [ + {Value: code}, + {Value: name}, + {Value: descr} + ] + }, + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Currencies List +// +annotate common.Currencies with @( + Common.SemanticKey: [code], + Identification: [{Value:code}], + UI: { + SelectionFields: [ name, descr ], + LineItem:[ + {Value: descr}, + {Value: symbol}, + {Value: code}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Currency Details +// +annotate common.Currencies with @( + UI: { + HeaderInfo: { + TypeName: '{i18n>Currency}', + TypeNamePlural: '{i18n>Currencies}', + Title: {Value: descr}, + Description: {Value: code} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'}, + {$Type: 'UI.ReferenceFacet', Label: '{i18n>Extended}', Target: '@UI.FieldGroup#Extended'}, + ], + FieldGroup#Details: { + Data: [ + {Value: name}, + {Value: symbol}, + {Value: code}, + {Value: descr} + ] + }, + FieldGroup#Extended: { + Data: [ + {Value: numcode}, + {Value: minor}, + {Value: exponent} + ] + }, + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Currencies Elements +// +annotate common.Currencies with { + numcode @title:'{i18n>NumCode}'; + minor @title:'{i18n>MinorUnit}'; + exponent @title:'{i18n>Exponent}'; } diff --git a/fiori/app/fiori.html b/fiori/app/fiori.html index 26182c12..aec60a55 100644 --- a/fiori/app/fiori.html +++ b/fiori/app/fiori.html @@ -40,7 +40,8 @@ -