From a6ea2fb13026def3806dede06d5a7f8d2ecde6ad Mon Sep 17 00:00:00 2001 From: nkaputnik Date: Tue, 7 Dec 2021 11:10:12 +0100 Subject: [PATCH] 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]": {