From a6ea2fb13026def3806dede06d5a7f8d2ecde6ad Mon Sep 17 00:00:00 2001 From: nkaputnik Date: Tue, 7 Dec 2021 11:10:12 +0100 Subject: [PATCH 1/3] Added changes for simple field extensibility (UIFlex) --- bookshop/db/schema.cds | 6 ++--- fiori/app/admin-authors/webapp/manifest.json | 4 ++++ fiori/app/admin-books/webapp/manifest.json | 4 ++++ fiori/app/fiori-apps.html | 25 +++++++++++++++++--- fiori/package.json | 10 ++++++-- 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/bookshop/db/schema.cds b/bookshop/db/schema.cds index ec8b119a..b29811e5 100644 --- a/bookshop/db/schema.cds +++ b/bookshop/db/schema.cds @@ -1,7 +1,7 @@ -using { Currency, managed, sap } from '@sap/cds/common'; +using { Currency, managed, sap, extensible } from '@sap/cds/common'; namespace sap.capire.bookshop; -entity Books : managed { +entity Books : managed, extensible { key ID : Integer; title : localized String(111); descr : localized String(1111); @@ -13,7 +13,7 @@ entity Books : managed { image : LargeBinary @Core.MediaType : 'image/png'; } -entity Authors : managed { +entity Authors : managed, extensible { key ID : Integer; name : String(111); dateOfBirth : Date; diff --git a/fiori/app/admin-authors/webapp/manifest.json b/fiori/app/admin-authors/webapp/manifest.json index f721b11d..2bd8e666 100644 --- a/fiori/app/admin-authors/webapp/manifest.json +++ b/fiori/app/admin-authors/webapp/manifest.json @@ -50,6 +50,10 @@ } }, "sap.ui5": { + "flexEnabled": true, + "config": { + "experimentalCAPScenario": true + }, "dependencies": { "minUI5Version": "1.81.0", "libs": { diff --git a/fiori/app/admin-books/webapp/manifest.json b/fiori/app/admin-books/webapp/manifest.json index 1cac7ab1..98886d36 100644 --- a/fiori/app/admin-books/webapp/manifest.json +++ b/fiori/app/admin-books/webapp/manifest.json @@ -22,6 +22,10 @@ } }, "sap.ui5": { + "flexEnabled": true, + "config": { + "experimentalCAPScenario": true + }, "dependencies": { "libs": { "sap.fe.templates": {} diff --git a/fiori/app/fiori-apps.html b/fiori/app/fiori-apps.html index 0a452268..9b7b2b89 100644 --- a/fiori/app/fiori-apps.html +++ b/fiori/app/fiori-apps.html @@ -10,7 +10,21 @@ @@ -22,8 +36,13 @@ data-sap-ui-frameOptions="allow" > + sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content")); + sap.ui + .getCore() + .getConfiguration() + .setFlexibilityServices([{ connector: "SessionStorageConnector" }]); + sap.ui.getCore().getConfiguration().setLanguage("en"); + diff --git a/fiori/package.json b/fiori/package.json index a01cff46..86cdd3e7 100644 --- a/fiori/package.json +++ b/fiori/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "dependencies": { "@capire/bookstore": "*", - "@sap/cds": "^5", + "@sap/cds": "*", "express": "^4.17.1", "passport": "^0.4.1" }, @@ -13,6 +13,9 @@ }, "cds": { "requires": { + "extensibility": { + "kind": "uiflex" + }, "auth": { "strategy": "dummy" }, @@ -36,7 +39,10 @@ } }, "db": { - "kind": "sql" + "kind": "sqlite", + "credentials": { + "database": "sqlite.db" + } }, "db-ext": { "[development]": { From 1ec44aaecf6a7787309718280b3476a41809f8fe Mon Sep 17 00:00:00 2001 From: nkaputnik Date: Fri, 10 Dec 2021 10:40:17 +0100 Subject: [PATCH 2/3] Fixed dependency --- fiori/package.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fiori/package.json b/fiori/package.json index 86cdd3e7..1014df46 100644 --- a/fiori/package.json +++ b/fiori/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "dependencies": { "@capire/bookstore": "*", - "@sap/cds": "*", + "@sap/cds": "^5", "express": "^4.17.1", "passport": "^0.4.1" }, @@ -39,9 +39,7 @@ } }, "db": { - "kind": "sqlite", - "credentials": { - "database": "sqlite.db" + "kind": "sql" } }, "db-ext": { From e08cdf78310a599ea4f999fa713f362c349e49a6 Mon Sep 17 00:00:00 2001 From: nkaputnik Date: Fri, 10 Dec 2021 10:41:34 +0100 Subject: [PATCH 3/3] typo --- fiori/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/fiori/package.json b/fiori/package.json index 1014df46..77da2d77 100644 --- a/fiori/package.json +++ b/fiori/package.json @@ -40,7 +40,6 @@ }, "db": { "kind": "sql" - } }, "db-ext": { "[development]": {