Skip to content

Fix access denied screen to surface logged-out state as possible cause#952

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-access-denied-screen
Draft

Fix access denied screen to surface logged-out state as possible cause#952
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-access-denied-screen

Conversation

Copy link

Copilot AI commented Mar 1, 2026

The "Access Denied" screen only showed "You must be an admin to view this page," which is misleading for users who are simply unauthenticated. This adds a second line of context so users know they may just be logged out.

Changes

  • NotAuthorised component — adds optional additionalDescription?: string prop; renders a second EmptyStateDescription below the primary one when provided
  • AdminClient.tsx — passes additionalDescription="You may also be logged out." to the NotAuthorised fallback in the admin RoleGuard
  • NotAuthorised.stories.tsx — updates the Custom story to include additionalDescription
<NotAuthorised
  title="Access Denied"
  description="You must be an admin to view this page."
  additionalDescription="You may also be logged out."
/>

Type of change

  • New feature or improvement (non-breaking change which adds/modifies functionality)

How Has This Been Tested?

  • Manual testing (requires screenshots or videos)

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added thorough tests that prove my fix is effective and that my feature works
  • Additional issues have been created for any tech debt left in this PR
  • I've requested a review from another user
Original prompt

This section details on the original issue you should resolve

<issue_title>[FRONTEND] Fix access denied screen to let users know they could be logged out</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.

Our "Access Denied" page is rather misleading as a user could just be logged out instead of "not being an admin". We should also add another quote stating the user could be logged out.

Image

Additional context

BEFORE MERGING

  • Storybooks created where possible
  • Tested with react testing library
  • Tests written for critical interactions
  • PR Reviewed (For non-trivial changes)
  • Changes tested after rebasing on master or merging in master (hint: git fetch origin master:master, then git rebase master or git merge master)
  • All required PR checks passing
    </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…t users

Co-authored-by: jeffplays2005 <61447509+jeffplays2005@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix access denied screen to inform users about logout Fix access denied screen to surface logged-out state as possible cause Mar 1, 2026
Copilot finished work on behalf of jji05 March 1, 2026 07:47
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

Preview Deployment Status

✅ Storybook Preview: https://ec5e0dc0.uabc-storybook.pages.dev

✅ Frontend Preview: https://ef340a99.uabc.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 76.75% (🎯 70%)
⬇️ -7.65%
1119 / 1458
🔵 Statements 76.59% (🎯 70%)
⬇️ -7.68%
1135 / 1482
🔵 Functions 64.45% (🎯 80%)
⬇️ -14.56%
194 / 301
🔵 Branches 69.46% (🎯 60%)
⬇️ -9.13%
448 / 645
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/frontend/src/components/client/admin/AdminClient.tsx 0%
🟰 ±0%
100%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
14-34
Generated in workflow #3946 for commit 347b4ad by the Vitest Coverage Report Action

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.

[FRONTEND] Fix access denied screen to let users know they could be logged out

2 participants