-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Transforms: Fixes available fields for sort options for latest configuration #88617
[ML] Transforms: Fixes available fields for sort options for latest configuration #88617
Conversation
Pinging @elastic/ml-ui (:ml) |
@@ -56,7 +56,8 @@ function getOptions( | |||
})); | |||
|
|||
const sortFieldOptions: Array<EuiComboBoxOptionOption<string>> = indexPattern.fields | |||
.filter((v) => !ignoreFieldNames.has(v.name) && v.sortable) | |||
// The backend API for `latest` allows all field types for sort but the UI will be limited to `date`. | |||
.filter((v) => !ignoreFieldNames.has(v.name) && v.sortable && v.type === 'date') |
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.
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.
An alternative solution could be to still make all fields available but group them in the dropdown by field type, with date
fields first, then numbers
, then keyword
.
Something like
date fields
@timestamp
created_at
----
number fields
responsetime
----
other
airline
Screenshot of the grouped dropdown from EUI docs:
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.
As discussed, let's stick to the current implementation and only show date
type fields in the dropdown. Advanced users can switch to the API or dev tools if they really want to use a number
field say. And add some help text below the Sort field input, along the lines of Select the date field to be used to identify the latest document.
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.
That text sounds fine to me. I wonder if we can alternatively change the "Add a sort field...." text in the screenshot to "Add a date field ...." and maybe even "...that identifies the latest documents" if space allows.
...ansform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx
Show resolved
Hide resolved
...ansform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx
Outdated
Show resolved
Hide resolved
...ansform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Lisa Cawley <[email protected]>
...ansform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx
Outdated
Show resolved
Hide resolved
copyToClipboard={copyToClipboardPivot} | ||
copyToClipboardDescription={copyToClipboardPivotDescription} |
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.
Did you consider passing the "Copy to clipboard" component as a child instead of adding extra props?
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.
It's the same prop structure how we pass it on to DataGrid
so didn't want to change that for this PR.
Changed |
@lcawl thanks for the feedback, updated the texts. |
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.
Tested latest edits and LGTM
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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.
LGTM
…onfiguration (elastic#88617) - Fixes the transform preview header to display the heading text in any case and the copy-to-clipboard button for latest configurations (the copy-to-clipboard option for pivot is displayed within the form). - Fix to avoid listing all fields for the sort option for latest configuration and only show date fields - Fixes ambiguous form field labels
…onfiguration (elastic#88617) - Fixes the transform preview header to display the heading text in any case and the copy-to-clipboard button for latest configurations (the copy-to-clipboard option for pivot is displayed within the form). - Fix to avoid listing all fields for the sort option for latest configuration and only show date fields - Fixes ambiguous form field labels
…onfiguration (#88617) (#88934) - Fixes the transform preview header to display the heading text in any case and the copy-to-clipboard button for latest configurations (the copy-to-clipboard option for pivot is displayed within the form). - Fix to avoid listing all fields for the sort option for latest configuration and only show date fields - Fixes ambiguous form field labels
…onfiguration (#88617) (#88933) - Fixes the transform preview header to display the heading text in any case and the copy-to-clipboard button for latest configurations (the copy-to-clipboard option for pivot is displayed within the form). - Fix to avoid listing all fields for the sort option for latest configuration and only show date fields - Fixes ambiguous form field labels
Summary
latest
configurations (the copy-to-clipboard option forpivot
is displayed within the form).sort
option forlatest
configuration and only showdate
fieldsChecklist
For maintainers