Skip to content

Commit

Permalink
Fix a field name bug in cluster alert banners (#46840)
Browse files Browse the repository at this point in the history
* Fix a field name bug in cluster alert banners

This bug prevented links from being properly rendered.

* Update web/packages/teleport/src/Main/Main.tsx

Co-authored-by: Sakshyam Shah <sshah@goteleport.com>

* lint

---------

Co-authored-by: Sakshyam Shah <sshah@goteleport.com>
  • Loading branch information
bl-nero and flyinghermit authored Sep 25, 2024
1 parent 0be5617 commit cdf7275
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions web/packages/teleport/src/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,15 @@ export function Main(props: MainProps) {
return 'danger';
};

const banners: BannerType[] = alerts.map(alert => ({
message: alert.spec.message,
severity: mapSeverity(alert.spec.severity),
link: alert.metadata.labels[LINK_DESTINATION_LABEL],
linkText: alert.metadata.labels[LINK_TEXT_LABEL],
id: alert.metadata.name,
}));
const banners: BannerType[] = alerts.map(
(alert): BannerType => ({
message: alert.spec.message,
severity: mapSeverity(alert.spec.severity),
linkDestination: alert.metadata.labels[LINK_DESTINATION_LABEL],
linkText: alert.metadata.labels[LINK_TEXT_LABEL],
id: alert.metadata.name,
})
);

const onboard = storageService.getOnboardDiscover();
const requiresOnboarding =
Expand Down

0 comments on commit cdf7275

Please sign in to comment.