Index pattern field editor - Add warning on name or type change#95528
Index pattern field editor - Add warning on name or type change#95528mattkime merged 17 commits intoelastic:masterfrom
Conversation
|
@sebelga It seems that adding the Screen.Recording.2021-03-25.at.6.36.04.PM.mov |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
| }, | ||
| }); | ||
|
|
||
| const changeWarning = i18n.translate('indexPatternFieldEditor.editor.form.changeWarning', { |
There was a problem hiding this comment.
nit: this might be better inside the geti18nTexts handler above.
There was a problem hiding this comment.
The geti18nTexts returns { title: string; description: JSX.Element | string }; and this is a single string.
src/plugins/index_pattern_field_editor/public/components/field_editor/field_editor.tsx
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/kibana-app-services (Team:AppServices) |
|
@elasticmachine merge upstream |
src/plugins/index_pattern_field_editor/public/components/field_editor/field_editor.tsx
Outdated
Show resolved
Hide resolved
…_editor/field_editor.tsx Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
| </EuiFlexGroup> | ||
|
|
||
| {(nameHasChanged || typeHasChanged) && ( | ||
| <EuiFormErrorText data-test-subj="changeWarning">{changeWarning}</EuiFormErrorText> |
There was a problem hiding this comment.
I wonder if a callout warning wouldn't be more appropriate?
{(nameHasChanged || typeHasChanged) && (
<>
<EuiSpacer size="xs" />
<EuiCallOut color="warning" title="Name/type change" iconType="alert" size="s">
{changeWarning}
</EuiCallOut>
</>
)}If we go that path we can then have the translation (title and description) as part of the geti18nTexts() handler.
There was a problem hiding this comment.
I'm curious what @ryankeairns thinks - I agree that its not the best to conflate designs for errors and warnings, but its also odd to have a warning thats larger than an error.
There was a problem hiding this comment.
@sebelga @ryankeairns is out on vacation for a week. I think we should move forward with this and circle back later.
There was a problem hiding this comment.
Maybe @mdefazio could give us his opinion? Basically between the warning message in the screenshot here and the one in the PR description. Thanks!
There was a problem hiding this comment.
Here's some quick thoughts:
- Can we append (or prepend) the warning icon to the form field if it's changed? and then show that message on hover or click?
- Maybe just use the title in the callout instead of title+description. This will shrink the height of the callout and maybe find a middle ground between our concerns.
- Perhaps a simpler option would be to show a confirmation dialog with this message when saving. If we do option 1, I think we would still need this approach too.
Happy to work through some more options as well as these are just some that come to mind.
There was a problem hiding this comment.
To me, the warning callout is too loud. We follow it up with confirm dialog with the same content. Do we really need both? I'm afraid that if we're too loud people might think they're doing something unwise.
I really don't like just showing the title of the warning as then we're failing to explain why we're showing it.
There was a problem hiding this comment.
I don't want to block on this, just sharing the pattern we've been applying in almost all of our forms. When there is something the user needs to be aware of in a form we either user the yellow or the blue callout. Even if it might look "big", if we consider that it is an important information for him to know we use the EuiCallout as they are meant for that.
If we consider it is not that important in the form and prefer just to have to confirm modal, that could be enough. But personally I don't mind having both to inform the user as soon as possible.
But again, happy if we go either way and don't want to block this PR on this. 😊
There was a problem hiding this comment.
I really don't like just showing the title of the warning as then we're failing to explain why we're showing it.
I agree with this, and to be clearer, my thought was putting Changing name or type... into the title prop of the callout. I don't think we need the Name / type change
I don't mean to block this either. So I would prefer seeing either both a callout + modal confirmation or just the modal confirmation.
There was a problem hiding this comment.
I spoke to the runtime fields ui working group about this and we've decided to go with the single line warning callout with icon.
There was a problem hiding this comment.
updated description with new screenshot
|
@elasticmachine merge upstream |
Dosant
left a comment
There was a problem hiding this comment.
Code LGTM,
I agree with https://github.com/elastic/kibana/pull/95528/files#r608551323 that error label doesn't seem like the best fit here
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
Copy LGTM |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
…ax_primary_shard_size * 'master' of github.com:elastic/kibana: (99 commits) added missing optional chain for bracket notation (elastic#96939) [Discover][DocViewer] Fix toggle columns from doc viewer table tab (elastic#95748) [TSVB] Fix per-request caching of index patterns (elastic#97043) [Datatable] Fix filter cell flakiness (elastic#96934) Unskip heatmap suite and fixes flakiness (elastic#96941) [Fleet] Improve performance of data stream API (elastic#97058) [ML] Data Frame Analytics: remove beta badge (elastic#96977) [App Search] Migrate expanded rows for meta engines table in Engines Overview (elastic#96251) Instances latency distribution chart tooltips and axis fixes (elastic#95577) [Monitoring] Using primary average shard size (elastic#96177) [Workplace Search] Hide Kibana chrome on 3rd party connector redirects (elastic#97028) ## [Security Solution] Fixes `Exit full screen` and `Copy to cliboard` styling issues (elastic#96676) Index pattern field editor - Add warning on name or type change (elastic#95528) [App Search] Add small engine breadcrumb utility helper (elastic#96917) Copy esArchiver commands from ./reassign.ts to fix tests (elastic#97012) [Security Solution][Detections] Updates MITRE Tactics, Techniques, and Subtechniques for 7.13 (elastic#97011) Index patterns server - throw correct error on field caps 404 (elastic#95879) Use `EuiThemeProvider` in lists plugin tests and stories (elastic#96129) [npm] upgrade caniuse database (elastic#97002) chore(NA): moving @kbn/apm-utils into bazel (elastic#96227) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts
…to-metrics-tab * 'master' of github.com:elastic/kibana: (61 commits) [Usage collection] Usage counters (elastic#96696) UI actions readme (elastic#96925) [TSVB] Enable brush for visualizations created with no index patterns (elastic#96727) [Data telemetry] Add Async Search to the tests (elastic#96693) added missing optional chain for bracket notation (elastic#96939) [Discover][DocViewer] Fix toggle columns from doc viewer table tab (elastic#95748) [TSVB] Fix per-request caching of index patterns (elastic#97043) [Datatable] Fix filter cell flakiness (elastic#96934) Unskip heatmap suite and fixes flakiness (elastic#96941) [Fleet] Improve performance of data stream API (elastic#97058) [ML] Data Frame Analytics: remove beta badge (elastic#96977) [App Search] Migrate expanded rows for meta engines table in Engines Overview (elastic#96251) Instances latency distribution chart tooltips and axis fixes (elastic#95577) [Monitoring] Using primary average shard size (elastic#96177) [Workplace Search] Hide Kibana chrome on 3rd party connector redirects (elastic#97028) ## [Security Solution] Fixes `Exit full screen` and `Copy to cliboard` styling issues (elastic#96676) Index pattern field editor - Add warning on name or type change (elastic#95528) [App Search] Add small engine breadcrumb utility helper (elastic#96917) Copy esArchiver commands from ./reassign.ts to fix tests (elastic#97012) [Security Solution][Detections] Updates MITRE Tactics, Techniques, and Subtechniques for 7.13 (elastic#97011) ...
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…tic#95528) * add warning on name or type change
…) (#97386) * add warning on name or type change Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Summary
Adds a warning when field name or type is changed.