Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit e4214b0

Browse files
PierreFritschchgeo
andauthored
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 <[email protected]>
1 parent ad76c69 commit e4214b0

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

bookstore/srv/mashup.cds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ using { sap.capire.bookshop.Books } from '@capire/bookshop';
1212
using { ReviewsService.Reviews } from '@capire/reviews';
1313
extend Books with {
1414
reviews : Composition of many Reviews on reviews.subject = $self.ID;
15+
16+
@Common.Label : '{i18n>Rating}'
1517
rating : Decimal;
18+
19+
@Common.Label : '{i18n>NumberOfReviews}'
1620
numberOfReviews : Integer;
1721
}
1822

fiori/app/_i18n/i18n.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Author = Author
66
AuthorID = Author ID
77
Stock = Stock
88
Name = Name
9+
Description = Description
10+
Image = Image
911
AuthorName = Author's Name
1012
DateOfBirth = Date of Birth
1113
DateOfDeath = Date of Death
@@ -17,6 +19,9 @@ Authors = Authors
1719
Order = Order
1820
Orders = Orders
1921
Price = Price
22+
Currency = Currency
23+
Rating = Rating
24+
NumberOfReviews = Number of Reviews
2025
2126
Genre = Genre
2227
Genres = Genres

fiori/app/browse/fiori-service.cds

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ annotate CatalogService.Books with @(UI : {
5252
},
5353
{Value : genre.name},
5454
{Value : price},
55-
{
56-
Value : currency.symbol,
57-
Label : ' '
58-
},
55+
{Value : currency.symbol},
5956
]
6057
}, );

fiori/app/common.cds

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using { sap.capire.bookshop as my } from '@capire/bookstore';
66
using { sap.common } from '@capire/common';
7+
using { sap.common.Currencies } from '@sap/cds/common';
78

89
////////////////////////////////////////////////////////////////////////////
910
//
@@ -25,7 +26,7 @@ annotate my.Books with @(
2526
{ Value: genre.name },
2627
{ Value: stock },
2728
{ Value: price },
28-
{ Value: currency.symbol, Label: ' ' },
29+
{ Value: currency.symbol },
2930
]
3031
}
3132
) {
@@ -37,6 +38,10 @@ annotate my.Books with @(
3738
author @ValueList.entity : 'Authors';
3839
};
3940

41+
annotate Currencies with {
42+
symbol @Common.Label : '{i18n>Currency}';
43+
}
44+
4045
////////////////////////////////////////////////////////////////////////////
4146
//
4247
// Books Details
@@ -60,7 +65,8 @@ annotate my.Books with {
6065
author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
6166
price @title: '{i18n>Price}' @Measures.ISOCurrency : currency_code;
6267
stock @title: '{i18n>Stock}';
63-
descr @UI.MultiLineText;
68+
descr @title: '{i18n>Description}' @UI.MultiLineText;
69+
image @title: '{i18n>Image}';
6470
}
6571

6672
////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)