-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Initial client-side support for sharing saved-objects phase 1.5 #69399
Initial client-side support for sharing saved-objects phase 1.5 #69399
Conversation
a144dde
to
3493a02
Compare
9d7b8ac
to
c560509
Compare
e65ef4d
to
070ee19
Compare
I know this is still draft, so apologies if these comments are premature. I wasn't sure about the tooltip/alert icon on the group level. Assuming the amount badge would include all objects, not just those with errors, so maybe we need the icon as well? Or would that number always be the overwrite errors? |
070ee19
to
c60f529
Compare
a937bb6
to
a8e14cf
Compare
a39ce3d
to
aa1f78f
Compare
a8e14cf
to
1c88425
Compare
af72668
to
d0926c2
Compare
@mdefazio See my responses to feedback below
No worries. I've pushed more updates, and incorporated some of your feedback already.
All copy results -- successes, conflicts, and other errors -- are shown in that section. So I imagine the number would be the results for that space. |
1c88425
to
b8179c4
Compare
97977b3
to
0aee3ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass through the client-side changes, primarily focused on changes within x-pack. Overall this is looking great so far! Just some questions/nits below for you
x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/public/copy_saved_objects_to_space/copy_saved_objects_to_space_action.tsx
Outdated
Show resolved
Hide resolved
...k/plugins/spaces/public/share_saved_objects_to_space/share_saved_objects_to_space_column.tsx
Outdated
Show resolved
Hide resolved
...k/plugins/spaces/public/share_saved_objects_to_space/share_saved_objects_to_space_service.ts
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx
Show resolved
Hide resolved
...k/plugins/spaces/public/share_saved_objects_to_space/share_saved_objects_to_space_action.tsx
Outdated
Show resolved
Hide resolved
b8179c4
to
a3c7444
Compare
6f772ea
to
02a7b4d
Compare
a3c7444
to
5102ed9
Compare
02a7b4d
to
f928ac2
Compare
f06412b
to
4303f82
Compare
Sort by descending order in the Elasticsearch query so that in the unlikely case there are more than 10 results, the most recently changed ones will show up. This is propagated all the way to the UI so the user will see choices in this order, too.
One of the copy-to-space tooltips had text size that was larger than all of the others.
Needed to pull "destination map" state up one component so it could be shared, and had to change how the SpaceResult is rendered in the process.
Modified server side management code to inject `namespaceType` as part of metadata, so "copy" and "share" actions can be disabled based on that attribute.
This allows retries to continue and ignore any `missing_references` errors. This is necessary to support copy-to-space, which does not support a workflow to replace references.
If the "Overwrite all" option is enabled, subsequent calls to the resolve import errors API should attempt to automatically overwrite conflicts. This behavior was unintentionally broken in a recent commit that introduced the "create new copies" import mode, because the type was optional and the change was not caught by the type checker. This commit fixes the behavior. In addition, this commit fixes import resolution so that missing_references errors are correctly added as copies by passing the createNewCopies option to the API. It also introduces a small change to prevent duplicate "replaceReferences" entries.
Some objects would result in a missing_references error when, if resolved, would subsequently result in an conflict error. This change allows the API to return both errors for a given object, and updates the client-side code to handle them accordingly.
Now, consumers can determine whether an import/copy result actually overwrote an existing object or not. Also modified consumers to utilize this value to determine whether or not retries should include the `overwrite` attribute.
1. All summary counts are shown all the time 2. Summary counts properly differentiate between copied, pending, skipped, and errors (errors only counts unresolvable errors). 3. Summary icons now show different tooltips based on whether or not any missing references were detected, and whether or not an overwrite was made/attempted.
This reverts commit bad3e23590777f047f105cc7ade5499d2f70577a.
The new import summary shows all objects that were not skipped, and for each one it shows the result (either newly created, or overwritten, or unresolvable error). Left old "summary" intact for legacy imports.
* Changed radios / switches to EuiCheckableCard components * Changed some text on flyout and action
* Changed radios / switches to EuiCheckableCard components * Changed some text on flyout
When "Create new copies" is disabled, shareable objects should not be copied to any spaces where they already exist. Otherwise the object would run into a conflict and subsequently overwrite itself. Note: referenced objects will still be copied, this could be refined in future work, potentially by filtering them out on the server-side.
* Now use tooltips instead of subdued text -- this is cleaner * Copy flyout shows "Relationship options" as a separate heading
d0c646a
to
2350e2f
Compare
Note to all: I had to do a force push to drop a snapshot of the server-side changes from the commit history and rebase onto the |
💔 Build Failed
Failed CI StepsTest FailuresChrome X-Pack UI Functional Tests.x-pack/test/functional/apps/spaces/copy_saved_objects·ts.Spaces app Copy Saved Objects to Space allows a dashboard to be copied to the marketing space, with all referencesStandard Out
Stack Trace
Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/spaces/copy_saved_objects·ts.Spaces app Copy Saved Objects to Space allows a dashboard to be copied to the marketing space, with all referencesStandard Out
Stack Trace
Build metrics
History
To update your PR or re-run it, just comment with: |
Client-side component to #58139.
Introduces support for importing, exporting, copying, and sharing multi-namespace saved objects on the Kibana server. Also improves the user experience for importing, exporting, and copying single-namespace (regular) saved objects.
Code owners except for
kibana-security
andkibana-platform
may be interested in waiting until a final PR is opened againstmaster
.Changes
Expand each item to see screenshots and additional notes if applicable.
Saved Objects Management Table
Added "Shared spaces" column
This displays which other space(s) each object is shared to. The display is limited to 5 spaces by default, but it is expandable. Any spaces that a user does not have access to are simply shown as a +X badge.
Two screenshots:
Added "Shared to space" action
This allows users to access the new "Share to space" flyout. It is only enabled for shareable (multi-namespace) saved object types.
Saved Objects Import Flyout
Revamped import options, added "Create new objects" option
Revamped import options (legacy file)
Added import summary
Before, it simply showed a callout with how many objects it attempted to import (and that number was incorrect due to a bug).
Updated import "Overwrite" modal, added super-select for multiple conflicts scenario
This scenario can happen with the advent of shareable saved objects.
Saved Objects Copy to Space Flyout
Revamped copy options, added "Create new objects" option
In addition, space(s) cannot be selected if an object already exists there; this scenario can happen with the advent of shareable saved objects.
Three screenshots:
Revamped copy error resolution / summary
Several screenshots:
Saved Objects Share to Space Flyout
Created flyout
NOTE: These screenshots were taken on 2020/08/12 when this PR is exiting draft state; text / minor UI elements may be out of date after this due to PR review feedback.