From 31d2f4c93283bcd31915cfdec064ad4847ca9d0a Mon Sep 17 00:00:00 2001 From: Dinu Date: Tue, 9 Nov 2021 14:01:53 +0400 Subject: [PATCH 1/4] Avoid popup for ID in Fiori preview for Books. --- bookshop/srv/admin-service.cds | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bookshop/srv/admin-service.cds b/bookshop/srv/admin-service.cds index ea9b0731..df48d7ca 100644 --- a/bookshop/srv/admin-service.cds +++ b/bookshop/srv/admin-service.cds @@ -3,3 +3,12 @@ service AdminService @(requires:'admin') { entity Books as projection on my.Books; entity Authors as projection on my.Authors; } + +//Since ID is computed, we can hide the popup for ID on Create +annotate AdminService.Books with { + ID @Core.Computed; +} + +annotate AdminService.Authors with { + ID @Core.Computed; +} \ No newline at end of file From 40ea057f7fd247ac570dd09ad6cde443276d5c20 Mon Sep 17 00:00:00 2001 From: Dinu Date: Tue, 9 Nov 2021 15:46:22 +0400 Subject: [PATCH 2/4] Annotation for value list for languages for locale --- fiori/app/admin/fiori-service.cds | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fiori/app/admin/fiori-service.cds b/fiori/app/admin/fiori-service.cds index a721c65a..e5fbea88 100644 --- a/fiori/app/admin/fiori-service.cds +++ b/fiori/app/admin/fiori-service.cds @@ -85,7 +85,9 @@ annotate AdminService.Books.texts with @( // Add Value Help for Locales annotate AdminService.Books.texts { - locale @ValueList:{entity:'Languages',type:#fixed} + locale @ValueList:{entity:'Languages'}; + locale @Common.ValueListWithFixedValues:true; //show as drop down, not a dialog + locale @Common.ValueListForValidation:''; // validate against this list } // In addition we need to expose Languages through AdminService as a target for ValueList using { sap } from '@sap/cds/common'; From e89e012eba17f41ca8d6a18fc4d0ccc5fdc06b55 Mon Sep 17 00:00:00 2001 From: dinurp Date: Wed, 10 Nov 2021 11:12:18 +0400 Subject: [PATCH 3/4] Update bookshop/srv/admin-service.cds Co-authored-by: Christian Georgi --- bookshop/srv/admin-service.cds | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bookshop/srv/admin-service.cds b/bookshop/srv/admin-service.cds index df48d7ca..abbdeaf5 100644 --- a/bookshop/srv/admin-service.cds +++ b/bookshop/srv/admin-service.cds @@ -5,10 +5,5 @@ service AdminService @(requires:'admin') { } //Since ID is computed, we can hide the popup for ID on Create -annotate AdminService.Books with { - ID @Core.Computed; -} - -annotate AdminService.Authors with { - ID @Core.Computed; -} \ No newline at end of file +annotate AdminService.Books with { ID @Core.Computed; } +annotate AdminService.Authors with { ID @Core.Computed; } \ No newline at end of file From e838f380c5be878e1fd6138eeee8f9e511a6bb87 Mon Sep 17 00:00:00 2001 From: dinurp Date: Wed, 10 Nov 2021 11:18:41 +0400 Subject: [PATCH 4/4] annotation to make language value list a drop down. type:#Fixed was not rendering the value list as a drop down. There was not UI validation for values entered. The added annotation does both these: UI validation and renders the a drop down list. --- fiori/app/admin/fiori-service.cds | 1 - 1 file changed, 1 deletion(-) diff --git a/fiori/app/admin/fiori-service.cds b/fiori/app/admin/fiori-service.cds index 7fc51e08..fc1987cb 100644 --- a/fiori/app/admin/fiori-service.cds +++ b/fiori/app/admin/fiori-service.cds @@ -87,7 +87,6 @@ annotate AdminService.Books.texts with @( annotate AdminService.Books.texts { locale @ValueList:{entity:'Languages'}; locale @Common.ValueListWithFixedValues:true; //show as drop down, not a dialog - locale @Common.ValueListForValidation:''; // validate against this list } // In addition we need to expose Languages through AdminService as a target for ValueList using { sap } from '@sap/cds/common';