Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dashboard] refactor EditorMenu to AddPanelButton (elastic#208226)
PR refactors `EditorMenu` component into `AddPanelButton` to provide better naming scheme and simplify logic. * replace `COMMON_VISUALIZATION_GROUPING` with `ADD_PANEL_VISUALIZATION_GROUP`. Moved from visualizations plugin to embeddable plugin. * rename `EditorMenu` => `AddPanelButton` * rename `DashboardPanelSelectionListFlyout` => `AddPanelFlyout` * remove unused style `dshSolutionToolbar__editorContextMenu` from editor_menu.scss * Simplify loading of `AddPanelFlyout` contents. Replaced `useGetDashboardPanels` hook with `getMenuItemGroups` function. * avoid loading `AddPanelFlyout` contents until `AddPanelButton` is clicked. `DashboardEditingToolbar` component used to setup `useGetDashboardPanels` hook. Now `AddPanelFlyout` loads contents by directly calling `getMenuItemGroups`. * Added loading state to `AddPanelFlyout` <img width="600" alt="Screenshot 2025-01-24 at 9 21 05 AM" src="https://github.com/user-attachments/assets/b2dfde5f-e347-4745-9ee0-b3268e2138c2" /> --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Hannah Mudge <[email protected]>
- Loading branch information