From 2239e9cc2de3302d8b02e3f2fad802e43acb2023 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Wed, 12 Nov 2025 17:18:35 +0000 Subject: [PATCH] move to propietary for settings --- .../shared/config/configNavSections.tsx | 140 --------------- .../shared/config/configNavSections.tsx | 160 ++++++++++++++++-- .../configSections/AdminAdvancedSection.tsx | 0 .../configSections/AdminAuditSection.tsx | 0 .../AdminConnectionsSection.tsx | 0 .../configSections/AdminDatabaseSection.tsx | 0 .../configSections/AdminEndpointsSection.tsx | 0 .../configSections/AdminFeaturesSection.tsx | 0 .../configSections/AdminGeneralSection.tsx | 0 .../configSections/AdminLegalSection.tsx | 0 .../configSections/AdminMailSection.tsx | 0 .../configSections/AdminPremiumSection.tsx | 0 .../configSections/AdminPrivacySection.tsx | 0 .../configSections/AdminSecuritySection.tsx | 0 .../configSections/AdminUsageSection.tsx | 0 .../config/configSections/PeopleSection.tsx | 132 ++++++++++++--- .../config/configSections/TeamsSection.tsx | 34 ++-- .../audit/AuditChartsSection.tsx | 0 .../configSections/audit/AuditEventsTable.tsx | 0 .../audit/AuditExportSection.tsx | 0 .../configSections/audit/AuditFiltersForm.tsx | 0 .../audit/AuditSystemStatus.tsx | 0 .../usage/UsageAnalyticsChart.tsx | 0 .../usage/UsageAnalyticsTable.tsx | 0 .../services/userManagementService.ts | 0 25 files changed, 279 insertions(+), 187 deletions(-) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminAdvancedSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminAuditSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminConnectionsSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminDatabaseSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminEndpointsSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminFeaturesSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminGeneralSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminLegalSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminMailSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminPremiumSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminPrivacySection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminSecuritySection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/AdminUsageSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/audit/AuditChartsSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/audit/AuditEventsTable.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/audit/AuditExportSection.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/audit/AuditFiltersForm.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/audit/AuditSystemStatus.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/usage/UsageAnalyticsChart.tsx (100%) rename frontend/src/{core => proprietary}/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx (100%) rename frontend/src/{core => proprietary}/services/userManagementService.ts (100%) 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 > @@ -616,20 +693,21 @@ export default function PeopleSection() { {/* Actions menu */} - + - openEditModal(user)}>{t('workspace.people.editRole')} + openEditModal(user)} disabled={!loginEnabled}>{t('workspace.people.editRole')} : } onClick={() => handleToggleEnabled(user)} + disabled={!loginEnabled} > {user.enabled ? t('workspace.people.disable') : t('workspace.people.enable')} - } onClick={() => handleDeleteUser(user)}> + } onClick={() => handleDeleteUser(user)} disabled={!loginEnabled}> {t('workspace.people.deleteUser')} diff --git a/frontend/src/proprietary/components/shared/config/configSections/TeamsSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/TeamsSection.tsx index 830370a4f..cfd6346ae 100644 --- a/frontend/src/proprietary/components/shared/config/configSections/TeamsSection.tsx +++ b/frontend/src/proprietary/components/shared/config/configSections/TeamsSection.tsx @@ -22,9 +22,12 @@ import { teamService, Team } from '@app/services/teamService'; import { userManagementService, User } from '@app/services/userManagementService'; import { Z_INDEX_OVER_CONFIG_MODAL } from '@app/styles/zIndex'; import TeamDetailsSection from '@app/components/shared/config/configSections/TeamDetailsSection'; +import { useLoginRequired } from '@app/hooks/useLoginRequired'; +import LoginRequiredBanner from '@app/components/shared/config/LoginRequiredBanner'; export default function TeamsSection() { const { t } = useTranslation(); + const { loginEnabled } = useLoginRequired(); const [teams, setTeams] = useState([]); const [loading, setLoading] = useState(true); const [createModalOpened, setCreateModalOpened] = useState(false); @@ -47,8 +50,18 @@ export default function TeamsSection() { const fetchTeams = async () => { try { setLoading(true); - const teamsData = await teamService.getTeams(); - setTeams(teamsData); + if (loginEnabled) { + const teamsData = await teamService.getTeams(); + setTeams(teamsData); + } else { + // Provide example data when login is disabled + const exampleTeams: Team[] = [ + { id: 1, name: 'Engineering', userCount: 3 }, + { id: 2, name: 'Marketing', userCount: 2 }, + { id: 3, name: 'Internal', userCount: 1 }, + ]; + setTeams(exampleTeams); + } } catch (error) { console.error('Failed to fetch teams:', error); alert({ alertType: 'error', title: 'Failed to load teams' }); @@ -207,6 +220,7 @@ export default function TeamsSection() { return ( +
{t('workspace.teams.title')} @@ -218,7 +232,7 @@ export default function TeamsSection() { {/* Header Actions */} - @@ -257,8 +271,8 @@ export default function TeamsSection() { teams.map((team) => ( setViewingTeamId(team.id)} + style={{ cursor: loginEnabled ? 'pointer' : 'default' }} + onClick={() => loginEnabled && setViewingTeamId(team.id)} > @@ -290,18 +304,18 @@ export default function TeamsSection() { e.stopPropagation()}> - + - } onClick={() => setViewingTeamId(team.id)}> + } onClick={() => setViewingTeamId(team.id)} disabled={!loginEnabled}> {t('workspace.teams.viewTeam', 'View Team')} - } onClick={() => openAddMemberModal(team)}> + } onClick={() => openAddMemberModal(team)} disabled={!loginEnabled}> {t('workspace.teams.addMember')} - } onClick={() => openRenameModal(team)}> + } onClick={() => openRenameModal(team)} disabled={!loginEnabled}> {t('workspace.teams.renameTeamLabel')} @@ -309,7 +323,7 @@ export default function TeamsSection() { color="red" leftSection={} onClick={() => handleDeleteTeam(team)} - disabled={team.name === 'Internal'} + disabled={!loginEnabled || team.name === 'Internal'} > {t('workspace.teams.deleteTeamLabel')} diff --git a/frontend/src/core/components/shared/config/configSections/audit/AuditChartsSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/audit/AuditChartsSection.tsx similarity index 100% rename from frontend/src/core/components/shared/config/configSections/audit/AuditChartsSection.tsx rename to frontend/src/proprietary/components/shared/config/configSections/audit/AuditChartsSection.tsx diff --git a/frontend/src/core/components/shared/config/configSections/audit/AuditEventsTable.tsx b/frontend/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx similarity index 100% rename from frontend/src/core/components/shared/config/configSections/audit/AuditEventsTable.tsx rename to frontend/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx diff --git a/frontend/src/core/components/shared/config/configSections/audit/AuditExportSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/audit/AuditExportSection.tsx similarity index 100% rename from frontend/src/core/components/shared/config/configSections/audit/AuditExportSection.tsx rename to frontend/src/proprietary/components/shared/config/configSections/audit/AuditExportSection.tsx diff --git a/frontend/src/core/components/shared/config/configSections/audit/AuditFiltersForm.tsx b/frontend/src/proprietary/components/shared/config/configSections/audit/AuditFiltersForm.tsx similarity index 100% rename from frontend/src/core/components/shared/config/configSections/audit/AuditFiltersForm.tsx rename to frontend/src/proprietary/components/shared/config/configSections/audit/AuditFiltersForm.tsx diff --git a/frontend/src/core/components/shared/config/configSections/audit/AuditSystemStatus.tsx b/frontend/src/proprietary/components/shared/config/configSections/audit/AuditSystemStatus.tsx similarity index 100% rename from frontend/src/core/components/shared/config/configSections/audit/AuditSystemStatus.tsx rename to frontend/src/proprietary/components/shared/config/configSections/audit/AuditSystemStatus.tsx diff --git a/frontend/src/core/components/shared/config/configSections/usage/UsageAnalyticsChart.tsx b/frontend/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsChart.tsx similarity index 100% rename from frontend/src/core/components/shared/config/configSections/usage/UsageAnalyticsChart.tsx rename to frontend/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsChart.tsx diff --git a/frontend/src/core/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx b/frontend/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx similarity index 100% rename from frontend/src/core/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx rename to frontend/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx diff --git a/frontend/src/core/services/userManagementService.ts b/frontend/src/proprietary/services/userManagementService.ts similarity index 100% rename from frontend/src/core/services/userManagementService.ts rename to frontend/src/proprietary/services/userManagementService.ts