Skip to content

Commit

Permalink
Support for @UI.HeaderInfo.TypeName (#124)
Browse files Browse the repository at this point in the history
Hi colleagues,

for the object type column the label of the entity is being used.
However it is not common that entities are annoyed with a label. Instead
they usually have the `@UI.HeaderInfo` annotation annotated as it
dictates app, object page and table names in Fiori elements. Thus change
tracking should also consider this annotation as a fallback.

`@UI.HeaderInfo.TypeNamePlural` is also an option if desired. Moreover
`@UI.HeaderInfo.Title` defines the object page identifier for a rotation
and it might make sense to consider this for a nicer Object Key (or
consider @Common.SemanticKey).

BR,
Marten

Co-authored-by: Wenjun Zheng <[email protected]>
  • Loading branch information
schiwekM and Sv7enNowitzki authored Nov 27, 2024
1 parent 0fd23c3 commit 3c826f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const _getLabelI18nKeyOnEntity = function (entityName, /** optinal */ attribute)
let def = cds.model.definitions[entityName];
if (attribute) def = def?.elements[attribute]
if (!def) return "";
return def['@Common.Label'] || def['@title'];
return def['@Common.Label'] || def['@title'] || def['@UI.HeaderInfo.TypeName'];
};

const localizeLogFields = function (data, locale) {
Expand Down

0 comments on commit 3c826f2

Please sign in to comment.