Kibana: Deprecate edit view in saved objects management

Created on 6 Mar 2020  路  6Comments  路  Source: elastic/kibana

Saved Objects can define an editUrl which will add an "inspect" item to the actions context menu.
Screenshot 2020-03-06 at 21 09 27

Clicking that item brings up an ominous warning:

Proceed with caution!
Modifying objects is for advanced users only. Object properties are not validated and invalid objects could cause errors, data loss, or worse. Unless someone with intimate knowledge of the code told you to be in here, you probably shouldn鈥檛 be.

Screenshot 2020-03-06 at 21 09 38

I believe we should deprecate this functionality for the following reasons:

  • There's no validation on the edits, so, as the warning suggests, editing an object is very likely to break Kibana, or worse, cause a migration failure and downtime in a future Kibana version upgrade.
  • Editing what's effectively raw JSON is a bad user experience and we should strive to provide all necessary functionality through the plugin's UI.
  • Workflows that depend on editing objects requires giving users saved objects management permissions which ideally should be restricted to system administrators https://github.com/elastic/kibana/issues/57026
  • This might have originally been important to update the index pattern references after importing visualizations, but this is now possible during the saved objects import process.

It's not possible to immediately remove these views as some edit/delete functionality would have to be exposed from the plugins that own these objects such as https://github.com/elastic/kibana/issues/57026 As a first step we can deprecate the API in Platform and then work with teams to transition any known workflows to the plugin's UI itself.

Related issues:

Saved Objects KibanaApp Core

Most helpful comment

@rudolf As talked besides this, I am all in favor for removing the editing support for saved objects. Instead as earlier mentioned we could just show the JSON as it is via an "inspect" button. That would then also allow to show ANY saved object and not just the "old" ones that are currently using the old client side saved object implementation (and thus solve https://github.com/elastic/kibana/issues/67607).

If we still want to give (advanced) users editing over saved objects, I'd still suggest, we simplify this screen significantly and just replace it by a single JSON editor. This way we could get rid of a lot of old code for that management section and in all the apps, that currently use the old legacy saved object classes (see above linked issue).

As an alternative we should make sure #67607 is addressed differently, and we actually decouple the old implementation from the management section. Since this sounds like quiet some effort, that imho does not outweigh the benefit of having separate input boxes on that management page (especially since in most of them the user anyway need to put JSON again...), I'd rather suggest we are going the "only JSON" route - and either only show it to users, or if we still really require, also have the user edit it (but as one JSON).

All 6 comments

Pinging @elastic/kibana-platform (Team:Platform)

@AlonaNadler What do you think about the suggestion? Would you be able to help create a list of common workflows that require editing saved objects directly? Then we can work through that list and see if we should create the UI to support these workflows or if it would be sufficient to tell users to use the Saved Objects API to edit their objects.

When you have an error for one of the existing visualizations, which can happen sometimes after upgrades or if you recreated the index pattern. There is no way to solve the error besides the inspect editing the JSON directly. This is far from ideal but that is the current situation.

@rudolf As talked besides this, I am all in favor for removing the editing support for saved objects. Instead as earlier mentioned we could just show the JSON as it is via an "inspect" button. That would then also allow to show ANY saved object and not just the "old" ones that are currently using the old client side saved object implementation (and thus solve https://github.com/elastic/kibana/issues/67607).

If we still want to give (advanced) users editing over saved objects, I'd still suggest, we simplify this screen significantly and just replace it by a single JSON editor. This way we could get rid of a lot of old code for that management section and in all the apps, that currently use the old legacy saved object classes (see above linked issue).

As an alternative we should make sure #67607 is addressed differently, and we actually decouple the old implementation from the management section. Since this sounds like quiet some effort, that imho does not outweigh the benefit of having separate input boxes on that management page (especially since in most of them the user anyway need to put JSON again...), I'd rather suggest we are going the "only JSON" route - and either only show it to users, or if we still really require, also have the user edit it (but as one JSON).

I'm a simple man. I see 'that would allow to remove SO loaders from SO management', I upvote.

However, the loaders are not only used for the edit view, but also for the legacy import, see https://github.com/elastic/kibana/blob/159369b71999b1f9d8df5645c0935044d25bb8bc/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#L72-L73

Hopefully we would be able to get rid of the legacy import in 8.0 (even if it's now one year from now)

Still, really in favor of @timroes proposal to replace the whole edition view with a single json editor for the whole content. That would indeed greatly simplify the SOM codebase, and is not really that different functionally.

@pgayvallet As far as my understanding goes, Platform team wanted to remove those APIs with 8.0 completely. I think it would be worthwhile already beforehand changing the management saved object section to the "JSON only" editor for all saved objects. Even if it won't help us to remove the client side saved object implementations before 8.0, we can a) already remove part of their code (that was responsible for the management screen, e.g. I think the clientside SO mapping that we have was only used for it), and b) can already offer editing/inspecting all saved objects beforehand (I'd really appreciate if we could look into those saved objects e.g. of Lens more easily :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ginja picture Ginja  路  3Comments

snide picture snide  路  3Comments

treussart picture treussart  路  3Comments

timroes picture timroes  路  3Comments

MaartenUreel picture MaartenUreel  路  3Comments