-
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
[Streams] Schema Editor UX improvements #207066
[Streams] Schema Editor UX improvements #207066
Conversation
65d2eb3
to
8142922
Compare
8142922
to
3d71540
Compare
362e72b
to
65f0831
Compare
x-pack/solutions/observability/plugins/streams_app/.storybook/get_mock_streams_app_context.tsx
Outdated
Show resolved
Hide resolved
...lity/plugins/streams_app/public/components/stream_detail_schema_editor/configuration_maps.ts
Outdated
Show resolved
Hide resolved
...rvability/plugins/streams_app/public/components/stream_detail_schema_editor/field_status.tsx
Outdated
Show resolved
Hide resolved
...rvability/plugins/streams_app/public/components/stream_detail_schema_editor/fields_table.tsx
Outdated
Show resolved
Hide resolved
...y/plugins/streams_app/public/components/stream_detail_schema_editor/filters/filter_group.tsx
Outdated
Show resolved
Hide resolved
}, | ||
} = useKibana(); | ||
|
||
const { fieldsMetadata, loading } = useFieldsMetadata({ |
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.
I've added this. It's not a completely simple change as it's not as easy as just setting a fallback select value as that also needs to be propagated to the editing state, otherwise the user would need to perform the selection again themself.
I've popped that in a useEffect
, it could possibly be hoisted all the way up to the main editing hook, but whilst that co-locates it with some other state, it doesn't really take away from the side effect nature.
This starts to +1 https://github.com/elastic/streams-program/issues/102
As we start to do smarter things with date formats this will be another plus one to the above as the state for that (to generate recommendations etc) will also increase in complexity.
if (!e.target.checked && !isPopularFormat(props.nextFieldFormat)) { | ||
props.setNextFieldFormat(undefined); | ||
} |
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.
note: the other way around shouldn't we clear the input once the user switch to freeform? So they immediately get the placeholder indicating which kind of freedom they have with the example, it currently keep the current format as a text.
Non-blocking comment, as this is mostly a consideration on the UX
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.
Yeah, considered both options here. My thinking was that by keeping it it may set the user up to just amend one of the "popular formats" (if you look at the full list of built in formats they're often just very similar derivatives).
Could see arguments either way, so will defer to @patpscal 😁
…0/kibana into 53-schema-editor-ux-improvements
@tonyghiani Thanks for the review! I've responded to everything bar the small UX question r.e. feeform mode. One side note, there is an edge case where technically you could get an ECS recommendation but we don't support the type in Streams themselves (we support a subset of types right now). In that case it won't try to set the recommendation automatically. UX wise we might need to have separate wording for "this is the recommendation but it is unsupported by streams" or maybe we just hide it altogether if unsupported (but not unknown). Anyway, I've left it as is for now, but we can refine if needed. |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
cc @Kerry350 |
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, thanks for applying these changes!
Starting backport for target branches: 8.x |
## Summary Closes elastic/streams-program#53 ## Overview of changes Enhanced filters for status / type. I omitted field parent (in designs) as this feels superfluous (can likely be facilitated via the inherited status). ![Screenshot 2025-01-21 at 14 39 53](https://github.com/user-attachments/assets/4ea43477-0fb7-4f29-9522-d2fabfd653a3) Children in the children affected callout are now linked ![Screenshot 2025-01-21 at 14 40 23](https://github.com/user-attachments/assets/0ce040c0-f6fc-479c-8941-25a493f1349a) ECS recommendations are given for type if available ![Screenshot 2025-01-21 at 14 40 41](https://github.com/user-attachments/assets/ab47f839-8a59-47af-898d-f7eb93de3107) For format (with date type) some popular options are now provided in a select. It's not exhaustive as there are **a lot** of format options. A toggle to switch to a freeform mode is provided. ![Screenshot 2025-01-21 at 14 41 10](https://github.com/user-attachments/assets/f89a9c14-d711-495d-a6df-54288d12592b) ![Screenshot 2025-01-21 at 14 41 20](https://github.com/user-attachments/assets/078733bd-dc19-435f-a10a-271723ab2c9f) Data Grid toolbar is added ![Screenshot 2025-01-21 at 14 41 42](https://github.com/user-attachments/assets/f234b965-9d90-452c-b0e5-8f918bc85756) Field parent link in badges is now more obvious ![Screenshot 2025-01-21 at 14 41 56](https://github.com/user-attachments/assets/001ed451-7930-48da-beba-95865b79a0bd) The only thing I haven't added from the nice to haves was the refresh button, I think we should wait to see if we actually need this (as it's technically a refresh of two entities - the definition and the unmapped fields). --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 8832cc4)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Could we create a follow-up issue for this? I think it would be really helpful to have this, I've found myself sitting on the schema editor page and waiting for docs to come in to make certain fields show up on the list. Together with the fact that the unmapped field list is not 100% reliable because it relies on sampling I think it's an important feature. |
# Backport This will backport the following commits from `main` to `8.x`: - [[Streams] Schema Editor UX improvements (#207066)](#207066) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kerry Gallagher","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-23T10:14:12Z","message":"[Streams] Schema Editor UX improvements (#207066)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/streams-program/issues/53\r\n\r\n## Overview of changes\r\n\r\nEnhanced filters for status / type. \r\n\r\nI omitted field parent (in designs) as this feels superfluous (can\r\nlikely be facilitated via the inherited status).\r\n \r\n![Screenshot 2025-01-21 at 14 39\r\n53](https://github.com/user-attachments/assets/4ea43477-0fb7-4f29-9522-d2fabfd653a3)\r\n\r\nChildren in the children affected callout are now linked\r\n\r\n![Screenshot 2025-01-21 at 14 40\r\n23](https://github.com/user-attachments/assets/0ce040c0-f6fc-479c-8941-25a493f1349a)\r\n\r\nECS recommendations are given for type if available\r\n\r\n![Screenshot 2025-01-21 at 14 40\r\n41](https://github.com/user-attachments/assets/ab47f839-8a59-47af-898d-f7eb93de3107)\r\n\r\nFor format (with date type) some popular options are now provided in a\r\nselect. It's not exhaustive as there are **a lot** of format options. A\r\ntoggle to switch to a freeform mode is provided.\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n10](https://github.com/user-attachments/assets/f89a9c14-d711-495d-a6df-54288d12592b)\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n20](https://github.com/user-attachments/assets/078733bd-dc19-435f-a10a-271723ab2c9f)\r\n\r\nData Grid toolbar is added\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n42](https://github.com/user-attachments/assets/f234b965-9d90-452c-b0e5-8f918bc85756)\r\n\r\nField parent link in badges is now more obvious\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n56](https://github.com/user-attachments/assets/001ed451-7930-48da-beba-95865b79a0bd)\r\n\r\nThe only thing I haven't added from the nice to haves was the refresh\r\nbutton, I think we should wait to see if we actually need this (as it's\r\ntechnically a refresh of two entities - the definition and the unmapped\r\nfields).\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"8832cc4289df403f2d690c19794e6c253b3c8d6b","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.18.0","Feature:Streams"],"title":"[Streams] Schema Editor UX improvements","number":207066,"url":"https://github.com/elastic/kibana/pull/207066","mergeCommit":{"message":"[Streams] Schema Editor UX improvements (#207066)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/streams-program/issues/53\r\n\r\n## Overview of changes\r\n\r\nEnhanced filters for status / type. \r\n\r\nI omitted field parent (in designs) as this feels superfluous (can\r\nlikely be facilitated via the inherited status).\r\n \r\n![Screenshot 2025-01-21 at 14 39\r\n53](https://github.com/user-attachments/assets/4ea43477-0fb7-4f29-9522-d2fabfd653a3)\r\n\r\nChildren in the children affected callout are now linked\r\n\r\n![Screenshot 2025-01-21 at 14 40\r\n23](https://github.com/user-attachments/assets/0ce040c0-f6fc-479c-8941-25a493f1349a)\r\n\r\nECS recommendations are given for type if available\r\n\r\n![Screenshot 2025-01-21 at 14 40\r\n41](https://github.com/user-attachments/assets/ab47f839-8a59-47af-898d-f7eb93de3107)\r\n\r\nFor format (with date type) some popular options are now provided in a\r\nselect. It's not exhaustive as there are **a lot** of format options. A\r\ntoggle to switch to a freeform mode is provided.\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n10](https://github.com/user-attachments/assets/f89a9c14-d711-495d-a6df-54288d12592b)\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n20](https://github.com/user-attachments/assets/078733bd-dc19-435f-a10a-271723ab2c9f)\r\n\r\nData Grid toolbar is added\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n42](https://github.com/user-attachments/assets/f234b965-9d90-452c-b0e5-8f918bc85756)\r\n\r\nField parent link in badges is now more obvious\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n56](https://github.com/user-attachments/assets/001ed451-7930-48da-beba-95865b79a0bd)\r\n\r\nThe only thing I haven't added from the nice to haves was the refresh\r\nbutton, I think we should wait to see if we actually need this (as it's\r\ntechnically a refresh of two entities - the definition and the unmapped\r\nfields).\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"8832cc4289df403f2d690c19794e6c253b3c8d6b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207066","number":207066,"mergeCommit":{"message":"[Streams] Schema Editor UX improvements (#207066)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/streams-program/issues/53\r\n\r\n## Overview of changes\r\n\r\nEnhanced filters for status / type. \r\n\r\nI omitted field parent (in designs) as this feels superfluous (can\r\nlikely be facilitated via the inherited status).\r\n \r\n![Screenshot 2025-01-21 at 14 39\r\n53](https://github.com/user-attachments/assets/4ea43477-0fb7-4f29-9522-d2fabfd653a3)\r\n\r\nChildren in the children affected callout are now linked\r\n\r\n![Screenshot 2025-01-21 at 14 40\r\n23](https://github.com/user-attachments/assets/0ce040c0-f6fc-479c-8941-25a493f1349a)\r\n\r\nECS recommendations are given for type if available\r\n\r\n![Screenshot 2025-01-21 at 14 40\r\n41](https://github.com/user-attachments/assets/ab47f839-8a59-47af-898d-f7eb93de3107)\r\n\r\nFor format (with date type) some popular options are now provided in a\r\nselect. It's not exhaustive as there are **a lot** of format options. A\r\ntoggle to switch to a freeform mode is provided.\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n10](https://github.com/user-attachments/assets/f89a9c14-d711-495d-a6df-54288d12592b)\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n20](https://github.com/user-attachments/assets/078733bd-dc19-435f-a10a-271723ab2c9f)\r\n\r\nData Grid toolbar is added\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n42](https://github.com/user-attachments/assets/f234b965-9d90-452c-b0e5-8f918bc85756)\r\n\r\nField parent link in badges is now more obvious\r\n\r\n![Screenshot 2025-01-21 at 14 41\r\n56](https://github.com/user-attachments/assets/001ed451-7930-48da-beba-95865b79a0bd)\r\n\r\nThe only thing I haven't added from the nice to haves was the refresh\r\nbutton, I think we should wait to see if we actually need this (as it's\r\ntechnically a refresh of two entities - the definition and the unmapped\r\nfields).\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"8832cc4289df403f2d690c19794e6c253b3c8d6b"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Kerry Gallagher <[email protected]>
## Summary Closes elastic/streams-program#53 ## Overview of changes Enhanced filters for status / type. I omitted field parent (in designs) as this feels superfluous (can likely be facilitated via the inherited status). ![Screenshot 2025-01-21 at 14 39 53](https://github.com/user-attachments/assets/4ea43477-0fb7-4f29-9522-d2fabfd653a3) Children in the children affected callout are now linked ![Screenshot 2025-01-21 at 14 40 23](https://github.com/user-attachments/assets/0ce040c0-f6fc-479c-8941-25a493f1349a) ECS recommendations are given for type if available ![Screenshot 2025-01-21 at 14 40 41](https://github.com/user-attachments/assets/ab47f839-8a59-47af-898d-f7eb93de3107) For format (with date type) some popular options are now provided in a select. It's not exhaustive as there are **a lot** of format options. A toggle to switch to a freeform mode is provided. ![Screenshot 2025-01-21 at 14 41 10](https://github.com/user-attachments/assets/f89a9c14-d711-495d-a6df-54288d12592b) ![Screenshot 2025-01-21 at 14 41 20](https://github.com/user-attachments/assets/078733bd-dc19-435f-a10a-271723ab2c9f) Data Grid toolbar is added ![Screenshot 2025-01-21 at 14 41 42](https://github.com/user-attachments/assets/f234b965-9d90-452c-b0e5-8f918bc85756) Field parent link in badges is now more obvious ![Screenshot 2025-01-21 at 14 41 56](https://github.com/user-attachments/assets/001ed451-7930-48da-beba-95865b79a0bd) The only thing I haven't added from the nice to haves was the refresh button, I think we should wait to see if we actually need this (as it's technically a refresh of two entities - the definition and the unmapped fields). --------- Co-authored-by: kibanamachine <[email protected]>
## Summary Closes elastic/streams-program#53 ## Overview of changes Enhanced filters for status / type. I omitted field parent (in designs) as this feels superfluous (can likely be facilitated via the inherited status). ![Screenshot 2025-01-21 at 14 39 53](https://github.com/user-attachments/assets/4ea43477-0fb7-4f29-9522-d2fabfd653a3) Children in the children affected callout are now linked ![Screenshot 2025-01-21 at 14 40 23](https://github.com/user-attachments/assets/0ce040c0-f6fc-479c-8941-25a493f1349a) ECS recommendations are given for type if available ![Screenshot 2025-01-21 at 14 40 41](https://github.com/user-attachments/assets/ab47f839-8a59-47af-898d-f7eb93de3107) For format (with date type) some popular options are now provided in a select. It's not exhaustive as there are **a lot** of format options. A toggle to switch to a freeform mode is provided. ![Screenshot 2025-01-21 at 14 41 10](https://github.com/user-attachments/assets/f89a9c14-d711-495d-a6df-54288d12592b) ![Screenshot 2025-01-21 at 14 41 20](https://github.com/user-attachments/assets/078733bd-dc19-435f-a10a-271723ab2c9f) Data Grid toolbar is added ![Screenshot 2025-01-21 at 14 41 42](https://github.com/user-attachments/assets/f234b965-9d90-452c-b0e5-8f918bc85756) Field parent link in badges is now more obvious ![Screenshot 2025-01-21 at 14 41 56](https://github.com/user-attachments/assets/001ed451-7930-48da-beba-95865b79a0bd) The only thing I haven't added from the nice to haves was the refresh button, I think we should wait to see if we actually need this (as it's technically a refresh of two entities - the definition and the unmapped fields). --------- Co-authored-by: kibanamachine <[email protected]>
## Summary Closes elastic/streams-program#53 ## Overview of changes Enhanced filters for status / type. I omitted field parent (in designs) as this feels superfluous (can likely be facilitated via the inherited status). ![Screenshot 2025-01-21 at 14 39 53](https://github.com/user-attachments/assets/4ea43477-0fb7-4f29-9522-d2fabfd653a3) Children in the children affected callout are now linked ![Screenshot 2025-01-21 at 14 40 23](https://github.com/user-attachments/assets/0ce040c0-f6fc-479c-8941-25a493f1349a) ECS recommendations are given for type if available ![Screenshot 2025-01-21 at 14 40 41](https://github.com/user-attachments/assets/ab47f839-8a59-47af-898d-f7eb93de3107) For format (with date type) some popular options are now provided in a select. It's not exhaustive as there are **a lot** of format options. A toggle to switch to a freeform mode is provided. ![Screenshot 2025-01-21 at 14 41 10](https://github.com/user-attachments/assets/f89a9c14-d711-495d-a6df-54288d12592b) ![Screenshot 2025-01-21 at 14 41 20](https://github.com/user-attachments/assets/078733bd-dc19-435f-a10a-271723ab2c9f) Data Grid toolbar is added ![Screenshot 2025-01-21 at 14 41 42](https://github.com/user-attachments/assets/f234b965-9d90-452c-b0e5-8f918bc85756) Field parent link in badges is now more obvious ![Screenshot 2025-01-21 at 14 41 56](https://github.com/user-attachments/assets/001ed451-7930-48da-beba-95865b79a0bd) The only thing I haven't added from the nice to haves was the refresh button, I think we should wait to see if we actually need this (as it's technically a refresh of two entities - the definition and the unmapped fields). --------- Co-authored-by: kibanamachine <[email protected]>
Summary
Closes https://github.com/elastic/streams-program/issues/53
Overview of changes
Enhanced filters for status / type.
I omitted field parent (in designs) as this feels superfluous (can likely be facilitated via the inherited status).
Children in the children affected callout are now linked
ECS recommendations are given for type if available
For format (with date type) some popular options are now provided in a select. It's not exhaustive as there are a lot of format options. A toggle to switch to a freeform mode is provided.
Data Grid toolbar is added
Field parent link in badges is now more obvious
The only thing I haven't added from the nice to haves was the refresh button, I think we should wait to see if we actually need this (as it's technically a refresh of two entities - the definition and the unmapped fields).