Skip to content

fix(dashboard): RBAC UI hiding and export buttons (#1034, #1035) - #1119

Merged
ONEONUORA merged 1 commit into
Fracverse:masterfrom
Gracie418502:fix/1034-1035-rbac-export-buttons
Oct 17, 2026
Merged

ONEONUORA merged 1 commit into
Fracverse:masterfrom
Gracie418502:fix/1034-1035-rbac-export-buttons

Conversation

@Gracie418502

Copy link
Copy Markdown
Contributor

Summary

Resolves two dashboard issues in a single PR.

#1034 — RBAC UI hiding for read-only users

  • Import useSuperAdmin() hook from lib/auth-context.tsx at the top of dashboard/app/dashboard/page.tsx
  • Gate the Export Users (CSV) button with disabled={!isSuperAdmin} so non-superadmins cannot trigger the Privy identity CSV export
  • Gate the Connect Freighter wallet button with disabled={!isSuperAdmin} so only superadmins can authorise on-chain vault operations
  • Show a 🔒 Superadmin access required warning panel inside the Wallet Authorization card when !isSuperAdmin
  • Fixed syntax errors in the file — removed a corrupted duplicate set of Payout Statistics, Vault Trend Charts, and Wallet Authorization sections that contained empty JSX expressions (value={}, empty tickFormatter/formatter arrow functions, empty className template literal) and orphaned brackets
  • Fixed useEffect cleanup — moved the return () => { cancelled = true; } to the correct scope (effect body, not inside .catch()) and added .finally() to clear chartsLoading

#1035 — Export CSV/JSON buttons for transaction audit tables

Already implemented in dashboard/app/dashboard/transactions/page.tsx:

  • exportAuditRows() helper converts rows to a Blob and triggers a browser download using URL.createObjectURL(blob)
  • ExportButtons component renders Export CSV and Export JSON buttons, disabled when table is empty
  • Buttons appear in both the Transactions table header and the Social Payments table header

Files Changed

  • dashboard/app/dashboard/page.tsx — RBAC gates + syntax fix

Testing

  • Verified all braces/parentheses are balanced (0 imbalance)
  • Confirmed isSuperAdmin check appears on all three gated elements (lines 312, 657, 684)
  • Confirmed ExportButtons used on both tables in transactions page

Closes #1034
Closes #1035

…acverse#1035)

- Fracverse#1034: Apply isSuperAdmin() gate to Export Users button, wallet
  Connect Freighter button, and !isSuperAdmin warning panel in
  dashboard/page.tsx using the existing useSuperAdmin() hook from
  auth-context.tsx
- Fracverse#1034: Fix syntax errors in dashboard/page.tsx — removed corrupted
  duplicate Payout Statistics, Vault Trend Charts, and Wallet sections
  that contained empty JSX expressions (value={}, tickFormatter,
  className template literals) and orphaned brackets
- Fracverse#1034: Fix useEffect cleanup — moved cancelled=true return to effect
  scope and added .finally() to set chartsLoading(false) after API call
- Fracverse#1035: Export CSV/JSON buttons already implemented in
  transactions/page.tsx via ExportButtons component and
  exportAuditRows() helper using URL.createObjectURL(blob)

Closes Fracverse#1034
Closes Fracverse#1035
@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@Gracie418502 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great job @Gracie418502

@ONEONUORA
ONEONUORA merged commit e24498f into Fracverse:master Oct 17, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants