Skip to content

fix(frontend): hide news widget from default dashboard for non-superusers - #13099

Merged
SchrodingersGat merged 1 commit into
inventree:masterfrom
Nero7991:fix/news-widget-non-superuser
Oct 26, 2026
Merged

SchrodingersGat merged 1 commit into
inventree:masterfrom
Nero7991:fix/news-widget-non-superuser

Conversation

@Nero7991

Copy link
Copy Markdown
Contributor

On a fresh dashboard, non-superuser accounts see a red "Requires Superuser" alert in place of the news widget, which suggests their account is missing permissions.

DashboardLayout already accounts for this in defaultLayouts (the news layout entry is only added for superusers), but defaultWidgets always loaded ['news', 'gstart']. The widget then renders for everyone, and NewsWidget shows its superuser alert.

This change applies the same superuser check to defaultWidgets, so non-superusers get only the "Getting Started" widget by default. Superusers see no change, and users can still add widgets by hand as before.

Seen on 1.6.1; the code on master is unchanged.

src/frontend/src/components/dashboard/DashboardLayout.tsx, +4 / -2. Not built or run locally (no frontend toolchain here); it is a type-safe change to a string list and a useMemo dependency.

Generated with Claude Code

https://claude.ai/code/session_01CR5gRLhFZQApAYRXBAtk3S

…sers

defaultLayouts only places the news widget for superusers, but
defaultWidgets always included it, so non-superusers saw a
"Requires Superuser" alert on a fresh dashboard.
@netlify

netlify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit be67576
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6ade67e17df000662fa28df3
😎 Deploy Preview https://deploy-preview-13099--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 94 (no change from production)
Accessibility: 82 (no change from production)
Best Practices: 92 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed backport Apply this label to a PR to enable auto-backport action User Interface Related to the frontend / User Interface backport-to-1.6.x labels Oct 25, 2026
@SchrodingersGat SchrodingersGat modified the milestones: 1.6.2, 1.7.0 Oct 25, 2026
@SchrodingersGat

Copy link
Copy Markdown
Member

@Nero7991 thanks for the fix!

@SchrodingersGat
SchrodingersGat merged commit 6d0ae8d into inventree:master Oct 26, 2026
70 of 73 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
✅ 1.6.x

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

SchrodingersGat pushed a commit that referenced this pull request Oct 26, 2026
…sers (#13099) (#13103)

defaultLayouts only places the news widget for superusers, but
defaultWidgets always included it, so non-superusers saw a
"Requires Superuser" alert on a fresh dashboard.

(cherry picked from commit 6d0ae8d)

Co-authored-by: Oren <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Apply this label to a PR to enable auto-backport action bug Identifies a bug which needs to be addressed User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants