Skip to content

fix(dashboards): Skip dashboard API requests when user has no project access#112855

Open
edwardgou-sentry wants to merge 1 commit intomasterfrom
edwardgou/dain-1416-dont-fetch-dashboards-when-user-has-no-projects
Open

fix(dashboards): Skip dashboard API requests when user has no project access#112855
edwardgou-sentry wants to merge 1 commit intomasterfrom
edwardgou/dain-1416-dont-fetch-dashboards-when-user-has-no-projects

Conversation

@edwardgou-sentry
Copy link
Copy Markdown
Contributor

@edwardgou-sentry edwardgou-sentry commented Apr 13, 2026

  • Extracts a reusable useHasProjectAccess hook from NoProjectMessage to consolidate the project access check logic
  • Uses the hook to disable dashboard API queries on dashboard manage page and side nav when no project access is available
  • Previously these requests fired unconditionally even though NoProjectMessage would discard the rendered results

DAIN-1416

… access

Extract a reusable `useHasProjectAccess` hook from `NoProjectMessage` and
use it to disable dashboard queries (`useApiQuery`, `useOwnedDashboards`,
`useGetStarredDashboards`) when the user has no accessible projects.
Previously these requests fired unconditionally even though
`NoProjectMessage` would discard the rendered results.

DAIN-1416
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 13, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 13, 2026
@edwardgou-sentry edwardgou-sentry marked this pull request as ready for review April 13, 2026 21:16
@edwardgou-sentry edwardgou-sentry requested review from a team as code owners April 13, 2026 21:16
Copy link
Copy Markdown
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 Might be a bit cleaner if the hook just returns a single boolean that determines whether the UI can be shown or not, but not a big deal. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants