Skip to content

fix: update default dashboard on landing page when changed from hub#343

Open
OlhaTmlk wants to merge 1 commit into
RedHatInsights:masterfrom
OlhaTmlk:fix-layout
Open

fix: update default dashboard on landing page when changed from hub#343
OlhaTmlk wants to merge 1 commit into
RedHatInsights:masterfrom
OlhaTmlk:fix-layout

Conversation

@OlhaTmlk

@OlhaTmlk OlhaTmlk commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes stale dashboard data on the start page when navigating from the Dashboard Hub or generic dashboard pages. Previously, the start page cached the homepage dashboard in jotai atoms and never re-fetched, even after the user changed their homepage or edited the homepage dashboard's layout on another page.

Changes:

  • dashboardsAtom.ts: Invalidates templateIdAtom (resets to -1) when setting a new homepage (setDefaultDashboardAtom), creating/duplicating with "set as homepage" enabled, or deleting the current
    homepage dashboard.
  • useDashboardTemplate.ts: Invalidates templateIdAtom after saving template changes on the generic dashboard page, but only if the edited dashboard is the homepage (dashboard.default).
    Invalidation runs after the debounced API call completes to avoid a race condition where the start page re-fetches before the patch lands.
  • DashboardTable.tsx: Shows an inline warning alert when no dashboard is set as homepage (e.g., after deleting the homepage dashboard).

How it works: The start page (useDashboardConfig) only fetches when templateIdAtom < 0. Mutations that affect the homepage reset it to -1, so the next time the start page mounts, it fetches fresh data from the API.

RHCLOUD48080


Screenshots

Screenshot 2026-06-01 at 12 23 35

@OlhaTmlk

OlhaTmlk commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@OlhaTmlk

OlhaTmlk commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@karelhala karelhala marked this pull request as ready for review June 9, 2026 08:57
@karelhala karelhala requested a review from a team as a code owner June 9, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant