cap-js / change-tracking

CDS plugin providing out-of-the box support for automatic capturing, storing, and viewing of the change records of modeled entities.
https://cap.cloud.sap/docs
Apache License 2.0
20 stars 8 forks source link

Adding the facet visible by default #104

Closed cakeBuddy closed 2 months ago

cakeBuddy commented 2 months ago

Hi,

I have one question about the usage.

By default the Change History Facet is not visible. I have to click on the "Show More" button to make it appear image

From the related issue https://github.com/cap-js/change-tracking/issues/46 I can confirm that changing the Facet configuration from ![@UI.PartOfPreview]: false to ![@UI.PartOfPreview]: true makes it by default visible right from the start.

However I did this configuration in my node_modules\@cap-js\change-tracking\index.cds file and with the next npm i command the changes will be overwritten.

How should I best configure this to have by default visibility true ?

cakeBuddy commented 2 months ago

Nevermind, I solve it by reading the documentation carefully :) I just had to put this in my app cds file and it works like a charm:

using from '@cap-js/change-tracking';

annotate sap.changelog.aspect @(UI.Facets: [{
  $Type : 'UI.ReferenceFacet',
  ID    : 'ChangeHistoryFacet',
  Label : '{i18n>ChangeHistory}',
  Target: 'changes/@UI.PresentationVariant',
  ![@UI.PartOfPreview]
}]);