From e4214b0e4003462888d41c35a0237d644d0130ac Mon Sep 17 00:00:00 2001 From: Pierre Fritsch Date: Tue, 8 Nov 2022 14:26:48 +0100 Subject: [PATCH] Fiori app *Browse Books*: Add missing column labels (#420) * Add labels for `rating` and `numberOfReviews` * Add label for `currency.symbol` * Add label for `descr` * Add label for `image` Co-authored-by: Christian Georgi --- bookstore/srv/mashup.cds | 4 ++++ fiori/app/_i18n/i18n.properties | 5 +++++ fiori/app/browse/fiori-service.cds | 5 +---- fiori/app/common.cds | 10 ++++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/bookstore/srv/mashup.cds b/bookstore/srv/mashup.cds index 061418c0..7344ff1a 100644 --- a/bookstore/srv/mashup.cds +++ b/bookstore/srv/mashup.cds @@ -12,7 +12,11 @@ using { sap.capire.bookshop.Books } from '@capire/bookshop'; using { ReviewsService.Reviews } from '@capire/reviews'; extend Books with { reviews : Composition of many Reviews on reviews.subject = $self.ID; + + @Common.Label : '{i18n>Rating}' rating : Decimal; + + @Common.Label : '{i18n>NumberOfReviews}' numberOfReviews : Integer; } diff --git a/fiori/app/_i18n/i18n.properties b/fiori/app/_i18n/i18n.properties index 01f3fc54..30c91ce9 100644 --- a/fiori/app/_i18n/i18n.properties +++ b/fiori/app/_i18n/i18n.properties @@ -6,6 +6,8 @@ Author = Author AuthorID = Author ID Stock = Stock Name = Name +Description = Description +Image = Image AuthorName = Author's Name DateOfBirth = Date of Birth DateOfDeath = Date of Death @@ -17,6 +19,9 @@ Authors = Authors Order = Order Orders = Orders Price = Price +Currency = Currency +Rating = Rating +NumberOfReviews = Number of Reviews Genre = Genre Genres = Genres diff --git a/fiori/app/browse/fiori-service.cds b/fiori/app/browse/fiori-service.cds index def17d31..03ff198c 100644 --- a/fiori/app/browse/fiori-service.cds +++ b/fiori/app/browse/fiori-service.cds @@ -52,9 +52,6 @@ annotate CatalogService.Books with @(UI : { }, {Value : genre.name}, {Value : price}, - { - Value : currency.symbol, - Label : ' ' - }, + {Value : currency.symbol}, ] }, ); diff --git a/fiori/app/common.cds b/fiori/app/common.cds index 1f396d8d..912fe190 100644 --- a/fiori/app/common.cds +++ b/fiori/app/common.cds @@ -4,6 +4,7 @@ using { sap.capire.bookshop as my } from '@capire/bookstore'; using { sap.common } from '@capire/common'; +using { sap.common.Currencies } from '@sap/cds/common'; //////////////////////////////////////////////////////////////////////////// // @@ -25,7 +26,7 @@ annotate my.Books with @( { Value: genre.name }, { Value: stock }, { Value: price }, - { Value: currency.symbol, Label: ' ' }, + { Value: currency.symbol }, ] } ) { @@ -37,6 +38,10 @@ annotate my.Books with @( author @ValueList.entity : 'Authors'; }; +annotate Currencies with { + symbol @Common.Label : '{i18n>Currency}'; +} + //////////////////////////////////////////////////////////////////////////// // // Books Details @@ -60,7 +65,8 @@ annotate my.Books with { author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly }; price @title: '{i18n>Price}' @Measures.ISOCurrency : currency_code; stock @title: '{i18n>Stock}'; - descr @UI.MultiLineText; + descr @title: '{i18n>Description}' @UI.MultiLineText; + image @title: '{i18n>Image}'; } ////////////////////////////////////////////////////////////////////////////