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] fix pre existing policy with no existing repository #76861

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Sep 7, 2020

Summary

Fix an issue where the snapshot and restore policy creation wizard does not allow you to select a different repo when the pre-existing repo for the policy was deleted - also inform the user of when this has happened.

There is an edge case where a user can be blocked if they only have one other policy to select from; the form will not allow the user to select another repo in this case.

Screenshot

Screenshot 2020-09-09 at 15 45 55

Checklist

Delete any items that are not applicable to this PR.

Release note

The snapshot and restore wizard will now notify a user when a policy configured with a non-existing repository is being updated and require that the user select a new repository.

@jloleysens jloleysens 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.10.0 v7.9.2 labels Sep 7, 2020
@jloleysens jloleysens requested a review from a team as a code owner September 7, 2020 10:38
@elasticmachine
Copy link
Contributor

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

@jloleysens jloleysens requested review from yuliacech and removed request for alisonelizabeth September 7, 2020 14:12
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 @jloleysens,
I tested your changes locally and the fix works!
I was just wondering if it would be possible to make the step invalid when a pre-selected repo was deleted? Since we are setting the value of the select to an empty string, I think the Next button should be disabled. Currently, the form can still progress to "Snapshot settings" step with an empty select, which is not possible when the from first loads (for a new policy).
Also, personally I would prefer having this callout and "no repositories" section similar to each other, maybe make this callout to be of type "danger" or use `SectionError' without the button.
What do you think?

<>
{!policyRepositoryExists && (
<>
<EuiCallOut
Copy link
Contributor

Choose a reason for hiding this comment

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

A screenshot would be 💣 !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@cjcenizal
Copy link
Contributor

@jloleysens Great job spotting and fixing this! Is this fixing a bug from a prior release? If so, can we add the release_note:fix label and add a release note?

@jloleysens jloleysens added release_note:fix and removed release_note:skip Skip the PR/issue when compiling release notes labels Sep 8, 2020
@jloleysens
Copy link
Contributor Author

@yuliacech @cjcenizal Thanks both for the review!

@yuliacech great catch regarding the form not blocking. After your comment about making the callout "danger" I also revised the copy a bit to also mention the currently configured repository and state that that does not exist. Would you mind taking another look?

@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

elasticmachine and others added 3 commits September 8, 2020 02:57
…' of github.com:jloleysens/kibana into ilm/fix/pre-existing-policy-with-no-existing-repository

* 'ilm/fix/pre-existing-policy-with-no-existing-repository' of github.com:jloleysens/kibana:
  fix empty string in selected indices (elastic#76855)
  [Security Solution] Refactor OverviewHost and OverviewNetwork to use Search Strategy (elastic#76409)
  Use Search API in Timelion (sync) (elastic#75115)
  [telemetry] expose getIsOptedIn function in plugin start contract (elastic#75143)
  [ILM] Clean up remaining js files and any typings (elastic#76803)
  [Logs UI] Shared `<LogStream />` component (elastic#76262)
  [Security Solution] Add unit test for all hosts (elastic#76752)
  [Security Solution] Add unit test for authentications search strategy (elastic#76665)
  Do not apply search source data for tsvb (elastic#75137)
  [Security Solution] Refactor NetworkDns to use Search Strategy (elastic#76250)
  [SECURITY SOLUTION] Adds 'cypress:open-as-ci' command (elastic#76125)
  [Logs UI] Update alert executor tests (elastic#75764)
  [Functional] Unskip vega tests and fix flakiness (elastic#76600)
  [Data] Query String Input accepts classname prop (elastic#76848)
  [ML] Swim lane pagination for viewing by job id (elastic#76847)
  [Security Solution] Refactor MatrixHistogram to use Search Strategy (elastic#76603)
  [APM] Use the outcome field to calculate the transaction error rate chart (elastic#75528)
  [APM] Use observer.hostname instead of observer.name (elastic#76074)
  Legacy logging: fix remoteAddress being duplicated in userAgent field (elastic#76751)
@cjcenizal
Copy link
Contributor

cjcenizal commented Sep 8, 2020

@jloleysens I noticed a couple accessibility issues with this change:

  • Clicking on the "Repository" label should focus the select, but it doesn't. You can test this with the labels for the other fields, though it gets a little broken with the "Time" field.
  • There's no aria-label associated with the "Repository" field, meaning that a screen-reader won't be able to tell the user what the field corresponds to.

My suggestion is to move the callout outside of the field/label area and use the EuiFormRow component to group the label and field per the typical pattern. This will solve the accessibility issues I mentioned. The UI will change a bit, but personally I think this visual hierarchy looks a little more familiar. I'm used to seeing callouts above or below forms, but not inside of fields.

image

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 @jloleysens,
thanks for fixing the form validation issue! Tested locally and the Next button is now disabled should the repo have been deleted in between. Apart from accessibility issues @cjcenizal mentioned, I'm good with merging this.

@jloleysens jloleysens merged commit 1c3f0fc into elastic:master Sep 9, 2020
@jloleysens jloleysens deleted the ilm/fix/pre-existing-policy-with-no-existing-repository branch September 9, 2020 13:10
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 9, 2020
…ory (elastic#76861)

* implement fix and add callout with copy

* added test

* make callout a danger callout and revise copy

* block the form if we have a repo, but it does not exist

* added test to assert that form wizard blocks on validation for not found repo

* fix types and add a doc comment

* move callout to above the form

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 9, 2020
…ory (elastic#76861)

* implement fix and add callout with copy

* added test

* make callout a danger callout and revise copy

* block the form if we have a repo, but it does not exist

* added test to assert that form wizard blocks on validation for not found repo

* fix types and add a doc comment

* move callout to above the form

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
snapshotRestore 763.3KB +1.8KB 761.6KB

History

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

jloleysens added a commit that referenced this pull request Sep 9, 2020
…ory (#76861) (#77050)

* implement fix and add callout with copy

* added test

* make callout a danger callout and revise copy

* block the form if we have a repo, but it does not exist

* added test to assert that form wizard blocks on validation for not found repo

* fix types and add a doc comment

* move callout to above the form

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jloleysens added a commit that referenced this pull request Sep 9, 2020
…ory (#76861) (#77051)

* implement fix and add callout with copy

* added test

* make callout a danger callout and revise copy

* block the form if we have a repo, but it does not exist

* added test to assert that form wizard blocks on validation for not found repo

* fix types and add a doc comment

* move callout to above the form

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 9, 2020
* master: (68 commits)
  a11y tests on spaces home page including feature control  (elastic#76515)
  [ML] Transforms list: persist pagination through refresh interval (elastic#76786)
  [ML] Replace all use of date_histogram interval with fixed_interval (elastic#76876)
  [Timelion] Update timelion deprecation links (elastic#77008)
  [Security Solution] Refactor Network Details to use Search Strategy (elastic#76928)
  Upgrade elastic charts to 21.1.2 (elastic#76939)
  [Alerting][Connectors] Refactor Jira: Generic Implementation (phase one) (elastic#73778)
  [Snapshot & Restore] fix pre existing policy with no existing repository (elastic#76861)
  Update saved object management UI text (elastic#76826)
  [Form lib] Add validations prop to UseArray and expose "moveItem" handler (elastic#76949)
  [Logs UI] Use fields api in log stream (elastic#76919)
  [UI Metrics] Support multi-colon keys (elastic#76913)
  [APM] Script for creating functional test archive (elastic#76926)
  [ENDPOINT] First version of the trusted apps list. (elastic#76304)
  Correct field for rum page url (elastic#76916)
  [Security Solution] Fix redirect properly old SIEM App routes (elastic#76868)
  Bump http-proxy from 1.17.0 to 1.18.1 (elastic#76924)
  [RUM Dashboard] Visitor breakdown usability (elastic#76834)
  [Search] Add a new advanced setting searchTimeout (elastic#75728)
  [DOCS] Adds timelion deprecation to new visualize docs structure (elastic#76959)
  ...
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:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.9.2 v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants