Feature/centralized share button - #4
Draft
DarshitChanpura wants to merge 5 commits into
Draft
Conversation
Exposes securityDashboards.ui.ShareButton on the plugin start contract so plugins that register protected resources under the resource-sharing framework can embed a Share / Update Access button (with the shared access modal) directly on their own pages, instead of navigating to the central Resource Access Management dashboard. - Extract ShareAccessModal, share-with types and diff/error helpers out of resource-sharing-panel into reusable modules (no behavior change) - Add ResourceShareButton: self-fetches sharing record + access levels, handles can_share permission, MDS dataSourceId, and hides itself when resource sharing is disabled or the type is not registered - Lazy-load the implementation so consumers only pay the cost on render Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…lity Extends the centralized share button with the integration surfaces needed by consumer plugins: - DOM-marker SPI: plugins render a data-resource-share-button marker element (id/type/data-source/display attributes) anywhere in their UI and the centralized share button mounts into it via MutationObserver. No plugin dependency, imports, or manifest changes required. - Controlled modal mode (isModalOpen/onModalClose) so triggers can live inside popovers/context menus that unmount on close; warns via toast when sharing is not possible instead of rendering a broken modal - display='icon' compact variant for dense placements like table rows - Request coalescing (5s TTL) so many buttons rendered at once (table rows) share a single types/list fetch; mutations bypass the cache - resourceSharing.enabled core capability (provider + per-request switcher backed by dashboardsinfo) so any plugin can gate surrounding chrome (e.g. a table column) without depending on this plugin Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Extends the resourceSharing core capability with availableTypes (comma- joined registered resource types from the /types API) so consumer plugins can hide share affordances when their specific type is not registered, in addition to the global enabled flag. Values are primitives because the capabilities switcher merge only retains keys with stable types. Note: availableTypes reflects registered types; protected_types is not exposed by the backend to non-admin users today, so per-type buttons still self-hide for registered-but-unprotected types. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
[Describe what this change achieves]
Category
[Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation]
Why these changes are required?
What is the old behavior before changes and new behavior after changes?
Issues Resolved
[List any issues this PR will resolve (Is this a backport? If so, please add backport PR # and/or commits #)]
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.