Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update frontend/src/pages/Settings.jsx
Browse files- frontend/src/pages/Settings.jsx +17 -14
frontend/src/pages/Settings.jsx
CHANGED
|
@@ -619,26 +619,29 @@ export const AlertSettingsPage = () => {
|
|
| 619 |
const profileEmail = user ? user.email : 'alex.mercer@larxiuswss.io';
|
| 620 |
const profileRole = user?.role ? `Role: ${user.role}` : 'Lead Security Engineer';
|
| 621 |
|
| 622 |
-
const isSchedulerAllowed = ['super_admin', 'support_engineer', 'admin', 'org_admin', 'soc_analyst'
|
| 623 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
| 624 |
|
| 625 |
const tabItems = [
|
| 626 |
{ id: 'profile', label: 'My Profile', icon: 'person' }
|
| 627 |
];
|
| 628 |
|
| 629 |
-
if (isSchedulerAllowed) {
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
}
|
|
|
|
|
|
|
| 633 |
|
| 634 |
-
|
| 635 |
-
tabItems.
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
{ id: 'billing', label: 'Billing', icon: 'credit_card' }
|
| 640 |
-
);
|
| 641 |
-
}
|
| 642 |
|
| 643 |
return (
|
| 644 |
<div className="flex flex-col gap-gutter text-left w-full">
|
|
|
|
| 619 |
const profileEmail = user ? user.email : 'alex.mercer@larxiuswss.io';
|
| 620 |
const profileRole = user?.role ? `Role: ${user.role}` : 'Lead Security Engineer';
|
| 621 |
|
| 622 |
+
const isSchedulerAllowed = ['super_admin', 'support_engineer', 'admin', 'org_admin', 'soc_analyst'].includes(user?.role);
|
| 623 |
+
const isDemoBookingsAllowed = ['super_admin', 'support_engineer', 'admin', 'org_admin'].includes(user?.role);
|
| 624 |
+
const isNotificationsAllowed = ['super_admin', 'support_engineer', 'admin', 'org_admin', 'soc_analyst', 'executive_user'].includes(user?.role);
|
| 625 |
+
const isApiKeysAllowed = ['super_admin', 'support_engineer', 'admin', 'org_admin', 'soc_analyst'].includes(user?.role);
|
| 626 |
+
const isTeamAllowed = ['super_admin', 'support_engineer', 'admin', 'org_admin'].includes(user?.role);
|
| 627 |
+
const isBillingAllowed = ['super_admin', 'support_engineer', 'admin', 'org_admin'].includes(user?.role);
|
| 628 |
|
| 629 |
const tabItems = [
|
| 630 |
{ id: 'profile', label: 'My Profile', icon: 'person' }
|
| 631 |
];
|
| 632 |
|
| 633 |
+
if (isSchedulerAllowed) tabItems.push({ id: 'scheduler', label: 'Scheduler', icon: 'schedule' });
|
| 634 |
+
if (isDemoBookingsAllowed) tabItems.push({ id: 'demoBookings', label: 'Demo Bookings', icon: 'event_available' });
|
| 635 |
+
if (isNotificationsAllowed) tabItems.push({ id: 'notifications', label: 'Notifications', icon: 'notifications' });
|
| 636 |
+
if (isApiKeysAllowed) tabItems.push({ id: 'apiKeys', label: 'API Keys', icon: 'key' });
|
| 637 |
+
if (isTeamAllowed) tabItems.push({ id: 'team', label: 'Team', icon: 'group' });
|
| 638 |
+
if (isBillingAllowed) tabItems.push({ id: 'billing', label: 'Billing', icon: 'credit_card' });
|
| 639 |
|
| 640 |
+
useEffect(() => {
|
| 641 |
+
if (tabItems.length > 0 && !tabItems.some(t => t.id === activeTab)) {
|
| 642 |
+
setActiveTab(tabItems[0].id);
|
| 643 |
+
}
|
| 644 |
+
}, [user?.role, activeTab, tabItems.length]);
|
|
|
|
|
|
|
|
|
|
| 645 |
|
| 646 |
return (
|
| 647 |
<div className="flex flex-col gap-gutter text-left w-full">
|