Merge pull request #291 from gregorwolf/navigation

Demo for Semantic Navigation using the local Fiori Launchpad
This commit is contained in:
Christian Georgi
2021-11-22 13:08:57 +01:00
committed by GitHub
14 changed files with 679 additions and 266 deletions

View File

@@ -1,16 +1,42 @@
using { sap.capire.bookshop as my } from '../db/schema'; using {sap.capire.bookshop as my} from '../db/schema';
service CatalogService @(path:'/browse') {
/** For displaying lists of Books */ service CatalogService @(path : '/browse') {
@readonly entity ListOfBooks as projection on Books
excluding { descr };
/** For display in details pages */ /**
@readonly entity Books as projection on my.Books { *, * For displaying lists of Books
author.name as author */
} excluding { createdBy, modifiedBy }; @readonly
entity ListOfBooks as projection on Books excluding {
descr
};
@requires: 'authenticated-user' /**
action submitOrder ( book: Books:ID, quantity: Integer ) returns { stock: Integer }; * For display in details pages
event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String }; */
@readonly
entity Books as projection on my.Books {
* , author.name as authorName
} excluding {
createdBy,
modifiedBy
};
@readonly
entity Authors as projection on my.Authors {
* , books : redirected to Books
} excluding {
createdBy,
modifiedBy
};
@requires : 'authenticated-user'
action submitOrder(book : Books:ID, quantity : Integer) returns {
stock : Integer
};
event OrderedBook : {
book : Books:ID;
quantity : Integer;
buyer : String
};
} }

View File

@@ -73,6 +73,7 @@
"options": { "options": {
"settings" : { "settings" : {
"entitySet" : "Books", "entitySet" : "Books",
"initialLoad": true,
"navigation" : { "navigation" : {
"Books" : { "Books" : {
"detail" : { "detail" : {

View File

@@ -0,0 +1,142 @@
{
"services": {
"LaunchPage": {
"adapter": {
"config": {
"catalogs": [],
"groups": [
{
"id": "Bookshop",
"title": "Bookshop",
"isPreset": true,
"isVisible": true,
"isGroupLocked": false,
"tiles": [
{
"id": "BrowseBooks",
"tileType": "sap.ushell.ui.tile.StaticTile",
"properties": {
"title": "Browse Books",
"targetURL": "#Books-display"
}
},
{
"id": "BrowseAuthors",
"tileType": "sap.ushell.ui.tile.StaticTile",
"properties": {
"title": "Browse Authors",
"targetURL": "#Authors-display"
}
}
]
},
{
"id": "Administration",
"title": "Administration",
"isPreset": true,
"isVisible": true,
"isGroupLocked": false,
"tiles": [
{
"id": "ManageBooks",
"tileType": "sap.ushell.ui.tile.StaticTile",
"properties": {
"title": "Manage Books",
"targetURL": "#Books-manage"
}
},
{
"id": "ManageOrders",
"tileType": "sap.ushell.ui.tile.StaticTile",
"properties": {
"title": "Manage Orders",
"targetURL": "#Orders-manage"
}
}
]
}
]
}
}
},
"NavTargetResolution": {
"config": {
"enableClientSideTargetResolution": true
}
},
"ClientSideTargetResolution": {
"adapter": {
"config": {
"inbounds": {
"BrowseBooks": {
"semanticObject": "Books",
"action": "display",
"title": "Browse Books",
"signature": {
"parameters": {
"Books.ID": {
"renameTo": "ID"
},
"Authors.books.ID": {
"renameTo": "ID"
}
},
"additionalParameters": "ignored"
},
"resolutionResult": {
"applicationType": "SAPUI5",
"additionalInformation": "SAPUI5.Component=bookshop",
"url": "/browse/webapp"
}
},
"BrowseAuthors": {
"semanticObject": "Authors",
"action": "display",
"title": "Browse Authors",
"signature": {
"parameters": {
"Books.author.ID":{
"renameTo": "ID"
}
},
"additionalParameters": "ignored"
},
"resolutionResult": {
"applicationType": "SAPUI5",
"additionalInformation": "SAPUI5.Component=authors",
"url": "/authors/webapp"
}
},
"ManageBooks": {
"semanticObject": "Books",
"action": "manage",
"title": "Manage Books",
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"resolutionResult": {
"applicationType": "SAPUI5",
"additionalInformation": "SAPUI5.Component=admin",
"url": "/admin/webapp"
}
},
"ManageOrders": {
"semanticObject": "Orders",
"action": "manage",
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"resolutionResult": {
"applicationType": "SAPUI5",
"additionalInformation": "SAPUI5.Component=orders",
"url": "/orders/webapp"
}
}
}
}
}
}
}
}

View File

@@ -0,0 +1,30 @@
using CatalogService from '@capire/bookshop';
////////////////////////////////////////////////////////////////////////////
//
// Authors Object Page
//
annotate CatalogService.Authors with @(UI : {
HeaderInfo : {
TypeName : 'Author',
TypeNamePlural : 'Authors',
Description : {Value : name}
},
HeaderFacets : [{
$Type : 'UI.ReferenceFacet',
Label : '{i18n>Description}',
Target : '@UI.FieldGroup#Descr'
}, ],
Facets : [{
$Type : 'UI.ReferenceFacet',
Label : '{i18n>Details}',
Target : 'books/@UI.LineItem'
}, ],
FieldGroup #Descr : {Data : [
{Value : name},
{Value : dateOfBirth},
{Value : dateOfDeath},
{Value : placeOfBirth},
{Value : placeOfDeath},
]},
});

View File

@@ -0,0 +1,7 @@
sap.ui.define(["sap/fe/core/AppComponent"], function (AppComponent) {
"use strict";
return AppComponent.extend("authors.Component", {
metadata: { manifest: "json" },
});
});
/* eslint no-undef:0 */

View File

@@ -0,0 +1,11 @@
# This is the resource bundle of itelo
# __ldi.translation.uuid=c3431418-9caf-11e8-98d0-529269fb1459
# JCI app descriptor contains lower case TITLE
appTitle=Bookshop Authors
# JCI app descriptor contains lower case DESCRIPTION
appSubTitle=Bookshop Authors
# JCI app descriptor contains lower case DESCRIPTION
appDescription=Bookshop Authors

View File

@@ -0,0 +1,141 @@
{
"_version": "1.28.0",
"sap.app": {
"id": "authors",
"type": "application",
"title": "Browse Authors",
"description": "Sample Application",
"i18n": "i18n/i18n.properties",
"applicationVersion": {
"version": "1.0.0"
},
"dataSources": {
"CatalogService": {
"uri": "/browse/",
"type": "OData",
"settings": {
"odataVersion": "4.0"
}
}
},
"sourceTemplate": {
"id": "ui5template.basicSAPUI5ApplicationProject",
"-id": "ui5template.smartTemplate",
"version": "1.40.12"
},
"crossNavigation": {
"inbounds": {
"intent1": {
"signature": {
"parameters": {
"Books.author.ID":{
"renameTo": "ID"
}
},
"additionalParameters": "ignored"
},
"semanticObject": "Authors",
"action": "display",
"title": "{{appTitle}}",
"info": "{{appInfo}}",
"subTitle": "{{appSubTitle}}",
"icon": "sap-icon://SAP-icons-TNT/user",
"indicatorDataSource": {
"dataSource": "CatalogService",
"path": "Authors/$count",
"refresh": 1800
}
}
}
}
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.81.0",
"libs": {
"sap.fe.templates": {}
}
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/i18n.properties"
},
"": {
"dataSource": "CatalogService",
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect": true,
"earlyRequests": true,
"groupProperties": {
"default": {
"submit": "Auto"
}
}
}
}
},
"routing": {
"routes": [
{
"pattern": ":?query:",
"name": "AuthorsList",
"target": "AuthorsList"
},
{
"pattern": "Authors({key}):?query:",
"name": "AuthorsDetails",
"target": "AuthorsDetails"
}
],
"targets": {
"AuthorsList": {
"type": "Component",
"id": "AuthorsList",
"name": "sap.fe.templates.ListReport",
"options": {
"settings": {
"entitySet": "Authors",
"initialLoad": true,
"navigation": {
"Authors": {
"detail": {
"route": "AuthorsDetails"
}
}
}
}
}
},
"AuthorsDetails": {
"type": "Component",
"id": "AuthorsDetailsList",
"name": "sap.fe.templates.ObjectPage",
"options": {
"settings": {
"entitySet": "Authors"
}
}
}
}
},
"contentDensities": {
"compact": true,
"cozy": true
}
},
"sap.ui": {
"technology": "UI5",
"fullWidth": false,
"deviceTypes":{
"desktop": true,
"tablet": true,
"phone": true
}
},
"sap.fiori": {
"registrationIds": [],
"archeType": "transactional"
}
}

View File

@@ -4,47 +4,57 @@ using CatalogService from '@capire/bookstore';
// //
// Books Object Page // Books Object Page
// //
annotate CatalogService.Books with @( annotate CatalogService.Books with @(UI : {
UI: { HeaderInfo : {
HeaderInfo: { TypeName : 'Book',
TypeName: 'Book', TypeNamePlural : 'Books',
TypeNamePlural: 'Books', Description : {Value : authorName}
Description: {Value: author} },
}, HeaderFacets : [{
HeaderFacets: [ $Type : 'UI.ReferenceFacet',
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Description}', Target: '@UI.FieldGroup#Descr'}, Label : '{i18n>Description}',
], Target : '@UI.FieldGroup#Descr'
Facets: [ }, ],
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Price'}, Facets : [{
], $Type : 'UI.ReferenceFacet',
FieldGroup#Descr: { Label : '{i18n>Details}',
Data: [ Target : '@UI.FieldGroup#Price'
{Value: descr}, }, ],
] FieldGroup #Descr : {Data : [{Value : descr}, ]},
}, FieldGroup #Price : {Data : [
FieldGroup#Price: { {Value : price},
Data: [ {
{Value: price}, Value : currency.symbol,
{Value: currency.symbol, Label: '{i18n>Currency}'}, Label : '{i18n>Currency}'
] },
}, ]},
} });
);
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Books Object Page // Books Object Page
// //
annotate CatalogService.Books with @( annotate CatalogService.Books with @(UI : {
UI: { SelectionFields : [
SelectionFields: [ ID, price, currency_code ], ID,
LineItem: [ price,
{Value: title}, currency_code
{Value: author, Label:'{i18n>Author}'}, ],
{Value: genre.name}, LineItem : [
{Value: price}, {
{Value: currency.symbol, Label:' '}, Value : ID,
] Label : '{i18n>Title}'
}, },
); {
Value : author.ID,
Label : '{i18n>Author}'
},
{Value : genre.name},
{Value : price},
{
Value : currency.symbol,
Label : ' '
},
]
}, );

View File

@@ -1,11 +1,14 @@
{ {
"_version": "1.8.0", "_version": "1.28.0",
"sap.app": { "sap.app": {
"id": "bookshop", "id": "bookshop",
"type": "application", "type": "application",
"title": "Browse Books", "title": "Browse Books",
"description": "Sample Application", "description": "Sample Application",
"i18n": "i18n/i18n.properties", "i18n": "i18n/i18n.properties",
"applicationVersion": {
"version": "1.0.0"
},
"dataSources": { "dataSources": {
"CatalogService": { "CatalogService": {
"uri": "/browse/", "uri": "/browse/",
@@ -15,14 +18,43 @@
} }
} }
}, },
"-sourceTemplate": { "sourceTemplate": {
"id": "ui5template.basicSAPUI5ApplicationProject", "id": "ui5template.basicSAPUI5ApplicationProject",
"-id": "ui5template.smartTemplate", "-id": "ui5template.smartTemplate",
"-version": "1.40.12" "version": "1.40.12"
},
"crossNavigation": {
"inbounds": {
"intent1": {
"signature": {
"parameters": {
"Books.ID":{
"renameTo": "ID"
},
"Authors.books.ID": {
"renameTo": "ID"
}
},
"additionalParameters": "ignored"
},
"semanticObject": "Books",
"action": "display",
"title": "{{appTitle}}",
"info": "{{appInfo}}",
"subTitle": "{{appSubTitle}}",
"icon": "sap-icon://course-book",
"indicatorDataSource": {
"dataSource": "CatalogService",
"path": "Books/$count",
"refresh": 1800
}
}
}
} }
}, },
"sap.ui5": { "sap.ui5": {
"dependencies": { "dependencies": {
"minUI5Version": "1.81.0",
"libs": { "libs": {
"sap.fe.templates": {} "sap.fe.templates": {}
} }
@@ -68,6 +100,7 @@
"options": { "options": {
"settings": { "settings": {
"entitySet": "Books", "entitySet": "Books",
"initialLoad": true,
"navigation": { "navigation": {
"Books": { "Books": {
"detail": { "detail": {
@@ -97,7 +130,12 @@
}, },
"sap.ui": { "sap.ui": {
"technology": "UI5", "technology": "UI5",
"fullWidth": false "fullWidth": false,
"deviceTypes":{
"desktop": true,
"tablet": true,
"phone": true
}
}, },
"sap.fiori": { "sap.fiori": {
"registrationIds": [], "registrationIds": [],

View File

@@ -1,5 +1,5 @@
/* /*
Common Annotations shared by all apps Common Annotations shared by all apps
*/ */
using { sap.capire.bookshop as my } from '@capire/bookstore'; using { sap.capire.bookshop as my } from '@capire/bookstore';
@@ -10,39 +10,52 @@ using { sap.common } from '@capire/common';
// Books Lists // Books Lists
// //
annotate my.Books with @( annotate my.Books with @(
Common.SemanticKey: [title], Common.SemanticKey : [ID],
UI: { UI : {
Identification: [{Value:title}], Identification : [{Value : title}],
SelectionFields: [ ID, author_ID, price, currency_code ], SelectionFields : [
LineItem: [ ID,
{Value: ID}, author_ID,
{Value: title}, price,
{Value: author.name, Label:'{i18n>Author}'}, currency_code
{Value: genre.name}, ],
{Value: stock}, LineItem : [
{Value: price}, {
{Value: currency.symbol, Label:' '}, Value : ID,
] Label : '{i18n>Title}'
} },
{
Value : author.ID,
Label : '{i18n>Author}'
},
{Value : genre.name},
{Value : stock},
{Value : price},
{
Value : currency.symbol,
Label : ' '
},
]
}
) { ) {
author @ValueList.entity:'Authors'; ID @Common: {
SemanticObject : 'Books',
Text: title,
TextArrangement : #TextOnly
};
author @ValueList.entity : 'Authors';
}; };
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Books Details // Books Details
// //
annotate my.Books with @( annotate my.Books with @(UI : {HeaderInfo : {
UI: { TypeName : '{i18n>Book}',
HeaderInfo: { TypeNamePlural : '{i18n>Books}',
TypeName: '{i18n>Book}', Title : {Value : title},
TypeNamePlural: '{i18n>Books}', Description : {Value : author.name}
Title: {Value: title}, }, });
Description: {Value: author.name}
},
}
);
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
@@ -50,13 +63,19 @@ annotate my.Books with @(
// Books Elements // Books Elements
// //
annotate my.Books with { annotate my.Books with {
ID @title:'{i18n>ID}' @UI.HiddenFilter; ID @title : '{i18n>ID}';
title @title:'{i18n>Title}'; title @title : '{i18n>Title}';
genre @title:'{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly }; genre @title : '{i18n>Genre}' @Common : {
author @title:'{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly }; Text : genre.name,
price @title:'{i18n>Price}' @Measures.ISOCurrency: currency_code; TextArrangement : #TextOnly
stock @title:'{i18n>Stock}'; };
descr @UI.MultiLineText; 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;
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
@@ -64,42 +83,45 @@ annotate my.Books with {
// Genres List // Genres List
// //
annotate my.Genres with @( annotate my.Genres with @(
Common.SemanticKey: [name], Common.SemanticKey : [name],
UI: { UI : {
SelectionFields: [ name ], SelectionFields : [name],
LineItem:[ LineItem : [
{Value: name}, {Value : name},
{Value: parent.name, Label: 'Main Genre'}, {
], Value : parent.name,
} Label : 'Main Genre'
},
],
}
); );
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Genre Details // Genre Details
// //
annotate my.Genres with @( annotate my.Genres with @(UI : {
UI: { Identification : [{Value : name}],
Identification: [{Value:name}], HeaderInfo : {
HeaderInfo: { TypeName : '{i18n>Genre}',
TypeName: '{i18n>Genre}', TypeNamePlural : '{i18n>Genres}',
TypeNamePlural: '{i18n>Genres}', Title : {Value : name},
Title: {Value: name}, Description : {Value : ID}
Description: {Value: ID} },
}, Facets : [{
Facets: [ $Type : 'UI.ReferenceFacet',
{$Type: 'UI.ReferenceFacet', Label: '{i18n>SubGenres}', Target: 'children/@UI.LineItem'}, Label : '{i18n>SubGenres}',
], Target : 'children/@UI.LineItem'
} }, ],
); });
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Genres Elements // Genres Elements
// //
annotate my.Genres with { annotate my.Genres with {
ID @title: '{i18n>ID}'; ID @title : '{i18n>ID}';
name @title: '{i18n>Genre}'; name @title : '{i18n>Genre}';
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
@@ -107,38 +129,42 @@ annotate my.Genres with {
// Authors List // Authors List
// //
annotate my.Authors with @( annotate my.Authors with @(
Common.SemanticKey: [name], Common.SemanticKey : [ID],
UI: { UI : {
Identification: [{Value:name}], Identification : [{Value : name}],
SelectionFields: [ name ], SelectionFields : [name],
LineItem:[ LineItem : [
{Value: ID}, {Value : ID},
{Value: name}, {Value : dateOfBirth},
{Value: dateOfBirth}, {Value : dateOfDeath},
{Value: dateOfDeath}, {Value : placeOfBirth},
{Value: placeOfBirth}, {Value : placeOfDeath},
{Value: placeOfDeath}, ],
], }
} ) {
); ID @Common: {
SemanticObject : 'Authors',
Text: name,
TextArrangement : #TextOnly,
};
};
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Author Details // Author Details
// //
annotate my.Authors with @( annotate my.Authors with @(UI : {
UI: { HeaderInfo : {
HeaderInfo: { TypeName : '{i18n>Author}',
TypeName: '{i18n>Author}', TypeNamePlural : '{i18n>Authors}',
TypeNamePlural: '{i18n>Authors}', Title : {Value : name},
Title: {Value: name}, Description : {Value : dateOfBirth}
Description: {Value: dateOfBirth} },
}, Facets : [{
Facets: [ $Type : 'UI.ReferenceFacet',
{$Type: 'UI.ReferenceFacet', Target: 'books/@UI.LineItem'}, Target : 'books/@UI.LineItem'
], }, ],
} });
);
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
@@ -146,12 +172,12 @@ annotate my.Authors with @(
// Authors Elements // Authors Elements
// //
annotate my.Authors with { annotate my.Authors with {
ID @title:'{i18n>ID}' @UI.HiddenFilter; ID @title : '{i18n>ID}';
name @title:'{i18n>Name}'; name @title : '{i18n>Name}';
dateOfBirth @title:'{i18n>DateOfBirth}'; dateOfBirth @title : '{i18n>DateOfBirth}';
dateOfDeath @title:'{i18n>DateOfDeath}'; dateOfDeath @title : '{i18n>DateOfDeath}';
placeOfBirth @title:'{i18n>PlaceOfBirth}'; placeOfBirth @title : '{i18n>PlaceOfBirth}';
placeOfDeath @title:'{i18n>PlaceOfDeath}'; placeOfDeath @title : '{i18n>PlaceOfDeath}';
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
@@ -159,99 +185,105 @@ annotate my.Authors with {
// Languages List // Languages List
// //
annotate common.Languages with @( annotate common.Languages with @(
Common.SemanticKey: [code], Common.SemanticKey : [code],
Identification: [{Value:code}], Identification : [{Value : code}],
UI: { UI : {
SelectionFields: [ name, descr ], SelectionFields : [
LineItem:[ name,
{Value: code}, descr
{Value: name}, ],
], LineItem : [
} {Value : code},
{Value : name},
],
}
); );
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Language Details // Language Details
// //
annotate common.Languages with @( annotate common.Languages with @(UI : {
UI: { HeaderInfo : {
HeaderInfo: { TypeName : '{i18n>Language}',
TypeName: '{i18n>Language}', TypeNamePlural : '{i18n>Languages}',
TypeNamePlural: '{i18n>Languages}', Title : {Value : name},
Title: {Value: name}, Description : {Value : descr}
Description: {Value: descr} },
}, Facets : [{
Facets: [ $Type : 'UI.ReferenceFacet',
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'}, Label : '{i18n>Details}',
], Target : '@UI.FieldGroup#Details'
FieldGroup#Details: { }, ],
Data: [ FieldGroup #Details : {Data : [
{Value: code}, {Value : code},
{Value: name}, {Value : name},
{Value: descr} {Value : descr}
] ]},
}, });
}
);
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Currencies List // Currencies List
// //
annotate common.Currencies with @( annotate common.Currencies with @(
Common.SemanticKey: [code], Common.SemanticKey : [code],
Identification: [{Value:code}], Identification : [{Value : code}],
UI: { UI : {
SelectionFields: [ name, descr ], SelectionFields : [
LineItem:[ name,
{Value: descr}, descr
{Value: symbol}, ],
{Value: code}, LineItem : [
], {Value : descr},
} {Value : symbol},
{Value : code},
],
}
); );
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Currency Details // Currency Details
// //
annotate common.Currencies with @( annotate common.Currencies with @(UI : {
UI: { HeaderInfo : {
HeaderInfo: { TypeName : '{i18n>Currency}',
TypeName: '{i18n>Currency}', TypeNamePlural : '{i18n>Currencies}',
TypeNamePlural: '{i18n>Currencies}', Title : {Value : descr},
Title: {Value: descr}, Description : {Value : code}
Description: {Value: code} },
}, Facets : [
Facets: [ {
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'}, $Type : 'UI.ReferenceFacet',
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Extended}', Target: '@UI.FieldGroup#Extended'}, Label : '{i18n>Details}',
], Target : '@UI.FieldGroup#Details'
FieldGroup#Details: { },
Data: [ {
{Value: name}, $Type : 'UI.ReferenceFacet',
{Value: symbol}, Label : '{i18n>Extended}',
{Value: code}, Target : '@UI.FieldGroup#Extended'
{Value: descr} },
] ],
}, FieldGroup #Details : {Data : [
FieldGroup#Extended: { {Value : name},
Data: [ {Value : symbol},
{Value: numcode}, {Value : code},
{Value: minor}, {Value : descr}
{Value: exponent} ]},
] FieldGroup #Extended : {Data : [
}, {Value : numcode},
} {Value : minor},
); {Value : exponent}
]},
});
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Currencies Elements // Currencies Elements
// //
annotate common.Currencies with { annotate common.Currencies with {
numcode @title:'{i18n>NumCode}'; numcode @title : '{i18n>NumCode}';
minor @title:'{i18n>MinorUnit}'; minor @title : '{i18n>MinorUnit}';
exponent @title:'{i18n>Exponent}'; exponent @title : '{i18n>Exponent}';
} }

View File

@@ -10,32 +10,7 @@
<script> <script>
window["sap-ushell-config"] = { window["sap-ushell-config"] = {
defaultRenderer: "fiori2", defaultRenderer: "fiori2",
applications: { applications: {}
"browse-books": {
title: "Browse Books",
description: "w/ SAP Fiori Elements",
additionalInformation: "SAPUI5.Component=bookshop",
applicationType : "URL",
url: "/browse/webapp",
navigationMode: "embedded"
},
"manage-books": {
title: "Manage Books",
description: "w/ SAP Fiori Elements",
additionalInformation: "SAPUI5.Component=admin",
applicationType : "URL",
url: "/admin/webapp",
navigationMode: "embedded"
},
"manage-orders": {
title: "Manage Orders",
description: "w/ SAP Fiori Elements",
additionalInformation: "SAPUI5.Component=orders",
applicationType : "URL",
url: "/orders/webapp",
navigationMode: "embedded"
}
}
}; };
</script> </script>

View File

@@ -4,6 +4,6 @@
using from './admin/fiori-service'; using from './admin/fiori-service';
using from './browse/fiori-service'; using from './browse/fiori-service';
using from './authors/fiori-service';
using from './common'; using from './common';
using from '@capire/bookstore/srv/mashup'; using from '@capire/bookstore/srv/mashup';

View File

@@ -11,39 +11,39 @@ describe('Localized Data', () => {
}) })
it('supports sap-language param', async () => { it('supports sap-language param', async () => {
const { data } = await GET(`/browse/Books?$select=title,author` + '&sap-language=de') const { data } = await GET(`/browse/Books?$select=title,authorName` + '&sap-language=de')
expect(data.value).to.containSubset([ expect(data.value).to.containSubset([
{ title: 'Sturmhöhe', author: 'Emily Brontë' }, { title: 'Sturmhöhe', authorName: 'Emily Brontë' },
{ title: 'Jane Eyre', author: 'Charlotte Brontë' }, { title: 'Jane Eyre', authorName: 'Charlotte Brontë' },
{ title: 'The Raven', author: 'Edgar Allen Poe' }, { title: 'The Raven', authorName: 'Edgar Allen Poe' },
{ title: 'Eleonora', author: 'Edgar Allen Poe' }, { title: 'Eleonora', authorName: 'Edgar Allen Poe' },
{ title: 'Catweazle', author: 'Richard Carpenter' }, { title: 'Catweazle', authorName: 'Richard Carpenter' },
]) ])
}) })
it('supports accept-language header', async () => { it('supports accept-language header', async () => {
const { data } = await GET(`/browse/Books?$select=title,author`, { const { data } = await GET(`/browse/Books?$select=title,authorName`, {
headers: { 'Accept-Language': 'de' }, headers: { 'Accept-Language': 'de' },
}) })
expect(data.value).to.containSubset([ expect(data.value).to.containSubset([
{ title: 'Sturmhöhe', author: 'Emily Brontë' }, { title: 'Sturmhöhe', authorName: 'Emily Brontë' },
{ title: 'Jane Eyre', author: 'Charlotte Brontë' }, { title: 'Jane Eyre', authorName: 'Charlotte Brontë' },
{ title: 'The Raven', author: 'Edgar Allen Poe' }, { title: 'The Raven', authorName: 'Edgar Allen Poe' },
{ title: 'Eleonora', author: 'Edgar Allen Poe' }, { title: 'Eleonora', authorName: 'Edgar Allen Poe' },
{ title: 'Catweazle', author: 'Richard Carpenter' }, { title: 'Catweazle', authorName: 'Richard Carpenter' },
]) ])
}) })
it('supports queries with $expand', async () => { it('supports queries with $expand', async () => {
const { data } = await GET(`/browse/Books?&$select=title,author&$expand=currency`, { const { data } = await GET(`/browse/Books?&$select=title,authorName&$expand=currency`, {
headers: { 'Accept-Language': 'de' }, headers: { 'Accept-Language': 'de' },
}) })
expect(data.value).to.containSubset([ expect(data.value).to.containSubset([
{ title: 'Sturmhöhe', author: 'Emily Brontë', currency: { name: 'Pfund' } }, { title: 'Sturmhöhe', authorName: 'Emily Brontë', currency: { name: 'Pfund' } },
{ title: 'Jane Eyre', author: 'Charlotte Brontë', currency: { name: 'Pfund' } }, { title: 'Jane Eyre', authorName: 'Charlotte Brontë', currency: { name: 'Pfund' } },
{ title: 'The Raven', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, { title: 'The Raven', authorName: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } },
{ title: 'Eleonora', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, { title: 'Eleonora', authorName: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } },
{ title: 'Catweazle', author: 'Richard Carpenter', currency: { name: 'Yen' } }, { title: 'Catweazle', authorName: 'Richard Carpenter', currency: { name: 'Yen' } },
]) ])
}) })

View File

@@ -19,13 +19,13 @@ describe('OData Protocol', () => {
it('supports $search in multiple fields', async () => { it('supports $search in multiple fields', async () => {
const { data } = await GET `/browse/Books ${{ const { data } = await GET `/browse/Books ${{
params: { $search: 'Po', $select: `title,author` }, params: { $search: 'Po', $select: `title,authorName` },
}}` }}`
expect(data.value).to.eql([ expect(data.value).to.eql([
{ ID: 201, title: 'Wuthering Heights', author: 'Emily Brontë' }, { ID: 201, title: 'Wuthering Heights', authorName: 'Emily Brontë' },
{ ID: 207, title: 'Jane Eyre', author: 'Charlotte Brontë' }, { ID: 207, title: 'Jane Eyre', authorName: 'Charlotte Brontë' },
{ ID: 251, title: 'The Raven', author: 'Edgar Allen Poe' }, { ID: 251, title: 'The Raven', authorName: 'Edgar Allen Poe' },
{ ID: 252, title: 'Eleonora', author: 'Edgar Allen Poe' }, { ID: 252, title: 'Eleonora', authorName: 'Edgar Allen Poe' },
]) ])
}) })