@admin-layout/client 12.0.16-alpha.67 → 12.0.16-alpha.70
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/hooks/useLayoutSettings.d.ts.map +1 -1
- package/lib/hooks/useLayoutSettings.js +8 -1
- package/lib/hooks/useLayoutSettings.js.map +1 -1
- package/lib/utils/settingsDifference.d.ts.map +1 -1
- package/lib/utils/settingsDifference.js +13 -12
- package/lib/utils/settingsDifference.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB;;0BAgDP,GAAG;;
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB;;0BAgDP,GAAG;;CAyEzB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,GAAG,SAAS,CAY1D"}
|
|
@@ -57,13 +57,20 @@ const useLayoutSettings = () => {
|
|
|
57
57
|
const cleanDiffSettings = compareAndSaveSettingsDifferences(config, settings);
|
|
58
58
|
if (Object.keys(cleanDiffSettings).length === 0)
|
|
59
59
|
return;
|
|
60
|
+
if (config?.routerPattern && cleanDiffSettings.routerPattern) {
|
|
61
|
+
delete cleanDiffSettings.routerPattern;
|
|
62
|
+
}
|
|
63
|
+
const payloadConfig = config?.routerPattern
|
|
64
|
+
? { [config.routerPattern]: cleanDiffSettings }
|
|
65
|
+
: cleanDiffSettings;
|
|
66
|
+
console.log('payloadConfig :', payloadConfig);
|
|
60
67
|
const response = await fetch('/resources/settings', {
|
|
61
68
|
method: 'POST',
|
|
62
69
|
headers: {
|
|
63
70
|
'Content-Type': 'application/json',
|
|
64
71
|
orgName: orgNameFromParams || orgNameFromUrl || '',
|
|
65
72
|
},
|
|
66
|
-
body: JSON.stringify({ config:
|
|
73
|
+
body: JSON.stringify({ config: payloadConfig, deviceType: getClientDeviceType() }),
|
|
67
74
|
});
|
|
68
75
|
// Check content type before parsing
|
|
69
76
|
const contentType = response.headers.get('content-type');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsDifference.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDifference.ts"],"names":[],"mappings":"AAkLA;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,iBAAiB,GAAG,EAAE,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"settingsDifference.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDifference.ts"],"names":[],"mappings":"AAkLA;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,iBAAiB,GAAG,EAAE,iBAAiB,GAAG,QA8D3F,CAAC"}
|
|
@@ -99,19 +99,20 @@ const compareAndSaveSettingsDifferences = (currentSettings, defaultSettings) =>
|
|
|
99
99
|
});
|
|
100
100
|
const baseSettingsDiff = getDifference(currentBase, defaultBase);
|
|
101
101
|
// Combine base settings differences with overrides
|
|
102
|
-
const diffSettings = {};
|
|
103
|
-
// Add base settings differences if any exist
|
|
104
|
-
if (baseSettingsDiff && Object.keys(baseSettingsDiff).length > 0) {
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
102
|
+
// const diffSettings: any = {};
|
|
103
|
+
// // Add base settings differences if any exist
|
|
104
|
+
// if (baseSettingsDiff && Object.keys(baseSettingsDiff).length > 0) {
|
|
105
|
+
// Object.assign(diffSettings, baseSettingsDiff);
|
|
106
|
+
// }
|
|
107
|
+
// console.log('diffSettings :', diffSettings);
|
|
108
|
+
// // Add all overrides (they are always different from defaults)
|
|
109
|
+
// Object.assign(diffSettings, overrides);
|
|
110
|
+
// // If there are no differences at all, return early
|
|
111
|
+
// if (Object.keys(diffSettings).length === 0) {
|
|
112
|
+
// return {};
|
|
113
|
+
// }
|
|
113
114
|
// Remove empty objects from the diff
|
|
114
|
-
const cleanDiffSettings = removeEmptyObjects(
|
|
115
|
+
const cleanDiffSettings = removeEmptyObjects(baseSettingsDiff);
|
|
115
116
|
return cleanDiffSettings;
|
|
116
117
|
}
|
|
117
118
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsDifference.js","sources":["../../src/utils/settingsDifference.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAqLG;AACH
|
|
1
|
+
{"version":3,"file":"settingsDifference.js","sources":["../../src/utils/settingsDifference.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAqLG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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.70",
|
|
4
4
|
"description": "Sample client for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"serialize-error": "^8.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"common": "12.0.16-alpha.
|
|
29
|
+
"common": "12.0.16-alpha.70",
|
|
30
30
|
"rc-menu": "^9.16.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"typescript": {
|
|
45
45
|
"definition": "lib/index.d.ts"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a086ab5ea5213416f3c5e929bd68a74f2e89979e"
|
|
48
48
|
}
|