Integrate centralized resource-sharing share button for monitors and workflows - #1496
Conversation
…workflows Adds a Share column to the monitors list backed by the security plugin's DOM-marker SPI (compact icon variant). Rows resolve their resource type per item — composite monitors map to the workflow type, others to the monitor type — matching the types registered by AlertingResourceSharingExtension (alerting#2180). The column is gated on the core resourceSharing capability (enabled + type available), so it is absent until an alerting backend containing the onboarding ships. Markers are inert empty elements with no dependency on the security plugin. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit badf579)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to badf579 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 5cf9fb4
Suggestions up to commit 5cf9fb4
Suggestions up to commit 5464ef8
Suggestions up to commit 7d344be
|
…ions The Access (share) column was 50px, sitting next to the 60px Actions column while the unwidthed static columns filled the rest under fixed table layout, making Access/Actions look stacked. Widen to 120px to match the AD detectors Access column. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
|
Persistent review updated to latest commit 5464ef8 |
…olumn - isResourceSharingAvailable: assert it returns false when the capability is absent, disabled, or the resource type is missing from availableTypes, and true for the monitor and workflow types when present. - Monitors buildColumns: assert the Access column and its share-button marker (data-resource-id/type/name) are present only when resource sharing is available, and that composite (workflow) monitors use the workflow resource type. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
|
Persistent review updated to latest commit 5cf9fb4 |
1 similar comment
|
Persistent review updated to latest commit 5cf9fb4 |
|
Nice clean approach — the dependency-free DOM-marker SPI with capability gating keeps this plugin decoupled from security-dashboards-plugin, and the availability helper + column tests are appreciated. A few items, one blocking: 1. Blocking: workflow resource type no longer matches alerting#2180
export const ALERTING_WORKFLOW_RESOURCE_TYPE = 'workflow';alerting#2180 renamed the registered workflow type to
The constant is even named 2. Question: composite detection via
|
- Render the Access column when either the monitor or the alerting-workflow resource type is shareable, so workflow rows keep their share button even when only the workflow type is enabled. - Trim whitespace around availableTypes tokens in isResourceSharingAvailable so values like 'monitor, workflow' resolve correctly. - Add tests for workflow-only availability and whitespace-tolerant parsing. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
|
Thanks for the review suggestions. Addressed in
|
|
Persistent review updated to latest commit badf579 |

Description
Integrates the centralized share button from security-dashboards-plugin PR #2491 via its dependency-free DOM-marker SPI, surfacing per-monitor sharing directly in the monitors list.
How it works
data-resource-share-button+ id/type attributes); the security dashboards plugin discovers them and mounts its centralized Share/Update Access button + modalworkflowtype, all other monitors tomonitor— matching the types registered byAlertingResourceSharingExtensionin alerting#2180resourceSharingcapability (enabled+ type present inavailableTypes), so it is completely absent when the security dashboards plugin is not installed, the feature is disabled, or the alerting backend does not yet contain #2180 — no dependency on the security plugin (no manifest changes, no imports)Draft status
Blocked on two upstream merges: security-dashboards-plugin#2491 (provides the SPI + capability) and alerting#2180 (registers the types). Safe to merge before either — the column stays dormant until both are present.
Testing
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.