Skip to content

Commit 1dd3fa1

Browse files
committed
Optimized use of managed data
1 parent c8d1e2d commit 1dd3fa1

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

index.cds

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ view ChangeView as
2323
entityID as objectID, // no clue why we have to rename this?
2424
parentEntityID as parentObjectID, // no clue why we have to rename this?
2525
changeLog.entityKey as entityKey, // flattening assoc path -> this is the main reason for having this helper view
26+
changeLog.createdAt as createdAt,
27+
changeLog.createdBy as createdBy,
2628
}
2729
excluding {
2830
entityID,
@@ -36,16 +38,17 @@ entity ChangeLog : managed, cuid {
3638
serviceEntity : String @title: '{i18n>ChangeLog.serviceEntity}'; // definition name of target entity (on service level) - e.g. ProcessorsService.Incidents
3739
entity : String @title: '{i18n>ChangeLog.entity}'; // definition name of target entity (on db level) - e.g. sap.capire.incidents.Incidents
3840
entityKey : UUID @title: '{i18n>ChangeLog.entityKey}'; // primary key of target entity, e.g. Incidents.ID
39-
changes : Composition of many Changes
40-
on changes.changeLog = $self;
41+
createdAt : managed:createdAt;
42+
createdBy : managed:createdBy;
43+
changes : Composition of many Changes on changes.changeLog = $self;
4144
}
4245

4346

4447
/**
4548
* Attribute-level Changes with simple capturing of one-level
4649
* composition trees in parent... elements.
4750
*/
48-
entity Changes : managed {
51+
entity Changes {
4952

5053
key ID : UUID @UI.Hidden;
5154
keys : String @title: '{i18n>Changes.keys}';
@@ -88,15 +91,14 @@ annotate ChangeView with @(UI: {
8891
}],
8992
},
9093
LineItem : [
91-
{Value: objectID},
92-
{Value: entity},
93-
{Value: parentObjectID},
94-
{Value: attribute},
95-
{Value: valueChangedTo},
96-
{Value: valueChangedFrom},
97-
{Value: createdBy},
98-
{Value: createdAt},
99-
{Value: modification}
94+
{ Value: modification, @HTML5.CssDefaults: {width:'9em'} },
95+
{ Value: createdAt, @HTML5.CssDefaults: {width:'11em'} },
96+
{ Value: createdBy, @HTML5.CssDefaults: {width:'9em'} },
97+
{ Value: objectID, @HTML5.CssDefaults: {width:'14em'} },
98+
{ Value: parentObjectID, @HTML5.CssDefaults: {width:'14em'} },
99+
{ Value: attribute, @HTML5.CssDefaults: {width:'9em'} },
100+
{ Value: valueChangedTo, @HTML5.CssDefaults: {width:'11em'} },
101+
{ Value: valueChangedFrom, @HTML5.CssDefaults: {width:'11em'} },
100102
],
101103
DeleteHidden : true,
102104
});

0 commit comments

Comments
 (0)