add object page and manage genres
This commit is contained in:
@@ -115,3 +115,5 @@ extend service AdminService {
|
||||
|
||||
// Workaround for Fiori popup for asking user to enter a new UUID on Create
|
||||
annotate AdminService.Books with { ID @Core.Computed; }
|
||||
|
||||
using from './tree-view';
|
||||
|
||||
42
fiori/app/admin-books/tree-view.cds
Normal file
42
fiori/app/admin-books/tree-view.cds
Normal file
@@ -0,0 +1,42 @@
|
||||
using { AdminService } from '@capire/bookstore';
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Contents Tree Table Annotations
|
||||
//
|
||||
|
||||
// Tell Fiori about the structure of the hierarchy
|
||||
annotate AdminService.Contents with @Aggregation.RecursiveHierarchy #ContentsHierarchy : {
|
||||
ParentNavigationProperty : parent, // navigates to a node's parent
|
||||
NodeProperty : ID, // identifies a node, usually the key
|
||||
};
|
||||
|
||||
// Fiori expects the following to be defined explicitly, even though they're always the same
|
||||
extend AdminService.Contents with @(
|
||||
// The columns expected by Fiori to be present in hierarchy entities
|
||||
Hierarchy.RecursiveHierarchy #ContentsHierarchy : {
|
||||
LimitedDescendantCount : LimitedDescendantCount,
|
||||
DistanceFromRoot : DistanceFromRoot,
|
||||
DrillState : DrillState,
|
||||
LimitedRank : LimitedRank
|
||||
},
|
||||
// Disallow filtering on these properties from Fiori UIs
|
||||
Capabilities.FilterRestrictions.NonFilterableProperties: [
|
||||
'LimitedDescendantCount',
|
||||
'DistanceFromRoot',
|
||||
'DrillState',
|
||||
'LimitedRank'
|
||||
],
|
||||
// Disallow sorting on these properties from Fiori UIs
|
||||
Capabilities.SortRestrictions.NonSortableProperties : [
|
||||
'LimitedDescendantCount',
|
||||
'DistanceFromRoot',
|
||||
'DrillState',
|
||||
'LimitedRank'
|
||||
],
|
||||
) columns { // Ensure we can query these fields from database
|
||||
null as LimitedDescendantCount : Int16,
|
||||
null as DistanceFromRoot : Int16,
|
||||
null as DrillState : String,
|
||||
null as LimitedRank : Int16,
|
||||
};
|
||||
@@ -18,14 +18,6 @@
|
||||
"title": "Browse Books",
|
||||
"targetURL": "#Books-display"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "BrowseGenres",
|
||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||
"properties": {
|
||||
"title": "Browse Genres",
|
||||
"targetURL": "#Genres-display"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -43,6 +35,14 @@
|
||||
"title": "Manage Books",
|
||||
"targetURL": "#Books-manage"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ManageGenres",
|
||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||
"properties": {
|
||||
"title": "Manage Genres",
|
||||
"targetURL": "#Genres-manage"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ManageAuthors",
|
||||
@@ -114,10 +114,10 @@
|
||||
"url": "/admin-authors/webapp"
|
||||
}
|
||||
},
|
||||
"BrowseGenres": {
|
||||
"ManageGenres": {
|
||||
"semanticObject": "Genres",
|
||||
"action": "display",
|
||||
"title": "Browse Genres",
|
||||
"action": "manage",
|
||||
"title": "Manage Genres",
|
||||
"signature": {
|
||||
"parameters": {
|
||||
"Genre.ID": {
|
||||
|
||||
@@ -68,6 +68,10 @@ annotate my.Books with {
|
||||
image @title: '{i18n>Image}';
|
||||
}
|
||||
|
||||
annotate my.Contents with @(
|
||||
cds.search: {name}
|
||||
);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Contents List
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using { sap.capire.bookshop.Genres } from '@capire/bookstore';
|
||||
|
||||
annotate Genres with @cds.search: {name};
|
||||
annotate Genres with @readonly;
|
||||
annotate Genres with {
|
||||
name @title: '{i18n>Genre}';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#XTIT
|
||||
appTitle=Browse Genres
|
||||
appTitle=Manage Genres
|
||||
#XTXT
|
||||
appDescription=Genres as Tree View
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
},
|
||||
"crossNavigation": {
|
||||
"inbounds": {
|
||||
"Genres-display": {
|
||||
"Genres-manage": {
|
||||
"signature": {
|
||||
"parameters": {},
|
||||
"additionalParameters": "allowed"
|
||||
},
|
||||
"semanticObject": "Genres",
|
||||
"action": "display"
|
||||
"action": "manage"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user