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) => ( + + ))} ); }