From 9b9d98e9c6c2855db148a2d0574bb310490a8f9a Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Wed, 11 Sep 2024 18:57:58 +0800 Subject: [PATCH 01/21] fix: fix width Signed-off-by: SuZhou-Joe --- .../__snapshots__/feature_cards.test.tsx.snap | 64 +++++++------------ .../feature_cards/feature_cards.test.tsx | 3 +- .../feature_cards/feature_cards.tsx | 55 ++++++---------- 3 files changed, 44 insertions(+), 78 deletions(-) diff --git a/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap b/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap index e5f9a1975d83..59d957733871 100644 --- a/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap +++ b/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap @@ -11,15 +11,15 @@ exports[` render with complex navLinks 1`] = ` class="euiSpacer euiSpacer--m" />
render with complex navLinks 1`] = `
render with complex navLinks 1`] = `
render with complex navLinks 1`] = `
render with complex navLinks 1`] = `
-
-
render with complex navLinks 1`] = `
-
-
-
render with complex navLinks 1`] = ` class="euiSpacer euiSpacer--m" />
render with complex navLinks 1`] = `
render with complex navLinks 1`] = `
render with complex navLinks 1`] = `
render with complex navLinks 1`] = `
-
-
render with complex navLinks 1`] = `
-
-
-
', () => { }); it('render with complex navLinks', () => { - const { container, getAllByTestId } = render( + const { container } = render( ', () => { /> ); expect(container).toMatchSnapshot(); - expect(getAllByTestId('landingPageRow_1').length).toEqual(2); }); it('click item', () => { diff --git a/src/plugins/management/public/components/feature_cards/feature_cards.tsx b/src/plugins/management/public/components/feature_cards/feature_cards.tsx index d308f185d602..2d2a3756654f 100644 --- a/src/plugins/management/public/components/feature_cards/feature_cards.tsx +++ b/src/plugins/management/public/components/feature_cards/feature_cards.tsx @@ -30,26 +30,20 @@ export const FeatureCards = ({ pageDescription, navigationUI: { HeaderControl }, }: FeatureCardsProps) => { - const itemsPerRow = 4; const groupedCardForDisplay = useMemo(() => { - const grouped: Array<{ category?: AppCategory; navLinks: ChromeNavLink[][] }> = []; + const grouped: Array<{ category?: AppCategory; navLinks: ChromeNavLink[] }> = []; // The navLinks has already been sorted based on link / category's order, // so it is safe to group the links here. navLinks.forEach((link) => { let lastGroup = grouped.length ? grouped[grouped.length - 1] : undefined; if (!lastGroup || lastGroup.category?.id !== link.category?.id) { - lastGroup = { category: link.category, navLinks: [[]] }; + lastGroup = { category: link.category, navLinks: [] }; grouped.push(lastGroup); } - const lastRow = lastGroup.navLinks[lastGroup.navLinks.length - 1]; - if (lastRow.length < itemsPerRow) { - lastRow.push(link); - } else { - lastGroup.navLinks.push([link]); - } + lastGroup.navLinks.push(link); }); return grouped; - }, [itemsPerRow, navLinks]); + }, [navLinks]); if (!navLinks.length) { return null; } @@ -72,30 +66,23 @@ export const FeatureCards = ({ )} - {group.navLinks.map((row, rowIndex) => { - return ( - - {Array.from({ length: itemsPerRow }).map((item, itemIndexInRow) => { - const link = row[itemIndexInRow]; - const content = link ? ( - navigateToApp(link.id)} - titleSize="xs" - /> - ) : null; - return ( - - {content} - - ); - })} - - ); - })} + + {group.navLinks.map((link, index) => { + return ( + + navigateToApp(link.id)} + titleSize="xs" + style={{ width: 200 }} + /> + + ); + })} +
))} From 638c902263090b5cb5a02044c8a54912949d9dcc Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Wed, 11 Sep 2024 19:09:43 +0800 Subject: [PATCH 02/21] feat: use workspace color Signed-off-by: SuZhou-Joe --- .../ui/header/collapsible_nav_group_enabled_top.scss | 3 --- .../ui/header/collapsible_nav_group_enabled_top.tsx | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) delete mode 100644 src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.scss diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.scss b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.scss deleted file mode 100644 index 25f4385775ec..000000000000 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.scss +++ /dev/null @@ -1,3 +0,0 @@ -.leftNavTopIcon { - color: $euiColorMediumShade; -} 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 3d1535992a3f..15a41c13d523 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 @@ -22,7 +22,13 @@ import { ChromeNavGroupServiceStartContract, NavGroupItemInMap } from '../../nav import { ChromeNavLink } from '../../nav_links'; import { ALL_USE_CASE_ID } from '../../../../../core/utils'; import { fulfillRegistrationLinksToChromeNavLinks } from '../../utils'; -import './collapsible_nav_group_enabled_top.scss'; + +// Reference https://github.com/opensearch-project/oui/blob/main/src/services/color/is_valid_hex.ts +const validateWorkspaceColor = (color?: string) => + !!color && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color); + +const getValidWorkspaceColor = (color?: string) => + validateWorkspaceColor(color) ? color : undefined; export interface CollapsibleNavTopProps { homeLink?: ChromeNavLink; @@ -131,8 +137,8 @@ export const CollapsibleNavTop = ({ From c70d8a919bd2f38ce468771480f42838cdd3db7a Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:14:12 +0000 Subject: [PATCH 03/21] Changeset file for PR #8140 created/updated --- changelogs/fragments/8140.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/8140.yml diff --git a/changelogs/fragments/8140.yml b/changelogs/fragments/8140.yml new file mode 100644 index 000000000000..3efd2aff2257 --- /dev/null +++ b/changelogs/fragments/8140.yml @@ -0,0 +1,2 @@ +feat: +- [navigation] Fit and finish issues collective for left nav and landing page ([#8140](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8140)) \ No newline at end of file From 57fe9a41b0e4bc3bbf0bb4715842cdbc58880816 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Wed, 11 Sep 2024 19:50:47 +0800 Subject: [PATCH 04/21] feat: style fit and finish for left nav Signed-off-by: SuZhou-Joe --- ...ollapsible_nav_group_enabled.test.tsx.snap | 18 ++++++++++--- .../collapsible_nav_groups.test.tsx.snap | 9 +++++-- .../header/collapsible_nav_group_enabled.scss | 25 +++++++++++++++++-- .../header/collapsible_nav_group_enabled.tsx | 1 + .../collapsible_nav_group_enabled_top.tsx | 2 +- .../ui/header/collapsible_nav_groups.tsx | 13 ++++++++-- 6 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap index b3a010659c21..8977d03f7d98 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap @@ -22,6 +22,7 @@ exports[` should render correctly 1`] = `
should render correctly 1`] = ` >
link-in-all
@@ -59,7 +61,7 @@ exports[` should render correctly 1`] = `
should render correctly 1`] = ` title="Observability" > @@ -101,6 +103,7 @@ exports[` should render correctly 1`] = ` >
link-in-observability
@@ -132,6 +135,7 @@ exports[` should render correctly 1`] = ` >
See all...
@@ -144,7 +148,7 @@ exports[` should render correctly 1`] = `
should render correctly 1`] = ` title="Essentials" > @@ -186,6 +190,7 @@ exports[` should render correctly 1`] = ` >
link-in-essentials
@@ -217,6 +222,7 @@ exports[` should render correctly 1`] = ` >
See all...
@@ -289,6 +295,7 @@ exports[` should show all use case by default and
should show all use case by default and >
link-in-essentials
@@ -362,6 +370,7 @@ exports[` should show all use case when current na
should show all use case when current na >
link-in-essentials
diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap index 3d923a49dd80..097e41e560f3 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap @@ -47,6 +47,7 @@ exports[` should render correctly 1`] = ` >
pure link
@@ -77,6 +78,7 @@ exports[` should render correctly 1`] = ` >
subLink
@@ -89,7 +91,7 @@ exports[` should render correctly 1`] = `
should render correctly 1`] = ` title="category-1" > @@ -131,6 +133,7 @@ exports[` should render correctly 1`] = ` >
link-in-category
@@ -161,6 +164,7 @@ exports[` should render correctly 1`] = ` >
sub-link-in-category
@@ -188,6 +192,7 @@ exports[` should render correctly 1`] = ` >
link-in-category-2
diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss index 27537d9af8eb..f709a7f3270f 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss @@ -1,15 +1,23 @@ .context-nav-wrapper { border: none !important; + .leftNavGroupTitle { + padding: 0 $euiSizeS; + font-weight: 400; + } + .nav-link-item { - padding: calc($euiSize / 4) $euiSize; - border-radius: $euiSize; + padding: $euiSizeS $euiSize; + border-radius: $euiSizeS; + font-size: 14px; box-shadow: none; margin-bottom: 0; margin-top: 0; .nav-link-item-btn { margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; &::after { display: none; @@ -17,6 +25,19 @@ } } + .nav-link-item-category-item { + margin-top: $euiSizeL; + + > * { + margin-bottom: 0; + } + } + + .nav-link-item-category-title { + line-height: 16px; + padding: $euiSizeS $euiSize; + } + .nav-link-parent-item-button { > span { flex-direction: row-reverse; diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.tsx b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.tsx index d08e2a413d42..e048ceff211b 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.tsx @@ -324,6 +324,7 @@ export function CollapsibleNavGroupEnabled({ paddingSize={!isNavOpen ? 's' : 'l'} hasShadow={false} className="eui-yScroll flex-1-container" + style={{ paddingTop: 0 }} > {shouldShowCollapsedNavHeaderContent && collapsibleNavHeaderRender ? ( <> 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 15a41c13d523..2b52979db9de 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 @@ -157,7 +157,7 @@ export const CollapsibleNavTop = ({ {currentNavGroup?.title && ( <> - {currentNavGroup?.title} + {currentNavGroup?.title} )} diff --git a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx index 53a75aeaaddd..431d9295dfae 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx @@ -58,7 +58,11 @@ export function NavGroups({ return { id: `${link.id}-${link.title}`, - name: {link.title}, + name: ( + + {link.title} + + ), onClick: euiListItem.onClick, href: euiListItem.href, emphasize: euiListItem.isActive, @@ -128,9 +132,14 @@ export function NavGroups({ if (navLink.itemType === LinkItemType.CATEGORY) { return { id: navLink.category?.id ?? '', - name:
{navLink.category?.label ?? ''}
, + name: ( +
+ {navLink.category?.label ?? ''} +
+ ), items: navLink.links?.map((link) => createSideNavItem(link, level + 1)), 'aria-label': navLink.category?.label, + className: 'nav-link-item-category-item', }; } From 5d12a8f3fd9eb86c3f262634f8d4f16c5856cca1 Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 09:56:37 +0000 Subject: [PATCH 05/21] Changeset file for PR #8140 created/updated --- changelogs/fragments/8140.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/8140.yml b/changelogs/fragments/8140.yml index 3efd2aff2257..10b904e18356 100644 --- a/changelogs/fragments/8140.yml +++ b/changelogs/fragments/8140.yml @@ -1,2 +1,2 @@ feat: -- [navigation] Fit and finish issues collective for left nav and landing page ([#8140](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8140)) \ No newline at end of file +- [navigation] Adjust the appearances of the left navigation menu and the landing page ([#8140](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8140)) \ No newline at end of file From 901a4f18d15c33a01808165df8993d3d29299ca0 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 13 Sep 2024 18:12:55 +0800 Subject: [PATCH 06/21] feat: update code Signed-off-by: SuZhou-Joe --- .../ui/header/collapsible_nav_group_enabled_top.tsx | 9 +-------- .../public/components/feature_cards/feature_cards.tsx | 4 ++-- 2 files changed, 3 insertions(+), 10 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 2b52979db9de..03a04e4076e7 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 @@ -23,13 +23,6 @@ import { ChromeNavLink } from '../../nav_links'; import { ALL_USE_CASE_ID } from '../../../../../core/utils'; import { fulfillRegistrationLinksToChromeNavLinks } from '../../utils'; -// Reference https://github.com/opensearch-project/oui/blob/main/src/services/color/is_valid_hex.ts -const validateWorkspaceColor = (color?: string) => - !!color && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color); - -const getValidWorkspaceColor = (color?: string) => - validateWorkspaceColor(color) ? color : undefined; - export interface CollapsibleNavTopProps { homeLink?: ChromeNavLink; navGroupsMap: Record; @@ -138,7 +131,7 @@ export const CollapsibleNavTop = ({ type={icon} size="l" data-test-subj={`collapsibleNavIcon-${icon}`} - color={getValidWorkspaceColor(currentWorkspace?.color)} + color={currentWorkspace?.color} /> diff --git a/src/plugins/management/public/components/feature_cards/feature_cards.tsx b/src/plugins/management/public/components/feature_cards/feature_cards.tsx index 2d2a3756654f..4ffdd917b2c3 100644 --- a/src/plugins/management/public/components/feature_cards/feature_cards.tsx +++ b/src/plugins/management/public/components/feature_cards/feature_cards.tsx @@ -74,10 +74,10 @@ export const FeatureCards = ({ data-test-subj={`landingPageFeature_${link.id}`} textAlign="left" title={link.title} - description={link.description || link.title} + description={link.description || ''} onClick={() => navigateToApp(link.id)} titleSize="xs" - style={{ width: 200 }} + style={{ width: 240 }} /> ); From 8219107d89fadbc652a3a0cf4573f75155734491 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Sat, 14 Sep 2024 17:32:17 +0800 Subject: [PATCH 07/21] feat: update style Signed-off-by: SuZhou-Joe --- .../chrome/ui/header/collapsible_nav_group_enabled.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss index f709a7f3270f..ee313efaeb53 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss @@ -16,8 +16,7 @@ .nav-link-item-btn { margin-bottom: 0; - padding-top: 0; - padding-bottom: 0; + padding: 0; &::after { display: none; @@ -35,7 +34,7 @@ .nav-link-item-category-title { line-height: 16px; - padding: $euiSizeS $euiSize; + padding: $euiSizeS; } .nav-link-parent-item-button { From 1da3a34e063137895403768c1e6b9ce0b52d745f Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Sat, 14 Sep 2024 17:47:01 +0800 Subject: [PATCH 08/21] feat: update padding Signed-off-by: SuZhou-Joe --- .../public/chrome/ui/header/collapsible_nav_group_enabled.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss index ee313efaeb53..158a87cd4a06 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss @@ -2,7 +2,6 @@ border: none !important; .leftNavGroupTitle { - padding: 0 $euiSizeS; font-weight: 400; } From b74973a6a3ead877fcc1faa0059ce4d6cdda73a1 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 20 Sep 2024 16:48:57 +0800 Subject: [PATCH 09/21] feat: update Signed-off-by: SuZhou-Joe --- .../chrome/ui/header/collapsible_nav_group_enabled.scss | 5 +++-- src/core/public/chrome/ui/header/collapsible_nav_groups.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss index 158a87cd4a06..5b7a489e12ac 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss @@ -3,6 +3,7 @@ .leftNavGroupTitle { font-weight: 400; + font-size: 18px; } .nav-link-item { @@ -42,7 +43,7 @@ > * { margin-right: $euiSizeS; - margin-left: 2px; + margin-left: 0; } } } @@ -56,7 +57,7 @@ } .nav-nested-item { - margin-bottom: 4px; + margin-left: -10px; &::after { height: unset; diff --git a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx index 431d9295dfae..25d93bb46a30 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx @@ -59,7 +59,7 @@ export function NavGroups({ return { id: `${link.id}-${link.title}`, name: ( - + {link.title} ), From b0380546daaeeb177648f381d2d64946d7c196ba Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 20 Sep 2024 18:26:49 +0800 Subject: [PATCH 10/21] feat: update Signed-off-by: SuZhou-Joe --- .../collapsible_nav_group_enabled.test.tsx.snap | 14 +++++++------- .../collapsible_nav_groups.test.tsx.snap | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap index 8977d03f7d98..481d1d300788 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap @@ -52,7 +52,7 @@ exports[` should render correctly 1`] = ` >
link-in-all
@@ -103,7 +103,7 @@ exports[` should render correctly 1`] = ` >
link-in-observability
@@ -135,7 +135,7 @@ exports[` should render correctly 1`] = ` >
See all...
@@ -190,7 +190,7 @@ exports[` should render correctly 1`] = ` >
link-in-essentials
@@ -222,7 +222,7 @@ exports[` should render correctly 1`] = ` >
See all...
@@ -325,7 +325,7 @@ exports[` should show all use case by default and >
link-in-essentials
@@ -400,7 +400,7 @@ exports[` should show all use case when current na >
link-in-essentials
diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap index 097e41e560f3..541622ed47ed 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap @@ -47,7 +47,7 @@ exports[` should render correctly 1`] = ` >
pure link
@@ -78,7 +78,7 @@ exports[` should render correctly 1`] = ` >
subLink
@@ -133,7 +133,7 @@ exports[` should render correctly 1`] = ` >
link-in-category
@@ -164,7 +164,7 @@ exports[` should render correctly 1`] = ` >
sub-link-in-category
@@ -192,7 +192,7 @@ exports[` should render correctly 1`] = ` >
link-in-category-2
From 565035985f7619aad9e94de33e5cc61cd77bb543 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 11:28:03 +0800 Subject: [PATCH 11/21] feat: update style Signed-off-by: SuZhou-Joe --- .../chrome/ui/header/collapsible_nav_group_enabled.scss | 7 +------ .../chrome/ui/header/collapsible_nav_group_enabled_top.tsx | 6 ++++-- .../public/chrome/ui/header/collapsible_nav_groups.tsx | 6 +++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss index 5b7a489e12ac..7b44e4f7623a 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss @@ -1,13 +1,8 @@ .context-nav-wrapper { border: none !important; - .leftNavGroupTitle { - font-weight: 400; - font-size: 18px; - } - .nav-link-item { - padding: $euiSizeS $euiSize; + padding: $euiSizeXS $euiSize; border-radius: $euiSizeS; font-size: 14px; box-shadow: none; 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 03a04e4076e7..50daaa00ea32 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 @@ -14,7 +14,7 @@ import { EuiIcon, EuiPanel, EuiSpacer, - EuiText, + EuiTitle, } from '@elastic/eui'; import { InternalApplicationStart } from 'src/core/public/application'; import { createEuiListItem } from './nav_link'; @@ -150,7 +150,9 @@ export const CollapsibleNavTop = ({ {currentNavGroup?.title && ( <> - {currentNavGroup?.title} + +

{currentNavGroup?.title}

+
)} diff --git a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx index 25d93bb46a30..622655f50407 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx @@ -4,7 +4,7 @@ */ import './collapsible_nav_group_enabled.scss'; -import { EuiFlexItem, EuiSideNavItemType, EuiSideNav, EuiText } from '@elastic/eui'; +import { EuiFlexItem, EuiSideNavItemType, EuiSideNav, EuiText, EuiTitle } from '@elastic/eui'; import { i18n } from '@osd/i18n'; import React from 'react'; import classNames from 'classnames'; @@ -59,8 +59,8 @@ export function NavGroups({ return { id: `${link.id}-${link.title}`, name: ( - - {link.title} + +

{link.title}

), onClick: euiListItem.onClick, From 24b913b4716f1a2fffb17f349d33d7e218ae3779 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 11:29:48 +0800 Subject: [PATCH 12/21] feat: update Signed-off-by: SuZhou-Joe --- .../public/components/feature_cards/feature_cards.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/management/public/components/feature_cards/feature_cards.tsx b/src/plugins/management/public/components/feature_cards/feature_cards.tsx index 4ffdd917b2c3..4c28ea9036d4 100644 --- a/src/plugins/management/public/components/feature_cards/feature_cards.tsx +++ b/src/plugins/management/public/components/feature_cards/feature_cards.tsx @@ -77,7 +77,7 @@ export const FeatureCards = ({ description={link.description || ''} onClick={() => navigateToApp(link.id)} titleSize="xs" - style={{ width: 240 }} + style={{ maxWidth: 240 }} /> ); From bc62ba0307566c81e1b2fadaecd40618a91238dd Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 11:30:53 +0800 Subject: [PATCH 13/21] feat: update Signed-off-by: SuZhou-Joe --- ...ollapsible_nav_group_enabled.test.tsx.snap | 63 ++++++++++++------- .../collapsible_nav_groups.test.tsx.snap | 45 ++++++++----- 2 files changed, 72 insertions(+), 36 deletions(-) diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap index 481d1d300788..4f290cee2a76 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap @@ -51,10 +51,13 @@ exports[` should render correctly 1`] = ` title="link-in-all" >
- link-in-all +

+ link-in-all +

@@ -102,10 +105,13 @@ exports[` should render correctly 1`] = ` title="link-in-observability" >
- link-in-observability +

+ link-in-observability +

@@ -134,10 +140,13 @@ exports[` should render correctly 1`] = ` class="euiTextColor euiTextColor--success" >
- See all... +

+ See all... +

@@ -189,10 +198,13 @@ exports[` should render correctly 1`] = ` title="link-in-essentials" >
- link-in-essentials +

+ link-in-essentials +

@@ -221,10 +233,13 @@ exports[` should render correctly 1`] = ` class="euiTextColor euiTextColor--success" >
- See all... +

+ See all... +

@@ -324,10 +339,13 @@ exports[` should show all use case by default and title="link-in-essentials" >
- link-in-essentials +

+ link-in-essentials +

@@ -399,10 +417,13 @@ exports[` should show all use case when current na title="link-in-essentials" >
- link-in-essentials +

+ link-in-essentials +

diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap index 541622ed47ed..9aace0d6dae6 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap @@ -46,10 +46,13 @@ exports[` should render correctly 1`] = ` title="pure link" >
- pure link +

+ pure link +

should render correctly 1`] = ` title="subLink" >
- subLink +

+ subLink +

@@ -132,10 +138,13 @@ exports[` should render correctly 1`] = ` title="link-in-category" >
- link-in-category +

+ link-in-category +

should render correctly 1`] = ` title="sub-link-in-category" >
- sub-link-in-category +

+ sub-link-in-category +

@@ -191,10 +203,13 @@ exports[` should render correctly 1`] = ` title="link-in-category-2" >
- link-in-category-2 +

+ link-in-category-2 +

From 14e96bdef9daa97cd2d9be422bec4ea760b6977e Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 11:49:24 +0800 Subject: [PATCH 14/21] feat: update style Signed-off-by: SuZhou-Joe --- ...ollapsible_nav_group_enabled.test.tsx.snap | 56 +++++++------------ .../header/collapsible_nav_group_enabled.scss | 1 - .../collapsible_nav_group_enabled_top.tsx | 6 +- .../ui/header/collapsible_nav_groups.tsx | 4 +- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap index 4f290cee2a76..60d70bbf7595 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap @@ -51,13 +51,11 @@ exports[` should render correctly 1`] = ` title="link-in-all" >
-

+

link-in-all -

+
@@ -105,13 +103,11 @@ exports[` should render correctly 1`] = ` title="link-in-observability" >
-

+

link-in-observability -

+
@@ -140,13 +136,11 @@ exports[` should render correctly 1`] = ` class="euiTextColor euiTextColor--success" >
-

+

See all... -

+
@@ -198,13 +192,11 @@ exports[` should render correctly 1`] = ` title="link-in-essentials" >
-

+

link-in-essentials -

+
@@ -233,13 +225,11 @@ exports[` should render correctly 1`] = ` class="euiTextColor euiTextColor--success" >
-

+

See all... -

+
@@ -339,13 +329,11 @@ exports[` should show all use case by default and title="link-in-essentials" >
-

+

link-in-essentials -

+
@@ -417,13 +405,11 @@ exports[` should show all use case when current na title="link-in-essentials" >
-

+

link-in-essentials -

+
diff --git a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss index 7b44e4f7623a..adc479a31267 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss +++ b/src/core/public/chrome/ui/header/collapsible_nav_group_enabled.scss @@ -4,7 +4,6 @@ .nav-link-item { padding: $euiSizeXS $euiSize; border-radius: $euiSizeS; - font-size: 14px; box-shadow: none; margin-bottom: 0; margin-top: 0; 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 50daaa00ea32..7ec738874686 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 @@ -14,7 +14,7 @@ import { EuiIcon, EuiPanel, EuiSpacer, - EuiTitle, + EuiText, } from '@elastic/eui'; import { InternalApplicationStart } from 'src/core/public/application'; import { createEuiListItem } from './nav_link'; @@ -150,9 +150,9 @@ export const CollapsibleNavTop = ({ {currentNavGroup?.title && ( <> - +

{currentNavGroup?.title}

-
+ )} diff --git a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx index 622655f50407..9485aff7b22c 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx @@ -59,8 +59,8 @@ export function NavGroups({ return { id: `${link.id}-${link.title}`, name: ( - -

{link.title}

+ +

{link.title}

), onClick: euiListItem.onClick, From e83f647b2516064f1da519600e3730697848a97b Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 12:16:32 +0800 Subject: [PATCH 15/21] feat: update Signed-off-by: SuZhou-Joe --- .../collapsible_nav_groups.test.tsx.snap | 45 +++++++------------ .../ui/header/collapsible_nav_groups.tsx | 9 ++-- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap index 9aace0d6dae6..3f8e9076c726 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap @@ -46,13 +46,10 @@ exports[` should render correctly 1`] = ` title="pure link" >
-

- pure link -

+ pure link
should render correctly 1`] = ` title="subLink" >
-

- subLink -

+ subLink
@@ -138,13 +132,10 @@ exports[` should render correctly 1`] = ` title="link-in-category" >
-

- link-in-category -

+ link-in-category
should render correctly 1`] = ` title="sub-link-in-category" >
-

- sub-link-in-category -

+ sub-link-in-category
@@ -203,13 +191,10 @@ exports[` should render correctly 1`] = ` title="link-in-category-2" >
-

- link-in-category-2 -

+ link-in-category-2
diff --git a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx index 9485aff7b22c..b1d723b95883 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx @@ -59,9 +59,12 @@ export function NavGroups({ return { id: `${link.id}-${link.title}`, name: ( - -

{link.title}

-
+ + {/* the inline style is required because 1. fontWeight is used */} + + {link.title} + + ), onClick: euiListItem.onClick, href: euiListItem.href, From f8219c188f193494fb3700ef0cd4233375e6a070 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 14:14:14 +0800 Subject: [PATCH 16/21] feat: update snapshot Signed-off-by: SuZhou-Joe --- ...ollapsible_nav_group_enabled.test.tsx.snap | 49 +++---- .../collapsible_nav_groups.test.tsx.snap | 10 +- .../__snapshots__/feature_cards.test.tsx.snap | 130 ++++-------------- 3 files changed, 56 insertions(+), 133 deletions(-) diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap index 60d70bbf7595..db4ee41b2090 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap @@ -51,11 +51,10 @@ exports[` should render correctly 1`] = ` title="link-in-all" >
-

- link-in-all -

+ link-in-all
@@ -103,11 +102,10 @@ exports[` should render correctly 1`] = ` title="link-in-observability" >
-

- link-in-observability -

+ link-in-observability
@@ -136,11 +134,10 @@ exports[` should render correctly 1`] = ` class="euiTextColor euiTextColor--success" >
-

- See all... -

+ See all...
@@ -192,11 +189,10 @@ exports[` should render correctly 1`] = ` title="link-in-essentials" >
-

- link-in-essentials -

+ link-in-essentials
@@ -225,11 +221,10 @@ exports[` should render correctly 1`] = ` class="euiTextColor euiTextColor--success" >
-

- See all... -

+ See all...
@@ -329,11 +324,10 @@ exports[` should show all use case by default and title="link-in-essentials" >
-

- link-in-essentials -

+ link-in-essentials
@@ -405,11 +399,10 @@ exports[` should show all use case when current na title="link-in-essentials" >
-

- link-in-essentials -

+ link-in-essentials
diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap index 3f8e9076c726..e77414b2af98 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap @@ -47,7 +47,7 @@ exports[` should render correctly 1`] = ` >
pure link
@@ -78,7 +78,7 @@ exports[` should render correctly 1`] = ` >
subLink
@@ -133,7 +133,7 @@ exports[` should render correctly 1`] = ` >
link-in-category
@@ -164,7 +164,7 @@ exports[` should render correctly 1`] = ` >
sub-link-in-category
@@ -192,7 +192,7 @@ exports[` should render correctly 1`] = ` >
link-in-category-2
diff --git a/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap b/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap index 59d957733871..1a1c2249537a 100644 --- a/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap +++ b/src/plugins/management/public/components/feature_cards/__snapshots__/feature_cards.test.tsx.snap @@ -19,7 +19,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title1 -

-
+
@@ -52,7 +45,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title2 -

-
+
@@ -85,7 +71,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title3 -

-
+
@@ -118,7 +97,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title4 -

-
+
@@ -151,7 +123,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title5 -

-
+
@@ -201,7 +166,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title1 -

-
+
@@ -234,7 +192,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title2 -

-
+
@@ -267,7 +218,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title3 -

-
+
@@ -300,7 +244,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title4 -

-
+
@@ -333,7 +270,7 @@ exports[` render with complex navLinks 1`] = `
render with complex navLinks 1`] = ` id="generated-idTitle" > -
-

- title5 -

-
+
From 8b5186bb87d9502cb343976fae06412fac7989cf Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 17:49:31 +0800 Subject: [PATCH 17/21] feat: update Signed-off-by: SuZhou-Joe --- src/core/public/chrome/ui/header/collapsible_nav_groups.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx index b1d723b95883..f6ddc68aad7b 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav_groups.tsx @@ -60,7 +60,7 @@ export function NavGroups({ id: `${link.id}-${link.title}`, name: ( - {/* the inline style is required because 1. fontWeight is used */} + {/* the inline style is required to overwrite the letterspacing style EuiText applies */} {link.title} From 9a8bc173d8a2fa8a215fa32073cc1d48d91895c5 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 23 Sep 2024 18:23:46 +0800 Subject: [PATCH 18/21] feat: revert the customized style on nested items Signed-off-by: SuZhou-Joe --- .../collapsible_nav_groups.test.tsx.snap | 4 +-- .../header/collapsible_nav_group_enabled.scss | 30 ++++--------------- .../ui/header/collapsible_nav_groups.tsx | 1 - 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap index e77414b2af98..69a9f8158e35 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_groups.test.tsx.snap @@ -34,7 +34,7 @@ exports[` should render correctly 1`] = ` >