[Tags] Expose saved object tagging on server #206948
Labels
Feature:Dashboard
Dashboard related features
impact:high
Addressing this issue will have a high level of impact on the quality/strength of our product.
loe:medium
Medium Level of Effort
Project:Dashboards API
Team:Presentation
Presentation Team for Dashboard, Input Controls, and Canvas
Team:SharedUX
Team label for AppEx-SharedUX (formerly Global Experience)
To support Dashboards-as-code (as well as future *-as-code initiatives) some plugins need access to the TagsClient on the server.
For Dashboards-as-code, specifically the Dashboard HTTP API, we want to remove the consumer concern for saved object references. This means the pre-save and pre-load hooks for extracting and injecting references should be moved to each plugin's StorageHandler rather than by the UI as they are now.
This would require adding a server component to the saved-objects-taggiing-oss bridge plugin that optionally provides the TagsClient in the start contract.
Consider the following examples of creating a dashboard with tags using the Dashboard HTTP API.
Current workflow for creating a dashboard with tags
Assumes the "foo" and "bar" tag saved objects already exist and the consumer knows the saved object id for both. If the saved objects for the referenced tags do not already exist, they will not be created which results in dangling references.
Preferred workflow for creating a dashboard with tags
In this example, the consumer does not need to know the saved object id of the tags. They add an array of tags for their dashboard and the tags are automatically referenced during the StorageHandler's create method and added to the saved object. When loading the dashboard, the tags are dereferenced from the saved object and populate the "tags" array.
If the tag does not exist, we return an error and maybe a suggestion for how to create the tag using the
/api/saved_objects_tagging/tags/create
endpoint.The text was updated successfully, but these errors were encountered: