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

Commit d9d6391

Browse files
committed
Fiori Tree Views towards GA
1 parent 987611b commit d9d6391

3 files changed

Lines changed: 34 additions & 20 deletions

File tree

fiori/app/common.cds

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,34 +71,36 @@ annotate my.Books with {
7171

7272
////////////////////////////////////////////////////////////////////////////
7373
//
74-
// Computed Fields for Tree Tables
74+
// Computed Fields for Tree Tables
7575
//
7676
// DISCLAIMER: The below are an alpha version implementation and will change in final release !!!
7777
//
7878
aspect Hierarchy {
79-
LimitedDescendantCount : Integer64 = null;
80-
DistanceFromRoot : Integer64 = null;
79+
LimitedDescendantCount : Int16 = null;
80+
LimitedRank : Int16 = null;
81+
DistanceFromRoot : Int16 = null;
8182
DrillState : String = null;
82-
Matched : Boolean = null;
83-
MatchedDescendantCount : Integer64 = null;
84-
LimitedRank : Integer64 = null;
83+
// Matched : Boolean = null;
84+
// MatchedDescendantCount : Int16 = null;
8585
}
8686

87+
// REVISIT: Do we really need to do that? -> answer shall be: no.
8788
annotate Hierarchy with @Capabilities.FilterRestrictions.NonFilterableProperties: [
8889
'LimitedDescendantCount',
8990
'DistanceFromRoot',
9091
'DrillState',
91-
'Matched',
92-
'MatchedDescendantCount',
92+
// 'Matched',
93+
// 'MatchedDescendantCount',
9394
'LimitedRank'
9495
];
9596

97+
// REVISIT: Do we really need to do that? -> answer shall be: no.
9698
annotate Hierarchy with @Capabilities.SortRestrictions.NonSortableProperties: [
9799
'LimitedDescendantCount',
98100
'DistanceFromRoot',
99101
'DrillState',
100-
'Matched',
101-
'MatchedDescendantCount',
102+
// 'Matched',
103+
// 'MatchedDescendantCount',
102104
'LimitedRank'
103105
];
104106

@@ -116,15 +118,15 @@ annotate my.Genres with @Aggregation.RecursiveHierarchy #GenreHierarchy: {
116118
ParentNavigationProperty: parent // navigates to a node's parent
117119
};
118120

119-
annotate my.Genres with @Hierarchy.RecursiveHierarchy #GenreHierarchy: {
120-
$Type : 'Hierarchy.RecursiveHierarchyType',
121-
LimitedDescendantCount: LimitedDescendantCount,
122-
DistanceFromRoot : DistanceFromRoot,
123-
DrillState : DrillState,
124-
Matched : Matched,
125-
MatchedDescendantCount: MatchedDescendantCount,
126-
LimitedRank : LimitedRank
127-
};
121+
// annotate my.Genres with @Hierarchy.RecursiveHierarchy #GenreHierarchy: {
122+
// $Type : 'Hierarchy.RecursiveHierarchyType',
123+
// LimitedDescendantCount: LimitedDescendantCount,
124+
// DistanceFromRoot : DistanceFromRoot,
125+
// DrillState : DrillState,
126+
// // Matched : Matched,
127+
// // MatchedDescendantCount: MatchedDescendantCount,
128+
// LimitedRank : LimitedRank
129+
// };
128130

129131
annotate my.Genres with @(
130132
readonly,

fiori/app/genres/fiori-service.cds

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/*
2-
All annotations needed for UI5 Tree Table View are located in '../common'
2+
All annotations needed for UI5 Tree Table View are located in '../common'
3+
REVISIT: Why?
34
*/

fiori/server.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// PoC for simplified Fiori Tree Views
2+
const cds = require('@sap/cds/lib')
3+
4+
cds.on('compile.to.edmx', csn => {
5+
const { 'AdminService.Genres': Genres } = csn.definitions
6+
Genres['@Hierarchy.RecursiveHierarchy#GenreHierarchy.$Type'] = 'Hierarchy.RecursiveHierarchyType'
7+
Genres['@Hierarchy.RecursiveHierarchy#GenreHierarchy.LimitedDescendantCount'] = {'=':'LimitedDescendantCount'}
8+
Genres['@Hierarchy.RecursiveHierarchy#GenreHierarchy.DistanceFromRoot'] = {'=':'DistanceFromRoot'}
9+
Genres['@Hierarchy.RecursiveHierarchy#GenreHierarchy.DrillState'] = {'=':'DrillState'}
10+
Genres['@Hierarchy.RecursiveHierarchy#GenreHierarchy.LimitedRank'] = {'=':'LimitedRank'}
11+
})

0 commit comments

Comments
 (0)