@jmruthers/pace-core 0.5.4 → 0.5.6
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/{DataTable-ZQDRE46Q.js → DataTable-BEMN72L5.js} +2 -2
- package/dist/{chunk-5H3C2SWM.js → chunk-4EIBJ6DF.js} +2 -2
- package/dist/{chunk-M4RW7PIP.js → chunk-SFGUMWEE.js} +105 -81
- package/dist/chunk-SFGUMWEE.js.map +1 -0
- package/dist/components.js +2 -2
- package/dist/index.js +2 -2
- package/dist/utils.js +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/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/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +34 -34
- 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/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.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 +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/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/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.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/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/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/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.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 +3 -3
- package/docs/implementation-guides/data-tables.md +20 -0
- package/docs/quick-reference.md +9 -0
- package/docs/rbac/examples.md +4 -0
- package/package.json +1 -1
- package/src/__tests__/helpers/test-utils.tsx +147 -1
- package/src/components/DataTable/DataTable.tsx +20 -0
- package/src/components/DataTable/__tests__/DataTable.hooks.test 2.tsx +191 -0
- package/src/components/DataTable/__tests__/DataTable.hooks.test.tsx +191 -0
- package/src/components/DataTable/components/DataTableCore.tsx +164 -131
- package/src/hooks/__tests__/hooks.integration.test.tsx +575 -0
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +115 -0
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +133 -0
- package/src/hooks/__tests__/useDebounce.unit.test.ts +82 -0
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +293 -0
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +385 -0
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +286 -0
- package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +838 -0
- package/src/hooks/__tests__/usePermissionCache.simple.test.ts +104 -0
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +633 -0
- package/src/hooks/__tests__/useRBAC.unit.test.ts +856 -0
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +537 -0
- package/src/hooks/__tests__/useToast.unit.test.tsx +62 -0
- package/src/hooks/__tests__/useZodForm.unit.test.tsx +37 -0
- package/src/rbac/utils/__tests__/eventContext.test.ts +428 -0
- package/src/rbac/utils/__tests__/eventContext.unit.test.ts +428 -0
- package/src/utils/__tests__/appConfig.unit.test.ts +55 -0
- package/src/utils/__tests__/audit.unit.test.ts +69 -0
- package/src/utils/__tests__/auth-utils.unit.test.ts +70 -0
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +317 -0
- package/src/utils/__tests__/cn.unit.test.ts +34 -0
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +503 -0
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +322 -0
- package/src/utils/__tests__/formatDate.unit.test.ts +109 -0
- package/src/utils/__tests__/formatting.unit.test.ts +66 -0
- package/src/utils/__tests__/index.unit.test.ts +251 -0
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +309 -0
- package/src/utils/__tests__/organisationContext.unit.test.ts +192 -0
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +259 -0
- package/src/utils/__tests__/permissionTypes.unit.test.ts +250 -0
- package/src/utils/__tests__/permissionUtils.unit.test.ts +362 -0
- package/src/utils/__tests__/sanitization.unit.test.ts +346 -0
- package/src/utils/__tests__/schemaUtils.unit.test.ts +441 -0
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +334 -0
- package/src/utils/__tests__/secureErrors.unit.test.ts +377 -0
- package/src/utils/__tests__/secureStorage.unit.test.ts +293 -0
- package/src/utils/__tests__/security.unit.test.ts +127 -0
- package/src/utils/__tests__/securityMonitor.unit.test.ts +280 -0
- package/src/utils/__tests__/sessionTracking.unit.test.ts +356 -0
- package/src/utils/__tests__/validation.unit.test.ts +84 -0
- package/src/utils/__tests__/validationUtils.unit.test.ts +571 -0
- package/src/validation/__tests__/common.unit.test.ts +101 -0
- package/src/validation/__tests__/csrf.unit.test.ts +302 -0
- package/src/validation/__tests__/passwordSchema.unit.test 2.ts +98 -0
- package/src/validation/__tests__/passwordSchema.unit.test.ts +98 -0
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +466 -0
- package/dist/chunk-M4RW7PIP.js.map +0 -1
- /package/dist/{DataTable-ZQDRE46Q.js.map → DataTable-BEMN72L5.js.map} +0 -0
- /package/dist/{chunk-5H3C2SWM.js.map → chunk-4EIBJ6DF.js.map} +0 -0
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
useDataTableContext,
|
|
33
33
|
usePluginRegistry,
|
|
34
34
|
useStateManager
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-SFGUMWEE.js";
|
|
36
36
|
import "./chunk-QVYBYGT2.js";
|
|
37
37
|
import "./chunk-GWSBHC4J.js";
|
|
38
38
|
import "./chunk-7BNPOCLL.js";
|
|
@@ -96,4 +96,4 @@ export {
|
|
|
96
96
|
usePluginRegistry,
|
|
97
97
|
useStateManager
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=DataTable-
|
|
99
|
+
//# sourceMappingURL=DataTable-BEMN72L5.js.map
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
SelectSeparator,
|
|
16
16
|
SelectTrigger,
|
|
17
17
|
SelectValue
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SFGUMWEE.js";
|
|
19
19
|
import {
|
|
20
20
|
isPermitted
|
|
21
21
|
} from "./chunk-GWSBHC4J.js";
|
|
@@ -3290,4 +3290,4 @@ export {
|
|
|
3290
3290
|
PublicPageDiagnostic,
|
|
3291
3291
|
PublicPageContextChecker
|
|
3292
3292
|
};
|
|
3293
|
-
//# sourceMappingURL=chunk-
|
|
3293
|
+
//# sourceMappingURL=chunk-4EIBJ6DF.js.map
|
|
@@ -3267,47 +3267,6 @@ function DataTableInternal({
|
|
|
3267
3267
|
}) {
|
|
3268
3268
|
const authResult = useUnifiedAuth();
|
|
3269
3269
|
const user = authResult.user;
|
|
3270
|
-
if (!user) {
|
|
3271
|
-
throw new Error("DataTable requires authenticated user for RBAC");
|
|
3272
|
-
}
|
|
3273
|
-
if (!rbac?.resource) {
|
|
3274
|
-
throw new Error("DataTable requires rbac.resource for permission checking");
|
|
3275
|
-
}
|
|
3276
|
-
const scope = {
|
|
3277
|
-
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3278
|
-
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3279
|
-
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3280
|
-
};
|
|
3281
|
-
const permissions = {
|
|
3282
|
-
canRead: useCan(user.id, scope, `read:${rbac.resource}`, rbac.pageId),
|
|
3283
|
-
canCreate: useCan(user.id, scope, `create:${rbac.resource}`, rbac.pageId),
|
|
3284
|
-
canUpdate: useCan(user.id, scope, `update:${rbac.resource}`, rbac.pageId),
|
|
3285
|
-
canDelete: useCan(user.id, scope, `delete:${rbac.resource}`, rbac.pageId),
|
|
3286
|
-
canExport: useCan(user.id, scope, `manage:${rbac.resource}`, rbac.pageId),
|
|
3287
|
-
// Using manage for export/import
|
|
3288
|
-
canImport: useCan(user.id, scope, `manage:${rbac.resource}`, rbac.pageId)
|
|
3289
|
-
// Using manage for export/import
|
|
3290
|
-
};
|
|
3291
|
-
if (!permissions.canRead.can) {
|
|
3292
|
-
return /* @__PURE__ */ jsx20(AccessDeniedPage, { resource: rbac?.resource || "test-resource", operation: "read" });
|
|
3293
|
-
}
|
|
3294
|
-
const secureFeatures = {
|
|
3295
|
-
...features,
|
|
3296
|
-
creation: features.creation && permissions.canCreate.can,
|
|
3297
|
-
editing: features.editing && permissions.canUpdate.can,
|
|
3298
|
-
deletion: features.deletion && permissions.canDelete.can,
|
|
3299
|
-
deleteSelected: features.deleteSelected && permissions.canDelete.can,
|
|
3300
|
-
export: features.export && permissions.canExport.can,
|
|
3301
|
-
import: features.import && permissions.canImport.can
|
|
3302
|
-
};
|
|
3303
|
-
const secureHandlers = {
|
|
3304
|
-
onEditRow: permissions.canUpdate.can ? onEditRow : void 0,
|
|
3305
|
-
onDeleteRow: permissions.canDelete.can ? onDeleteRow : void 0,
|
|
3306
|
-
onCreateRow: permissions.canCreate.can ? onCreateRow : void 0,
|
|
3307
|
-
onImport: permissions.canImport.can ? onImport : void 0,
|
|
3308
|
-
onExport: permissions.canExport.can ? onExport : void 0,
|
|
3309
|
-
onDeleteSelected: permissions.canDelete.can ? onDeleteSelected : void 0
|
|
3310
|
-
};
|
|
3311
3270
|
const [sorting, setSorting] = useState6([]);
|
|
3312
3271
|
const [columnFilters, setColumnFilters] = useState6([]);
|
|
3313
3272
|
const [columnVisibility, setColumnVisibility] = useState6({});
|
|
@@ -3388,6 +3347,40 @@ function DataTableInternal({
|
|
|
3388
3347
|
defaultOrder: columns.map((col) => col.id || col.accessorKey || ""),
|
|
3389
3348
|
enablePersistence: features.columnReordering
|
|
3390
3349
|
});
|
|
3350
|
+
const permissions = {
|
|
3351
|
+
canRead: useCan(user?.id || "", {
|
|
3352
|
+
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3353
|
+
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3354
|
+
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3355
|
+
}, `read:${rbac.resource}`, rbac.pageId),
|
|
3356
|
+
canCreate: useCan(user?.id || "", {
|
|
3357
|
+
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3358
|
+
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3359
|
+
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3360
|
+
}, `create:${rbac.resource}`, rbac.pageId),
|
|
3361
|
+
canUpdate: useCan(user?.id || "", {
|
|
3362
|
+
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3363
|
+
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3364
|
+
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3365
|
+
}, `update:${rbac.resource}`, rbac.pageId),
|
|
3366
|
+
canDelete: useCan(user?.id || "", {
|
|
3367
|
+
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3368
|
+
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3369
|
+
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3370
|
+
}, `delete:${rbac.resource}`, rbac.pageId),
|
|
3371
|
+
canExport: useCan(user?.id || "", {
|
|
3372
|
+
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3373
|
+
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3374
|
+
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3375
|
+
}, `manage:${rbac.resource}`, rbac.pageId),
|
|
3376
|
+
// Using manage for export/import
|
|
3377
|
+
canImport: useCan(user?.id || "", {
|
|
3378
|
+
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3379
|
+
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3380
|
+
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3381
|
+
}, `manage:${rbac.resource}`, rbac.pageId)
|
|
3382
|
+
// Using manage for export/import
|
|
3383
|
+
};
|
|
3391
3384
|
const finalPaginationMode = paginationMode || detectedMode;
|
|
3392
3385
|
const finalPageSizeOptions = optimizedPageSizeOptions;
|
|
3393
3386
|
const validatedInitialPageSize = useMemo6(() => {
|
|
@@ -3458,6 +3451,62 @@ function DataTableInternal({
|
|
|
3458
3451
|
return features.hierarchical && hierarchical?.enabled && sorting.length > 0 ? sortedTableData : tableData;
|
|
3459
3452
|
}, [features.hierarchical, hierarchical?.enabled, sorting.length, sortedTableData, tableData]);
|
|
3460
3453
|
const finalDataCount = finalPaginationMode === "server" ? serverData?.totalCount || 0 : finalTableData?.length || 0;
|
|
3454
|
+
const handleSearch = useCallback5((value) => {
|
|
3455
|
+
setSearchQuery(value);
|
|
3456
|
+
if (features.pagination) {
|
|
3457
|
+
setPagination((prev) => ({ ...prev, pageIndex: 0 }));
|
|
3458
|
+
}
|
|
3459
|
+
}, [setSearchQuery, features.pagination]);
|
|
3460
|
+
const handleServerSideChange = useCallback5(async () => {
|
|
3461
|
+
if (finalPaginationMode !== "server" || !serverSide) return;
|
|
3462
|
+
const params = {
|
|
3463
|
+
pageIndex: pagination.pageIndex,
|
|
3464
|
+
pageSize: pagination.pageSize,
|
|
3465
|
+
sorting,
|
|
3466
|
+
columnFilters,
|
|
3467
|
+
globalFilter: searchQuery,
|
|
3468
|
+
grouping
|
|
3469
|
+
};
|
|
3470
|
+
await fetchServerData(params);
|
|
3471
|
+
}, [
|
|
3472
|
+
finalPaginationMode,
|
|
3473
|
+
serverSide,
|
|
3474
|
+
pagination,
|
|
3475
|
+
sorting,
|
|
3476
|
+
columnFilters,
|
|
3477
|
+
searchQuery,
|
|
3478
|
+
grouping,
|
|
3479
|
+
fetchServerData
|
|
3480
|
+
]);
|
|
3481
|
+
useEffect5(() => {
|
|
3482
|
+
if ((tableData?.length || 0) > 0 || finalPaginationMode === "server") {
|
|
3483
|
+
handleServerSideChange();
|
|
3484
|
+
}
|
|
3485
|
+
}, [handleServerSideChange, tableData?.length, finalPaginationMode]);
|
|
3486
|
+
useEffect5(() => {
|
|
3487
|
+
return () => {
|
|
3488
|
+
if (typeof cleanup === "function") {
|
|
3489
|
+
cleanup();
|
|
3490
|
+
}
|
|
3491
|
+
};
|
|
3492
|
+
}, [cleanup]);
|
|
3493
|
+
const secureFeatures = useMemo6(() => ({
|
|
3494
|
+
...features,
|
|
3495
|
+
creation: features.creation && permissions.canCreate.can,
|
|
3496
|
+
editing: features.editing && permissions.canUpdate.can,
|
|
3497
|
+
deletion: features.deletion && permissions.canDelete.can,
|
|
3498
|
+
deleteSelected: features.deleteSelected && permissions.canDelete.can,
|
|
3499
|
+
export: features.export && permissions.canExport.can,
|
|
3500
|
+
import: features.import && permissions.canImport.can
|
|
3501
|
+
}), [features, permissions.canCreate.can, permissions.canUpdate.can, permissions.canDelete.can, permissions.canExport.can, permissions.canImport.can]);
|
|
3502
|
+
const secureHandlers = useMemo6(() => ({
|
|
3503
|
+
onEditRow: permissions.canUpdate.can ? onEditRow : void 0,
|
|
3504
|
+
onDeleteRow: permissions.canDelete.can ? onDeleteRow : void 0,
|
|
3505
|
+
onCreateRow: permissions.canCreate.can ? onCreateRow : void 0,
|
|
3506
|
+
onImport: permissions.canImport.can ? onImport : void 0,
|
|
3507
|
+
onExport: permissions.canExport.can ? onExport : void 0,
|
|
3508
|
+
onDeleteSelected: permissions.canDelete.can ? onDeleteSelected : void 0
|
|
3509
|
+
}), [permissions.canUpdate.can, permissions.canDelete.can, permissions.canCreate.can, permissions.canImport.can, permissions.canExport.can, onEditRow, onDeleteRow, onCreateRow, onImport, onExport, onDeleteSelected]);
|
|
3461
3510
|
const effectiveActions = useMemo6(() => {
|
|
3462
3511
|
const result = [...actions];
|
|
3463
3512
|
if (secureFeatures.editing && secureHandlers.onEditRow && !result.some((a) => a.label === "Edit")) {
|
|
@@ -3636,45 +3685,20 @@ function DataTableInternal({
|
|
|
3636
3685
|
pagination.pageSize
|
|
3637
3686
|
]);
|
|
3638
3687
|
const table = useReactTable(tableConfig);
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
}
|
|
3645
|
-
const
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
grouping
|
|
3654
|
-
};
|
|
3655
|
-
await fetchServerData(params);
|
|
3656
|
-
}, [
|
|
3657
|
-
finalPaginationMode,
|
|
3658
|
-
serverSide,
|
|
3659
|
-
pagination,
|
|
3660
|
-
sorting,
|
|
3661
|
-
columnFilters,
|
|
3662
|
-
searchQuery,
|
|
3663
|
-
grouping,
|
|
3664
|
-
fetchServerData
|
|
3665
|
-
]);
|
|
3666
|
-
useEffect5(() => {
|
|
3667
|
-
if ((tableData?.length || 0) > 0 || finalPaginationMode === "server") {
|
|
3668
|
-
handleServerSideChange();
|
|
3669
|
-
}
|
|
3670
|
-
}, [handleServerSideChange, tableData?.length, finalPaginationMode]);
|
|
3671
|
-
useEffect5(() => {
|
|
3672
|
-
return () => {
|
|
3673
|
-
if (typeof cleanup === "function") {
|
|
3674
|
-
cleanup();
|
|
3675
|
-
}
|
|
3676
|
-
};
|
|
3677
|
-
}, [cleanup]);
|
|
3688
|
+
if (!user) {
|
|
3689
|
+
throw new Error("DataTable requires authenticated user for RBAC");
|
|
3690
|
+
}
|
|
3691
|
+
if (!rbac?.resource) {
|
|
3692
|
+
throw new Error("DataTable requires rbac.resource for permission checking");
|
|
3693
|
+
}
|
|
3694
|
+
const scope = {
|
|
3695
|
+
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3696
|
+
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3697
|
+
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3698
|
+
};
|
|
3699
|
+
if (!permissions.canRead.can) {
|
|
3700
|
+
return /* @__PURE__ */ jsx20(AccessDeniedPage, { resource: rbac?.resource || "test-resource", operation: "read" });
|
|
3701
|
+
}
|
|
3678
3702
|
if (isLoading) {
|
|
3679
3703
|
return /* @__PURE__ */ jsx20(LoadingComponent, {});
|
|
3680
3704
|
}
|
|
@@ -5438,4 +5462,4 @@ export {
|
|
|
5438
5462
|
GroupHeader,
|
|
5439
5463
|
EditableRow
|
|
5440
5464
|
};
|
|
5441
|
-
//# sourceMappingURL=chunk-
|
|
5465
|
+
//# sourceMappingURL=chunk-SFGUMWEE.js.map
|