From 9ba4238fe37f8d144e9785811dd54fc6060f9021 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Fri, 14 Nov 2025 11:28:37 +0000 Subject: [PATCH] typecheck --- .../config/configSections/AdminUsageSection.tsx | 1 + .../shared/config/configSections/PeopleSection.tsx | 14 +++++++------- .../configSections/audit/AuditEventsTable.tsx | 10 +++++----- frontend/src/proprietary/routes/Login.tsx | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/frontend/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx index a2f60f034..ef6aaa6ac 100644 --- a/frontend/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx +++ b/frontend/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx @@ -85,6 +85,7 @@ const AdminUsageSection: React.FC = () => { setData({ totalVisits: totalVisits, + totalEndpoints: filteredEndpoints.length, endpoints: filteredEndpoints, }); setLoading(false); diff --git a/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx b/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx index ae5bd6f8b..9ef4e0d01 100644 --- a/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx +++ b/frontend/src/proprietary/components/shared/config/configSections/PeopleSection.tsx @@ -138,8 +138,8 @@ export default function PeopleSection() { rolesAsString: 'ROLE_ADMIN', authenticationType: 'password', isActive: true, - lastRequest: new Date().toISOString(), - team: { id: 1, name: 'Engineering', userCount: 3 } + lastRequest: Date.now(), + team: { id: 1, name: 'Engineering' } }, { id: 2, @@ -150,8 +150,8 @@ export default function PeopleSection() { rolesAsString: 'ROLE_USER', authenticationType: 'password', isActive: false, - lastRequest: new Date(Date.now() - 86400000).toISOString(), - team: { id: 1, name: 'Engineering', userCount: 3 } + lastRequest: Date.now() - 86400000, + team: { id: 1, name: 'Engineering' } }, { id: 3, @@ -162,8 +162,8 @@ export default function PeopleSection() { rolesAsString: 'ROLE_USER', authenticationType: 'oauth', isActive: true, - lastRequest: new Date().toISOString(), - team: { id: 2, name: 'Marketing', userCount: 2 } + lastRequest: Date.now(), + team: { id: 2, name: 'Marketing' } }, { id: 4, @@ -174,7 +174,7 @@ export default function PeopleSection() { rolesAsString: 'ROLE_USER', authenticationType: 'password', isActive: false, - lastRequest: new Date(Date.now() - 604800000).toISOString(), + lastRequest: Date.now() - 604800000, team: undefined } ]; diff --git a/frontend/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx b/frontend/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx index 33adf1d8d..adad94388 100644 --- a/frontend/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx +++ b/frontend/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx @@ -67,7 +67,7 @@ const AuditEventsTable: React.FC = ({ loginEnabled = true eventType: 'LOGIN', username: 'admin', ipAddress: '192.168.1.100', - details: 'User logged in successfully', + details: { message: 'User logged in successfully' }, }, { id: '2', @@ -75,7 +75,7 @@ const AuditEventsTable: React.FC = ({ loginEnabled = true eventType: 'FILE_UPLOAD', username: 'user1', ipAddress: '192.168.1.101', - details: 'Uploaded document.pdf', + details: { message: 'Uploaded document.pdf' }, }, { id: '3', @@ -83,7 +83,7 @@ const AuditEventsTable: React.FC = ({ loginEnabled = true eventType: 'SETTINGS_CHANGE', username: 'admin', ipAddress: '192.168.1.100', - details: 'Modified system settings', + details: { message: 'Modified system settings' }, }, { id: '4', @@ -91,7 +91,7 @@ const AuditEventsTable: React.FC = ({ loginEnabled = true eventType: 'FILE_DOWNLOAD', username: 'user2', ipAddress: '192.168.1.102', - details: 'Downloaded report.pdf', + details: { message: 'Downloaded report.pdf' }, }, { id: '5', @@ -99,7 +99,7 @@ const AuditEventsTable: React.FC = ({ loginEnabled = true eventType: 'LOGOUT', username: 'user1', ipAddress: '192.168.1.101', - details: 'User logged out', + details: { message: 'User logged out' }, }, ]); setTotalPages(1); diff --git a/frontend/src/proprietary/routes/Login.tsx b/frontend/src/proprietary/routes/Login.tsx index bbca13307..983047c80 100644 --- a/frontend/src/proprietary/routes/Login.tsx +++ b/frontend/src/proprietary/routes/Login.tsx @@ -51,7 +51,7 @@ export default function Login() { // The keys are like "/oauth2/authorization/google" - extract the last part const providerIds = Object.keys(data.providerList || {}) .map(key => key.split('/').pop()) - .filter(id => id); + .filter((id): id is string => id !== undefined); setEnabledProviders(providerIds); } } catch (err) { @@ -124,7 +124,7 @@ export default function Login() { return ; } - const signInWithProvider = async (provider: 'github' | 'google' | 'apple' | 'azure') => { + const signInWithProvider = async (provider: 'github' | 'google' | 'apple' | 'azure' | 'keycloak' | 'oidc') => { try { setIsSigningIn(true); setError(null);