From 557aac8033630d54fd7761ae7215af842c4ccc02 Mon Sep 17 00:00:00 2001 From: Qxisylolo Date: Wed, 11 Sep 2024 18:11:32 +0800 Subject: [PATCH 1/3] fix/ fix the UI of menu content picker Signed-off-by: Qxisylolo --- .../workspace_menu/workspace_menu.tsx | 194 +++++++++--------- .../workspace_picker_content.tsx | 15 +- 2 files changed, 108 insertions(+), 101 deletions(-) diff --git a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx index bf36fc3844ff..0be39281f384 100644 --- a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx +++ b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx @@ -14,6 +14,7 @@ import { EuiButtonIcon, EuiFlexItem, EuiIcon, + EuiSpacer, EuiFlexGroup, EuiHorizontalRule, EuiButtonEmpty, @@ -86,106 +87,111 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => { button={currentWorkspaceButton} isOpen={isPopoverOpen} closePopover={closePopover} - panelPaddingSize="s" + panelPaddingSize="none" anchorPosition="downCenter" repositionOnScroll={true} > - - + + + {currentWorkspace ? ( + <> + + + + + + {currentWorkspaceName} + + + {getUseCase(currentWorkspace)?.title ?? ''} + + + + ) : ( + <> + + + + + {currentWorkspaceName} + + + )} + + + + + - {currentWorkspace ? ( - <> - - - - - {currentWorkspaceName} - - {getUseCase(currentWorkspace)?.title ?? ''} - - - - ) : ( - <> - - - - - {currentWorkspaceName} - - - )} - - + setPopover(false)} + /> + - - setPopover(false)} - /> + {isDashboardAdmin ? ( + <> + + + + + { + closePopover(); + coreStart.application.navigateToApp(WORKSPACE_LIST_APP_ID); + }} + > + {manageWorkspacesButton} + + + + + { + closePopover(); + coreStart.application.navigateToApp(WORKSPACE_CREATE_APP_ID); + }} + > + {createWorkspaceButton} + + + + + + ) : ( + + )} - - {isDashboardAdmin && ( - - - - - { - closePopover(); - coreStart.application.navigateToApp(WORKSPACE_LIST_APP_ID); - }} - > - {manageWorkspacesButton} - - - - - { - closePopover(); - coreStart.application.navigateToApp(WORKSPACE_CREATE_APP_ID); - }} - > - {createWorkspaceButton} - - - - - )} ); }; diff --git a/src/plugins/workspace/public/components/workspace_picker_content/workspace_picker_content.tsx b/src/plugins/workspace/public/components/workspace_picker_content/workspace_picker_content.tsx index 72fdd67b7367..322ce72bfd85 100644 --- a/src/plugins/workspace/public/components/workspace_picker_content/workspace_picker_content.tsx +++ b/src/plugins/workspace/public/components/workspace_picker_content/workspace_picker_content.tsx @@ -99,7 +99,7 @@ export const WorkspacePickerContent = ({ iconType="wsSelector" data-test-subj="empty-workspace-prompt" title={ - +

{i18n.translate('workspace.picker.empty.state.title', { defaultMessage: 'No workspace available', @@ -138,7 +138,7 @@ export const WorkspacePickerContent = ({ data-test-subj={`workspace-menu-item-${itemType}-${workspace.id}`} icon={ @@ -156,17 +156,18 @@ export const WorkspacePickerContent = ({

{itemType === 'all' ? allWorkspacesTitle : recentWorkspacesTitle}

- - + + {listItems} - + ); }; return ( <> + setSearch(e.target.value)} placeholder={searchFieldPlaceholder} /> - + {queriedRecentWorkspace.length > 0 && getWorkspaceListGroup(queriedRecentWorkspace, 'recent')} From 1ad2dc4a47bc16698187adc7c8330e7c8980e4ed Mon Sep 17 00:00:00 2001 From: Qxisylolo Date: Thu, 12 Sep 2024 14:28:01 +0800 Subject: [PATCH 2/3] fix/ fix manage button position Signed-off-by: Qxisylolo --- .../workspace_menu/workspace_menu.tsx | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx index 0be39281f384..dc20cb7542d8 100644 --- a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx +++ b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx @@ -91,13 +91,19 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => { anchorPosition="downCenter" repositionOnScroll={true} > - + {currentWorkspace ? ( <> @@ -140,8 +146,9 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => { { {isDashboardAdmin ? ( <> - + - + { closePopover(); coreStart.application.navigateToApp(WORKSPACE_LIST_APP_ID); }} > - {manageWorkspacesButton} + {manageWorkspacesButton} @@ -174,6 +182,7 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => { Date: Thu, 12 Sep 2024 14:44:05 +0800 Subject: [PATCH 3/3] fix/ fix manage button position and padding Signed-off-by: Qxisylolo --- .../public/components/workspace_menu/workspace_menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx index dc20cb7542d8..649275e43f18 100644 --- a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx +++ b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx @@ -161,7 +161,7 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => { {isDashboardAdmin ? ( <> - +