-
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] Invalid actions pattern on Transforms management table #70383
Comments
Pinging @elastic/ml-ui (:ml) |
TransformsManagement
table and EUI patterns
Thanks for the ping @thompsongl! We have a related issue here which we wanted to fix for |
That's perfect, @walterra, thanks. |
…ount after button click. (#70555) Related to #70383 and #63455. Refactors the action buttons of the transform and data frame analytics jobs list: Previously custom actions included state and JSX for e.g. confirmation modals. Problem with that: If the actions list popover hides, the modal would unmount too. Since EUI's behaviour will change with the release/merge of #70383, we needed a refactor that solves that issue right now. With this PR, state management for UI behaviour that follows after a button click like the confirmation modals was moved to a custom hook which is part of the outer level of the buttons itself. The modal now also gets mounted on the outer level. This way we won't loose the modals state and DOM rendering when the action button hides. Note that this PR doesn't fix the nested buttons issue (#63455) yet. For that we need EUI issue #70383 to be in Kibana which will arrive with EUI v26.3.0 via #70243. So there will be one follow up to that which will focus on getting rid of the nested button structure.
…ount after button click. (elastic#70555) Related to elastic#70383 and elastic#63455. Refactors the action buttons of the transform and data frame analytics jobs list: Previously custom actions included state and JSX for e.g. confirmation modals. Problem with that: If the actions list popover hides, the modal would unmount too. Since EUI's behaviour will change with the release/merge of elastic#70383, we needed a refactor that solves that issue right now. With this PR, state management for UI behaviour that follows after a button click like the confirmation modals was moved to a custom hook which is part of the outer level of the buttons itself. The modal now also gets mounted on the outer level. This way we won't loose the modals state and DOM rendering when the action button hides. Note that this PR doesn't fix the nested buttons issue (elastic#63455) yet. For that we need EUI issue elastic#70383 to be in Kibana which will arrive with EUI v26.3.0 via elastic#70243. So there will be one follow up to that which will focus on getting rid of the nested button structure.
…ount after button click. (#70555) (#71050) Related to #70383 and #63455. Refactors the action buttons of the transform and data frame analytics jobs list: Previously custom actions included state and JSX for e.g. confirmation modals. Problem with that: If the actions list popover hides, the modal would unmount too. Since EUI's behaviour will change with the release/merge of #70383, we needed a refactor that solves that issue right now. With this PR, state management for UI behaviour that follows after a button click like the confirmation modals was moved to a custom hook which is part of the outer level of the buttons itself. The modal now also gets mounted on the outer level. This way we won't loose the modals state and DOM rendering when the action button hides. Note that this PR doesn't fix the nested buttons issue (#63455) yet. For that we need EUI issue #70383 to be in Kibana which will arrive with EUI v26.3.0 via #70243. So there will be one follow up to that which will focus on getting rid of the nested button structure. Co-authored-by: Elastic Machine <[email protected]>
Fixed by #70555. |
Upgrading EUI to its latest version (#70243,
not yet merged) highlights a component composition pattern that is now incompatible with EUI.The
TransformsManagement
component table row actions (Start, Edit, and Delete) use a pattern where the form component (inside either a modal or a flyout) is rendered from within the actions menu. When the menu closes, the form component is unmounted and closes.EUI altered this category of table actions menu to close by default after an item action has been taken.
The result is that the Start, Edit, and Delete actions cannot be taken, as the launched components are immediately unmounted.
Any workarounds result in event propagation and focus management issues due to the React portal component tree. Our recommendation is to move the Start, Edit, and Delete form components outside of the menu actions themselves to be renedered by a parent with "higher" state.
EUI could mitigate the problem on a temporary basis by providing an opt-out option for the new behavior. This would require a new release, and the added prop would eventually be deprecated.
Happy to discuss, explain more, or give a demo.
cc// @walterra @peteharverson @alvarezmelissa87
The text was updated successfully, but these errors were encountered: