-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Use the displayName property in default editor #73311
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
@@ -57,7 +57,7 @@ export class Field implements IFieldType { | |||
visualizable?: boolean; | |||
scripted?: boolean; | |||
subType?: IFieldSubType; | |||
displayName?: string; | |||
displayName: string; |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
@@ -52,7 +52,7 @@ function FieldParamEditor({ | |||
}: FieldParamEditorProps) { | |||
const [isDirty, setIsDirty] = useState(false); | |||
const selectedOptions: ComboBoxGroupedOptions<IndexPatternField> = value | |||
? [{ label: value.displayName || value.name, target: value }] | |||
? [{ label: value.displayName, target: value }] |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Blocked on elastic/eui#3803 |
@@ -93,7 +93,7 @@ function getAggParamsToRender({ | |||
} | |||
} | |||
fields = filterAggTypeFields(availableFields, agg); | |||
indexedFields = groupAndSortBy(fields, 'type', 'name'); | |||
indexedFields = groupAndSortBy(fields, 'type', 'displayName'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there were displayName duplicates, you could prevent troubles with the EuiComboBox by appending the name
in this case. So it could be ${displayName} (${name})
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we really want this. I mean e.g. the shortDots setting will change the display name. If a user actually will use this, I assume they really want their names shortened, and I have the feeling printing the long name then for them again, kind of defines the purpose of why they used this setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just suggest to display it this way, if there are conflicts with duplicates. so users named 2 fields the same way.
or shortDots converts i.have.cookies
and i.hate.cookies
to i.h.cookies
813b9af
to
89abb0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only "weird" thing that I noticed is the duplicates but as it is going to be fixed on 7.11 then we are fine. I can't find any other regressions and code is LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, merged with #69908 and worked.
Only thing I noticed, that for some cases it would be useful if the search of the Combobox would also search the keys (the original field names)
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
* Use displayName in field list in visualize editor * Set key in combo box * Fix jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* master: [Security Solution][Endpoint][Admin] Malware Protections Notify User Version (elastic#81415) Revert "[Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81390)" [Maps] Use default format when proxying EMS-files (elastic#79760) [Discover] Deangularize context.html (elastic#81442) Use the displayName property in default editor (elastic#73311) adds bug label to Bug report for Security Solution template (elastic#81643) [ML] Transforms: Remove index field limitation for custom query. (elastic#81467) [Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81390) [Task Manager] Mark task as failed if maxAttempts has been met. (elastic#80681) [Lens] Fix URL query loss on redirect (elastic#81475) Log reason for 404 in field existence check (elastic#81315)
* Use displayName in field list in visualize editor * Set key in combo box * Fix jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* master: (87 commits) [Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81778) [i18n] add get_kibana_translation_paths tests (elastic#81624) [UX] Fix search term reset from url (elastic#81654) [Lens] Improved range formatter (elastic#80132) [Resolver] `SideEffectContext` changes, remove `@testing-library` uses (elastic#81077) [Time to Visualize] Update Library Text with Call to Action (elastic#81667) [docs] Resolving failed Kibana upgrade migrations (elastic#80999) [ftr/menuToggle] provide helper for enhanced menu toggle handling (elastic#81709) [Task Manager] adds basic observability into Task Manager's runtime operations (elastic#77868) Doc changes for stack management and grouped feature privileges (elastic#80486) Added functional test for alerts list filters by status, alert type and action type. Did a code refactoring and splitting for alerts tests. (elastic#81422) [Security Solution][Endpoint][Admin] Malware Protections Notify User Version (elastic#81415) Revert "[Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81390)" [Maps] Use default format when proxying EMS-files (elastic#79760) [Discover] Deangularize context.html (elastic#81442) Use the displayName property in default editor (elastic#73311) adds bug label to Bug report for Security Solution template (elastic#81643) [ML] Transforms: Remove index field limitation for custom query. (elastic#81467) [Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81390) [Task Manager] Mark task as failed if maxAttempts has been met. (elastic#80681) ...
Summary
This will make the default vis editor to use the
displayName
instead of thename
property of an index pattern field properly. (It currently already showed it after selection, but not in the list.Easiest way to test this is to enable the
shortDots:enable
setting under advanced settings. Now all field names containing at least a.
should be shortened before that to just one letter per block.This is a preparation for #69908 where users can specify the
displayName
themselves.Known bugs
When opening the checkbox and there are duplicate items the checkmark is shown before both items, not just the one actually selected. That's a bug in EUI and will be still be fixed via (elastic/eui#4162) so ignore this for review, it will be fixed with one of the next EUI upgrades (which happens before the 7.11 release).
Checklist
Delete any items that are not applicable to this PR.
[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibility[ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser[ ] This was checked for cross-browser compatibilityFor maintainers
[ ] This was checked for breaking API changes and was labeled appropriately