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

[Snapshot + Restore] Add callout when restoring snapshot #95104

Merged
merged 7 commits into from
Mar 25, 2021

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Mar 22, 2021

This PR adds an info callout when a user enables global state while restoring a snapshot.

Fixes #83014
Fixes #92916

How to test

  1. Specify a local repository when starting ES, e.g., yarn es snapshot --license trial -E path.repo=/tmp/es_backups
  2. Using the Snapshot + Restore UI, create a local repository.
  3. Create an index or add the sample Kibana data.
  4. Create a SLM policy with the index create in step 3 selected and global state enabled (default).
  5. Run the policy and verify successful snapshot.
  6. Find the snapshot created in step 5 and click the "restore" action.
  7. Enable "Restore global state" on the "Logistics" step and verify callout renders.

Screenshots

Screen Shot 2021-03-24 at 1 29 39 PM

// Text change only
Screen Shot 2021-03-22 at 3 49 28 PM

@alisonelizabeth alisonelizabeth added v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI v7.13.0 labels Mar 22, 2021
@alisonelizabeth alisonelizabeth marked this pull request as ready for review March 23, 2021 12:35
@alisonelizabeth alisonelizabeth requested review from a team as code owners March 23, 2021 12:35
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

>
<FormattedMessage
id="xpack.snapshotRestore.restoreForm.stepLogistics.systemIndicesCallOut.description"
defaultMessage="When this snapshot is restored, system indices will be overwritten with data from the snapshot. {learnMoreLink}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original recommended text also included: ... If this is not what you want, set include_global_state to false. This seems self-explanatory as the message only appears in the UI when global state is enabled, so I did not include it. Adding a comment here though in case anyone thinks it would be helpful to add back.

@alisonelizabeth
Copy link
Contributor Author

/cc @gwbrown

Copy link
Contributor

@jrodewig jrodewig left a comment

Choose a reason for hiding this comment

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

LGTM. Copy seems clear. Thanks for this update @alisonelizabeth.

*/}
{includeGlobalState && semverGt(version, '7.12.0') && (
<>
<EuiSpacer size="xs" />
Copy link
Contributor

Choose a reason for hiding this comment

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

This spacing looked a little tight to me in the screenshot. Might be worth checking with Michael?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mdefazio would you mind taking a look? Screenshot in PR description.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just based on looking at the screenshot, here's a rough guideline: (Spacing is tight, but we want to make sure there's more space between the button and the callout).

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed to spacing from xs --> s above the callout, and from l --> xl between the callout and the button. Let me know what you think. @mdefazio I'm not sure if you made a mistake when you said to "drop" 1-2 sizes in the screenshot, when in the original comment you said there should be more space between the button and callout. It's possible I misunderstood the screenshot though 😅 .

Screen Shot 2021-03-23 at 10 04 55 PM

Another idea - we could simplify the callout and only have a title. Something like this (not committed):
Screen Shot 2021-03-23 at 10 06 28 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

My apologies for the poor direction 🤦 . I was simply trying to say that yes, there should be more space between the text and the callout, and it should be a bit less than the space between the button and the callout. So I didn't mean to say you had to change the space between the button and the callout (but the new screenshots look fine)

I like the callout with only the title. It's a bit less obtrusive and feels more straightforward.

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Core CODEOWNER review LGTM

const { docLinks } = useCore();

return (
<EuiCallOut
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about accessibility, I wonder if screen-readers announce the content of this callout when the user enables the global state toggle? If not then I think we should consider rendering the callout even when the toggle is disabled. If the callout is too prominent to show at all times, maybe we could just present it as standard description text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for bringing this up! I've added an aria-live attribute so that it will be read by the screenreader when it is rendered.

If not then I think we should consider rendering the callout even when the toggle is disabled. If the callout is too prominent to show at all times, maybe we could just present it as standard description text.

If there is a general concern that the callout is too prominent, I've also included an example of just using the title in the callout: #95104 (comment). Adding it as a standard description text is a possibility as well.

@alisonelizabeth alisonelizabeth removed the request for review from esdocs March 24, 2021 17:31
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
snapshotRestore 167 176 +9

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
snapshotRestore 455.5KB 468.6KB +13.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 412.1KB 412.2KB +100.0B

History

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

* Note: Once we support features states in the UI, we will also need to add a check here for that
* See https://github.com/elastic/kibana/issues/95128 more details
*/}
{includeGlobalState && semverGt(version, '7.12.0') && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the explanation about features states, it's very helpful to understand the code

Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Hi @alisonelizabeth, code changes LGTM! Tested locally and confirmed the callout is rendered correctly. Thanks a lot for adding tests as well.

@alisonelizabeth alisonelizabeth merged commit 43e3d55 into elastic:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.13.0 v8.0.0
Projects
None yet
8 participants