-
Notifications
You must be signed in to change notification settings - Fork 1
feat(supernova): add perses presentation plusone presentation #1683
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
Draft
ibakshay
wants to merge
5
commits into
main
Choose a base branch
from
ibakshay/perses-alert-in-supernova
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+129
−0
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1e86160
add perses presentation plusone presentation
ibakshay fe599fc
add changeset
ibakshay 9476274
add tests + other review comment fixes
ibakshay 120da87
Merge branch 'main' into ibakshay/perses-alert-in-supernova
ArtieReus 59296a0
Merge branch 'main' into ibakshay/perses-alert-in-supernova
ArtieReus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@cloudoperators/juno-app-supernova": minor | ||
| --- | ||
|
|
||
| Add Perses and PersesGlobal dashboard links to alert details |
102 changes: 102 additions & 0 deletions
102
apps/supernova/src/components/alerts/shared/AlertLinks.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and Juno contributors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import React from "react" | ||
| import { render, screen } from "@testing-library/react" | ||
| import AlertLinks from "./AlertLinks" | ||
|
|
||
| describe("AlertLinks", () => { | ||
| describe("Perses regional dashboard link", () => { | ||
| it("renders when both persesDashboard and region labels are present", () => { | ||
| const alert = { | ||
| labels: { | ||
| persesDashboard: "observability/dashboards/blackbox-overview", | ||
| region: "region-1", | ||
| }, | ||
| } | ||
| render(<AlertLinks alert={alert} />) | ||
| const link = screen.getByText("Perses") | ||
| expect(link).toBeInTheDocument() | ||
| expect(link).toHaveAttribute( | ||
| "href", | ||
| "https://perses.region-1.cloud.sap/projects/observability/dashboards/blackbox-overview" | ||
| ) | ||
| expect(link).toHaveAttribute("target", "_blank") | ||
| expect(link).toHaveAttribute("rel", "noopener noreferrer") | ||
| }) | ||
|
|
||
| it("does not render when persesDashboard is present but region is missing", () => { | ||
| const alert = { | ||
| labels: { | ||
| persesDashboard: "observability/dashboards/blackbox-overview", | ||
| }, | ||
| } | ||
| render(<AlertLinks alert={alert} />) | ||
| expect(screen.queryByText("Perses")).not.toBeInTheDocument() | ||
| }) | ||
|
|
||
| it("does not render when region is present but persesDashboard is missing", () => { | ||
| const alert = { | ||
| labels: { | ||
| region: "region-1", | ||
| }, | ||
| } | ||
| render(<AlertLinks alert={alert} />) | ||
| expect(screen.queryByText("Perses")).not.toBeInTheDocument() | ||
| }) | ||
| }) | ||
|
|
||
| describe("Perses Global dashboard link", () => { | ||
| it("renders when persesGlobalDashboard label is present", () => { | ||
| const alert = { | ||
| labels: { | ||
| persesGlobalDashboard: "observability/dashboards/global-sci-logs", | ||
| }, | ||
| } | ||
| render(<AlertLinks alert={alert} />) | ||
| const link = screen.getByText("Perses Global") | ||
| expect(link).toBeInTheDocument() | ||
| expect(link).toHaveAttribute( | ||
| "href", | ||
| "https://perses.global.cloud.sap/projects/observability/dashboards/global-sci-logs" | ||
| ) | ||
| expect(link).toHaveAttribute("target", "_blank") | ||
| expect(link).toHaveAttribute("rel", "noopener noreferrer") | ||
| }) | ||
|
|
||
| it("does not render when persesGlobalDashboard label is missing", () => { | ||
| const alert = { | ||
| labels: {}, | ||
| } | ||
| render(<AlertLinks alert={alert} />) | ||
| expect(screen.queryByText("Perses Global")).not.toBeInTheDocument() | ||
| }) | ||
| }) | ||
|
|
||
| describe("both Perses links together", () => { | ||
| it("renders both links when both labels are present", () => { | ||
| const alert = { | ||
| labels: { | ||
| persesDashboard: "compute/dashboards/nova-health", | ||
| persesGlobalDashboard: "observability/dashboards/global-sci-logs", | ||
| region: "region-1", | ||
| }, | ||
| } | ||
| render(<AlertLinks alert={alert} />) | ||
| const regionalLink = screen.getByText("Perses") | ||
| const globalLink = screen.getByText("Perses Global") | ||
| expect(regionalLink).toBeInTheDocument() | ||
| expect(regionalLink).toHaveAttribute( | ||
| "href", | ||
| "https://perses.region-1.cloud.sap/projects/compute/dashboards/nova-health" | ||
| ) | ||
| expect(globalLink).toBeInTheDocument() | ||
| expect(globalLink).toHaveAttribute( | ||
| "href", | ||
| "https://perses.global.cloud.sap/projects/observability/dashboards/global-sci-logs" | ||
| ) | ||
| }) | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.