Skip to content

Commit

Permalink
feat: update page titles for dashboards and alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
nishantharcot committed Dec 24, 2024
1 parent 53b86e4 commit 86a74a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/pages/AlertDetails/AlertDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function AlertDetails(): JSX.Element {
alertDetailsResponse,
} = useGetAlertRuleDetails();

const alertTitle = alertDetailsResponse?.payload?.data.alert;
document.title = alertTitle || document.title;

if (
isError ||
!isValidRuleId ||
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/NewDashboard/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ function DashboardPage(): JSX.Element {
(dashboardResponse?.error as AxiosError)?.response?.data?.errorType
: 'Something went wrong';

const dashboardTitle = dashboardResponse.data?.data.title;
document.title = dashboardTitle || document.title;

if (isError && !isFetching && errorMessage === ErrorType.NotFound) {
return <NotFound />;
}
Expand Down

0 comments on commit 86a74a6

Please sign in to comment.