Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify TopNavControlDescriptionData to to be followed by links #7723

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/7723.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Simplify `TopNavControlDescriptionData` to to be followed by links ([#7723](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7723))
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

&.headerBottomControl {
padding: $euiSizeM;
max-width: 725px;
}

&:empty {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface TopNavControlTextData {

export interface TopNavControlDescriptionData {
description: string;
links?: TopNavControlLinkData | TopNavControlLinkData[];
}

export interface TopNavControlComponentData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@
}

if ('description' in props) {
const links = props.links && [props.links].flat();

return (
<EuiText className="descriptionHeaderControl" size="s">
{props.description}
{links?.map((linkProps) => (
<TopNavControlItem {...linkProps} />

Check warning on line 55 in src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx#L55

Added line #L55 was not covered by tests
))}
</EuiText>
);
}
Expand Down
Loading