Skip to content

Commit

Permalink
Disable Facet with annotation (#86)
Browse files Browse the repository at this point in the history
Hello everyone,

with this patch I suggest adding the annotation
`@changelog.disable_facet` to disable the facet on an entity completely.
This might be useful if we have deep fiori UIs where a lot of the
entities are tracked. Depending on the configuration, I want all of them
tracked on the main entity, yet empty facets are shown on the subpages
anyway.

Have a nice weekend and feel free to ask questions.

Kind regards

---------

Co-authored-by: Nick Josipovic <[email protected]>
  • Loading branch information
pandayo and nkaputnik authored Apr 25, 2024
1 parent 5c11089 commit 877579c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ annotate sap.changelog.aspect @(UI.Facets: [{

The system now uses the SAPUI5 default setting `![@UI.PartOfPreview]: true`, such that the table will always shown when navigating to that respective Object page.

### Disable Facet

To not show the changelog facet on compositions subsites, you can use `@changelog.disable_facet` for the facet to not show up.


## Modelling Samples

Expand Down
3 changes: 2 additions & 1 deletion cds-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ cds.on('loaded', m => {
}

// Add UI.Facet for Change History List
entity['@UI.Facets']?.push(facet)
if(!entity['@changelog.disable_facet'])
entity['@UI.Facets']?.push(facet)

// The changehistory list should be refreshed after the custom action is triggered
if (entity.actions) {
Expand Down

0 comments on commit 877579c

Please sign in to comment.