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.
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.
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
In this example, the @UI.Facet.skipAnnotation is set to
true
, which means the plugin will be hidden by default.