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

Sharing saved-objects phase 1.5 #75444

Merged
merged 15 commits into from
Aug 26, 2020
Merged

Conversation

jportner
Copy link
Contributor

@jportner jportner commented Aug 19, 2020

Phase 1.5 from #27004.

Closes #58139
Closes #43873
Closes #48221
Closes #68772
Closes #68958

Overview

This PR makes changes to existing saved object management flows (import, export, copy-to-space) to support multi-namespace (shareable) saved object types. In addition, imports and copy flows have a new option available to "Create new objects with random IDs", which creates a brand new copy of the object. This PR also adds a new user interface for sharing objects.

Changes

Saved Objects Management Table

Added "Shared spaces" column

NOTE: this column is implemented but it is currently disabled. See #69399 (comment) and 10c1cbc for details.

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:

image

image

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.

image

Saved Objects Import Flyout

Revamped import options, added "Create new objects" option

image

Tooltips from top to bottom:

  • "Check if each object was previously imported or copied into the destination space."
  • "All imported objects will be created with new random IDs."
Revamped import options (legacy file)

image

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). New summary after import finishes:

image

Updated import "Overwrite" modal, added super-select for multiple conflicts scenario

This scenario can happen with the advent of shareable saved objects.

image

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.

Two screenshots for an object that exists in the current space and in the "bar" space:

image

Tooltip for spaces cannot be selected:

image

Revamped copy error resolution / summary
  • Now shows actual object icon and title
  • Added "resolve all" option to either overwrite or skip all objects in the selected space
  • Overhauled summary counts at bottom of screen
  • Added support for missing references
  • Overhauled summary icons and tooltips to account for combinations of [conflict, missing references, conflict + missing references]
  • Differentiate "success" summary icon tooltips to inform users whether objects were newly created or overwritten
  • Added super-select for multiple conflicts scenario; this scenario can happen with the advent of shareable saved objects.

Several screenshots:

image

image

image

Saved Objects Share to Space Flyout

Created flyout
  • Allows user to share and "unshare" objects to/from spaces
  • If an object has not yet been shared to another space, it shows a warning callout at the top

Two screenshots...

Flyout:

image

Tooltips when an object has been shared and/or unshared:

image

Docs changes

Preview links for docs changes:

Testing

Some of these changes cannot be tested with the currently available saved object types. I created a sample plugin that adds a new multi-namespace saved object type and provides a UI to generate some saved objects to test with.

This column should not be shown until we at least have one saved
object type that is multi-namespace.
These were unskipped in #74907, but the copy-to-space flyout has
changed. Updated the tests to use new test subject selectors, and
also updated some of the i18n keys to be more consistent.
@jportner jportner marked this pull request as ready for review August 20, 2020 17:26
@jportner jportner requested a review from a team August 20, 2020 17:26
@jportner jportner requested review from a team as code owners August 20, 2020 17:26
@jportner jportner requested review from pgayvallet, legrego, mdefazio and a team August 20, 2020 17:27
docs/api/saved-objects/find.asciidoc Outdated Show resolved Hide resolved
docs/api/saved-objects/find.asciidoc Outdated Show resolved Hide resolved
docs/api/saved-objects/find.asciidoc Outdated Show resolved Hide resolved
docs/api/saved-objects/find.asciidoc Outdated Show resolved Hide resolved
docs/api/saved-objects/find.asciidoc Outdated Show resolved Hide resolved
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Aug 20, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

This is looking awesome. I have a few edits from reviewing the screenshots:
1/ The label for object id is on the right of the select component. I think this needs to be switched to the left.
2/ The space between the warning callout and the import json block could use about 16px-24px of spacing to separate them
3/ I think we should try to find a different icon for overwriting compared to new. I'm not sure the color difference will be enough to make it clear. I will work on getting something to you.
4/ Add a cancel option to the Copy to space flyout opposite the copy button

@jportner
Copy link
Contributor Author

@KOTungseth Thanks for the thorough review. I implemented all of your changes in 3958c02, a couple with slight modifications that I commented on above.

I also noticed that you didn't have any feedback for copy_saved_objects.asciidoc. I inferred some changes based on your comments on the other asciidocs. Let me know if you think any further changes should be made, thanks.


@mdefazio I implemented these changes in 3958c02.

This is looking awesome.

Thanks!

1/ The label for object id is on the right of the select component. I think this needs to be switched to the left.

Sure (see below for screenshot). The cancel button is disabled if:

  • Copy API call is in progress
  • Copy API call finished, and at least one object was successfully copied (e.g. not pending or skipped)
  • Error resolution API call is in progress

2/ The space between the warning callout and the import json block could use about 16px-24px of spacing to separate them

Done, click for screenshot

image

3/ I think we should try to find a different icon for overwriting compared to new. I'm not sure the color difference will be enough to make it clear. I will work on getting something to you.

Agree...

4/ Add a cancel option to the Copy to space flyout opposite the copy button

Good idea, now that I think of it I'm not sure why there wasn't one to begin with 😅

Click for screenshots

Copy flyout:

image

Import overwrite modal:

image

These broke due to the recently merged code for reading request ID
from the X-Opaque-Id header in #71019.
Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

Already reviewed from the PRs targeting the feature branch. Unless anything major changed (in that case, please re-request a review), LGTM

Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

LGTM - code review & local testing.

My in-depth reviews were already done in the feature branch, but I have this another round of local testing, and a re-review of the critical components.

Fantastic job, @jportner!! 👏

@ph
Copy link
Contributor

ph commented Aug 25, 2020

fyi @ruflin

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

Reposting here from our conversation:
Let's change the summary icons for Error to the alert icon and the checkInCircle icon for success. Then I think we can remove the warning color for overwritten.

We will address larger changes for the copy and import summary pages in a separate task.

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

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

Ingest Manager changes* LGTM

*type change in x-pack/plugins/ingest_manager/server/services/epm/kibana/assets/install.ts

- type SavedObjectToBe = Required<Omit<SavedObjectsBulkCreateObject, 'version'>> & {
+ type SavedObjectToBe = Required<Pick<SavedObjectsBulkCreateObject, keyof ArchiveAsset>> & {

Kibana logo was used in a few places, changed it to Elastic logo.
@jportner
Copy link
Contributor Author

jportner commented Aug 26, 2020

Reposting here from our conversation:
Let's change the summary icons for Error to the alert icon and the checkInCircle icon for success. Then I think we can remove the warning color for overwritten.

We will address larger changes for the copy and import summary pages in a separate task.

Made requested changes in bb9e3de and 71a8eef.

Updated import screenshot

image

Updated copy screenshot

image

(Note on the above: I don't have an easy way to surface an error for copy, but the error icon has been changed for it as well).

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

Thanks for making these edits! LGTM!

@jportner
Copy link
Contributor Author

Merging now, will address UI text changes and any additional docs changes in a follow-on PR next week!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
savedObjectsManagement 137 +18 119
spaces 228 +36 192
total +54

async chunks size

id value diff baseline
enterpriseSearch 349.1KB +17.0B 349.0KB
savedObjectsManagement 203.4KB +34.5KB 168.9KB
spaces 45.9KB +122.0B 45.8KB
total +34.6KB

page load bundle size

id value diff baseline
core 1.2MB +2.7KB 1.2MB
savedObjectsManagement 224.5KB +8.1KB 216.4KB
spaces 488.2KB +75.4KB 412.8KB
upgradeAssistant 64.7KB +17.0B 64.7KB
total +86.3KB

Saved Objects .kibana field count

id value diff baseline
originId 1 +1 -

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0 v8.0.0
Projects
None yet
9 participants