typecheck

This commit is contained in:
Anthony Stirling 2025-11-14 11:28:37 +00:00
parent 1db931c94b
commit 9ba4238fe3
4 changed files with 15 additions and 14 deletions

View File

@ -85,6 +85,7 @@ const AdminUsageSection: React.FC = () => {
setData({
totalVisits: totalVisits,
totalEndpoints: filteredEndpoints.length,
endpoints: filteredEndpoints,
});
setLoading(false);

View File

@ -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
}
];

View File

@ -67,7 +67,7 @@ const AuditEventsTable: React.FC<AuditEventsTableProps> = ({ 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<AuditEventsTableProps> = ({ 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<AuditEventsTableProps> = ({ 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<AuditEventsTableProps> = ({ 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<AuditEventsTableProps> = ({ loginEnabled = true
eventType: 'LOGOUT',
username: 'user1',
ipAddress: '192.168.1.101',
details: 'User logged out',
details: { message: 'User logged out' },
},
]);
setTotalPages(1);

View File

@ -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 <LoggedInState />;
}
const signInWithProvider = async (provider: 'github' | 'google' | 'apple' | 'azure') => {
const signInWithProvider = async (provider: 'github' | 'google' | 'apple' | 'azure' | 'keycloak' | 'oidc') => {
try {
setIsSigningIn(true);
setError(null);