Saved object annotation - #12683
Saved object annotation#12683ruanyl wants to merge 9 commits into
Conversation
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
- prevent duplicate tag names - preserve tags during overwrite saves - render selected tag filters as colored pills Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
savedObjects.annotations.enabled: false savedObjectTags.enabled: false Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 8ef9b52. ⛔ Hard block: Issues at High severity or above will block this PR from merging.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit fa4ebef)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to fa4ebef Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 413d10e
Suggestions up to commit 5bbe312
Suggestions up to commit 8ef9b52
|
❌ 20 Jest Test Failure(s)📄
|
- add setAnnotationsForObject to server and browser clients - replace selected tag assignments in one request - preserve unrelated references and remove orphan annotations Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
|
Persistent review updated to latest commit 5bbe312 |
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
|
Persistent review updated to latest commit 413d10e |
+ Hide dashboard tag controls for read-only users Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
|
Persistent review updated to latest commit fa4ebef |
Description
As the number of dashboards and visualizations grows, finding and organizing saved objects by title alone becomes difficult. This PR introduces saved object tags so users can classify dashboards with reusable, colored labels and filter the dashboard list by tag.
Rather than adding a tag-specific field and lifecycle logic to every saved object type, this PR introduces a generic annotation framework in the Saved Objects service. Tags are the first annotation type built on this framework.
How the annotation framework works
An annotation definition is stored as a regular
saved-object-annotationsaved object. It contains a type, name, optional description, and optional payload for annotation-specific metadata. Tags use the payload to store their color.Plugins register annotation types during setup and declare which saved object types they support. The tags plugin registers the
tagannotation type for dashboards and visualizations and requires tag names to be unique.Annotations are attached to target objects through saved object references. For example, assigning a tag to a dashboard adds a reference from the dashboard to the tag definition. This allows the existing Saved Objects infrastructure to handle relationships, export and import, and filtering through
hasReference.The core annotation service provides operations to:
Saved object writers do not normally know about references owned by other features. To prevent tags from disappearing when a dashboard is saved or overwritten, core preserves persisted annotation references across regular create, update, bulk-create, and bulk-update operations. Annotation mutations use an internal client path so explicitly removing a reference still works.
The framework is exposed through request-scoped server services, internal HTTP routes, and a browser client. Additional annotation types can reuse the same lifecycle and attachment behavior without introducing custom fields on every target saved object type.
Dashboard integration
The initial UI integration focuses on dashboards. Users can create, assign, and remove colored tags from the dashboard header in either view or edit mode. Hovering over the tag action displays the currently assigned tags.
The dashboard listing includes a Tags column and supports filtering dashboards by a selected tag. Tag options and selected values are consistently rendered as colored labels.
Issues Resolved
Screenshot
Screen.Recording.2026-09-02.at.14.51.30.mov
Testing the changes
Check List
yarn test:jestyarn test:jest_integration