cosmetics

This commit is contained in:
Daniel
2022-10-04 11:48:01 +02:00
parent 92f7489def
commit ee2fdd0989
6 changed files with 173 additions and 187 deletions

View File

@@ -33,7 +33,7 @@ annotate CatalogService.Books with @(UI : {
////////////////////////////////////////////////////////////////////////////
//
// Books Object Page
// Books List Page
//
annotate CatalogService.Books with @(UI : {
SelectionFields : [

View File

@@ -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}';
}

View File

@@ -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',

View File

@@ -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",

View File

@@ -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": {

View File

@@ -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;