-
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
[Cases] Add custom fields: List type #194236
base: main
Are you sure you want to change the base?
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
/ci |
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Closes #176491
Adds the List custom field type to Cases. Also makes some changes to the custom field configuration type system to handle the new features added in this field type.
The List field type creates a
<select>
dropdown with a set ofoptions
determined by the custom field's configuration. Options are defined as{ key: UUID, label: String }
.When the user selects a value, it is saved to the case with the schema
{ key: Custom Field UUID, value: Option UUID }
. The option'slabel
is fetched at runtime by the UI from the custom field configuration, and displayed. This is a deviation from the research issue proposal, which specced a schema of{ key: ${Field UUID}.{Option UUID}, label: Option Label }
. Engineering this turned out to require major changes to the form UI library and the API transformation libraries, and it's a less drastic change to simply convert the key to a label when displaying the field.Option labels can be renamed for free using this new schema, since the UUID is the only thing stored in case saved objects. We don't need to create a new issue to add renaming support.
This PR also allows List fields to be filtered. This required a change from using static
filterOptions
in custom field configurations to a dynamicgetFilterOptions
function. The Toggle field was updated to use this new dynamic function.Known Issues
Due to elastic/eui#8027 drag-and-drop on the new
<OptionsField>
doesn't correctly render the current draggable element inside the flyout. EUI is aiming to fix this before 8.16.Checklist