diff --git a/frontend/src/core/components/shared/config/configNavSections.tsx b/frontend/src/core/components/shared/config/configNavSections.tsx
index e9f97aafb..58f7456ae 100644
--- a/frontend/src/core/components/shared/config/configNavSections.tsx
+++ b/frontend/src/core/components/shared/config/configNavSections.tsx
@@ -2,18 +2,6 @@ import React from 'react';
import { NavKey } from '@app/components/shared/config/types';
import HotkeysSection from '@app/components/shared/config/configSections/HotkeysSection';
import GeneralSection from '@app/components/shared/config/configSections/GeneralSection';
-import AdminGeneralSection from '@app/components/shared/config/configSections/AdminGeneralSection';
-import AdminSecuritySection from '@app/components/shared/config/configSections/AdminSecuritySection';
-import AdminConnectionsSection from '@app/components/shared/config/configSections/AdminConnectionsSection';
-import AdminPrivacySection from '@app/components/shared/config/configSections/AdminPrivacySection';
-import AdminDatabaseSection from '@app/components/shared/config/configSections/AdminDatabaseSection';
-import AdminAdvancedSection from '@app/components/shared/config/configSections/AdminAdvancedSection';
-import AdminLegalSection from '@app/components/shared/config/configSections/AdminLegalSection';
-import AdminPremiumSection from '@app/components/shared/config/configSections/AdminPremiumSection';
-import AdminFeaturesSection from '@app/components/shared/config/configSections/AdminFeaturesSection';
-import AdminEndpointsSection from '@app/components/shared/config/configSections/AdminEndpointsSection';
-import AdminAuditSection from '@app/components/shared/config/configSections/AdminAuditSection';
-import AdminUsageSection from '@app/components/shared/config/configSections/AdminUsageSection';
export interface ConfigNavItem {
key: NavKey;
@@ -64,133 +52,5 @@ export const createConfigNavSections = (
},
];
- // Add Admin sections if user is admin OR if login is disabled (but mark as disabled)
- if (isAdmin || !loginEnabled) {
- const requiresLogin = !loginEnabled;
- // Configuration
- sections.push({
- title: 'Configuration',
- items: [
- {
- key: 'adminGeneral',
- label: 'System Settings',
- icon: 'settings-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- {
- key: 'adminFeatures',
- label: 'Features',
- icon: 'extension-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- {
- key: 'adminEndpoints',
- label: 'Endpoints',
- icon: 'api-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- {
- key: 'adminDatabase',
- label: 'Database',
- icon: 'storage-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- {
- key: 'adminAdvanced',
- label: 'Advanced',
- icon: 'tune-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- ],
- });
-
- // Security & Authentication
- sections.push({
- title: 'Security & Authentication',
- items: [
- {
- key: 'adminSecurity',
- label: 'Security',
- icon: 'shield-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- {
- key: 'adminConnections',
- label: 'Connections',
- icon: 'link-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- ],
- });
-
- // Licensing & Analytics
- sections.push({
- title: 'Licensing & Analytics',
- items: [
- {
- key: 'adminPremium',
- label: 'Premium',
- icon: 'star-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- {
- key: 'adminAudit',
- label: 'Audit',
- icon: 'fact-check-rounded',
- component: ,
- disabled: !runningEE || requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : 'Requires Enterprise license'
- },
- {
- key: 'adminUsage',
- label: 'Usage Analytics',
- icon: 'analytics-rounded',
- component: ,
- disabled: !runningEE || requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : 'Requires Enterprise license'
- },
- ],
- });
-
- // Policies & Privacy
- sections.push({
- title: 'Policies & Privacy',
- items: [
- {
- key: 'adminLegal',
- label: 'Legal',
- icon: 'gavel-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- {
- key: 'adminPrivacy',
- label: 'Privacy',
- icon: 'visibility-rounded',
- component: ,
- disabled: requiresLogin,
- disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
- },
- ],
- });
- }
-
return sections;
};
diff --git a/frontend/src/proprietary/components/shared/config/configNavSections.tsx b/frontend/src/proprietary/components/shared/config/configNavSections.tsx
index d8f795220..0ee203fc9 100644
--- a/frontend/src/proprietary/components/shared/config/configNavSections.tsx
+++ b/frontend/src/proprietary/components/shared/config/configNavSections.tsx
@@ -2,40 +2,180 @@ import React from 'react';
import { createConfigNavSections as createCoreConfigNavSections, ConfigNavSection } from '@core/components/shared/config/configNavSections';
import PeopleSection from '@app/components/shared/config/configSections/PeopleSection';
import TeamsSection from '@app/components/shared/config/configSections/TeamsSection';
+import AdminGeneralSection from '@app/components/shared/config/configSections/AdminGeneralSection';
+import AdminSecuritySection from '@app/components/shared/config/configSections/AdminSecuritySection';
+import AdminConnectionsSection from '@app/components/shared/config/configSections/AdminConnectionsSection';
+import AdminPrivacySection from '@app/components/shared/config/configSections/AdminPrivacySection';
+import AdminDatabaseSection from '@app/components/shared/config/configSections/AdminDatabaseSection';
+import AdminAdvancedSection from '@app/components/shared/config/configSections/AdminAdvancedSection';
+import AdminLegalSection from '@app/components/shared/config/configSections/AdminLegalSection';
+import AdminPremiumSection from '@app/components/shared/config/configSections/AdminPremiumSection';
+import AdminFeaturesSection from '@app/components/shared/config/configSections/AdminFeaturesSection';
+import AdminEndpointsSection from '@app/components/shared/config/configSections/AdminEndpointsSection';
+import AdminAuditSection from '@app/components/shared/config/configSections/AdminAuditSection';
+import AdminUsageSection from '@app/components/shared/config/configSections/AdminUsageSection';
/**
- * Proprietary extension of createConfigNavSections that adds workspace sections
+ * Proprietary extension of createConfigNavSections that adds all admin and workspace sections
*/
export const createConfigNavSections = (
isAdmin: boolean = false,
runningEE: boolean = false,
loginEnabled: boolean = true
): ConfigNavSection[] => {
- // Get the core sections
+ // Get the core sections (just Preferences)
const sections = createCoreConfigNavSections(isAdmin, runningEE, loginEnabled);
- // Add Workspace section if user is admin
- if (isAdmin) {
- const workspaceSection: ConfigNavSection = {
+ // Add Admin sections if user is admin OR if login is disabled (but mark as disabled)
+ if (isAdmin || !loginEnabled) {
+ const requiresLogin = !loginEnabled;
+
+ // Workspace
+ sections.push({
title: 'Workspace',
items: [
{
key: 'people',
label: 'People',
icon: 'group-rounded',
- component:
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
},
{
key: 'teams',
label: 'Teams',
icon: 'groups-rounded',
- component:
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
},
],
- };
+ });
- // Insert workspace section after Preferences (at index 1)
- sections.splice(1, 0, workspaceSection);
+ // Configuration
+ sections.push({
+ title: 'Configuration',
+ items: [
+ {
+ key: 'adminGeneral',
+ label: 'System Settings',
+ icon: 'settings-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ {
+ key: 'adminFeatures',
+ label: 'Features',
+ icon: 'extension-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ {
+ key: 'adminEndpoints',
+ label: 'Endpoints',
+ icon: 'api-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ {
+ key: 'adminDatabase',
+ label: 'Database',
+ icon: 'storage-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ {
+ key: 'adminAdvanced',
+ label: 'Advanced',
+ icon: 'tune-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ ],
+ });
+
+ // Security & Authentication
+ sections.push({
+ title: 'Security & Authentication',
+ items: [
+ {
+ key: 'adminSecurity',
+ label: 'Security',
+ icon: 'shield-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ {
+ key: 'adminConnections',
+ label: 'Connections',
+ icon: 'link-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ ],
+ });
+
+ // Licensing & Analytics
+ sections.push({
+ title: 'Licensing & Analytics',
+ items: [
+ {
+ key: 'adminPremium',
+ label: 'Premium',
+ icon: 'star-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ {
+ key: 'adminAudit',
+ label: 'Audit',
+ icon: 'fact-check-rounded',
+ component: ,
+ disabled: !runningEE || requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : 'Requires Enterprise license'
+ },
+ {
+ key: 'adminUsage',
+ label: 'Usage Analytics',
+ icon: 'analytics-rounded',
+ component: ,
+ disabled: !runningEE || requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : 'Requires Enterprise license'
+ },
+ ],
+ });
+
+ // Policies & Privacy
+ sections.push({
+ title: 'Policies & Privacy',
+ items: [
+ {
+ key: 'adminLegal',
+ label: 'Legal',
+ icon: 'gavel-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ {
+ key: 'adminPrivacy',
+ label: 'Privacy',
+ icon: 'visibility-rounded',
+ component: ,
+ disabled: requiresLogin,
+ disabledTooltip: requiresLogin ? 'Enable login mode first' : undefined
+ },
+ ],
+ });
}
return sections;
diff --git a/frontend/src/core/components/shared/config/configSections/AdminAdvancedSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminAdvancedSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminAdvancedSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminAdvancedSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminAuditSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminAuditSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminAuditSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminAuditSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminConnectionsSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminConnectionsSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminConnectionsSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminConnectionsSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminDatabaseSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminDatabaseSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminDatabaseSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminDatabaseSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminEndpointsSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminEndpointsSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminEndpointsSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminEndpointsSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminFeaturesSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminFeaturesSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminFeaturesSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminFeaturesSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminGeneralSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminGeneralSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminGeneralSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminGeneralSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminLegalSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminLegalSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminLegalSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminLegalSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminMailSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminMailSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminMailSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminMailSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminPremiumSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminPremiumSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminPremiumSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminPremiumSection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminPrivacySection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminPrivacySection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminPrivacySection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminPrivacySection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminSecuritySection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminSecuritySection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminSecuritySection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminSecuritySection.tsx
diff --git a/frontend/src/core/components/shared/config/configSections/AdminUsageSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx
similarity index 100%
rename from frontend/src/core/components/shared/config/configSections/AdminUsageSection.tsx
rename to frontend/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx
diff --git a/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx
index 090ae2a46..ae5bd6f8b 100644
--- a/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx
+++ b/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx
@@ -28,10 +28,13 @@ import { userManagementService, User } from '@app/services/userManagementService
import { teamService, Team } from '@app/services/teamService';
import { Z_INDEX_OVER_CONFIG_MODAL } from '@app/styles/zIndex';
import { useAppConfig } from '@app/contexts/AppConfigContext';
+import { useLoginRequired } from '@app/hooks/useLoginRequired';
+import LoginRequiredBanner from '@app/components/shared/config/LoginRequiredBanner';
export default function PeopleSection() {
const { t } = useTranslation();
const { config } = useAppConfig();
+ const { loginEnabled } = useLoginRequired();
const [users, setUsers] = useState([]);
const [teams, setTeams] = useState([]);
const [loading, setLoading] = useState(true);
@@ -97,30 +100,103 @@ export default function PeopleSection() {
const fetchData = async () => {
try {
setLoading(true);
- const [adminData, teamsData] = await Promise.all([
- userManagementService.getUsers(),
- teamService.getTeams(),
- ]);
- // Enrich users with session data
- const enrichedUsers = adminData.users.map(user => ({
- ...user,
- isActive: adminData.userSessions[user.username] || false,
- lastRequest: adminData.userLastRequest[user.username] || undefined,
- }));
+ if (loginEnabled) {
+ const [adminData, teamsData] = await Promise.all([
+ userManagementService.getUsers(),
+ teamService.getTeams(),
+ ]);
- setUsers(enrichedUsers);
- setTeams(teamsData);
+ // Enrich users with session data
+ const enrichedUsers = adminData.users.map(user => ({
+ ...user,
+ isActive: adminData.userSessions[user.username] || false,
+ lastRequest: adminData.userLastRequest[user.username] || undefined,
+ }));
- // Store license information
- setLicenseInfo({
- maxAllowedUsers: adminData.maxAllowedUsers,
- availableSlots: adminData.availableSlots,
- grandfatheredUserCount: adminData.grandfatheredUserCount,
- licenseMaxUsers: adminData.licenseMaxUsers,
- premiumEnabled: adminData.premiumEnabled,
- totalUsers: adminData.totalUsers,
- });
+ setUsers(enrichedUsers);
+ setTeams(teamsData);
+
+ // Store license information
+ setLicenseInfo({
+ maxAllowedUsers: adminData.maxAllowedUsers,
+ availableSlots: adminData.availableSlots,
+ grandfatheredUserCount: adminData.grandfatheredUserCount,
+ licenseMaxUsers: adminData.licenseMaxUsers,
+ premiumEnabled: adminData.premiumEnabled,
+ totalUsers: adminData.totalUsers,
+ });
+ } else {
+ // Provide example data when login is disabled
+ const exampleUsers: User[] = [
+ {
+ id: 1,
+ username: 'admin',
+ email: 'admin@example.com',
+ enabled: true,
+ roleName: 'ROLE_ADMIN',
+ rolesAsString: 'ROLE_ADMIN',
+ authenticationType: 'password',
+ isActive: true,
+ lastRequest: new Date().toISOString(),
+ team: { id: 1, name: 'Engineering', userCount: 3 }
+ },
+ {
+ id: 2,
+ username: 'john.doe',
+ email: 'john.doe@example.com',
+ enabled: true,
+ roleName: 'ROLE_USER',
+ rolesAsString: 'ROLE_USER',
+ authenticationType: 'password',
+ isActive: false,
+ lastRequest: new Date(Date.now() - 86400000).toISOString(),
+ team: { id: 1, name: 'Engineering', userCount: 3 }
+ },
+ {
+ id: 3,
+ username: 'jane.smith',
+ email: 'jane.smith@example.com',
+ enabled: true,
+ roleName: 'ROLE_USER',
+ rolesAsString: 'ROLE_USER',
+ authenticationType: 'oauth',
+ isActive: true,
+ lastRequest: new Date().toISOString(),
+ team: { id: 2, name: 'Marketing', userCount: 2 }
+ },
+ {
+ id: 4,
+ username: 'bob.wilson',
+ email: 'bob.wilson@example.com',
+ enabled: false,
+ roleName: 'ROLE_USER',
+ rolesAsString: 'ROLE_USER',
+ authenticationType: 'password',
+ isActive: false,
+ lastRequest: new Date(Date.now() - 604800000).toISOString(),
+ team: undefined
+ }
+ ];
+
+ const exampleTeams: Team[] = [
+ { id: 1, name: 'Engineering', userCount: 3 },
+ { id: 2, name: 'Marketing', userCount: 2 }
+ ];
+
+ setUsers(exampleUsers);
+ setTeams(exampleTeams);
+
+ // Example license information
+ setLicenseInfo({
+ maxAllowedUsers: 10,
+ availableSlots: 6,
+ grandfatheredUserCount: 0,
+ licenseMaxUsers: 5,
+ premiumEnabled: true,
+ totalUsers: 4,
+ });
+ }
} catch (error) {
console.error('Failed to fetch people data:', error);
alert({ alertType: 'error', title: 'Failed to load people data' });
@@ -405,6 +481,7 @@ export default function PeopleSection() {
return (
+
{t('workspace.people.title')}
@@ -457,15 +534,15 @@ export default function PeopleSection() {
style={{ maxWidth: 300 }}
/>
0}
+ label={!loginEnabled ? 'Enable login mode first' : t('workspace.people.license.noSlotsAvailable', 'No user slots available')}
+ disabled={loginEnabled && (!licenseInfo || licenseInfo.availableSlots > 0)}
position="bottom"
withArrow
>
}
onClick={() => setInviteModalOpened(true)}
- disabled={licenseInfo ? licenseInfo.availableSlots === 0 : false}
+ disabled={!loginEnabled || (licenseInfo ? licenseInfo.availableSlots === 0 : false)}
>
{t('workspace.people.addMembers')}
@@ -616,20 +693,21 @@ export default function PeopleSection() {
{/* Actions menu */}