Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions app/admin/fiori-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,33 @@ annotate AdminService.Books with @(UI : {
]}
});

// Add Value Help for Tree Table
annotate AdminService.Books with {
genre @(Common: {
Label : 'Genre',
ValueList: {
CollectionPath : 'GenreHierarchy',
Parameters : [
{
$Type : 'Common.ValueListParameterDisplayOnly',
ValueListProperty: 'name',
}],
PresentationVariantQualifier: 'VH',
}
});
}

annotate AdminService.GenreHierarchy with @UI: {
PresentationVariant #VH: {
$Type : 'UI.PresentationVariantType',
Visualizations : ['@UI.LineItem'],
RecursiveHierarchyQualifier: 'GenreHierarchy'
},
LineItem : [{
$Type: 'UI.DataField',
Value: name,
}]
};

////////////////////////////////////////////////////////////
//
Expand Down
21 changes: 21 additions & 0 deletions app/appconfig/fioriSandboxConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
"title": "Browse Books",
"description": "Find your favorite book"
}
}, {
"id": "browse-genres",
"tileType": "sap.ushell.ui.tile.StaticTile",
"properties": {
"targetURL": "#Genres-display",
"title": "Browse Genres",
"description": "Find your favorite genre"
}
}
]
},
Expand Down Expand Up @@ -112,6 +120,19 @@
"url": "/browse/webapp"
}
},
"browse-genres": {
"semanticObject": "Genres",
"action": "display",
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"resolutionResult": {
"applicationType": "SAPUI5",
"additionalInformation": "SAPUI5.Component=genres",
"url": "/genres/webapp"
}
},
"manage-books": {
"semanticObject": "Books",
"action": "manage",
Expand Down
13 changes: 3 additions & 10 deletions app/common.cds
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,8 @@ annotate my.Genres with
UI : {
SelectionFields : [name],
LineItem : [
{Value : name},
{
Value : parent.name,
Label : 'Main Genre'
{Value : name,
Label : '{i18n>Name}',
},
],
}
Expand All @@ -199,12 +197,7 @@ annotate my.Genres with
TypeNamePlural : '{i18n>Genres}',
Title : {Value : name},
Description : {Value : ID}
},
Facets : [{
$Type : 'UI.ReferenceFacet',
Label : '{i18n>SubGenres}',
Target : 'children/@UI.LineItem'
}, ],
}
});


Expand Down
23 changes: 23 additions & 0 deletions app/genres/fiori-service.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
UI annotations for the Browse GenreHierarchy App
*/

using AdminService from '../../srv/admin-service';


annotate AdminService.GenreHierarchy with @Aggregation.RecursiveHierarchy#GenreHierarchy: {
$Type: 'Aggregation.RecursiveHierarchyType',
NodeProperty: node_id, // identifies a node
ParentNavigationProperty: parent // navigates to a node's parent
};

annotate AdminService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#GenreHierarchy: {
$Type: 'Hierarchy.RecursiveHierarchyType',
// ExternalKey : null,
LimitedDescendantCount: LimitedDescendantCount,
DistanceFromRoot: DistanceFromRoot,
DrillState: DrillState,
Matched: Matched,
MatchedDescendantCount: MatchedDescendantCount,
LimitedRank: LimitedRank
Comment on lines +17 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to check if we need this annotation if we don't rename anything

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it looks the same in the example I got from Gwendal (no renaming), but I can't find confirmation in the documentation -> ask UI colleagues

};
12 changes: 12 additions & 0 deletions app/genres/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "genres",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
3 changes: 3 additions & 0 deletions app/genres/webapp/Component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("genres.Component", {
metadata:{ manifest:'json' }
}))
2 changes: 2 additions & 0 deletions app/genres/webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appTitle=Browse Genres
appDescription=Genres as Tree View
2 changes: 2 additions & 0 deletions app/genres/webapp/i18n/i18n_de.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appTitle=Zeige Genres
appDescription=Genres als Baumansicht
35 changes: 35 additions & 0 deletions app/genres/webapp/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Browse Genres</title>
<style>
html, body, body > div, #container, #container-uiarea {
height: 100%;
}
</style>
<script
id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-resourceroots='{
"genres": "./"
}'
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted"
></script>
</head>
<body class="sapUiBody sapUiSizeCompact" id="content">
<div
data-sap-ui-component
data-name="genres"
data-id="container"
data-settings='{"id" : "genres"}'
data-handle-validation="true"
></div>
</body>
</html>
129 changes: 129 additions & 0 deletions app/genres/webapp/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"_version": "1.8.0",
"sap.app": {
"id": "genres",
"type": "application",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": {
"version": "1.0.0"
},
"dataSources": {
"AdminService": {
"uri": "/api/admin/",
"type": "OData",
"settings": {
"odataVersion": "4.0"
}
}
},
"-sourceTemplate": {
"id": "ui5template.basicSAPUI5ApplicationProject",
"-id": "ui5template.smartTemplate",
"-version": "1.40.12"
},
"crossNavigation": {
"inbounds": {
"Genres-show": {
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"semanticObject": "GenreHierarchy",
"action": "show"
}
}
}
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.122.0",
"libs": {
"sap.fe.templates": {}
}
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/i18n.properties"
},
"": {
"dataSource": "AdminService",
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect" : true,
"earlyRequests": true,
"groupProperties": {
"default": {
"submit": "Auto"
}
}
}
}
},
"routing": {
"routes": [
{
"pattern": ":?query:",
"name": "GenreHierarchyList",
"target": "GenreHierarchyList"
},
{
"pattern": "GenreHierarchy({key}):?query:",
"name": "GenreHierarchyDetails",
"target": "GenreHierarchyDetails"
}
],
"targets": {
"GenreHierarchyList": {
"type": "Component",
"id": "GenreHierarchyList",
"name": "sap.fe.templates.ListReport",
"options": {
"settings" : {
"entitySet" : "GenreHierarchy",
"navigation" : {
"GenreHierarchy" : {
"detail" : {
"route" : "GenreHierarchyDetails"
}
}
},
"controlConfiguration": {
"@com.sap.vocabularies.UI.v1.LineItem": {
"tableSettings": {
"hierarchyQualifier": "GenreHierarchy",
"type": "TreeTable"
}
}
}
}
}
},
"GenreHierarchyDetails": {
"type": "Component",
"id": "GenreHierarchyDetails",
"name": "sap.fe.templates.ObjectPage",
"options": {
"settings" : {
"entitySet": "GenreHierarchy"
}
}
}
}
},
"contentDensities": {
"compact": true,
"cozy": true
}
},
"sap.ui": {
"technology": "UI5",
"fullWidth": false
},
"sap.fiori": {
"registrationIds": [],
"archeType": "transactional"
}
}
1 change: 1 addition & 0 deletions app/index.cds
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ using from './orders/fiori-service';
using from './reviews/fiori-service';
using from './notes/fiori-service';
using from './addresses/fiori-service';
using from './genres/fiori-service';
using from './common';
Loading