From d447c5dbc7914cf22bd9f964f5b5f982264efe42 Mon Sep 17 00:00:00 2001 From: Miki Date: Thu, 15 Aug 2024 16:18:41 -0700 Subject: [PATCH] Simplify `TopNavControlDescriptionData` to to be followed by links (#7723) * Simplify `TopNavControlDescriptionData` to to be followed by links Signed-off-by: Miki * Changeset file for PR #7723 created/updated --------- Signed-off-by: Miki Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/7723.yml | 2 ++ .../public/chrome/ui/header/header_controls_container.scss | 1 + .../navigation/public/top_nav_menu/top_nav_control_data.tsx | 1 + .../navigation/public/top_nav_menu/top_nav_control_item.tsx | 5 +++++ 4 files changed, 9 insertions(+) create mode 100644 changelogs/fragments/7723.yml diff --git a/changelogs/fragments/7723.yml b/changelogs/fragments/7723.yml new file mode 100644 index 000000000000..6f38d9e804be --- /dev/null +++ b/changelogs/fragments/7723.yml @@ -0,0 +1,2 @@ +feat: +- Simplify `TopNavControlDescriptionData` to to be followed by links ([#7723](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7723)) \ No newline at end of file diff --git a/src/core/public/chrome/ui/header/header_controls_container.scss b/src/core/public/chrome/ui/header/header_controls_container.scss index 7d4f2101ab85..bba07ef60fbd 100644 --- a/src/core/public/chrome/ui/header/header_controls_container.scss +++ b/src/core/public/chrome/ui/header/header_controls_container.scss @@ -16,6 +16,7 @@ &.headerBottomControl { padding: $euiSizeM; + max-width: 725px; } &:empty { diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx index 83fa46e69508..4482eaec723d 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx @@ -78,6 +78,7 @@ export interface TopNavControlTextData { export interface TopNavControlDescriptionData { description: string; + links?: TopNavControlLinkData | TopNavControlLinkData[]; } export interface TopNavControlComponentData { diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx index ada02dba27bf..4b2d7b948170 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx @@ -46,9 +46,14 @@ export function TopNavControlItem(props: TopNavControlData) { } if ('description' in props) { + const links = props.links && [props.links].flat(); + return ( {props.description} + {links?.map((linkProps) => ( + + ))} ); }