From dd669d911873cea6d4bf2f314fdfbc03561928b0 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Tue, 30 Jul 2024 18:00:17 +0800 Subject: [PATCH] feat: optimize description and variable naming Signed-off-by: SuZhou-Joe --- .../chrome/ui/header/collapsible_nav_group_enabled_top.tsx | 6 +++--- src/plugins/dev_tools/public/dev_tools_icon.test.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.tsx b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.tsx index dde8e3a20ba8..8bcb890b812c 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.tsx @@ -43,7 +43,7 @@ export const CollapsibleNavTop = ({ }: CollapsibleNavTopProps) => { const homeLink = useMemo(() => navLinks.find((link) => link.id === 'home'), [navLinks]); - const isInGlobalWorkspace = useMemo( + const isOutsideWorkspace = useMemo( () => !visibleUseCases.find((useCase) => useCase.id === currentNavGroup?.id), [currentNavGroup, visibleUseCases] ); @@ -58,12 +58,12 @@ export const CollapsibleNavTop = ({ return false; } - if (isInGlobalWorkspace) { + if (isOutsideWorkspace) { return true; } return visibleUseCases.length > 1; - }, [visibleUseCases, currentNavGroup, shouldShrinkNavigation, isInGlobalWorkspace]); + }, [visibleUseCases, currentNavGroup, shouldShrinkNavigation, isOutsideWorkspace]); const shouldShowHomeLink = useMemo(() => { if (!homeLink || shouldShrinkNavigation) return false; diff --git a/src/plugins/dev_tools/public/dev_tools_icon.test.tsx b/src/plugins/dev_tools/public/dev_tools_icon.test.tsx index 911cfcfa64dc..47d9a621600f 100644 --- a/src/plugins/dev_tools/public/dev_tools_icon.test.tsx +++ b/src/plugins/dev_tools/public/dev_tools_icon.test.tsx @@ -10,7 +10,7 @@ import { coreMock } from '../../../core/public/mocks'; import { DEFAULT_NAV_GROUPS } from '../../../core/public'; describe('', () => { - it('should call some methods from core service when click', () => { + it('should call chrome.navGroup.setCurrentNavGroup and application.navigateToApp methods from core service when click', () => { const coreStartMock = coreMock.createStart(); const { container } = render(); const component = container.children[0];