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

[Content Inspector] Integrate into dashboard/vis/maps/graph #144435

Closed
4 of 5 tasks
Tracked by #135247
sebelga opened this issue Nov 2, 2022 · 7 comments
Closed
4 of 5 tasks
Tracked by #135247

[Content Inspector] Integrate into dashboard/vis/maps/graph #144435

sebelga opened this issue Nov 2, 2022 · 7 comments
Assignees
Labels
Component:TableListView Feature:Content Management User generated content (saved objects) management Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@sebelga
Copy link
Contributor

sebelga commented Nov 2, 2022

In #144240 we are adding a new inspector capability to the <TableListView />.

We will need to wire the inspector onSave() handler in each of the following app to update the underlying saved object

  • Dashboard
  • Visualisation
  • Maps

Screenshot 2022-11-02 at 10 33 26

Blocked by

@sebelga sebelga self-assigned this Nov 2, 2022
@sebelga sebelga added Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Feature:Content Management User generated content (saved objects) management labels Nov 2, 2022
@sebelga
Copy link
Contributor Author

sebelga commented Nov 2, 2022

@ThomThomson @nickpeihl @flash1293 @kertal

I'd like to check with you if there is anything I should take into consideration when integrating the inspector into the above apps listing pages. Local storage synchronisation? Specific service to use? Something else?

We basically want to update a saved object with:

  • Updated title
  • Updated description
  • Updated list of tags (Merging the tags references into possible existing references array and remove old tags references)

Thanks! 👍

[EDIT] Also there is a readonly mode. The flag should be passed if the user does not have write access. Let me know if there are app specific rules for that, cheers.

@ThomThomson
Copy link
Contributor

Thanks for opening this @sebelga! There are a couple things you'll need to take into consideration for implementing this in Dashboard:

Our services to save dashboards live in src/plugins/dashboard/public/services/dashboard_saved_object/dashboard_saved_object_service.ts.

One problem with the save methods in that service is that they expect a full DashboardState object to save, whereas I think from the listing page you'd likely only have the raw attributes. You could either:

  • Build out a dashboard state object from the attributes using helper methods we have, update the title, description etc, then save with the existing function.
  • Or we could implement a straightforward updateMeta function that takes only the required keys and updates the savedObject accordingly.

Another consideration is our session storage which stores unsaved state. At the moment, you cannot edit a dashboard's title without immediately saving it, but in the future you will be able to do this from the dashboard @cqliu1. To future-proof this, I would suggest that as part of the inspector's onSave function, you delete Title, description, and tags from the session store of that dashboard's id if they exist. That way, the most recently set title for that dashboard will take precedence. We could also write a helper function for this in the dashboardSessionStorage service.

In terms of readonly mode, you can access that from the dashboard plugin services under dashboardCapabilities: { showWriteControls }.

@sebelga
Copy link
Contributor Author

sebelga commented Nov 2, 2022

Thanks for the input @ThomThomson !

Or we could implement a straightforward updateMeta function that takes only the required keys and updates the savedObject accordingly.

It seems that this would be best. We can call it updateMeta() or maybe updateAttributes? I would expect this handler to take care of everything (invalidating the local storage cache if needed) and not have to separately deal with session storage. WDYT?

@ThomThomson
Copy link
Contributor

Agreed, we can handle that on our side. Opened this issue to track it.

@nickpeihl
Copy link
Member

Hi @sebelga. For saving Maps we use the service in x-pack/plugins/maps/public/map_attribute_service.ts.

To see if Maps is readonly you should be able to check the save property of the getMapsCapabilities service in x-pack/plugins/maps/public/kibana_services.ts.

@petrklapka
Copy link
Member

@sebelga - talk to maps & graph. If they intend to do this, great, create issues and track here. If not, close this.

@petrklapka
Copy link
Member

Nobody is asking for this, so we're closing it. If you feel strongly otherwise and it is an actual priority, please re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:TableListView Feature:Content Management User generated content (saved objects) management Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

No branches or pull requests

4 participants