diff --git a/fiori/app/browse/fiori-service.cds b/fiori/app/browse/fiori-service.cds index ef960b29..def17d31 100644 --- a/fiori/app/browse/fiori-service.cds +++ b/fiori/app/browse/fiori-service.cds @@ -33,7 +33,7 @@ annotate CatalogService.Books with @(UI : { //////////////////////////////////////////////////////////////////////////// // -// Books Object Page +// Books List Page // annotate CatalogService.Books with @(UI : { SelectionFields : [ diff --git a/fiori/app/common.cds b/fiori/app/common.cds index 7337c56a..1f396d8d 100644 --- a/fiori/app/common.cds +++ b/fiori/app/common.cds @@ -10,40 +10,31 @@ using { sap.common } from '@capire/common'; // Books Lists // annotate my.Books with @( - Common.SemanticKey : [ID], - UI : { - Identification : [{Value : title}], - SelectionFields : [ - ID, - author_ID, - price, - currency_code - ], - LineItem : [ - { - Value : ID, - Label : '{i18n>Title}' - }, - { - Value : author.ID, - Label : '{i18n>Author}' - }, - {Value : genre.name}, - {Value : stock}, - {Value : price}, - { - Value : currency.symbol, - Label : ' ' - }, - ] - } + Common.SemanticKey : [ID], + UI : { + Identification : [{ Value: title }], + SelectionFields : [ + ID, + author_ID, + price, + currency_code + ], + LineItem : [ + { Value: ID, Label: '{i18n>Title}' }, + { Value: author.ID, Label: '{i18n>Author}' }, + { Value: genre.name }, + { Value: stock }, + { Value: price }, + { Value: currency.symbol, Label: ' ' }, + ] + } ) { - ID @Common: { - SemanticObject : 'Books', - Text: title, - TextArrangement : #TextOnly - }; - author @ValueList.entity : 'Authors'; + ID @Common: { + SemanticObject : 'Books', + Text: title, + TextArrangement : #TextOnly + }; + author @ValueList.entity : 'Authors'; }; //////////////////////////////////////////////////////////////////////////// @@ -51,10 +42,10 @@ annotate my.Books with @( // Books Details // annotate my.Books with @(UI : {HeaderInfo : { - TypeName : '{i18n>Book}', - TypeNamePlural : '{i18n>Books}', - Title : {Value : title}, - Description : {Value : author.name} + TypeName : '{i18n>Book}', + TypeNamePlural : '{i18n>Books}', + Title : { Value: title }, + Description : { Value: author.name } }, }); @@ -63,19 +54,13 @@ annotate my.Books with @(UI : {HeaderInfo : { // Books Elements // annotate my.Books with { - ID @title : '{i18n>ID}'; - title @title : '{i18n>Title}'; - genre @title : '{i18n>Genre}' @Common : { - Text : genre.name, - TextArrangement : #TextOnly - }; - 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; + ID @title: '{i18n>ID}'; + title @title: '{i18n>Title}'; + genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly }; + 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; } //////////////////////////////////////////////////////////////////////////// @@ -83,17 +68,17 @@ annotate my.Books with { // Genres List // annotate my.Genres with @( - Common.SemanticKey : [name], - UI : { - SelectionFields : [name], - LineItem : [ - {Value : name}, - { - Value : parent.name, - Label : 'Main Genre' - }, - ], - } + Common.SemanticKey : [name], + UI : { + SelectionFields : [name], + LineItem : [ + { Value: name }, + { + Value : parent.name, + Label: 'Main Genre' + }, + ], + } ); //////////////////////////////////////////////////////////////////////////// @@ -101,18 +86,18 @@ annotate my.Genres with @( // Genre Details // annotate my.Genres with @(UI : { - Identification : [{Value : name}], - HeaderInfo : { - TypeName : '{i18n>Genre}', - TypeNamePlural : '{i18n>Genres}', - Title : {Value : name}, - Description : {Value : ID} - }, - Facets : [{ - $Type : 'UI.ReferenceFacet', - Label : '{i18n>SubGenres}', - Target : 'children/@UI.LineItem' - }, ], + Identification : [{ Value: name}], + HeaderInfo : { + TypeName : '{i18n>Genre}', + TypeNamePlural : '{i18n>Genres}', + Title : { Value: name }, + Description : { Value: ID } + }, + Facets : [{ + $Type : 'UI.ReferenceFacet', + Label : '{i18n>SubGenres}', + Target : 'children/@UI.LineItem' + }, ], }); //////////////////////////////////////////////////////////////////////////// @@ -120,8 +105,8 @@ annotate my.Genres with @(UI : { // Genres Elements // annotate my.Genres with { - ID @title : '{i18n>ID}'; - name @title : '{i18n>Genre}'; + ID @title: '{i18n>ID}'; + name @title: '{i18n>Genre}'; } //////////////////////////////////////////////////////////////////////////// @@ -129,24 +114,24 @@ annotate my.Genres with { // Authors List // annotate my.Authors with @( - Common.SemanticKey : [ID], - UI : { - Identification : [{Value : name}], - SelectionFields : [name], - LineItem : [ - {Value : ID}, - {Value : dateOfBirth}, - {Value : dateOfDeath}, - {Value : placeOfBirth}, - {Value : placeOfDeath}, - ], - } + Common.SemanticKey : [ID], + UI : { + Identification : [{ Value: name}], + SelectionFields : [name], + LineItem : [ + { Value: ID }, + { Value: dateOfBirth }, + { Value: dateOfDeath }, + { Value: placeOfBirth }, + { Value: placeOfDeath }, + ], + } ) { - ID @Common: { - SemanticObject : 'Authors', - Text: name, - TextArrangement : #TextOnly, - }; + ID @Common: { + SemanticObject : 'Authors', + Text: name, + TextArrangement : #TextOnly, + }; }; //////////////////////////////////////////////////////////////////////////// @@ -154,16 +139,16 @@ annotate my.Authors with @( // Author Details // annotate my.Authors with @(UI : { - HeaderInfo : { - TypeName : '{i18n>Author}', - TypeNamePlural : '{i18n>Authors}', - Title : {Value : name}, - Description : {Value : dateOfBirth} - }, - Facets : [{ - $Type : 'UI.ReferenceFacet', - Target : 'books/@UI.LineItem' - }, ], + HeaderInfo : { + TypeName : '{i18n>Author}', + TypeNamePlural : '{i18n>Authors}', + Title : { Value: name }, + Description : { Value: dateOfBirth } + }, + Facets : [{ + $Type : 'UI.ReferenceFacet', + Target : 'books/@UI.LineItem' + }, ], }); @@ -172,12 +157,12 @@ annotate my.Authors with @(UI : { // Authors Elements // annotate my.Authors with { - ID @title : '{i18n>ID}'; - name @title : '{i18n>Name}'; - dateOfBirth @title : '{i18n>DateOfBirth}'; - dateOfDeath @title : '{i18n>DateOfDeath}'; - placeOfBirth @title : '{i18n>PlaceOfBirth}'; - placeOfDeath @title : '{i18n>PlaceOfDeath}'; + ID @title: '{i18n>ID}'; + name @title: '{i18n>Name}'; + dateOfBirth @title: '{i18n>DateOfBirth}'; + dateOfDeath @title: '{i18n>DateOfDeath}'; + placeOfBirth @title: '{i18n>PlaceOfBirth}'; + placeOfDeath @title: '{i18n>PlaceOfDeath}'; } //////////////////////////////////////////////////////////////////////////// @@ -185,18 +170,18 @@ annotate my.Authors with { // Languages List // annotate common.Languages with @( - Common.SemanticKey : [code], - Identification : [{Value : code}], - UI : { - SelectionFields : [ - name, - descr - ], - LineItem : [ - {Value : code}, - {Value : name}, - ], - } + Common.SemanticKey : [code], + Identification : [{ Value: code}], + UI : { + SelectionFields : [ + name, + descr + ], + LineItem : [ + { Value: code }, + { Value: name }, + ], + } ); //////////////////////////////////////////////////////////////////////////// @@ -204,22 +189,22 @@ annotate common.Languages with @( // Language Details // annotate common.Languages with @(UI : { - HeaderInfo : { - TypeName : '{i18n>Language}', - TypeNamePlural : '{i18n>Languages}', - Title : {Value : name}, - Description : {Value : descr} - }, - Facets : [{ - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Details}', - Target : '@UI.FieldGroup#Details' - }, ], - FieldGroup #Details : {Data : [ - {Value : code}, - {Value : name}, - {Value : descr} - ]}, + HeaderInfo : { + TypeName : '{i18n>Language}', + TypeNamePlural : '{i18n>Languages}', + Title : { Value: name }, + Description : { Value: descr } + }, + Facets : [{ + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Details}', + Target : '@UI.FieldGroup#Details' + }, ], + FieldGroup #Details : {Data : [ + { Value: code }, + { Value: name }, + { Value: descr } + ]}, }); //////////////////////////////////////////////////////////////////////////// @@ -227,19 +212,19 @@ annotate common.Languages with @(UI : { // Currencies List // annotate common.Currencies with @( - Common.SemanticKey : [code], - Identification : [{Value : code}], - UI : { - SelectionFields : [ - name, - descr - ], - LineItem : [ - {Value : descr}, - {Value : symbol}, - {Value : code}, - ], - } + Common.SemanticKey : [code], + Identification : [{ Value: code}], + UI : { + SelectionFields : [ + name, + descr + ], + LineItem : [ + { Value: descr }, + { Value: symbol }, + { Value: code }, + ], + } ); //////////////////////////////////////////////////////////////////////////// @@ -247,35 +232,35 @@ annotate common.Currencies with @( // Currency Details // annotate common.Currencies with @(UI : { - HeaderInfo : { - TypeName : '{i18n>Currency}', - TypeNamePlural : '{i18n>Currencies}', - Title : {Value : descr}, - Description : {Value : code} + HeaderInfo : { + TypeName : '{i18n>Currency}', + TypeNamePlural : '{i18n>Currencies}', + Title : { Value: descr }, + Description : { Value: code } + }, + Facets : [ + { + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Details}', + Target : '@UI.FieldGroup#Details' }, - Facets : [ - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Details}', - Target : '@UI.FieldGroup#Details' - }, - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Extended}', - Target : '@UI.FieldGroup#Extended' - }, - ], - FieldGroup #Details : {Data : [ - {Value : name}, - {Value : symbol}, - {Value : code}, - {Value : descr} - ]}, - FieldGroup #Extended : {Data : [ - {Value : numcode}, - {Value : minor}, - {Value : exponent} - ]}, + { + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Extended}', + Target : '@UI.FieldGroup#Extended' + }, + ], + FieldGroup #Details : {Data : [ + { Value: name }, + { Value: symbol }, + { Value: code }, + { Value: descr } + ]}, + FieldGroup #Extended : {Data : [ + { Value: numcode }, + { Value: minor }, + { Value: exponent } + ]}, }); //////////////////////////////////////////////////////////////////////////// @@ -283,7 +268,7 @@ annotate common.Currencies with @(UI : { // Currencies Elements // annotate common.Currencies with { - numcode @title : '{i18n>NumCode}'; - minor @title : '{i18n>MinorUnit}'; - exponent @title : '{i18n>Exponent}'; + numcode @title: '{i18n>NumCode}'; + minor @title: '{i18n>MinorUnit}'; + exponent @title: '{i18n>Exponent}'; } diff --git a/orders/app/fiori.cds b/orders/app/fiori.cds index e3644ede..8e2a3ab6 100644 --- a/orders/app/fiori.cds +++ b/orders/app/fiori.cds @@ -16,11 +16,12 @@ using { OrdersService } from '../srv/orders-service'; @odata.draft.enabled annotate OrdersService.Orders with @( UI: { - SelectionFields: [ createdAt, createdBy ], + SelectionFields: [ createdBy ], LineItem: [ {Value: OrderNo, Label:'OrderNo'}, {Value: buyer, Label:'Customer'}, - {Value: createdAt, Label:'Date'} + {Value: currency.symbol, Label:'Currency'}, + {Value: createdAt, Label:'Date'}, ], HeaderInfo: { TypeName: 'Order', TypeNamePlural: 'Orders', diff --git a/orders/app/orders/index.html b/orders/app/orders/index.html index 6324cec3..5761894b 100644 --- a/orders/app/orders/index.html +++ b/orders/app/orders/index.html @@ -13,7 +13,7 @@ applications: { "manage-orders": { title: "Manage Orders", - description: "... testing FE v42", + description: "CAP Sample App", additionalInformation: "SAPUI5.Component=orders", applicationType : "URL", url: "/orders/webapp", diff --git a/orders/app/orders/webapp/manifest.json b/orders/app/orders/webapp/manifest.json index 045fa70a..257be403 100644 --- a/orders/app/orders/webapp/manifest.json +++ b/orders/app/orders/webapp/manifest.json @@ -3,8 +3,8 @@ "sap.app": { "id": "orders", "type": "application", - "title": "Order Books", - "description": "Sample Application", + "title": "Order Management", + "description": "CAP Sample Application", "i18n": "i18n/i18n.properties", "dataSources": { "OrdersService": { diff --git a/orders/db/schema.cds b/orders/db/schema.cds index 85effeaf..ec9549ac 100644 --- a/orders/db/schema.cds +++ b/orders/db/schema.cds @@ -2,7 +2,7 @@ using { Currency, User, managed, cuid } from '@sap/cds/common'; namespace sap.capire.orders; entity Orders : cuid, managed { - OrderNo : String @title:'Order Number'; //> readable key + OrderNo : String(22) @title:'Order Number'; //> readable key Items : Composition of many { key ID : UUID; product : Association to Products;