cap-js / attachments

The @cap-js/attachments package is a CDS plugin that provides out-of-the box asset storage and handling by using an aspect Attachments. It also provides a CAP-level, easy to use integration of the SAP Object Store.
Apache License 2.0
6 stars 4 forks source link

visibility control of the plugin #57

Open 0sman opened 3 weeks ago

0sman commented 3 weeks ago

This PR introduces a new feature to the @cap-js/attachments plugin that allows developers to control visibility of the plugin.

Changes made

A new line of code has been added to the plugin.js :

if(comp["@attachments.UI.Facet.skipAnnotation"] == true) return;

It checks if the @attachments.UI.Facet.skipAnnotation property is set to true for a composition. If it is, the function returns immediately, skipping the addition of the @UI.Facet annotation to the composition.

Purpose of the Change

The purpose of this change is to provide developers with more control over the visibility of the @cap-js/attachments plugin in their applications. By setting the @attachments.UI.Facet.skipAnnotation property to true, developers can hide the plugin from the UI. This feature is particularly useful in scenarios where the visibility of the plugin needs to be dynamically controlled based on certain conditions.

Example Usage

entity Incidents {
  // ...
  @attachments.UI.Facet.skipAnnotation
  attachments: Composition of many Attachments;
}

In this example, the @UI.Facet.skipAnnotation is set to true, which means the plugin will be hidden by default.

RamIndia commented 3 weeks ago

@0sman : are you using freestyle applications or any other framework to develop UI?

0sman commented 3 weeks ago

@0sman : are you using freestyle applications or any other framework to develop UI?

@RamIndia we're using SAP Fiori Elements (FEv4)