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

Spaces - Copy Saved Objects to Spaces UI #39002

Merged
merged 50 commits into from
Aug 23, 2019
Merged

Conversation

legrego
Copy link
Member

@legrego legrego commented Jun 14, 2019

Summary

This introduces a new "Copy to space" action within the Saved Objects Management UI. When Spaces is enabled, a new action appears in the table next to each saved object. From there, users are given the option to copy that saved object (with or without references) to one or more other spaces.

Tasks

  • create workflow
  • create integration points in saved objects management ui
  • integrate with actual APIs from Copy Saved Objects to Spaces API #38014
  • testing
  • i18n verification
  • a11y verification
  • copy review

cts_demo

Menu option

cts_1

Select spaces to copy into

cts_2

Processing copy

cts_3

Copy response, showing sample error

cts_4

Copy response, showing conflict resolution

cts_5

cts_6

Resolves #37286

"Release notes: Saved objects can be easily copied from one space to another from the Saved Objects Management screen"

@legrego
Copy link
Member Author

legrego commented Jun 14, 2019

@cchaos no rush, as the implementation is blocked on several other PRs, but if you get some free time, I'd love a preliminary design review!

@legrego legrego added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! Feature:Security/Spaces Platform Security - Spaces feature WIP Work in progress labels Jun 14, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security

};
}

export abstract class SavedObjectsManagementAction<T = unknown> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tightly coupled to both EUI and React. My ultimate goal is to replace this entirely with the Embeddable/Actions APIs once they're ready, so I don't want to spend a ton of time crafting the perfect abstraction here. Instead, this provides enough functionality to enable the copy-to-space feature, without coupling it to Spaces itself.

@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 14, 2019

💔 Build Failed

^ Unrelated CI failure

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@Conky5
Copy link
Contributor

Conky5 commented Jul 8, 2019

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@cchaos
Copy link
Contributor

cchaos commented Jul 15, 2019

@legrego Sorry it's taken so long for the design team to take a look at this. @ryankeairns will actually be able to help you out on it. You'll probably want to sync with him to go over the purpose and intricacies of all the Spaces stuffs.

@legrego
Copy link
Member Author

legrego commented Aug 23, 2019

We also are re-using types and processImportResponse from the saved objects import, which is somewhat awkward. It isn't obvious that internally copy to space is relying upon import/export.

I didn't see it that way - I liked that we weren't duplicating functionality or type definitions for what's effectively a thin wrapper around the import/export feature. It felt to me like we'd be able to see how changes to import/export will impact Copy to Space in the future. Do you have suggestions on how we can improve this? We can divorce the two from a types perspective, but then I feel like it's even less obvious that copy to space relies upon import/export.

Also, when choosing to "overwrite" a saved object, should we change the test of the "Finish" button? It wasn't immediately obvious to me that clicking "overwrite" wasn't enough to actually overwrite it and that we were just marking it to be retried once we hit "Finish".

Sure, that's a good idea.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@legrego
Copy link
Member Author

legrego commented Aug 23, 2019

Following a discussion with @kobelb, we decided on the following:

  • We will no longer explain when a copy failed due to "missing references"
  • We will no longer allow a saved object to be copied without it's references (related objects)

These decisions were made after discovering shortcomings in the import/export functionality which would have led to a confusing user experience for the Copy to Space feature.

@legrego
Copy link
Member Author

legrego commented Aug 23, 2019

Also discovered during testing: #43876

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on green CI

@snide
Copy link
Contributor

snide commented Aug 23, 2019

@legrego I'll have a review / PR for you in a couple hours from the design side.

@snide snide self-requested a review August 23, 2019 17:02
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I loaded this locally and looked through the code. There are some changes I'd like to make on the design / sass side that I can do on my own. There's nothing in here that looks scary that I would want to hold this PR up for.

Since we're got the green, I'm ok with a merge, and I'll do my design pass as a separate concern before freeze.

@legrego legrego merged commit 6a9844c into elastic:master Aug 23, 2019
@legrego legrego deleted the copy-to-space-ui branch August 23, 2019 18:24
legrego added a commit to legrego/kibana that referenced this pull request Aug 23, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Security/Spaces Platform Security - Spaces feature release_note:enhancement Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saved Object Management - Copy to Space
7 participants