Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visibility control of the plugin #57

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

0sman
Copy link

@0sman 0sman commented Jun 5, 2024

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.

@0sman 0sman marked this pull request as ready for review June 5, 2024 14:51
@RamIndia
Copy link
Contributor

RamIndia commented Jun 6, 2024

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

@0sman
Copy link
Author

0sman commented Jun 7, 2024

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

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

@nils
Copy link

nils commented Aug 22, 2024

@RamIndia any feedback on this? We still need it...

btw. @cap-js/change-tracking has a similar solution in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants