@jmruthers/pace-core 0.5.110 → 0.5.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuthService-DrHrvXNZ.d.ts → AuthService-CVgsgtaZ.d.ts} +8 -0
- package/dist/{DataTable-D3BK2FCN.js → DataTable-5W2HVLLV.js} +8 -8
- package/dist/{UnifiedAuthProvider-A7I23UCN.js → UnifiedAuthProvider-LUM3QLS5.js} +3 -3
- package/dist/{api-PIE4JRFS.js → api-SIZPFBFX.js} +5 -3
- package/dist/{audit-65VNHEV2.js → audit-5JI5T3SL.js} +2 -2
- package/dist/{chunk-3J5N2T2N.js → chunk-2BIDKXQU.js} +113 -116
- package/dist/chunk-2BIDKXQU.js.map +1 -0
- package/dist/{chunk-AWK2FAUN.js → chunk-ACYQNYHB.js} +7 -7
- package/dist/{chunk-D6MEKC27.js → chunk-EFVQBYFN.js} +2 -2
- package/dist/{chunk-EZ64QG2I.js → chunk-I5YM5BGS.js} +2 -2
- package/dist/{chunk-Q7APDV6H.js → chunk-IWJYNWXN.js} +13 -5
- package/dist/chunk-IWJYNWXN.js.map +1 -0
- package/dist/{chunk-YFMENCR4.js → chunk-JE2GFA3O.js} +3 -3
- package/dist/{chunk-AUXS7XSO.js → chunk-MW73E7SP.js} +35 -11
- package/dist/chunk-MW73E7SP.js.map +1 -0
- package/dist/{chunk-XRSP3H52.js → chunk-PXXS26G5.js} +57 -23
- package/dist/chunk-PXXS26G5.js.map +1 -0
- package/dist/{chunk-HGZSO43Y.js → chunk-TD4BXGPE.js} +4 -4
- package/dist/{chunk-EYSXQ756.js → chunk-TDFBX7KJ.js} +2 -2
- package/dist/{chunk-HADXAZT3.js → chunk-UGVU7L7N.js} +52 -90
- package/dist/chunk-UGVU7L7N.js.map +1 -0
- package/dist/{chunk-2W4WKJVF.js → chunk-X7SPKHYZ.js} +290 -255
- package/dist/chunk-X7SPKHYZ.js.map +1 -0
- package/dist/{chunk-7GBEBJLR.js → chunk-ZL45MG76.js} +45 -37
- package/dist/chunk-ZL45MG76.js.map +1 -0
- package/dist/components.js +10 -10
- package/dist/hooks.d.ts +11 -1
- package/dist/hooks.js +9 -7
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -13
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +2 -2
- package/dist/rbac/index.d.ts +13 -8
- package/dist/rbac/index.js +9 -9
- package/dist/utils.js +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +4 -4
- package/docs/api/classes/MissingUserContextError.md +4 -4
- package/docs/api/classes/OrganisationContextRequiredError.md +4 -4
- package/docs/api/classes/PermissionDeniedError.md +4 -4
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +8 -8
- package/docs/api/classes/RBACCache.md +8 -8
- package/docs/api/classes/RBACEngine.md +4 -4
- package/docs/api/classes/RBACError.md +4 -4
- package/docs/api/classes/RBACNotInitializedError.md +4 -4
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
- package/docs/api/interfaces/PaceLoginPageProps.md +4 -4
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +8 -8
- package/docs/api/interfaces/RoleBasedRouterProps.md +10 -10
- package/docs/api/interfaces/RouteAccessRecord.md +10 -10
- package/docs/api/interfaces/RouteConfig.md +19 -6
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +36 -36
- package/docs/api-reference/hooks.md +8 -4
- package/docs/architecture/rpc-function-standards.md +3 -1
- package/docs/best-practices/common-patterns.md +3 -3
- package/docs/best-practices/deployment.md +10 -4
- package/docs/best-practices/performance.md +11 -3
- package/docs/core-concepts/organisations.md +8 -8
- package/docs/core-concepts/permissions.md +133 -72
- package/docs/migration/rbac-migration.md +65 -66
- package/docs/rbac/advanced-patterns.md +15 -22
- package/docs/rbac/examples.md +12 -12
- package/docs/rbac/getting-started.md +3 -3
- package/docs/rbac/troubleshooting.md +2 -1
- package/package.json +1 -1
- package/src/components/DataTable/components/__tests__/ActionButtons.test.tsx +913 -0
- package/src/components/DataTable/components/__tests__/ColumnFilter.test.tsx +609 -0
- package/src/components/DataTable/components/__tests__/EmptyState.test.tsx +434 -0
- package/src/components/DataTable/components/__tests__/LoadingState.test.tsx +120 -0
- package/src/components/DataTable/components/__tests__/PaginationControls.test.tsx +519 -0
- package/src/components/DataTable/examples/__tests__/HierarchicalActionsExample.test.tsx +316 -0
- package/src/components/DataTable/examples/__tests__/InitialPageSizeExample.test.tsx +211 -0
- package/src/components/FileUpload/FileUpload.tsx +2 -8
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +193 -63
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +102 -135
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +41 -2
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +61 -6
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +71 -21
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +113 -41
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +155 -45
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +30 -1
- package/src/hooks/__tests__/usePermissionCache.simple.test.ts +63 -5
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +156 -72
- package/src/hooks/__tests__/useRBAC.unit.test.ts +4 -38
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useFileDisplay.ts +51 -0
- package/src/hooks/usePermissionCache.test.ts +112 -68
- package/src/hooks/usePermissionCache.ts +55 -15
- package/src/rbac/README.md +81 -39
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +3 -3
- package/src/rbac/__tests__/engine.comprehensive.test.ts +15 -6
- package/src/rbac/__tests__/rbac-core.test.tsx +1 -1
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +57 -4
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +3 -2
- package/src/rbac/adapters.tsx +4 -4
- package/src/rbac/api.test.ts +37 -13
- package/src/rbac/api.ts +25 -8
- package/src/rbac/audit.test.ts +2 -2
- package/src/rbac/audit.ts +14 -5
- package/src/rbac/cache.test.ts +12 -0
- package/src/rbac/cache.ts +29 -9
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +1 -1
- package/src/rbac/components/NavigationGuard.tsx +14 -14
- package/src/rbac/components/NavigationProvider.test.tsx +1 -1
- package/src/rbac/components/PagePermissionGuard.tsx +4 -3
- package/src/rbac/components/PagePermissionProvider.test.tsx +1 -1
- package/src/rbac/components/PermissionEnforcer.tsx +19 -15
- package/src/rbac/components/RoleBasedRouter.tsx +16 -9
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +123 -107
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +1 -1
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +121 -103
- package/src/rbac/docs/event-based-apps.md +6 -6
- package/src/rbac/engine.ts +12 -2
- package/src/rbac/hooks/useCan.test.ts +29 -2
- package/src/rbac/hooks/usePermissions.test.ts +25 -25
- package/src/rbac/hooks/usePermissions.ts +47 -23
- package/src/rbac/hooks/useRBAC.simple.test.ts +1 -8
- package/src/rbac/hooks/useRBAC.test.ts +3 -40
- package/src/rbac/hooks/useRBAC.ts +0 -55
- package/src/rbac/hooks/useResolvedScope.ts +23 -31
- package/src/rbac/permissions.test.ts +11 -7
- package/src/rbac/security.test.ts +2 -2
- package/src/rbac/security.ts +22 -7
- package/src/rbac/types.test.ts +2 -2
- package/src/rbac/types.ts +1 -2
- package/src/services/EventService.ts +41 -13
- package/src/services/__tests__/EventService.test.ts +25 -4
- package/src/services/interfaces/IEventService.ts +1 -0
- package/src/utils/file-reference.ts +9 -0
- package/dist/chunk-2W4WKJVF.js.map +0 -1
- package/dist/chunk-3J5N2T2N.js.map +0 -1
- package/dist/chunk-7GBEBJLR.js.map +0 -1
- package/dist/chunk-AUXS7XSO.js.map +0 -1
- package/dist/chunk-HADXAZT3.js.map +0 -1
- package/dist/chunk-Q7APDV6H.js.map +0 -1
- package/dist/chunk-XRSP3H52.js.map +0 -1
- /package/dist/{DataTable-D3BK2FCN.js.map → DataTable-5W2HVLLV.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-A7I23UCN.js.map → UnifiedAuthProvider-LUM3QLS5.js.map} +0 -0
- /package/dist/{api-PIE4JRFS.js.map → api-SIZPFBFX.js.map} +0 -0
- /package/dist/{audit-65VNHEV2.js.map → audit-5JI5T3SL.js.map} +0 -0
- /package/dist/{chunk-AWK2FAUN.js.map → chunk-ACYQNYHB.js.map} +0 -0
- /package/dist/{chunk-D6MEKC27.js.map → chunk-EFVQBYFN.js.map} +0 -0
- /package/dist/{chunk-EZ64QG2I.js.map → chunk-I5YM5BGS.js.map} +0 -0
- /package/dist/{chunk-YFMENCR4.js.map → chunk-JE2GFA3O.js.map} +0 -0
- /package/dist/{chunk-HGZSO43Y.js.map → chunk-TD4BXGPE.js.map} +0 -0
- /package/dist/{chunk-EYSXQ756.js.map → chunk-TDFBX7KJ.js.map} +0 -0
|
@@ -76,6 +76,7 @@ interface IEventService {
|
|
|
76
76
|
setSelectedEvent(event: Event | null): void;
|
|
77
77
|
refreshEvents(): Promise<void>;
|
|
78
78
|
loadPersistedEvent(events: Event[]): Promise<boolean>;
|
|
79
|
+
restorePersistedEvent(): Promise<boolean>;
|
|
79
80
|
persistEventSelection(eventId: string): void;
|
|
80
81
|
autoSelectNextEvent(events: Event[]): void;
|
|
81
82
|
initialize(): Promise<void>;
|
|
@@ -116,6 +117,13 @@ declare class EventService extends BaseService implements IEventService {
|
|
|
116
117
|
setSelectedEvent(event: Event | null): void;
|
|
117
118
|
refreshEvents(): Promise<void>;
|
|
118
119
|
loadPersistedEvent(events: Event[]): Promise<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* Restore persisted event after login screen has rendered
|
|
122
|
+
* This should be called explicitly from login page component
|
|
123
|
+
*
|
|
124
|
+
* @returns Promise<boolean> - true if event was successfully restored, false otherwise
|
|
125
|
+
*/
|
|
126
|
+
restorePersistedEvent(): Promise<boolean>;
|
|
119
127
|
persistEventSelection(eventId: string): void;
|
|
120
128
|
clearEventSelection(): void;
|
|
121
129
|
autoSelectNextEvent(events: Event[]): void;
|
|
@@ -54,10 +54,10 @@ import {
|
|
|
54
54
|
sortHierarchicalDataWithSorting,
|
|
55
55
|
validateHierarchicalData,
|
|
56
56
|
validatePaginationConfig
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
57
|
+
} from "./chunk-TD4BXGPE.js";
|
|
58
|
+
import "./chunk-UGVU7L7N.js";
|
|
59
|
+
import "./chunk-PXXS26G5.js";
|
|
60
|
+
import "./chunk-IWJYNWXN.js";
|
|
61
61
|
import {
|
|
62
62
|
CircuitBreaker,
|
|
63
63
|
DEFAULT_FALLBACK_CONFIG,
|
|
@@ -76,9 +76,9 @@ import {
|
|
|
76
76
|
throttle,
|
|
77
77
|
useDataTablePerformance
|
|
78
78
|
} from "./chunk-4OX5PXHX.js";
|
|
79
|
-
import "./chunk-
|
|
80
|
-
import "./chunk-
|
|
81
|
-
import "./chunk-
|
|
79
|
+
import "./chunk-I5YM5BGS.js";
|
|
80
|
+
import "./chunk-TDFBX7KJ.js";
|
|
81
|
+
import "./chunk-MW73E7SP.js";
|
|
82
82
|
import "./chunk-PYUXFQJ3.js";
|
|
83
83
|
import "./chunk-JCQZ6LA7.js";
|
|
84
84
|
import "./chunk-BDZUMRBD.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
validateHierarchicalData,
|
|
158
158
|
validatePaginationConfig
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=DataTable-
|
|
160
|
+
//# sourceMappingURL=DataTable-5W2HVLLV.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_UnifiedAuthProvider
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TDFBX7KJ.js";
|
|
4
4
|
import {
|
|
5
5
|
UnifiedAuthProvider,
|
|
6
6
|
useUnifiedAuth
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MW73E7SP.js";
|
|
8
8
|
import "./chunk-BDZUMRBD.js";
|
|
9
9
|
import "./chunk-SMJZMKYN.js";
|
|
10
10
|
import "./chunk-PLDDJCW6.js";
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
UnifiedAuthProvider,
|
|
14
14
|
useUnifiedAuth
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=UnifiedAuthProvider-
|
|
16
|
+
//# sourceMappingURL=UnifiedAuthProvider-LUM3QLS5.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
OrganisationContextRequiredError,
|
|
2
3
|
clearCache,
|
|
3
4
|
getAccessLevel,
|
|
4
5
|
getAppConfig,
|
|
@@ -19,10 +20,11 @@ import {
|
|
|
19
20
|
isSuperAdmin,
|
|
20
21
|
resolveAppContext,
|
|
21
22
|
setupRBAC
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-PXXS26G5.js";
|
|
24
|
+
import "./chunk-IWJYNWXN.js";
|
|
24
25
|
import "./chunk-PLDDJCW6.js";
|
|
25
26
|
export {
|
|
27
|
+
OrganisationContextRequiredError,
|
|
26
28
|
clearCache,
|
|
27
29
|
getAccessLevel,
|
|
28
30
|
getAppConfig,
|
|
@@ -44,4 +46,4 @@ export {
|
|
|
44
46
|
resolveAppContext,
|
|
45
47
|
setupRBAC
|
|
46
48
|
};
|
|
47
|
-
//# sourceMappingURL=api-
|
|
49
|
+
//# sourceMappingURL=api-SIZPFBFX.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
emitAuditEvent,
|
|
5
5
|
getGlobalAuditManager,
|
|
6
6
|
setGlobalAuditManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IWJYNWXN.js";
|
|
8
8
|
import "./chunk-PLDDJCW6.js";
|
|
9
9
|
export {
|
|
10
10
|
RBACAuditManager,
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
getGlobalAuditManager,
|
|
14
14
|
setGlobalAuditManager
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=audit-
|
|
16
|
+
//# sourceMappingURL=audit-5JI5T3SL.js.map
|
|
@@ -25,16 +25,16 @@ import {
|
|
|
25
25
|
SelectSeparator,
|
|
26
26
|
SelectTrigger,
|
|
27
27
|
SelectValue
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-TD4BXGPE.js";
|
|
29
29
|
import {
|
|
30
|
+
useCan,
|
|
30
31
|
usePermissions,
|
|
31
32
|
useRBAC,
|
|
32
33
|
useResolvedScope
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-UGVU7L7N.js";
|
|
34
35
|
import {
|
|
35
|
-
isPermitted,
|
|
36
36
|
isSuperAdmin
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-PXXS26G5.js";
|
|
38
38
|
import {
|
|
39
39
|
OrganisationProvider_exports,
|
|
40
40
|
PublicErrorBoundary,
|
|
@@ -49,18 +49,19 @@ import {
|
|
|
49
49
|
useIsPublicPage,
|
|
50
50
|
usePublicFileDisplay,
|
|
51
51
|
usePublicPageContext
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-X7SPKHYZ.js";
|
|
53
53
|
import {
|
|
54
54
|
useToast
|
|
55
55
|
} from "./chunk-4OX5PXHX.js";
|
|
56
56
|
import {
|
|
57
|
+
init_useOrganisations,
|
|
57
58
|
useEvents,
|
|
58
59
|
useOrganisations
|
|
59
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-I5YM5BGS.js";
|
|
60
61
|
import {
|
|
61
62
|
UnifiedAuthProvider_exports,
|
|
62
63
|
init_UnifiedAuthProvider as init_UnifiedAuthProvider2
|
|
63
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-TDFBX7KJ.js";
|
|
64
65
|
import {
|
|
65
66
|
EventServiceContext,
|
|
66
67
|
EventServiceProvider,
|
|
@@ -70,7 +71,7 @@ import {
|
|
|
70
71
|
useEventService,
|
|
71
72
|
useSessionRestoration,
|
|
72
73
|
useUnifiedAuth
|
|
73
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-MW73E7SP.js";
|
|
74
75
|
import {
|
|
75
76
|
LoadingSpinner
|
|
76
77
|
} from "./chunk-CDQ3PX7L.js";
|
|
@@ -1372,7 +1373,8 @@ Footer.displayName = "Footer";
|
|
|
1372
1373
|
|
|
1373
1374
|
// src/components/PaceAppLayout/PaceAppLayout.tsx
|
|
1374
1375
|
init_UnifiedAuthProvider2();
|
|
1375
|
-
|
|
1376
|
+
init_useOrganisations();
|
|
1377
|
+
import { useState as useState5, useEffect as useEffect3, useMemo as useMemo5 } from "react";
|
|
1376
1378
|
import { Outlet, useNavigate, useLocation } from "react-router-dom";
|
|
1377
1379
|
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1378
1380
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
@@ -1407,48 +1409,31 @@ function PaceAppLayout({
|
|
|
1407
1409
|
onRouteAccessDenied,
|
|
1408
1410
|
onRouteStrictModeViolation
|
|
1409
1411
|
}) {
|
|
1410
|
-
const { user, signOut, updatePassword } = useUnifiedAuth();
|
|
1412
|
+
const { user, signOut, updatePassword, supabase } = useUnifiedAuth();
|
|
1413
|
+
const { selectedOrganisation } = useOrganisations();
|
|
1411
1414
|
const navigate = useNavigate();
|
|
1412
1415
|
const location = useLocation();
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1416
|
+
let selectedEvent = null;
|
|
1417
|
+
try {
|
|
1418
|
+
const eventsContext = useEvents();
|
|
1419
|
+
selectedEvent = eventsContext.selectedEvent;
|
|
1420
|
+
} catch (error) {
|
|
1421
|
+
}
|
|
1422
|
+
const { resolvedScope } = useResolvedScope({
|
|
1423
|
+
supabase: supabase || null,
|
|
1424
|
+
selectedOrganisationId: selectedOrganisation?.id || null,
|
|
1425
|
+
selectedEventId: selectedEvent?.event_id || null
|
|
1426
|
+
});
|
|
1427
|
+
const scope = useMemo5(() => {
|
|
1428
|
+
if (!resolvedScope?.organisationId) {
|
|
1429
|
+
return {
|
|
1430
|
+
organisationId: selectedOrganisation?.id || "",
|
|
1431
|
+
eventId: selectedEvent?.event_id || void 0,
|
|
1432
|
+
appId: void 0
|
|
1420
1433
|
};
|
|
1421
|
-
try {
|
|
1422
|
-
const { isSuperAdmin: isSuperAdmin2 } = await import("./api-PIE4JRFS.js");
|
|
1423
|
-
const isSuper = await isSuperAdmin2(user.id);
|
|
1424
|
-
if (isSuper) {
|
|
1425
|
-
return true;
|
|
1426
|
-
}
|
|
1427
|
-
} catch (error) {
|
|
1428
|
-
if (error && typeof error === "object" && "code" in error && error.code === "RBAC_NOT_INITIALIZED") {
|
|
1429
|
-
} else {
|
|
1430
|
-
throw error;
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
if (!scope.organisationId) {
|
|
1434
|
-
console.warn("No organisation context available for permission check, denying access");
|
|
1435
|
-
return false;
|
|
1436
|
-
}
|
|
1437
|
-
const fullPermission = permission.includes(":") ? permission : pageId ? `${permission}:page.${pageId}` : permission;
|
|
1438
|
-
return await isPermitted({
|
|
1439
|
-
userId: user.id,
|
|
1440
|
-
scope,
|
|
1441
|
-
permission: fullPermission,
|
|
1442
|
-
pageId
|
|
1443
|
-
});
|
|
1444
|
-
} catch (error) {
|
|
1445
|
-
console.error("Permission check failed:", error);
|
|
1446
|
-
throw error;
|
|
1447
1434
|
}
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
const [isCheckingPermission, setIsCheckingPermission] = useState5(false);
|
|
1451
|
-
const [permissionError, setPermissionError] = useState5(null);
|
|
1435
|
+
return resolvedScope;
|
|
1436
|
+
}, [resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id]);
|
|
1452
1437
|
const defaultNavItems = useMemo5(() => [
|
|
1453
1438
|
{ id: "home", label: "Home", href: "/", icon: "Home" },
|
|
1454
1439
|
{ id: "dashboard", label: "Dashboard", href: "/dashboard", icon: "LayoutDashboard" },
|
|
@@ -1465,60 +1450,54 @@ function PaceAppLayout({
|
|
|
1465
1450
|
const currentPath = location.pathname;
|
|
1466
1451
|
return pageIdMapping[currentPath] || currentPath.slice(1) || "home";
|
|
1467
1452
|
}, [location.pathname, pageIdMapping]);
|
|
1453
|
+
const currentPermission = useMemo5(() => {
|
|
1454
|
+
if (!enforcePermissions) {
|
|
1455
|
+
return "read:page.home";
|
|
1456
|
+
}
|
|
1457
|
+
const permissionString = `${currentRoutePermission}:page.${currentPageId}`;
|
|
1458
|
+
return permissionString;
|
|
1459
|
+
}, [enforcePermissions, currentRoutePermission, currentPageId]);
|
|
1460
|
+
const { can, isLoading: isCheckingPermission, error: permissionError } = useCan(
|
|
1461
|
+
user?.id || "",
|
|
1462
|
+
scope,
|
|
1463
|
+
currentPermission,
|
|
1464
|
+
currentPageId,
|
|
1465
|
+
true
|
|
1466
|
+
// useCache
|
|
1467
|
+
);
|
|
1468
|
+
const hasPermission = enforcePermissions ? can : true;
|
|
1468
1469
|
useEffect3(() => {
|
|
1469
1470
|
if (!enforcePermissions) {
|
|
1470
|
-
setHasPermission(true);
|
|
1471
1471
|
return;
|
|
1472
1472
|
}
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
operation: currentRoutePermission,
|
|
1496
|
-
userId: user?.id,
|
|
1497
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1498
|
-
});
|
|
1499
|
-
if (onStrictModeViolation) {
|
|
1500
|
-
onStrictModeViolation(currentPageId, currentRoutePermission);
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
if (!hasAccess && onPageAccessDenied) {
|
|
1504
|
-
onPageAccessDenied(currentPageId, currentRoutePermission);
|
|
1505
|
-
}
|
|
1506
|
-
} catch (error) {
|
|
1507
|
-
if (!isMounted) return;
|
|
1508
|
-
console.error(`[PaceAppLayout] Permission check failed for ${currentPageId}:`, error);
|
|
1509
|
-
setPermissionError(error instanceof Error ? error : new Error("Permission check failed"));
|
|
1510
|
-
setHasPermission(false);
|
|
1511
|
-
} finally {
|
|
1512
|
-
if (isMounted) {
|
|
1513
|
-
setIsCheckingPermission(false);
|
|
1514
|
-
}
|
|
1473
|
+
if (isCheckingPermission) {
|
|
1474
|
+
return;
|
|
1475
|
+
}
|
|
1476
|
+
if (auditLog) {
|
|
1477
|
+
console.log(`[PaceAppLayout] Page access attempt:`, {
|
|
1478
|
+
pageName: currentPageId,
|
|
1479
|
+
operation: currentRoutePermission,
|
|
1480
|
+
userId: user?.id,
|
|
1481
|
+
allowed: can,
|
|
1482
|
+
strictMode,
|
|
1483
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
if (strictMode && !can) {
|
|
1487
|
+
console.error(`[PaceAppLayout] STRICT MODE VIOLATION: User attempted to access protected page without permission`, {
|
|
1488
|
+
pageName: currentPageId,
|
|
1489
|
+
operation: currentRoutePermission,
|
|
1490
|
+
userId: user?.id,
|
|
1491
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1492
|
+
});
|
|
1493
|
+
if (onStrictModeViolation) {
|
|
1494
|
+
onStrictModeViolation(currentPageId, currentRoutePermission);
|
|
1515
1495
|
}
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
}, [enforcePermissions, currentRoutePermission, currentPageId, strictMode, user?.id]);
|
|
1496
|
+
}
|
|
1497
|
+
if (!can && onPageAccessDenied) {
|
|
1498
|
+
onPageAccessDenied(currentPageId, currentRoutePermission);
|
|
1499
|
+
}
|
|
1500
|
+
}, [enforcePermissions, can, isCheckingPermission, currentPageId, currentRoutePermission, user?.id, strictMode, auditLog, onPageAccessDenied, onStrictModeViolation]);
|
|
1522
1501
|
const [filteredMenuItems, setFilteredMenuItems] = useState5(baseMenuItems);
|
|
1523
1502
|
useEffect3(() => {
|
|
1524
1503
|
if (!filterNavigationByPermissions) {
|
|
@@ -1533,13 +1512,13 @@ function PaceAppLayout({
|
|
|
1533
1512
|
}
|
|
1534
1513
|
return;
|
|
1535
1514
|
}
|
|
1536
|
-
const
|
|
1515
|
+
const scope2 = {
|
|
1537
1516
|
organisationId: user.user_metadata?.organisationId || user.app_metadata?.organisationId,
|
|
1538
1517
|
eventId: user.user_metadata?.eventId || user.app_metadata?.eventId,
|
|
1539
1518
|
appId: user.user_metadata?.appId || user.app_metadata?.appId
|
|
1540
1519
|
};
|
|
1541
1520
|
try {
|
|
1542
|
-
const { isSuperAdmin: isSuperAdmin2 } = await import("./api-
|
|
1521
|
+
const { isSuperAdmin: isSuperAdmin2 } = await import("./api-SIZPFBFX.js");
|
|
1543
1522
|
const isSuper = await isSuperAdmin2(user.id);
|
|
1544
1523
|
if (isSuper) {
|
|
1545
1524
|
if (isMounted) {
|
|
@@ -1553,17 +1532,17 @@ function PaceAppLayout({
|
|
|
1553
1532
|
throw error;
|
|
1554
1533
|
}
|
|
1555
1534
|
}
|
|
1556
|
-
if (!
|
|
1535
|
+
if (!scope2.organisationId) {
|
|
1557
1536
|
if (isMounted) {
|
|
1558
1537
|
setFilteredMenuItems(baseMenuItems);
|
|
1559
1538
|
}
|
|
1560
1539
|
return;
|
|
1561
1540
|
}
|
|
1562
1541
|
try {
|
|
1563
|
-
const { getPermissionMap } = await import("./api-
|
|
1542
|
+
const { getPermissionMap } = await import("./api-SIZPFBFX.js");
|
|
1564
1543
|
const permissionMap = await getPermissionMap({
|
|
1565
1544
|
userId: user.id,
|
|
1566
|
-
scope
|
|
1545
|
+
scope: scope2
|
|
1567
1546
|
});
|
|
1568
1547
|
const filtered = baseMenuItems.map((item) => {
|
|
1569
1548
|
if (!item.href) return { item, hasAccess: true };
|
|
@@ -1596,7 +1575,7 @@ function PaceAppLayout({
|
|
|
1596
1575
|
return () => {
|
|
1597
1576
|
isMounted = false;
|
|
1598
1577
|
};
|
|
1599
|
-
}, [baseMenuItems, filterNavigationByPermissions, pageIdMapping, routePermissions, defaultPermission,
|
|
1578
|
+
}, [baseMenuItems, filterNavigationByPermissions, pageIdMapping, routePermissions, defaultPermission, can, user?.id, user?.user_metadata, user?.app_metadata]);
|
|
1600
1579
|
useEffect3(() => {
|
|
1601
1580
|
if (!roleBasedRouting || routeConfig.length === 0) return;
|
|
1602
1581
|
let isMounted = true;
|
|
@@ -1619,7 +1598,13 @@ function PaceAppLayout({
|
|
|
1619
1598
|
let hasAccess = true;
|
|
1620
1599
|
if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
|
|
1621
1600
|
try {
|
|
1622
|
-
const
|
|
1601
|
+
const { isPermittedCached } = await import("./api-SIZPFBFX.js");
|
|
1602
|
+
const hasPagePermission = await isPermittedCached({
|
|
1603
|
+
userId: user?.id || "",
|
|
1604
|
+
scope,
|
|
1605
|
+
permission: currentRoute.permissions[0],
|
|
1606
|
+
pageId: currentRoute.pageId
|
|
1607
|
+
});
|
|
1623
1608
|
if (!isMounted) return;
|
|
1624
1609
|
hasAccess = hasPagePermission;
|
|
1625
1610
|
} catch (error) {
|
|
@@ -1629,7 +1614,7 @@ function PaceAppLayout({
|
|
|
1629
1614
|
}
|
|
1630
1615
|
}
|
|
1631
1616
|
if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
|
|
1632
|
-
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-
|
|
1617
|
+
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-LUM3QLS5.js");
|
|
1633
1618
|
hasAccess = true;
|
|
1634
1619
|
}
|
|
1635
1620
|
if (!isMounted) return;
|
|
@@ -1669,7 +1654,7 @@ function PaceAppLayout({
|
|
|
1669
1654
|
return () => {
|
|
1670
1655
|
isMounted = false;
|
|
1671
1656
|
};
|
|
1672
|
-
}, [roleBasedRouting, routeConfig, location.pathname, strictMode, user?.id, fallbackRoute,
|
|
1657
|
+
}, [roleBasedRouting, routeConfig, location.pathname, strictMode, user?.id, fallbackRoute, scope, navigate, auditLog, onRouteAccessDenied, onRouteStrictModeViolation]);
|
|
1673
1658
|
const handleSignOut = async () => {
|
|
1674
1659
|
await signOut();
|
|
1675
1660
|
};
|
|
@@ -1737,9 +1722,10 @@ function PaceAppLayout({
|
|
|
1737
1722
|
}
|
|
1738
1723
|
|
|
1739
1724
|
// src/components/PaceLoginPage/PaceLoginPage.tsx
|
|
1740
|
-
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1725
|
+
import { useEffect as useEffect4, useState as useState6, useContext } from "react";
|
|
1741
1726
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
1742
1727
|
init_runtime();
|
|
1728
|
+
init_EventServiceProvider();
|
|
1743
1729
|
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1744
1730
|
var PaceLoginPage = ({
|
|
1745
1731
|
appName = "Pace",
|
|
@@ -1751,9 +1737,27 @@ var PaceLoginPage = ({
|
|
|
1751
1737
|
const [isSigningIn, setIsSigningIn] = useState6(false);
|
|
1752
1738
|
const [accessError, setAccessError] = useState6(null);
|
|
1753
1739
|
const [isCheckingAccess, setIsCheckingAccess] = useState6(false);
|
|
1740
|
+
const eventServiceContext = useContext(EventServiceContext);
|
|
1741
|
+
const eventService = eventServiceContext?.eventService || null;
|
|
1754
1742
|
useEffect4(() => {
|
|
1755
1743
|
clearPalette();
|
|
1756
1744
|
}, []);
|
|
1745
|
+
useEffect4(() => {
|
|
1746
|
+
const restoreEvent = async () => {
|
|
1747
|
+
try {
|
|
1748
|
+
const isOnLoginPage = window.location.pathname === "/login" || window.location.pathname.startsWith("/login");
|
|
1749
|
+
if (isOnLoginPage && eventService) {
|
|
1750
|
+
await eventService.restorePersistedEvent();
|
|
1751
|
+
}
|
|
1752
|
+
} catch (error) {
|
|
1753
|
+
console.debug("[PaceLoginPage] Could not restore persisted event (service may not be ready):", error);
|
|
1754
|
+
}
|
|
1755
|
+
};
|
|
1756
|
+
const timeoutId = setTimeout(() => {
|
|
1757
|
+
restoreEvent();
|
|
1758
|
+
}, 100);
|
|
1759
|
+
return () => clearTimeout(timeoutId);
|
|
1760
|
+
}, [eventService]);
|
|
1757
1761
|
useEffect4(() => {
|
|
1758
1762
|
if (!requireAppAccess || !isAuthenticated || isLoading || !user || !supabase) {
|
|
1759
1763
|
return;
|
|
@@ -2990,13 +2994,6 @@ function FileUpload({
|
|
|
2990
2994
|
};
|
|
2991
2995
|
onProgress?.(finalProgress);
|
|
2992
2996
|
onUploadSuccess?.(result);
|
|
2993
|
-
setTimeout(() => {
|
|
2994
|
-
setUploadStates((prev) => {
|
|
2995
|
-
const updated = new Map(prev);
|
|
2996
|
-
updated.delete(fileId);
|
|
2997
|
-
return updated;
|
|
2998
|
-
});
|
|
2999
|
-
}, 3e3);
|
|
3000
2997
|
} else {
|
|
3001
2998
|
setUploadStates((prev) => {
|
|
3002
2999
|
const updated = new Map(prev);
|
|
@@ -3191,7 +3188,7 @@ function FileUpload({
|
|
|
3191
3188
|
}
|
|
3192
3189
|
|
|
3193
3190
|
// src/components/FileDisplay/FileDisplay.tsx
|
|
3194
|
-
import { useState as useState12, useEffect as useEffect8, useRef as useRef5, useContext, useMemo as useMemo9 } from "react";
|
|
3191
|
+
import { useState as useState12, useEffect as useEffect8, useRef as useRef5, useContext as useContext2, useMemo as useMemo9 } from "react";
|
|
3195
3192
|
|
|
3196
3193
|
// src/hooks/useFileUrl.ts
|
|
3197
3194
|
import { useState as useState11, useEffect as useEffect7, useCallback as useCallback7, useRef as useRef4 } from "react";
|
|
@@ -3571,7 +3568,7 @@ function FileDisplayPublic({
|
|
|
3571
3568
|
fallbackText,
|
|
3572
3569
|
fallbackSize
|
|
3573
3570
|
}) {
|
|
3574
|
-
const publicPageContext =
|
|
3571
|
+
const publicPageContext = useContext2(PublicPageContext);
|
|
3575
3572
|
const supabase = publicPageContext?.supabase ?? null;
|
|
3576
3573
|
if (!supabase) {
|
|
3577
3574
|
return /* @__PURE__ */ jsx22("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in public context" });
|
|
@@ -4453,4 +4450,4 @@ export {
|
|
|
4453
4450
|
PublicPageDiagnostic,
|
|
4454
4451
|
PublicPageContextChecker
|
|
4455
4452
|
};
|
|
4456
|
-
//# sourceMappingURL=chunk-
|
|
4453
|
+
//# sourceMappingURL=chunk-2BIDKXQU.js.map
|