[SR] Allow custom index pattern to be used instead of selectable list when choosing indices to restore#41534
Conversation
|
Pinging @elastic/es-ui |
| id="xpack.snapshotRestore.repositoryDetails.reverifyButtonLabel" | ||
| defaultMessage="Re-verify repository" | ||
| id="xpack.snapshotRestore.repositoryDetails.verifyButtonLabel" | ||
| defaultMessage="Verify repository" |
There was a problem hiding this comment.
this is a small copy change @gchaps requested
|
@gchaps Would you please review the copy for the toggle links and the validation error message? Thanks! (The error message under Index Pattern input, not the ES one on review page.) |
💔 Build Failed |
💚 Build Succeeded |
|
We typically use this format for validation on fields: An index is required. Make sure this format is consistent with the rest of the UI (i.e. that the validation on the Name field is "Name is required."_ Also, for the message on the review page, is it possible to change the heading to "Unable to restore snapshot."? I'd prefer not to use the word "execute". Do we need to update the S & R documentation? |
|
@gchaps Thanks for the feedback! The SR doc link doesn't seem to include detailed information about the Restore wizard, so I don't think that needs to be updated. I do remember we worked on a detailed walkthrough for the wizard that includes screenshots of all steps - will that be published? If so, there is probably 1 screenshot that should be updated. |
alisonelizabeth
left a comment
There was a problem hiding this comment.
tested locally and LGTM. i left a couple comments about the UX, let me know what you think.
| )} | ||
| </EuiSelectable> | ||
| ) : ( | ||
| <EuiFieldText |
There was a problem hiding this comment.
What do you think about using the EuiComboBox here instead?
There was a problem hiding this comment.
I think this is a good idea, I'll play around with the combo box placeholder text to make sure the user understands the kind of patterns they can enter
| ), | ||
| }} | ||
| /> | ||
| selectIndicesMode === 'list' ? ( |
There was a problem hiding this comment.
I don't have a good alternative atm, but i'm not sure if it would have been immediately clear to me that the Custom pattern/Show indices link is used to toggle views if i wasn't familiar with the PR changes.
There was a problem hiding this comment.
@gchaps Could you help me with the wording for the toggle links?
Currently they are: Custom pattern and Select indices. You can see them in the screenshots in PR description. I agree with Alison that the current wording doesn't correlate very strongly to the fact that the links themselves toggle between a text input view and a selectable list view.
Maybe they could be: Enter index patterns and Select from indices list instead? Help!! 🙂
There was a problem hiding this comment.
I had the same thought when I looked at the copy. How about "Use index pattern" and "Choose individual indices"?
In terms of prior art, in the Rollup Job Wizard we use "Create cron expression" and "Create basic interval" to switch between two UIs for creating what eventually becomes a cron expression, though I'm not convinced "Create" is the right verb to use here. I think I would prefer "Use".
There was a problem hiding this comment.
@jen-huang Based on the suggestion from @cjcenizal , what about:
Use index pattern
Select index
There was a problem hiding this comment.
Thanks @gchaps! Is there a reason to use "Select index" instead of "Select indices"? Is singular better than plural in these cases?
There was a problem hiding this comment.
@cjcenizal If the user can select more than one index, then "Select indices" is better.
💚 Build Succeeded |
cjcenizal
left a comment
There was a problem hiding this comment.
Code LGTM! Didn't test locally. I found one string which I think we should internationalize and one comment I'd love to see added before merging but the rest of my comments are optional.
|
|
||
| // State for using selectable indices list or custom patterns | ||
| const [selectIndicesMode, setSelectIndicesMode] = useState<'list' | 'custom'>( | ||
| typeof restoreIndices === 'string' || snapshotIndices.length > 100 ? 'custom' : 'list' |
There was a problem hiding this comment.
I love the UX consideration we're making here. I think it warrants a comment, e.g.
// Users with more than 100 indices will probably want to use an index pattern to select
// them instead, so we'll default to showing them the index pattern input.Also, the Index Pattern Wizard shows you a preview of matching indices to your index pattern. Do you think users would benefit from something similar here? Even if so, I would not consider it a blocker for this PR.
There was a problem hiding this comment.
BTW if we do decide to fetch matching indices at some point, #42045 contains a suggestion on how to make that request more efficient.
| options.forEach(({ label, checked }) => { | ||
| if (checked === 'on') { | ||
| newSelectedIndices.push(label); | ||
| {selectIndicesMode === 'list' ? ( |
There was a problem hiding this comment.
Minor nit: we have three parallel branches that depend upon selectIndicesMode, do you think it would make sense to reduce this to a single branch that switches between an IndicesSelect component and an IndexPatternInput component? That would also reduce the size of this file, which is getting lengthy.
| ) : ( | ||
| <EuiComboBox | ||
| options={snapshotIndices.map(index => ({ label: index }))} | ||
| placeholder="Enter index patterns or indices, i.e. logstash-*" |
There was a problem hiding this comment.
I think this needs to be internationalized.
💔 Build Failed |
💚 Build Succeeded |
… when choosing indices to restore (elastic#41534) * Allow user to use custom input instead of selectable list * Small copy change, fix indices toggle link * Remove unused translation * Adjust copy and change index pattern input to combo box * Address PR feedback
…-or-edit-existing-rollup-job * 'master' of github.com:elastic/kibana: (114 commits) [ML] Fixing empty index pattern list (elastic#42299) [Markdown] Shim new platform - cleanup plugin (elastic#41760) [Code] Enable hierarchicalDocumentSymbolSupport for java language server (elastic#42233) Add New Platform mocks for data plugin (elastic#42261) Http server route handler implementation (elastic#41894) [SR] Allow custom index pattern to be used instead of selectable list when choosing indices to restore (elastic#41534) [Code] distributed Code abstraction (elastic#41374) [SIEM] Sets page titles to the current page you are on (elastic#42157) Saved Objects export API stable type order (elastic#42310) cancellation of interpreter execution (elastic#40238) [SIEM] Fixes a crash when Machine Learning influencers is an undefined value (elastic#42198) Changed the job to work with a dedicated index (elastic#42297) FTR: fix testSubjects.missingOrFail (elastic#42290) Increase retry timeout to prevent flaky tests (elastic#42291) Spaces - make space a hidden saved object type (elastic#41688) Allow applications to register feature privileges which are excluded from the base privileges (elastic#41300) Disable flaky log column reorder test (elastic#42285) Fixing add element in element reducer (elastic#42276) Fix infinite loop (elastic#42228) [Maps][File upload] Remove geojson deep clone logic, handle on maps side (elastic#41835) ...





Summary
This PR is an enhancement to #39193. The original work overlooked that fact that when restoring a snapshot, an index pattern can be used to choose which indices to restore instead of index names. This is useful for users with with a large amount of indices and/or time series indices.
With this PR, there is a now a toggle link when the user turns off All Indices. By default, if the snapshot to restore has <= 100 indices, the selectable list will display. If the snapshot to restore has > 100 indices, the custom pattern input will display. The custom pattern input does not do validation against the available indices, so ES error will surface on Review page if it is invalid.
Screenshots
Selectable list input with toggle link to custom pattern input
Custom pattern input with toggle link to selectable list input
Review page using custom pattern input value
rollup*,kibana*,test_indexReview page surfacing an error with invalid index name in custom pattern input