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

Commit 756ed48

Browse files
committed
Fiori apps with manage authors
Signed-off-by: Daniel <daniel.hutzel@sap.com>
1 parent 19b680a commit 756ed48

12 files changed

Lines changed: 74 additions & 75 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using {AdminService} from '@capire/bookshop';
2+
3+
annotate AdminService.Authors with @odata.draft.enabled;
4+
5+
////////////////////////////////////////////////////////////////////////////
6+
//
7+
// Authors Object Page
8+
//
9+
annotate AdminService.Authors with @(UI : {
10+
HeaderInfo : {
11+
TypeName : 'Author',
12+
TypeNamePlural : 'Authors',
13+
Description : {Value : lifetime}
14+
},
15+
Facets : [
16+
{
17+
$Type : 'UI.ReferenceFacet',
18+
Label : '{i18n>Details}',
19+
Target : '@UI.FieldGroup#Details'
20+
},
21+
{
22+
$Type : 'UI.ReferenceFacet',
23+
Label : '{i18n>Books}',
24+
Target : 'books/@UI.LineItem'
25+
},
26+
],
27+
FieldGroup #Details : {Data : [
28+
{Value : placeOfBirth},
29+
{Value : placeOfDeath},
30+
{Value : dateOfBirth},
31+
{Value : dateOfDeath},
32+
{
33+
Value : age,
34+
Label : '{i18n>Age}'
35+
},
36+
]},
37+
});
38+
39+
40+
// Workaround to avoid errors for unknown db-specific calculated fields above
41+
extend sap.capire.bookshop.Authors with {
42+
virtual age : Integer;
43+
virtual lifetime : String;
44+
}
45+
46+
// Workaround for Fiori popup for asking user to enter a new UUID on Create
47+
annotate AdminService.Authors with { ID @Core.Computed; }
File renamed without changes.
File renamed without changes.

fiori/app/authors/webapp/manifest.json renamed to fiori/app/admin-authors/webapp/manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"sap.app": {
44
"id": "authors",
55
"type": "application",
6-
"title": "Browse Authors",
6+
"title": "Manage Authors",
77
"description": "Sample Application",
88
"i18n": "i18n/i18n.properties",
99
"applicationVersion": {
1010
"version": "1.0.0"
1111
},
1212
"dataSources": {
13-
"CatalogService": {
14-
"uri": "/browse/",
13+
"AdminService": {
14+
"uri": "/admin/",
1515
"type": "OData",
1616
"settings": {
1717
"odataVersion": "4.0"
@@ -41,7 +41,7 @@
4141
"subTitle": "{{appSubTitle}}",
4242
"icon": "sap-icon://SAP-icons-TNT/user",
4343
"indicatorDataSource": {
44-
"dataSource": "CatalogService",
44+
"dataSource": "AdminService",
4545
"path": "Authors/$count",
4646
"refresh": 1800
4747
}
@@ -62,7 +62,7 @@
6262
"uri": "i18n/i18n.properties"
6363
},
6464
"": {
65-
"dataSource": "CatalogService",
65+
"dataSource": "AdminService",
6666
"settings": {
6767
"synchronizationMode": "None",
6868
"operationMode": "Server",
Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,6 @@ annotate AdminService.Books with @(
4040
}
4141
);
4242

43-
annotate AdminService.Authors with @(
44-
UI: {
45-
HeaderInfo: {
46-
Description: {Value: lifetime}
47-
},
48-
Facets: [
49-
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
50-
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Books}', Target: 'books/@UI.LineItem'},
51-
],
52-
FieldGroup#Details: {
53-
Data: [
54-
{Value: placeOfBirth},
55-
{Value: placeOfDeath},
56-
{Value: dateOfBirth},
57-
{Value: dateOfDeath},
58-
{Value: age, Label: '{i18n>Age}'},
59-
]
60-
},
61-
}
62-
);
63-
6443

6544

6645
////////////////////////////////////////////////////////////
@@ -93,3 +72,6 @@ using { sap } from '@sap/cds/common';
9372
extend service AdminService {
9473
@readonly entity Languages as projection on sap.common.Languages;
9574
}
75+
76+
// Workaround for Fiori popup for asking user to enter a new UUID on Create
77+
annotate AdminService.Books with { ID @Core.Computed; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sap.ui.define(["sap/fe/core/AppComponent"], function(AppComponent) {
22
"use strict";
3-
return AppComponent.extend("admin.Component", {
3+
return AppComponent.extend("books.Component", {
44
metadata: { manifest: "json" }
55
});
66
});
File renamed without changes.

fiori/app/admin/webapp/manifest.json renamed to fiori/app/admin-books/webapp/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"_version": "1.8.0",
33
"sap.app": {
4-
"id": "admin",
4+
"id": "books",
55
"type": "application",
66
"title": "Manage Books",
77
"description": "Sample Application",

fiori/app/appconfig/fioriSandboxConfig.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
"title": "Browse Books",
2020
"targetURL": "#Books-display"
2121
}
22-
},
23-
{
24-
"id": "BrowseAuthors",
25-
"tileType": "sap.ushell.ui.tile.StaticTile",
26-
"properties": {
27-
"title": "Browse Authors",
28-
"targetURL": "#Authors-display"
29-
}
3022
}
3123
]
3224
},
@@ -45,6 +37,14 @@
4537
"targetURL": "#Books-manage"
4638
}
4739
},
40+
{
41+
"id": "ManageAuthors",
42+
"tileType": "sap.ushell.ui.tile.StaticTile",
43+
"properties": {
44+
"title": "Manage Authors",
45+
"targetURL": "#Authors-display"
46+
}
47+
},
4848
{
4949
"id": "ManageOrders",
5050
"tileType": "sap.ushell.ui.tile.StaticTile",
@@ -75,10 +75,10 @@
7575
"signature": {
7676
"parameters": {
7777
"Books.ID": {
78-
"renameTo": "ID"
78+
"renameTo": "ID"
7979
},
8080
"Authors.books.ID": {
81-
"renameTo": "ID"
81+
"renameTo": "ID"
8282
}
8383
},
8484
"additionalParameters": "ignored"
@@ -104,7 +104,7 @@
104104
"resolutionResult": {
105105
"applicationType": "SAPUI5",
106106
"additionalInformation": "SAPUI5.Component=authors",
107-
"url": "/authors/webapp"
107+
"url": "/admin-authors/webapp"
108108
}
109109
},
110110
"ManageBooks": {
@@ -117,8 +117,8 @@
117117
},
118118
"resolutionResult": {
119119
"applicationType": "SAPUI5",
120-
"additionalInformation": "SAPUI5.Component=admin",
121-
"url": "/admin/webapp"
120+
"additionalInformation": "SAPUI5.Component=books",
121+
"url": "/admin-books/webapp"
122122
}
123123
},
124124
"ManageOrders": {

fiori/app/authors/fiori-service.cds

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)