@jmruthers/pace-core 0.5.104 → 0.5.106
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-DX15wM6y.d.ts → AuthService-1D2ifNfa.d.ts} +1 -0
- package/dist/{DataTable-EEDFYMJP.js → DataTable-LWHFLTEW.js} +6 -6
- package/dist/{UnifiedAuthProvider-H7RI4KYD.js → UnifiedAuthProvider-XU4BHFXZ.js} +3 -3
- package/dist/{chunk-62AVH7CM.js → chunk-75G3NZWN.js} +4 -4
- package/dist/{chunk-B6LDHZGA.js → chunk-DMNMZKWS.js} +97 -30
- package/dist/chunk-DMNMZKWS.js.map +1 -0
- package/dist/{chunk-G7UUVEAP.js → chunk-GVRSXXAA.js} +3 -3
- package/dist/{chunk-SF6VFEWO.js → chunk-IBZBNBTE.js} +15 -7
- package/dist/chunk-IBZBNBTE.js.map +1 -0
- package/dist/{chunk-ORACUZ7H.js → chunk-KBG34SVL.js} +2 -2
- package/dist/{chunk-ZGCVJ7WW.js → chunk-LT6RKRA7.js} +2 -2
- package/dist/{chunk-7TQDRDSM.js → chunk-MOMYOQMC.js} +5 -5
- package/dist/{chunk-2KLAOD4M.js → chunk-QDDUU625.js} +3 -3
- package/dist/{chunk-S7TZKHG3.js → chunk-VJ7MPS2K.js} +14 -7
- package/dist/chunk-VJ7MPS2K.js.map +1 -0
- package/dist/{chunk-5RYPBJYL.js → chunk-X4FRXJV6.js} +7 -3
- package/dist/{chunk-5RYPBJYL.js.map → chunk-X4FRXJV6.js.map} +1 -1
- package/dist/{chunk-MVNOAHOP.js → chunk-ZXY5NTJB.js} +2 -2
- package/dist/components.js +8 -8
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -11
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +2 -2
- package/dist/rbac/index.js +7 -7
- package/dist/{usePublicRouteParams-BiXgKiYa.d.ts → usePublicRouteParams-CnM-IK2I.d.ts} +1 -0
- 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 +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/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 +1 -1
- 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 +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/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 +7 -6
- package/package.json +1 -1
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +7 -0
- package/src/hooks/public/usePublicFileDisplay.ts +33 -15
- package/src/hooks/useEventTheme.ts +14 -1
- package/src/hooks/useFileDisplay.ts +21 -2
- package/src/services/EventService.ts +10 -3
- package/src/utils/file-reference.ts +64 -32
- package/dist/chunk-B6LDHZGA.js.map +0 -1
- package/dist/chunk-S7TZKHG3.js.map +0 -1
- package/dist/chunk-SF6VFEWO.js.map +0 -1
- /package/dist/{DataTable-EEDFYMJP.js.map → DataTable-LWHFLTEW.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-H7RI4KYD.js.map → UnifiedAuthProvider-XU4BHFXZ.js.map} +0 -0
- /package/dist/{chunk-62AVH7CM.js.map → chunk-75G3NZWN.js.map} +0 -0
- /package/dist/{chunk-G7UUVEAP.js.map → chunk-GVRSXXAA.js.map} +0 -0
- /package/dist/{chunk-ORACUZ7H.js.map → chunk-KBG34SVL.js.map} +0 -0
- /package/dist/{chunk-ZGCVJ7WW.js.map → chunk-LT6RKRA7.js.map} +0 -0
- /package/dist/{chunk-7TQDRDSM.js.map → chunk-MOMYOQMC.js.map} +0 -0
- /package/dist/{chunk-2KLAOD4M.js.map → chunk-QDDUU625.js.map} +0 -0
- /package/dist/{chunk-MVNOAHOP.js.map → chunk-ZXY5NTJB.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.106](../README.md) / [Exports](../modules.md) / PaceLoginPageProps
|
|
2
2
|
|
|
3
3
|
# Interface: PaceLoginPageProps
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ The name of the application to be displayed on the login form.
|
|
|
20
20
|
|
|
21
21
|
#### Defined in
|
|
22
22
|
|
|
23
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
23
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:134](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L134)
|
|
24
24
|
|
|
25
25
|
___
|
|
26
26
|
|
|
@@ -32,7 +32,7 @@ The path to redirect to upon successful login. Defaults to `/`.
|
|
|
32
32
|
|
|
33
33
|
#### Defined in
|
|
34
34
|
|
|
35
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
35
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:136](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L136)
|
|
36
36
|
|
|
37
37
|
___
|
|
38
38
|
|
|
@@ -44,4 +44,4 @@ Whether to check app access using RBAC. Defaults to false.
|
|
|
44
44
|
|
|
45
45
|
#### Defined in
|
|
46
46
|
|
|
47
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
47
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:138](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L138)
|
package/docs/api/modules.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.106](README.md) / Exports
|
|
2
2
|
|
|
3
|
-
# @jmruthers/pace-core - v0.5.
|
|
3
|
+
# @jmruthers/pace-core - v0.5.106
|
|
4
4
|
|
|
5
5
|
**`File`**
|
|
6
6
|
|
|
@@ -2477,7 +2477,7 @@ JSX.Element - The rendered login page with enhanced functionality
|
|
|
2477
2477
|
|
|
2478
2478
|
#### Defined in
|
|
2479
2479
|
|
|
2480
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
2480
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:165](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L165)
|
|
2481
2481
|
|
|
2482
2482
|
___
|
|
2483
2483
|
|
|
@@ -3837,7 +3837,7 @@ Useful for testing or when you need to force refresh all data
|
|
|
3837
3837
|
|
|
3838
3838
|
#### Defined in
|
|
3839
3839
|
|
|
3840
|
-
[packages/core/src/hooks/public/usePublicFileDisplay.ts:
|
|
3840
|
+
[packages/core/src/hooks/public/usePublicFileDisplay.ts:373](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/public/usePublicFileDisplay.ts#L373)
|
|
3841
3841
|
|
|
3842
3842
|
___
|
|
3843
3843
|
|
|
@@ -3858,7 +3858,7 @@ Get cache statistics for debugging
|
|
|
3858
3858
|
|
|
3859
3859
|
#### Defined in
|
|
3860
3860
|
|
|
3861
|
-
[packages/core/src/hooks/public/usePublicFileDisplay.ts:
|
|
3861
|
+
[packages/core/src/hooks/public/usePublicFileDisplay.ts:384](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/public/usePublicFileDisplay.ts#L384)
|
|
3862
3862
|
|
|
3863
3863
|
___
|
|
3864
3864
|
|
|
@@ -4048,6 +4048,7 @@ This hook watches the selected event and applies its colors using the theming sy
|
|
|
4048
4048
|
It will:
|
|
4049
4049
|
- Apply event colors when an event with `event_colours` is selected
|
|
4050
4050
|
- Clear theming when no event is selected
|
|
4051
|
+
- Skip theme application when on the login route to prevent login screen styling
|
|
4051
4052
|
- Handle cleanup when the component unmounts
|
|
4052
4053
|
|
|
4053
4054
|
#### Returns
|
|
@@ -4058,7 +4059,7 @@ void - This is an effect hook with no return value
|
|
|
4058
4059
|
|
|
4059
4060
|
#### Defined in
|
|
4060
4061
|
|
|
4061
|
-
[packages/core/src/hooks/useEventTheme.ts:
|
|
4062
|
+
[packages/core/src/hooks/useEventTheme.ts:41](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useEventTheme.ts#L41)
|
|
4062
4063
|
|
|
4063
4064
|
___
|
|
4064
4065
|
|
package/package.json
CHANGED
|
@@ -127,6 +127,7 @@ import { useUnifiedAuth } from '../../providers';
|
|
|
127
127
|
import { isSuperAdmin } from '../../rbac/api';
|
|
128
128
|
import { LoginForm } from '../LoginForm';
|
|
129
129
|
import { Button, Input, Label } from '..';
|
|
130
|
+
import { clearPalette } from '../../theming/runtime';
|
|
130
131
|
|
|
131
132
|
export interface PaceLoginPageProps {
|
|
132
133
|
/** The name of the application to be displayed on the login form. */
|
|
@@ -173,6 +174,12 @@ export const PaceLoginPage: React.FC<PaceLoginPageProps> = ({
|
|
|
173
174
|
const [accessError, setAccessError] = useState<string | null>(null);
|
|
174
175
|
const [isCheckingAccess, setIsCheckingAccess] = useState(false);
|
|
175
176
|
|
|
177
|
+
// Clear any active event theme when login page mounts
|
|
178
|
+
// This ensures the login screen always uses default colors
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
clearPalette();
|
|
181
|
+
}, []);
|
|
182
|
+
|
|
176
183
|
// Check app access after authentication using RBAC
|
|
177
184
|
useEffect(() => {
|
|
178
185
|
if (!requireAppAccess || !isAuthenticated || isLoading || !user || !supabase) {
|
|
@@ -147,8 +147,16 @@ export function usePublicFileDisplay(
|
|
|
147
147
|
|
|
148
148
|
let files: any[] = [];
|
|
149
149
|
|
|
150
|
+
// CRITICAL: When category is provided, MUST use RPC function, not direct queries
|
|
151
|
+
// Category is stored in file_metadata JSONB field, not a direct column
|
|
150
152
|
if (category) {
|
|
151
153
|
// Single file mode - use RPC to get files by category
|
|
154
|
+
console.log('[usePublicFileDisplay] Using RPC function for category filtering:', {
|
|
155
|
+
table_name,
|
|
156
|
+
record_id,
|
|
157
|
+
category,
|
|
158
|
+
organisation_id
|
|
159
|
+
});
|
|
152
160
|
const { data, error: rpcError } = await (supabase as any)
|
|
153
161
|
.rpc('data_file_reference_by_category_list', {
|
|
154
162
|
p_table_name: table_name,
|
|
@@ -161,24 +169,34 @@ export function usePublicFileDisplay(
|
|
|
161
169
|
throw new Error(rpcError.message || 'Failed to fetch file reference');
|
|
162
170
|
}
|
|
163
171
|
|
|
164
|
-
// RPC returns partial data
|
|
172
|
+
// RPC returns partial data with: id, file_path, file_metadata, is_public, created_at
|
|
173
|
+
// We have table_name, record_id, organisation_id from function parameters
|
|
174
|
+
// We can construct FileReference objects directly without another query (avoiding RLS issues)
|
|
165
175
|
if (!data || data.length === 0) {
|
|
166
176
|
files = [];
|
|
167
177
|
} else {
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
// Construct file reference objects from RPC response
|
|
179
|
+
// This avoids RLS issues - the RPC already validated permissions and filtered public files
|
|
180
|
+
files = data
|
|
181
|
+
.filter((item: any) => {
|
|
182
|
+
// RPC should only return public files for public context, but verify
|
|
183
|
+
return item.is_public === true && item.id && item.file_path && item.file_metadata;
|
|
184
|
+
})
|
|
185
|
+
.map((item: any) => {
|
|
186
|
+
// Construct complete file reference from RPC response + function parameters
|
|
187
|
+
return {
|
|
188
|
+
id: item.id,
|
|
189
|
+
table_name: table_name,
|
|
190
|
+
record_id: record_id,
|
|
191
|
+
file_path: item.file_path,
|
|
192
|
+
file_metadata: item.file_metadata || {},
|
|
193
|
+
organisation_id: organisation_id,
|
|
194
|
+
app_id: item.file_metadata?.app_id || null,
|
|
195
|
+
is_public: true, // RPC already filtered for public files
|
|
196
|
+
created_at: item.created_at || new Date().toISOString(),
|
|
197
|
+
updated_at: item.created_at || new Date().toISOString()
|
|
198
|
+
};
|
|
199
|
+
});
|
|
182
200
|
}
|
|
183
201
|
} else {
|
|
184
202
|
// Multiple files mode - use RPC to get all files
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { useEffect } from 'react';
|
|
24
|
+
import { useLocation } from 'react-router-dom';
|
|
24
25
|
import { useEvents } from './useEvents';
|
|
25
26
|
import { applyPalette, clearPalette } from '../theming/runtime';
|
|
26
27
|
import type { PaletteData, ColorPalette } from '../theming/runtime';
|
|
@@ -32,14 +33,26 @@ import type { PaletteData, ColorPalette } from '../theming/runtime';
|
|
|
32
33
|
* It will:
|
|
33
34
|
* - Apply event colors when an event with `event_colours` is selected
|
|
34
35
|
* - Clear theming when no event is selected
|
|
36
|
+
* - Skip theme application when on the login route to prevent login screen styling
|
|
35
37
|
* - Handle cleanup when the component unmounts
|
|
36
38
|
*
|
|
37
39
|
* @returns void - This is an effect hook with no return value
|
|
38
40
|
*/
|
|
39
41
|
export function useEventTheme(): void {
|
|
40
42
|
const { selectedEvent } = useEvents();
|
|
43
|
+
const location = useLocation();
|
|
41
44
|
|
|
42
45
|
useEffect(() => {
|
|
46
|
+
// Skip theme application when on login route
|
|
47
|
+
// This prevents event colors from styling the login screen
|
|
48
|
+
const isOnLoginRoute = location.pathname === '/login' || location.pathname.startsWith('/login');
|
|
49
|
+
|
|
50
|
+
if (isOnLoginRoute) {
|
|
51
|
+
// Clear any active theme when on login route
|
|
52
|
+
clearPalette();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
43
56
|
// If there's no selected event, clear any dynamic theming
|
|
44
57
|
if (!selectedEvent) {
|
|
45
58
|
clearPalette();
|
|
@@ -82,5 +95,5 @@ export function useEventTheme(): void {
|
|
|
82
95
|
// Don't clear on unmount since we want the theme to persist
|
|
83
96
|
// The next event selection will update it
|
|
84
97
|
};
|
|
85
|
-
}, [selectedEvent]);
|
|
98
|
+
}, [selectedEvent, location.pathname]);
|
|
86
99
|
}
|