@admin-layout/client 12.0.16-alpha.43 → 12.0.16-alpha.44
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/lib/__tests__/ApplicationErrorHandlerCommon.test.d.ts.map +1 -0
- package/lib/__tests__/SettingsConfigurationModel.test.d.ts.map +1 -0
- package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts +3 -0
- package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts.map +1 -0
- package/lib/colors/presets/black.js +3 -0
- package/lib/colors/presets/black.js.map +1 -1
- package/lib/colors/presets/white.js +3 -0
- package/lib/colors/presets/white.js.map +1 -1
- package/lib/components/LayoutCookieProvider.d.ts.map +1 -1
- package/lib/components/LayoutCookieProvider.js +10 -0
- package/lib/components/LayoutCookieProvider.js.map +1 -1
- package/lib/components/UpdateSettings/UpdateSettings.server.d.ts +9 -13
- package/lib/components/UpdateSettings/UpdateSettings.server.d.ts.map +1 -1
- package/lib/components/UpdateSettings/UpdateSettings.server.js +120 -127
- package/lib/components/UpdateSettings/UpdateSettings.server.js.map +1 -1
- package/lib/config/defaultSettings.d.ts +75 -1
- package/lib/config/defaultSettings.d.ts.map +1 -1
- package/lib/config/defaultSettings.js +1 -111
- package/lib/config/defaultSettings.js.map +1 -1
- package/lib/config/env-config.d.ts +1 -3
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +7 -17
- package/lib/config/env-config.js.map +1 -1
- package/lib/hooks/useLayoutSettings.d.ts.map +1 -1
- package/lib/hooks/useLayoutSettings.js +19 -6
- package/lib/hooks/useLayoutSettings.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.native.js +1 -1
- package/lib/redux/reducers/settings.d.ts.map +1 -1
- package/lib/redux/reducers/settings.js +2 -2
- package/lib/redux/reducers/settings.js.map +1 -1
- package/lib/redux/store.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/lib/components/UpdateSettings/SettingsConfigurationModel.test.d.ts.map +0 -1
- package/lib/components/__tests__/ApplicationErrorHandlerCommon.test.d.ts.map +0 -1
- /package/lib/{components/__tests__ → __tests__}/ApplicationErrorHandlerCommon.test.d.ts +0 -0
- /package/lib/{components/UpdateSettings → __tests__}/SettingsConfigurationModel.test.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplicationErrorHandlerCommon.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/ApplicationErrorHandlerCommon.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsConfigurationModel.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/SettingsConfigurationModel.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultSettingsExample.d.ts","sourceRoot":"","sources":["../../../src/__tests__/__fixtures__/defaultSettingsExample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+D,MAAM,8BAA8B,CAAC;AAEtH,eAAO,MAAM,eAAe,EAAE,SA+G7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"black.js","sources":["../../../src/colors/presets/black.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO
|
|
1
|
+
{"version":3,"file":"black.js","sources":["../../../src/colors/presets/black.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"white.js","sources":["../../../src/colors/presets/white.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO
|
|
1
|
+
{"version":3,"file":"white.js","sources":["../../../src/colors/presets/white.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutCookieProvider.d.ts","sourceRoot":"","sources":["../../src/components/LayoutCookieProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,UAAU,yBAAyB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"LayoutCookieProvider.d.ts","sourceRoot":"","sources":["../../src/components/LayoutCookieProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,UAAU,yBAAyB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,CAsChG"}
|
|
@@ -3,9 +3,19 @@ import {jsx,Fragment}from'react/jsx-runtime';import {useRouteLoaderData}from'@re
|
|
|
3
3
|
const settings = routeData?.settings?.settings || routeData?.settings;
|
|
4
4
|
const dispatch = useDispatch();
|
|
5
5
|
const hasDispatched = useRef(false);
|
|
6
|
+
// Debug logging
|
|
7
|
+
if (typeof window !== 'undefined') {
|
|
8
|
+
console.log('🎨 LayoutCookieProvider - Client Side:', {
|
|
9
|
+
hasRouteData: !!routeData,
|
|
10
|
+
hasSettings: !!settings,
|
|
11
|
+
settingsKeys: settings ? Object.keys(settings).slice(0, 10) : 'null',
|
|
12
|
+
settingsData: settings, // Full settings object
|
|
13
|
+
});
|
|
14
|
+
}
|
|
6
15
|
// Handle both server and client side
|
|
7
16
|
useEffect(() => {
|
|
8
17
|
if (settings && !hasDispatched.current) {
|
|
18
|
+
console.log('🎨 LayoutCookieProvider - Dispatching settings to Redux');
|
|
9
19
|
dispatch({
|
|
10
20
|
type: CHANGE_SETTINGS_ACTION,
|
|
11
21
|
payload: settings,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutCookieProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayoutCookieProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { IAppLoadContext } from '@common-stack/client-core';
|
|
2
2
|
import { IResourceParams } from '@common-stack/core';
|
|
3
|
+
import { IGetPageSettingsQuery } from 'common';
|
|
4
|
+
import type { ApolloClient } from '@apollo/client';
|
|
3
5
|
import { ProSettings } from '../../interfaces';
|
|
4
|
-
export declare
|
|
6
|
+
export declare const settingsCookie: import("@remix-run/server-runtime").Cookie;
|
|
7
|
+
export declare function fetchPageSettings(apolloClient: ApolloClient<any>): Promise<import("@apollo/client").InteropApolloQueryResult<IGetPageSettingsQuery>>;
|
|
8
|
+
export declare function fetchPageSettingsWithFetch(request: Request, graphqlUrl?: string): Promise<{
|
|
9
|
+
data: any;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function settingsLoaderUtil({ request, context, params, useFetch, }: {
|
|
5
12
|
request: Request;
|
|
6
13
|
context?: IAppLoadContext;
|
|
7
14
|
params?: IResourceParams;
|
|
15
|
+
useFetch?: boolean;
|
|
8
16
|
}): Promise<{
|
|
9
17
|
settings: ProSettings;
|
|
10
18
|
setCookie: string;
|
|
11
19
|
}>;
|
|
12
|
-
export declare const action: ({ request, context, params, }: {
|
|
13
|
-
request: Request;
|
|
14
|
-
context?: IAppLoadContext;
|
|
15
|
-
params?: IResourceParams;
|
|
16
|
-
}) => Promise<import("@remix-run/server-runtime").TypedResponse<any>>;
|
|
17
|
-
export declare const loader: ({ request, context, params, }: {
|
|
18
|
-
request: Request;
|
|
19
|
-
context?: IAppLoadContext;
|
|
20
|
-
params?: IResourceParams;
|
|
21
|
-
}) => Promise<import("@remix-run/server-runtime").TypedResponse<{
|
|
22
|
-
settings: any;
|
|
23
|
-
}>>;
|
|
24
20
|
//# sourceMappingURL=UpdateSettings.server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAKH,qBAAqB,EAExB,MAAM,QAAQ,CAAC;AAGhB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,eAAO,MAAM,cAAc,4CAMzB,CAAC;AAGH,wBAAsB,iBAAiB,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,qFAyBtE;AAGD,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM;;GAqErF;AAED,wBAAsB,kBAAkB,CAAC,EACrC,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAe,GAClB,EAAE;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC;IACR,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC,CA6FD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {createCookie
|
|
2
|
-
const settingsCookie = createCookie('settings', {
|
|
1
|
+
import {createCookie}from'@remix-run/node';import {ConfigCollectionName,ConfigFragmentName,ConfigurationSchemaId}from'common';import {GetPageSettingsDocument}from'common/graphql';import {merge}from'lodash-es';import {print}from'graphql';import {config}from'../../config/env-config.js';import'../../config/defaultSettings.js';import'react';import'@cdm-logger/client';import {compareAndSaveSettingsDifferences}from'../../utils/settingsDifference.js';import {assignDefaults}from'../../utils/assignDefaults.js';import {generateCdecodeUri,DEFAULT_TENANT_ID}from'@adminide-stack/core';const settingsCookie = createCookie('settings', {
|
|
3
2
|
maxAge: 60 * 60 * 24 * 30, // 1 month
|
|
4
3
|
httpOnly: false, // Allow client-side access
|
|
5
4
|
sameSite: 'lax',
|
|
@@ -8,61 +7,141 @@ const settingsCookie = createCookie('settings', {
|
|
|
8
7
|
});
|
|
9
8
|
// Helper to fetch page settings from Apollo
|
|
10
9
|
async function fetchPageSettings(apolloClient) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
variables: {
|
|
26
|
-
resourceUri: resource,
|
|
27
|
-
options: {
|
|
28
|
-
schemaId: ConfigurationSchemaId.UiLayout,
|
|
29
|
-
target: 2 /* ConfigurationTarget.APPLICATION */,
|
|
30
|
-
},
|
|
10
|
+
const resource = generateCdecodeUri(DEFAULT_TENANT_ID, {
|
|
11
|
+
resourceType: ConfigCollectionName.Applications,
|
|
12
|
+
resourceId: config.APPLICATION_ID,
|
|
13
|
+
idField: 'appId',
|
|
14
|
+
}, {}, ConfigFragmentName.UiSettings);
|
|
15
|
+
const result = await apolloClient.query({
|
|
16
|
+
query: GetPageSettingsDocument,
|
|
17
|
+
variables: {
|
|
18
|
+
resourceUri: resource,
|
|
19
|
+
options: {
|
|
20
|
+
schemaId: ConfigurationSchemaId.UiLayout,
|
|
21
|
+
target: 2 /* ConfigurationTarget.APPLICATION */,
|
|
31
22
|
},
|
|
23
|
+
},
|
|
24
|
+
fetchPolicy: 'no-cache', // Bypass cache completely - always fetch fresh from server
|
|
25
|
+
});
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
// Alternative: Direct fetch-based implementation (for testing/comparison)
|
|
29
|
+
async function fetchPageSettingsWithFetch(request, graphqlUrl) {
|
|
30
|
+
const resource = generateCdecodeUri(DEFAULT_TENANT_ID, {
|
|
31
|
+
resourceType: ConfigCollectionName.Applications,
|
|
32
|
+
resourceId: config.APPLICATION_ID,
|
|
33
|
+
idField: 'appId',
|
|
34
|
+
}, {}, ConfigFragmentName.UiSettings);
|
|
35
|
+
const url = graphqlUrl || process.env.GRAPHQL_URL || 'http://localhost:8080/graphql';
|
|
36
|
+
// Convert GraphQL DocumentNode to string
|
|
37
|
+
const query = print(GetPageSettingsDocument);
|
|
38
|
+
const variables = {
|
|
39
|
+
resourceUri: resource,
|
|
40
|
+
options: {
|
|
41
|
+
schemaId: ConfigurationSchemaId.UiLayout,
|
|
42
|
+
target: 2 /* ConfigurationTarget.APPLICATION */,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
console.log('🔍 Fetching settings with direct fetch to:', url);
|
|
46
|
+
console.log('🔍 Query variables:', JSON.stringify(variables, null, 2));
|
|
47
|
+
// Forward cookies from the incoming request
|
|
48
|
+
const headers = {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
};
|
|
51
|
+
const cookieHeader = request.headers.get('Cookie');
|
|
52
|
+
if (cookieHeader) {
|
|
53
|
+
headers['Cookie'] = cookieHeader;
|
|
54
|
+
console.log('🍪 Forwarding cookies to GraphQL backend');
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.log('⚠️ No cookies found in request');
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const response = await fetch(url, {
|
|
61
|
+
method: 'POST',
|
|
62
|
+
headers,
|
|
63
|
+
body: JSON.stringify({
|
|
64
|
+
query,
|
|
65
|
+
variables,
|
|
66
|
+
}),
|
|
32
67
|
});
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
console.error('❌ GraphQL fetch failed with status:', response.status);
|
|
70
|
+
throw new Error(`GraphQL request failed: ${response.status} ${response.statusText}`);
|
|
71
|
+
}
|
|
72
|
+
const result = await response.json();
|
|
73
|
+
if (result.errors) {
|
|
74
|
+
console.error('❌ GraphQL errors:', JSON.stringify(result.errors, null, 2));
|
|
75
|
+
throw new Error(`GraphQL errors: ${JSON.stringify(result.errors)}`);
|
|
76
|
+
}
|
|
77
|
+
console.log('✅ Settings fetched successfully with fetch');
|
|
78
|
+
return { data: result.data };
|
|
33
79
|
}
|
|
34
80
|
catch (error) {
|
|
35
|
-
console.
|
|
36
|
-
|
|
37
|
-
return null;
|
|
81
|
+
console.error('❌ Failed to fetch settings with fetch:', error);
|
|
82
|
+
throw error;
|
|
38
83
|
}
|
|
39
84
|
}
|
|
40
|
-
async function settingsLoaderUtil({ request, context, params,
|
|
85
|
+
async function settingsLoaderUtil({ request, context, params, useFetch = true, // Set to true to test fetch-based approach
|
|
86
|
+
}) {
|
|
41
87
|
const cookieHeader = request.headers.get('Cookie');
|
|
42
|
-
let settings;
|
|
43
88
|
const { apolloClient } = context;
|
|
44
|
-
|
|
45
|
-
|
|
89
|
+
// Fetch settings from backend - choose method based on flag
|
|
90
|
+
let result;
|
|
91
|
+
if (useFetch) {
|
|
92
|
+
console.log('📡 Using direct fetch to get settings');
|
|
93
|
+
result = await fetchPageSettingsWithFetch(request);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
console.log('🚀 Using Apollo Client to get settings');
|
|
97
|
+
result = await fetchPageSettings(apolloClient);
|
|
98
|
+
}
|
|
46
99
|
const pageSettings = result?.data?.pageSettings?.settings
|
|
47
100
|
? JSON.parse(JSON.stringify(result?.data?.pageSettings?.settings))
|
|
48
101
|
: null;
|
|
49
|
-
|
|
50
|
-
|
|
102
|
+
// Extract uilayout settings if available
|
|
103
|
+
const uilayout = pageSettings?.uilayout;
|
|
104
|
+
const hasUilayoutData = uilayout && typeof uilayout === 'object' && Object.keys(uilayout).length > 0;
|
|
105
|
+
let pageDefaultSettings = hasUilayoutData ? uilayout : pageSettings || {};
|
|
106
|
+
// Add required keys that might not be in backend
|
|
51
107
|
pageDefaultSettings = {
|
|
52
108
|
...pageDefaultSettings,
|
|
53
109
|
hiddenMenuKeys: [],
|
|
54
110
|
hiddenMenuCategories: [],
|
|
55
111
|
};
|
|
112
|
+
// Fallback to config.LAYOUT_SETTINGS if backend returns empty
|
|
113
|
+
const settingsKeys = Object.keys(pageDefaultSettings);
|
|
114
|
+
const hasOnlyDefaultKeys = settingsKeys.length === 2 &&
|
|
115
|
+
settingsKeys.includes('hiddenMenuKeys') &&
|
|
116
|
+
settingsKeys.includes('hiddenMenuCategories');
|
|
117
|
+
if (hasOnlyDefaultKeys && config.LAYOUT_SETTINGS) {
|
|
118
|
+
const fallbackSettings = typeof config.LAYOUT_SETTINGS === 'string'
|
|
119
|
+
? JSON.parse(config.LAYOUT_SETTINGS)
|
|
120
|
+
: { ...config.LAYOUT_SETTINGS };
|
|
121
|
+
pageDefaultSettings = {
|
|
122
|
+
...fallbackSettings,
|
|
123
|
+
hiddenMenuKeys: [],
|
|
124
|
+
hiddenMenuCategories: [],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// Parse cookie settings
|
|
128
|
+
let settings;
|
|
56
129
|
try {
|
|
57
130
|
settings = await settingsCookie.parse(cookieHeader);
|
|
58
|
-
|
|
131
|
+
// Remove any invalid numeric string keys from cookie
|
|
132
|
+
if (settings && typeof settings === 'object') {
|
|
133
|
+
Object.keys(settings).forEach((key) => {
|
|
134
|
+
if (/^\d+$/.test(key)) {
|
|
135
|
+
delete settings[key];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
59
139
|
assignDefaults(settings, pageDefaultSettings);
|
|
60
140
|
}
|
|
61
141
|
catch (error) {
|
|
62
|
-
console.error('Error parsing settings cookie:', error);
|
|
63
142
|
settings = null;
|
|
64
143
|
}
|
|
65
|
-
//
|
|
144
|
+
// Generate default settings if no cookie exists
|
|
66
145
|
if (!settings) {
|
|
67
146
|
const fullSettings = merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS);
|
|
68
147
|
assignDefaults(fullSettings, pageDefaultSettings);
|
|
@@ -71,100 +150,14 @@ async function settingsLoaderUtil({ request, context, params, }) {
|
|
|
71
150
|
const cookie = await settingsCookie.serialize(diffSettings);
|
|
72
151
|
return { settings: fullSettings, setCookie: cookie };
|
|
73
152
|
}
|
|
74
|
-
// Merge defaults
|
|
153
|
+
// Merge settings: backend defaults + config + cookie overrides
|
|
75
154
|
const fullSettings = merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS, settings);
|
|
155
|
+
// Remove any numeric keys that might have appeared during merge
|
|
156
|
+
const numericKeysAfterMerge = Object.keys(fullSettings).filter((k) => /^\d+$/.test(k));
|
|
157
|
+
numericKeysAfterMerge.forEach((key) => {
|
|
158
|
+
delete fullSettings[key];
|
|
159
|
+
});
|
|
76
160
|
// Refresh the cookie to keep it active
|
|
77
161
|
const cookie = await settingsCookie.serialize(settings);
|
|
78
162
|
return { settings: fullSettings, setCookie: cookie };
|
|
79
|
-
}
|
|
80
|
-
const action = async ({ request, context, params, }) => {
|
|
81
|
-
try {
|
|
82
|
-
// 1. Fetch default settings from GraphQL (or fallback to local defaults)
|
|
83
|
-
const { apolloClient } = context;
|
|
84
|
-
const result = await fetchPageSettings(apolloClient);
|
|
85
|
-
const pageSettings = result?.data?.pageSettings?.settings
|
|
86
|
-
? JSON.parse(JSON.stringify(result.data.pageSettings.settings))
|
|
87
|
-
: null;
|
|
88
|
-
let pageDefaultSettings = pageSettings?.uilayout || pageSettings || {};
|
|
89
|
-
// 2 TEMPORARY: Manually add hiddenMenuKeys to defaults until GraphQL schema is updated
|
|
90
|
-
pageDefaultSettings = {
|
|
91
|
-
...pageDefaultSettings,
|
|
92
|
-
hiddenMenuKeys: [],
|
|
93
|
-
hiddenMenuCategories: [],
|
|
94
|
-
};
|
|
95
|
-
// 3. Parse the incoming settings update from the client (usually only changed keys)
|
|
96
|
-
const jsonData = await request.json();
|
|
97
|
-
const payload = jsonData?.config || {};
|
|
98
|
-
// 4. Fill in any missing default keys in the payload (does not overwrite user values)
|
|
99
|
-
assignDefaults(payload, pageDefaultSettings);
|
|
100
|
-
// 5. Parse existing settings from the cookie (if present)
|
|
101
|
-
const cookieHeader = request.headers.get('Cookie');
|
|
102
|
-
let existingSettings;
|
|
103
|
-
let mergedSettings;
|
|
104
|
-
try {
|
|
105
|
-
existingSettings = await settingsCookie.parse(cookieHeader);
|
|
106
|
-
// 6. Merge existing settings with the new payload from the client
|
|
107
|
-
mergedSettings = merge({}, existingSettings, payload);
|
|
108
|
-
// 7. Ensure merged settings have all default keys (again, does not overwrite user values)
|
|
109
|
-
assignDefaults(mergedSettings, pageDefaultSettings);
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
// If cookie parsing fails, fall back to just the payload
|
|
113
|
-
console.error('Error parsing settings cookie in action:', error);
|
|
114
|
-
existingSettings = null;
|
|
115
|
-
}
|
|
116
|
-
// 8. Build the final settings object: defaults → config.LAYOUT_SETTINGS → merged user settings
|
|
117
|
-
const fullSettings = merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS, mergedSettings);
|
|
118
|
-
// TEMPORARY FIX: Manually override hiddenMenuKeys with payload value
|
|
119
|
-
// This ensures payload array replaces the prev array values
|
|
120
|
-
if (payload.hiddenMenuKeys !== undefined) {
|
|
121
|
-
fullSettings.hiddenMenuKeys = [...payload.hiddenMenuKeys];
|
|
122
|
-
}
|
|
123
|
-
// 9. Store only the differences from the defaults in the cookie (to minimize cookie size)
|
|
124
|
-
const diffSettings = await compareAndSaveSettingsDifferences(fullSettings, pageDefaultSettings);
|
|
125
|
-
// 10. Serialize the diff settings into a cookie string
|
|
126
|
-
const newCookie = await settingsCookie.serialize(diffSettings);
|
|
127
|
-
// 11. Return the full settings as JSON, and set the new cookie in the response headers
|
|
128
|
-
return json(fullSettings, {
|
|
129
|
-
headers: {
|
|
130
|
-
'Set-Cookie': newCookie,
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
// If anything fails, log the error and return a 500 error response
|
|
136
|
-
console.error('Error in action:', error);
|
|
137
|
-
return json({ error: 'Failed to update settings' }, { status: 500 });
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
const loader = async ({ request, context, params, }) => {
|
|
141
|
-
try {
|
|
142
|
-
const { settings, setCookie } = await settingsLoaderUtil({ request, context, params });
|
|
143
|
-
// Always include headers, but only set cookie if provided
|
|
144
|
-
const headers = {};
|
|
145
|
-
if (setCookie) {
|
|
146
|
-
headers['Set-Cookie'] = setCookie;
|
|
147
|
-
}
|
|
148
|
-
return json({ settings }, { headers });
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
console.error('Error in settings loader:', error);
|
|
152
|
-
// Fall back to default settings
|
|
153
|
-
const { apolloClient } = context;
|
|
154
|
-
const result = await fetchPageSettings(apolloClient);
|
|
155
|
-
console.log('result', result);
|
|
156
|
-
const pageSettings = result?.data?.pageSettings?.settings
|
|
157
|
-
? JSON.parse(JSON.stringify(result.data.pageSettings.settings))
|
|
158
|
-
: null;
|
|
159
|
-
let pageDefaultSettings = pageSettings?.uilayout || pageSettings || {};
|
|
160
|
-
// TEMPORARY: Manually add hiddenMenuKeys to defaults until GraphQL schema is updated
|
|
161
|
-
pageDefaultSettings = {
|
|
162
|
-
...pageDefaultSettings,
|
|
163
|
-
hiddenMenuKeys: [], // Array format for menu visibility
|
|
164
|
-
hiddenMenuCategories: [], // Array format for category visibility
|
|
165
|
-
};
|
|
166
|
-
return json({
|
|
167
|
-
settings: merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS),
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
};export{action,loader,settingsLoaderUtil};//# sourceMappingURL=UpdateSettings.server.js.map
|
|
163
|
+
}export{fetchPageSettings,fetchPageSettingsWithFetch,settingsCookie,settingsLoaderUtil};//# sourceMappingURL=UpdateSettings.server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":"mkBA+HC,MAAA,cAAA,GAAA,YAAA,CAAA,UAAA,EAAA;AAED,IAAA,MAAA,EAAA,EAAA,GAAA,EAAA,GAAA,EAAsB,GAAA,EAAA;IAMlB,QAAO;IACP,QAAQ,EAAE,KAAA;IACV,IAAA,EAAM,GAAG;IACT,MAAA,EAAQ,MAAG,CAAA,MAAQ,GAAA,MAAA,CAAA,UAAA,GAAA,SAAA;AACtB,CAAA;;AAEG,eAAkB,iBAAA,CAAA,YAAA,EAAA;AACrB,IA6FA,MAAA,QAAA,GAAA,kBAAA,CAAA,iBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,81 @@
|
|
|
1
1
|
import { ProSettings, SearchbarSettings } from '../interfaces';
|
|
2
2
|
import { NavigationMode, SideMenuType, SearchBarBehavior } from '../interfaces/settings';
|
|
3
3
|
import { ContentWidth } from '../interfaces/pure-settings';
|
|
4
|
+
export declare const DEFAULT_LAYOUT: {
|
|
5
|
+
contentWidth: ContentWidth;
|
|
6
|
+
fixedHeader: boolean;
|
|
7
|
+
fixedSidebar: boolean;
|
|
8
|
+
splitMenus: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const DEFAULT_HEADER: {
|
|
11
|
+
showLogo: boolean;
|
|
12
|
+
showRightContent: boolean;
|
|
13
|
+
showMenuToggle: boolean;
|
|
14
|
+
showBackButton: boolean;
|
|
15
|
+
showPageTitle: boolean;
|
|
16
|
+
showActionButtons: boolean;
|
|
17
|
+
position: "fixed";
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
elevation: number;
|
|
20
|
+
showHeader: boolean;
|
|
21
|
+
showMenu: boolean;
|
|
22
|
+
menuHeaderRender: boolean;
|
|
23
|
+
searchBarRender: boolean;
|
|
24
|
+
searchBarBehavior: SearchBarBehavior;
|
|
25
|
+
searchBarOverlay: boolean;
|
|
26
|
+
scrollThreshold: number;
|
|
27
|
+
};
|
|
28
|
+
export declare const SEARCH_TYPES: {
|
|
29
|
+
readonly HOTELS: "HOTELS";
|
|
30
|
+
readonly FLIGHTS: "FLIGHTS";
|
|
31
|
+
readonly CARS: "CARS";
|
|
32
|
+
};
|
|
33
|
+
export declare const AMENITIES: readonly ["WiFi", "Pool", "Parking", "Air Conditioning", "Kitchen", "Washer", "Dryer", "TV", "Gym", "Elevator", "Hot Tub", "Breakfast"];
|
|
34
|
+
export declare const SHARED_VIEW_CONFIG: {
|
|
35
|
+
layout: {
|
|
36
|
+
navigationMode: NavigationMode;
|
|
37
|
+
sideMenuType: SideMenuType;
|
|
38
|
+
upperMenuDividerName: string;
|
|
39
|
+
middleMenuDividerName: string;
|
|
40
|
+
lowerMenuDividerName: string;
|
|
41
|
+
contentWidth: ContentWidth;
|
|
42
|
+
fixedHeader: boolean;
|
|
43
|
+
fixedSidebar: boolean;
|
|
44
|
+
splitMenus: boolean;
|
|
45
|
+
};
|
|
46
|
+
regions: {
|
|
47
|
+
header: {
|
|
48
|
+
showSearchSlot: boolean;
|
|
49
|
+
height: string;
|
|
50
|
+
showLogo: boolean;
|
|
51
|
+
showRightContent: boolean;
|
|
52
|
+
showMenuToggle: boolean;
|
|
53
|
+
showBackButton: boolean;
|
|
54
|
+
showPageTitle: boolean;
|
|
55
|
+
showActionButtons: boolean;
|
|
56
|
+
position: "fixed";
|
|
57
|
+
backgroundColor: string;
|
|
58
|
+
elevation: number;
|
|
59
|
+
showHeader: boolean;
|
|
60
|
+
showMenu: boolean;
|
|
61
|
+
menuHeaderRender: boolean;
|
|
62
|
+
searchBarRender: boolean;
|
|
63
|
+
searchBarBehavior: SearchBarBehavior;
|
|
64
|
+
searchBarOverlay: boolean;
|
|
65
|
+
scrollThreshold: number;
|
|
66
|
+
};
|
|
67
|
+
background: {
|
|
68
|
+
type: string;
|
|
69
|
+
color: string;
|
|
70
|
+
image: string;
|
|
71
|
+
video: string;
|
|
72
|
+
videoThumbnail: string;
|
|
73
|
+
};
|
|
74
|
+
footer: {
|
|
75
|
+
showFooter: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
4
79
|
export type ISettings = ProSettings & {
|
|
5
80
|
logo: string;
|
|
6
81
|
showSettingPanel: boolean;
|
|
@@ -123,5 +198,4 @@ export type ISettings = ProSettings & {
|
|
|
123
198
|
components: any[];
|
|
124
199
|
activeComponent: string | null;
|
|
125
200
|
};
|
|
126
|
-
export declare const defaultSettings: ISettings;
|
|
127
201
|
//# sourceMappingURL=defaultSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultSettings.d.ts","sourceRoot":"","sources":["../../src/config/defaultSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"defaultSettings.d.ts","sourceRoot":"","sources":["../../src/config/defaultSettings.ts"],"names":[],"mappings":"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"}
|
|
@@ -67,114 +67,4 @@ const SHARED_VIEW_CONFIG = {
|
|
|
67
67
|
},
|
|
68
68
|
footer: { showFooter: true },
|
|
69
69
|
},
|
|
70
|
-
};
|
|
71
|
-
const defaultSettings = {
|
|
72
|
-
logo: 'https://cdmbase.s3.ca-central-1.amazonaws.com/favicon-new-128.svg',
|
|
73
|
-
themeType: 'light',
|
|
74
|
-
theme: 'default',
|
|
75
|
-
primaryColor: '#1890ff',
|
|
76
|
-
colorPrimary: '#1677FF',
|
|
77
|
-
secondaryColor: '#4A5568',
|
|
78
|
-
layout: 'mix',
|
|
79
|
-
contentWidth: DEFAULT_LAYOUT.contentWidth,
|
|
80
|
-
fixedHeader: DEFAULT_LAYOUT.fixedHeader,
|
|
81
|
-
fixSiderbar: DEFAULT_LAYOUT.fixedSidebar,
|
|
82
|
-
colorWeak: false,
|
|
83
|
-
title: 'CDMBase LLC',
|
|
84
|
-
iconfontUrl: '',
|
|
85
|
-
showSettingPanel: true,
|
|
86
|
-
titleColor: '#2869E0',
|
|
87
|
-
language: 'en-US',
|
|
88
|
-
fontFamily: 'Poppins, sans-serif',
|
|
89
|
-
titleFontWeight: '700',
|
|
90
|
-
titleHeight: '30px',
|
|
91
|
-
titleFontSize: '1.8rem',
|
|
92
|
-
letterSpacings: '1px',
|
|
93
|
-
headerTheme: undefined,
|
|
94
|
-
loginThemeColor: 'blue',
|
|
95
|
-
loginFormPosition: 'center',
|
|
96
|
-
loginSocials: '{"Google":true,"Apple":true,"Facebook":true}',
|
|
97
|
-
loginBackgroundImage: null,
|
|
98
|
-
verifyFormLayout: 'center',
|
|
99
|
-
verifyFormImageUrl: '',
|
|
100
|
-
verifyFormBackgroundStyle: 'color',
|
|
101
|
-
verifyFormVisibleFields: '["firstName","lastName","username","companyName","workEmail","phoneNumber","dateOfBirth"]',
|
|
102
|
-
verifyFormShowSkipButton: false,
|
|
103
|
-
sideMenuType: 'expanded',
|
|
104
|
-
currentRoute: '/',
|
|
105
|
-
routeSettings: {
|
|
106
|
-
'/': {
|
|
107
|
-
layout: {
|
|
108
|
-
desktop: SHARED_VIEW_CONFIG.layout,
|
|
109
|
-
mobile: SHARED_VIEW_CONFIG.layout,
|
|
110
|
-
},
|
|
111
|
-
regions: {
|
|
112
|
-
desktop: SHARED_VIEW_CONFIG.regions,
|
|
113
|
-
mobile: SHARED_VIEW_CONFIG.regions,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
components: [],
|
|
118
|
-
activeComponent: null,
|
|
119
|
-
searchbarSettings: {
|
|
120
|
-
enabledSearchBars: {
|
|
121
|
-
[SEARCH_TYPES.HOTELS]: true,
|
|
122
|
-
[SEARCH_TYPES.FLIGHTS]: true,
|
|
123
|
-
[SEARCH_TYPES.CARS]: true,
|
|
124
|
-
},
|
|
125
|
-
fieldsConfig: {
|
|
126
|
-
[SEARCH_TYPES.HOTELS]: {
|
|
127
|
-
location: true,
|
|
128
|
-
dates: true,
|
|
129
|
-
guests: true,
|
|
130
|
-
},
|
|
131
|
-
[SEARCH_TYPES.FLIGHTS]: {
|
|
132
|
-
fromLocation: true,
|
|
133
|
-
toLocation: true,
|
|
134
|
-
dates: true,
|
|
135
|
-
returnFlight: true,
|
|
136
|
-
},
|
|
137
|
-
[SEARCH_TYPES.CARS]: {
|
|
138
|
-
pickupLocation: true,
|
|
139
|
-
dropoffLocation: true,
|
|
140
|
-
dates: true,
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
datePickerConfig: {
|
|
144
|
-
[SEARCH_TYPES.HOTELS]: {
|
|
145
|
-
enableSingleDayMode: true,
|
|
146
|
-
enableTimeSelection: true,
|
|
147
|
-
defaultToSingleDay: false,
|
|
148
|
-
},
|
|
149
|
-
[SEARCH_TYPES.FLIGHTS]: {
|
|
150
|
-
enableSingleDayMode: false,
|
|
151
|
-
enableTimeSelection: false,
|
|
152
|
-
defaultToSingleDay: false,
|
|
153
|
-
},
|
|
154
|
-
[SEARCH_TYPES.CARS]: {
|
|
155
|
-
enableSingleDayMode: false,
|
|
156
|
-
enableTimeSelection: true,
|
|
157
|
-
defaultToSingleDay: false,
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
advanceFilterConfig: {
|
|
161
|
-
enabled: true,
|
|
162
|
-
fields: {
|
|
163
|
-
distance: true,
|
|
164
|
-
price: true,
|
|
165
|
-
petsAllowed: true,
|
|
166
|
-
instantBooking: true,
|
|
167
|
-
amenities: true,
|
|
168
|
-
datasources: true,
|
|
169
|
-
},
|
|
170
|
-
amenitiesList: AMENITIES.map((name) => ({ name })),
|
|
171
|
-
},
|
|
172
|
-
showTypeSelector: true,
|
|
173
|
-
isSettingsPanelOpen: false,
|
|
174
|
-
showTravelPlanner: false,
|
|
175
|
-
showAIAgent: true,
|
|
176
|
-
},
|
|
177
|
-
siderBgColor: '#000000',
|
|
178
|
-
headerBgColor: '#000000',
|
|
179
|
-
textColor: '#a19c9c',
|
|
180
|
-
};export{defaultSettings};//# sourceMappingURL=defaultSettings.js.map
|
|
70
|
+
};export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG};//# sourceMappingURL=defaultSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"0DACA;
|
|
1
|
+
{"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"0DACA;AACS,MAAA,cAAc;AAGvB,IAAA,qBAAa;qBACgB;;;;AAI3B,MAAA,cAAA,GAAA;AAEF,IAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;AAiBE,MAAA,YAAA,GAAA;AAEF,IAAA,MAAA,EAAA;;;;AAIW,MAAA,SAAA,GAAA;AAEX,IAAA,MAAA;AAgBA,IAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { DefaultSettings } from '../interfaces';
|
|
2
|
-
declare const
|
|
2
|
+
export declare const config: Readonly<{
|
|
3
3
|
LAYOUT_SETTINGS: DefaultSettings;
|
|
4
4
|
APP_DOMAIN: string;
|
|
5
5
|
APPLICATION_ID: string;
|
|
6
6
|
} & import("envalid").CleanedEnvAccessors>;
|
|
7
|
-
declare let config: typeof preConfig;
|
|
8
|
-
export { config };
|
|
9
7
|
//# sourceMappingURL=env-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAoBhD,eAAO,MAAM,MAAM;;;;0CAAY,CAAC"}
|
package/lib/config/env-config.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {cleanEnv,str,json}from'envalid';import {getEnvironment}from'@common-stack/core';
|
|
1
|
+
import {cleanEnv,str,json}from'envalid';import {getEnvironment}from'@common-stack/core';const env = getEnvironment();
|
|
2
2
|
const preConfig = cleanEnv(env, {
|
|
3
3
|
LAYOUT_SETTINGS: json({
|
|
4
|
-
default: JSON.stringify({
|
|
4
|
+
default: JSON.stringify({
|
|
5
|
+
// Empty defaults - all settings come from backend GraphQL query
|
|
6
|
+
hiddenMenuKeys: [],
|
|
7
|
+
hiddenMenuCategories: [],
|
|
8
|
+
}),
|
|
5
9
|
}),
|
|
6
10
|
APP_DOMAIN: str({ default: 'cdebase.dev' }),
|
|
7
11
|
APPLICATION_ID: str({
|
|
@@ -9,18 +13,4 @@ const preConfig = cleanEnv(env, {
|
|
|
9
13
|
desc: 'Matches the Application ID exist already',
|
|
10
14
|
}),
|
|
11
15
|
});
|
|
12
|
-
|
|
13
|
-
// Parse the LAYOUT_SETTINGS if it exists in the environment
|
|
14
|
-
if (env.LAYOUT_SETTINGS) {
|
|
15
|
-
try {
|
|
16
|
-
const parsedLayoutSettings = JSON.parse(env.LAYOUT_SETTINGS);
|
|
17
|
-
config = { ...preConfig, LAYOUT_SETTINGS: merge({}, defaultSettings, parsedLayoutSettings) };
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.error('Error parsing LAYOUT_SETTINGS:', error);
|
|
21
|
-
config = preConfig;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
config = preConfig;
|
|
26
|
-
}export{config};//# sourceMappingURL=env-config.js.map
|
|
16
|
+
const config = preConfig;export{config};//# sourceMappingURL=env-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-config.js","sources":[
|
|
1
|
+
{"version":3,"file":"env-config.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB;;0BAoCP,GAAG;;
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB;;0BAoCP,GAAG;;CAgEzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useCallback}from'react';import {useDispatch,useSelector,shallowEqual}from'react-redux';import {merge}from'lodash-es';import {useParams}from'@remix-run/react';import {
|
|
1
|
+
import {useCallback}from'react';import {useDispatch,useSelector,shallowEqual}from'react-redux';import {merge}from'lodash-es';import {useParams}from'@remix-run/react';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';import {compareAndSaveSettingsDifferences}from'../utils/settingsDifference.js';const updateColorWeak = (colorWeak) => {
|
|
2
2
|
// @sri to avoid breaking during SSR, split into to checks
|
|
3
3
|
if (typeof window !== 'undefined') {
|
|
4
4
|
const root = document.getElementById('root');
|
|
@@ -26,13 +26,13 @@ const useLayoutSettings = () => {
|
|
|
26
26
|
if (!response.ok) {
|
|
27
27
|
throw new Error('Failed to fetch settings');
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
return
|
|
29
|
+
const pageUiSettings = await response.json();
|
|
30
|
+
return pageUiSettings.settings;
|
|
31
31
|
}
|
|
32
32
|
catch (error) {
|
|
33
33
|
console.error(error);
|
|
34
34
|
// Return default settings if there's an error
|
|
35
|
-
return
|
|
35
|
+
return {};
|
|
36
36
|
}
|
|
37
37
|
}, []);
|
|
38
38
|
const setSettings = useCallback(async (config) => {
|
|
@@ -45,7 +45,7 @@ const useLayoutSettings = () => {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
updateColorWeak(!!colorWeak);
|
|
48
|
-
const cleanDiffSettings = compareAndSaveSettingsDifferences(config,
|
|
48
|
+
const cleanDiffSettings = compareAndSaveSettingsDifferences(config, settings);
|
|
49
49
|
const response = await fetch('/resources/settings', {
|
|
50
50
|
method: 'POST',
|
|
51
51
|
headers: {
|
|
@@ -54,11 +54,24 @@ const useLayoutSettings = () => {
|
|
|
54
54
|
},
|
|
55
55
|
body: JSON.stringify({ config: cleanDiffSettings }),
|
|
56
56
|
});
|
|
57
|
+
// Check content type before parsing
|
|
58
|
+
const contentType = response.headers.get('content-type');
|
|
59
|
+
console.log('Response content-type:', contentType);
|
|
57
60
|
if (!response.ok) {
|
|
61
|
+
const errorText = await response.text();
|
|
62
|
+
console.error('Server error response:', errorText.substring(0, 500));
|
|
58
63
|
throw new Error('Failed to update settings');
|
|
59
64
|
}
|
|
65
|
+
// If response is HTML instead of JSON, log it and throw error
|
|
66
|
+
if (!contentType || !contentType.includes('application/json')) {
|
|
67
|
+
const text = await response.text();
|
|
68
|
+
console.error('❌ Server returned non-JSON response (HTML error page):');
|
|
69
|
+
console.error('Content-Type:', contentType);
|
|
70
|
+
console.error('Response preview:', text.substring(0, 500));
|
|
71
|
+
throw new Error('Server crashed - returned HTML instead of JSON. Check server terminal for errors.');
|
|
72
|
+
}
|
|
60
73
|
const result = await response.json();
|
|
61
|
-
const pageDefaultSettings = result
|
|
74
|
+
const pageDefaultSettings = result;
|
|
62
75
|
// Merge the full config with default settings before updating the store
|
|
63
76
|
const mergedSettings = merge({}, pageDefaultSettings, config);
|
|
64
77
|
dispatch({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{
|
|
1
|
+
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{assignDefaults}from'./utils/assignDefaults.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';export{useLayoutSettings}from'./hooks/useLayoutSettings.js';export{usePermissionAutoFetch,useSetting,useSettingsLoader}from'@adminide-stack/platform-client';export{ClientOnly}from'./hooks/Client-only.js';export{blue}from'./colors/presets/blue.js';export{brinkPink}from'./colors/presets/brinkPink.js';export{cyan}from'./colors/presets/cyan.js';export{green}from'./colors/presets/green.js';export{lime}from'./colors/presets/lime.js';export{orange}from'./colors/presets/orange.js';export{pink}from'./colors/presets/pink.js';export{purple}from'./colors/presets/purple.js';export{red}from'./colors/presets/red.js';export{skyBlue}from'./colors/presets/skyBlue.js';export{turquoise}from'./colors/presets/turquoise.js';export{yellow}from'./colors/presets/yellow.js';export{white}from'./colors/presets/white.js';export{black}from'./colors/presets/black.js';export{colorList,getThemeColors}from'./colors/colorsList.js';//# sourceMappingURL=index.js.map
|
package/lib/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{
|
|
1
|
+
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{assignDefaults}from'./utils/assignDefaults.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAanD,QAAA,MAAM,eAAe,GACjB,OAAO,GAAmB,EAC1B,mBAAwB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,QAyBrE,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'../../constants/constants.js';import {
|
|
1
|
+
import {CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'../../constants/constants.js';import {merge,cloneDeep}from'lodash-es';/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
2
2
|
/* eslint-disable no-case-declarations */
|
|
3
3
|
// Note: We customize reducer part as AntPro uses inbuild way.
|
|
4
4
|
const updateColorWeak = (colorWeak) => {
|
|
@@ -10,7 +10,7 @@ const updateColorWeak = (colorWeak) => {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
const settingsReducer = (state = merge({},
|
|
13
|
+
const settingsReducer = (state = merge({}, {}), { type, payload = {} }) => {
|
|
14
14
|
switch (type) {
|
|
15
15
|
case CHANGE_SETTINGS_ACTION:
|
|
16
16
|
const { colorWeak, contentWidth } = payload;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"0HAGA;AAaA;AAEsE;AA2BtE,MAAA,eAAS,GAAe,CAAA,SAAG,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/redux/store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {combineReducers,configureStore}from'@reduxjs/toolkit';import {applicationErrors}from'./reducers/error.js';import'
|
|
1
|
+
import {combineReducers,configureStore}from'@reduxjs/toolkit';import {applicationErrors}from'./reducers/error.js';import'lodash-es';// Combine the reducers into an object
|
|
2
2
|
const rootReducer = combineReducers({
|
|
3
3
|
applicationErrors: applicationErrors, // Adding applicationErrors reducer
|
|
4
4
|
});
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/client",
|
|
3
|
-
"version": "12.0.16-alpha.
|
|
3
|
+
"version": "12.0.16-alpha.44",
|
|
4
4
|
"description": "Sample client for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"serialize-error": "^8.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"common": "12.0.16-alpha.
|
|
29
|
+
"common": "12.0.16-alpha.44",
|
|
30
|
+
"rc-menu": "^9.16.1"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
32
33
|
"@adminide-stack/core": ">=12.0.4-alpha.247",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"typescript": {
|
|
44
45
|
"definition": "lib/index.d.ts"
|
|
45
46
|
},
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "81709761b697730903123a9d1d79d2d907a3edc5"
|
|
47
48
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsConfigurationModel.test.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/SettingsConfigurationModel.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationErrorHandlerCommon.test.d.ts","sourceRoot":"","sources":["../../../src/components/__tests__/ApplicationErrorHandlerCommon.test.tsx"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|