@jmruthers/pace-core 0.5.143 → 0.5.144
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/{chunk-VP44VQJ6.js → chunk-FC46D3KC.js} +33 -15
- package/dist/chunk-FC46D3KC.js.map +1 -0
- package/dist/components.js +1 -1
- package/dist/index.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 +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- 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/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.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/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.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/GrantEventAppRoleParams.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 +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- 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/ResourcePermissions.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/SessionRestorationLoaderProps.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/TabsContentProps.md +1 -1
- package/docs/api/interfaces/TabsListProps.md +1 -1
- package/docs/api/interfaces/TabsProps.md +1 -1
- package/docs/api/interfaces/TabsTriggerProps.md +1 -1
- package/docs/api/interfaces/TextareaProps.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/UseResourcePermissionsOptions.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 +2 -2
- package/package.json +1 -1
- package/src/components/NavigationMenu/NavigationMenu.tsx +51 -15
- package/dist/chunk-VP44VQJ6.js.map +0 -1
|
@@ -1158,7 +1158,7 @@ var NavigationMenu = React12.forwardRef(({
|
|
|
1158
1158
|
const orgContextReady = authContext?.isContextReady ?? (authContext?.selectedOrganisation?.id ? true : false);
|
|
1159
1159
|
const { supabase } = authContext || {};
|
|
1160
1160
|
const { selectedOrganisation } = authContext || {};
|
|
1161
|
-
const { resolvedScope, isLoading: scopeLoading } = useResolvedScope({
|
|
1161
|
+
const { resolvedScope, isLoading: scopeLoading, error: scopeError } = useResolvedScope({
|
|
1162
1162
|
supabase: filterByPermissions ? supabase || null : null,
|
|
1163
1163
|
selectedOrganisationId: filterByPermissions ? selectedOrganisation?.id || null : null,
|
|
1164
1164
|
selectedEventId: filterByPermissions ? selectedEvent?.event_id || null : null
|
|
@@ -1168,10 +1168,23 @@ var NavigationMenu = React12.forwardRef(({
|
|
|
1168
1168
|
eventId: void 0,
|
|
1169
1169
|
appId: void 0
|
|
1170
1170
|
});
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1171
|
+
const effectiveScope = React12.useMemo(() => {
|
|
1172
|
+
if (!scopeLoading && resolvedScope?.organisationId) {
|
|
1173
|
+
return resolvedScope;
|
|
1174
|
+
} else if (!scopeLoading && selectedOrganisation?.id) {
|
|
1175
|
+
return {
|
|
1176
|
+
organisationId: selectedOrganisation.id,
|
|
1177
|
+
eventId: selectedEvent?.event_id || void 0,
|
|
1178
|
+
appId: void 0
|
|
1179
|
+
// App ID will be resolved by usePermissions if needed
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1182
|
+
return null;
|
|
1183
|
+
}, [scopeLoading, resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id]);
|
|
1184
|
+
if (effectiveScope?.organisationId) {
|
|
1185
|
+
const newOrgId = effectiveScope.organisationId;
|
|
1186
|
+
const newEventId = effectiveScope.eventId;
|
|
1187
|
+
const newAppId = effectiveScope.appId;
|
|
1175
1188
|
if (stableScopeRef.current.organisationId !== newOrgId || stableScopeRef.current.eventId !== newEventId || stableScopeRef.current.appId !== newAppId) {
|
|
1176
1189
|
stableScopeRef.current = {
|
|
1177
1190
|
organisationId: newOrgId,
|
|
@@ -1179,7 +1192,7 @@ var NavigationMenu = React12.forwardRef(({
|
|
|
1179
1192
|
appId: newAppId
|
|
1180
1193
|
};
|
|
1181
1194
|
}
|
|
1182
|
-
} else if (!scopeLoading && !
|
|
1195
|
+
} else if (!scopeLoading && !effectiveScope) {
|
|
1183
1196
|
if (stableScopeRef.current.organisationId !== "") {
|
|
1184
1197
|
stableScopeRef.current = {
|
|
1185
1198
|
organisationId: "",
|
|
@@ -1199,7 +1212,10 @@ var NavigationMenu = React12.forwardRef(({
|
|
|
1199
1212
|
if (filterByPermissions) {
|
|
1200
1213
|
const isOrgContextReady = orgContextReady && selectedOrganisation?.id;
|
|
1201
1214
|
const isEventContextReady = eventLoadingRaw === void 0 ? true : !eventLoading;
|
|
1202
|
-
|
|
1215
|
+
const hasValidContext = isOrgContextReady && isEventContextReady;
|
|
1216
|
+
const shouldWaitForScope = scopeLoading || !hasValidContext;
|
|
1217
|
+
const shouldRetryAfterError = scopeError && hasValidContext && !scopeLoading;
|
|
1218
|
+
if (!authContext || !rbacContext || shouldWaitForScope && !shouldRetryAfterError) {
|
|
1203
1219
|
return [];
|
|
1204
1220
|
}
|
|
1205
1221
|
if (permissionsLoading) {
|
|
@@ -1332,8 +1348,10 @@ var NavigationMenu = React12.forwardRef(({
|
|
|
1332
1348
|
permissionMap,
|
|
1333
1349
|
hasAnyPermission,
|
|
1334
1350
|
scopeLoading,
|
|
1351
|
+
scopeError,
|
|
1335
1352
|
permissionsLoading,
|
|
1336
1353
|
resolvedScope,
|
|
1354
|
+
effectiveScope,
|
|
1337
1355
|
auditLog,
|
|
1338
1356
|
// Add event context state to dependencies so we re-check permissions when event context becomes available
|
|
1339
1357
|
eventLoadingRaw,
|
|
@@ -1344,18 +1362,18 @@ var NavigationMenu = React12.forwardRef(({
|
|
|
1344
1362
|
]);
|
|
1345
1363
|
React12.useEffect(() => {
|
|
1346
1364
|
if (auditLog && authContext) {
|
|
1365
|
+
const currentItem = items?.find((item) => item.href === currentPath || item.id === "navigation-menu");
|
|
1347
1366
|
logger.debug("NavigationMenu", "Navigation access attempt:", {
|
|
1348
|
-
itemId: "navigation-menu",
|
|
1349
|
-
label: "Navigation Menu",
|
|
1367
|
+
itemId: currentItem?.id || "navigation-menu",
|
|
1368
|
+
label: currentItem?.label || "Navigation Menu",
|
|
1350
1369
|
href: currentPath,
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
accessLevel: null,
|
|
1370
|
+
permissions: currentItem?.permissions || null,
|
|
1371
|
+
roles: currentItem?.roles || null,
|
|
1372
|
+
accessLevel: currentItem?.accessLevel || null,
|
|
1355
1373
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1356
1374
|
});
|
|
1357
1375
|
}
|
|
1358
|
-
}, [auditLog, authContext, currentPath]);
|
|
1376
|
+
}, [auditLog, authContext, currentPath, items]);
|
|
1359
1377
|
const handleHierarchicalKeyDown = (event, item) => {
|
|
1360
1378
|
switch (event.key) {
|
|
1361
1379
|
case "Enter":
|
|
@@ -4564,4 +4582,4 @@ export {
|
|
|
4564
4582
|
EventLogoCompact,
|
|
4565
4583
|
EventLogoLarge
|
|
4566
4584
|
};
|
|
4567
|
-
//# sourceMappingURL=chunk-
|
|
4585
|
+
//# sourceMappingURL=chunk-FC46D3KC.js.map
|