elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.63k stars 8.22k forks source link

Copy several Saved Objects to spaces at the same time. Currently I need to select one by one #163431

Open ninoslavmiskovic opened 1 year ago

ninoslavmiskovic commented 1 year ago

As a user, I want to copy more than one saved object to spaces, and currently, the "action" menu gets deactivated when I start selecting Saved Objects.

See video:

https://github.com/elastic/kibana/assets/108192783/781b37d9-8200-4da4-8951-8db217b115bd

The request: Be able to select several Saved Objects and "copy to spaces".


Edit by @legrego: I want to highlight this comment for anyone that finds this issue:

This issue is a duplicate of https://github.com/elastic/kibana/issues/52098.

We support bulk copy today via the API: https://www.elastic.co/guide/en/kibana/current/spaces-api-copy-saved-objects.html

We don't have this exposed via the UI because it adds complexity to an already confusing UX, and we haven't yet planned or prioritized design improvements.

elasticmachine commented 1 year ago

Pinging @elastic/appex-sharedux (Team:SharedUX)

elasticmachine commented 1 year ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

kertal commented 1 year ago

it seems this part of the code (saved_objects_management) is owned by @elastic/kibana-core ? Rem

petrklapka commented 1 year ago

Hey Mr. @sebelga, It smells to me that the copy functionality is not ours, but a glitch that deactivates the action menu on multi select may very well be. Can you please investigate and see where the plumbing has gone wrong so we can triage?

sebelga commented 1 year ago

it seems this part of the code (saved_objects_management) is owned by https://github.com/orgs/elastic/teams/kibana-core

Yes saved object management is owned by the core team.

The fact that the action menu gets deactivated when selecting a row is an expected behaviour that we have across Kibana tables. It comes from EUi. Once we select one or multiple row we enter "bulk" mode. A single row actions menu does not make sense as some row could have different actions based on their properties.

Handling bulk action is then done on the table header. In Saved object management, once we start selecting rows, the "Delete" and "Export" bulk action buttons get active.

This is similar for example to Index templates:

Screenshot 2023-08-10 at 09 24 29
sebelga commented 1 year ago

The enhancement for this issue would be to add a new bulk action: "Copy to space".

For the UX, instead of adding another button, we might start considering something similar to what we plan to do with the TableListView: https://github.com/elastic/kibana/issues/140185

petrklapka commented 1 year ago

Adding core team just for visibility.

rayafratkina commented 9 months ago

Should be considered as part of the sharing/coping SOs across spaces initiative

TinaHeiligers commented 9 months ago

Copying a saved object to a space is not as simple as it might seem and could cause some serious performance issues.

Risks

Kibana has to deal with generating new ID's, ensuring the references and related objects get handled and possibly also deal with legacy url aliases.

Doing all of this in a bulk action could also cause cyclic dependencies. We'd also have to think about how to handle sharable objects such as data views.

Workaround:

At the moment, there is a work-around using export/import.

Exporting several objects is already supported, as is importing them into another space and the decision of how to handle related objects and duplicates then falls on the consumer.

Possible implementation

We could explore implementing an API that uses export/import under the hood. We would then need to figure out a way to handle duplicates.

@elastic/kibana-security What are your thoughts about exploring export/import for supporting a bulk copy-to-space action under the hood?

legrego commented 9 months ago

This issue is a duplicate of https://github.com/elastic/kibana/issues/52098.

We support bulk copy today via the API: https://www.elastic.co/guide/en/kibana/current/spaces-api-copy-saved-objects.html

We don't have this exposed via the UI because it adds complexity to an already confusing UX, and we haven't yet planned or prioritized design improvements.

legrego commented 9 months ago

@elastic/kibana-security What are your thoughts about exploring export/import for supporting a bulk copy-to-space action under the hood?

image

https://github.com/elastic/kibana/blob/4566ef71eca07bf0b6e386e277d6364bfe8cd4fa/x-pack/plugins/spaces/server/lib/copy_to_spaces/copy_to_spaces.ts#L69-L101

legrego commented 9 months ago

Can we close either this issue or https://github.com/elastic/kibana/issues/52098, in order to consolidate the conversation?

ninoslavmiskovic commented 9 months ago

@legrego perhaps close the 4y issue since this one have more comments and context . I am good either way.

pgayvallet commented 8 months ago

Do we have a consensus on which team should own this? Is it more @elastic/kibana-security or @elastic/kibana-core ?

legrego commented 8 months ago

@pgayvallet, the platform security team has historically owned this, but I'm open to discussing alternatives. A secret third option would be the shared ux team. This should "only" require front-end changes, since the API already supports this functionality. Those quotes are doing a lot of heavy lifting, though.

pgayvallet commented 6 months ago

@sebelga

For the UX, instead of adding another button, we might start considering something similar to what we plan to do with the TableListView: https://github.com/elastic/kibana/issues/140185

Did we make any progress on some shareable UI components that we could use for that?

I was just looking at the issue and the code, and as @legrego said, he modal and API would already support selecting multiple objects, so it's all about how to correctly implement the UI for that new action.

sebelga commented 6 months ago

Did we make any progress on some shareable UI components that we could use for that?

@pgayvallet No we didn't move forward with the linked issue I mentionned. Not sure it would have served you as the bulk action header were meant for the TableListView component and I don't think the SO management table is using it. But there are places in Kibana (e.g. the Index management table) that do have the bulk drop down for multiple actions that you could easily copy over in your table here. It's not too complex to do. Doing it reusable (the issue linked) through TableListView is much more complex.

A secret third option would be the shared ux team. This should "only" require front-end changes, since the API already supports this functionality.

@legrego We build the shared components but can't really maintain all their implementations and their respective tests accross Kibana 😊 (dashboard, vis library, maps...).

cc @petrklapka for visibility.