@admin-layout/client 10.0.9-alpha.62 → 10.0.9-alpha.65
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateMenuLink.d.ts","sourceRoot":"","sources":["../../src/utils/generateMenuLink.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"generateMenuLink.d.ts","sourceRoot":"","sources":["../../src/utils/generateMenuLink.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,gBAAgB,oCA2B5B,CAAC"}
|
|
@@ -67,12 +67,24 @@ function generatePath(originalPath, params) {
|
|
|
67
67
|
return prefix + segments.join('/');
|
|
68
68
|
}
|
|
69
69
|
const generateMenuPath = (path, params) => {
|
|
70
|
+
// Check if all required parameters exist before attempting to generate the path
|
|
71
|
+
const requiredParams = [];
|
|
72
|
+
path.split('/').forEach((segment) => {
|
|
73
|
+
if (segment.startsWith(':') && !segment.endsWith('?')) {
|
|
74
|
+
const paramName = segment.substring(1);
|
|
75
|
+
requiredParams.push(paramName);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
// If any required parameter is missing, return null immediately
|
|
79
|
+
const missingParams = requiredParams.filter((param) => params[param] === undefined);
|
|
80
|
+
if (missingParams.length > 0) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
70
83
|
try {
|
|
71
84
|
const generatedPath = generatePath(path, params);
|
|
72
85
|
return generatedPath;
|
|
73
86
|
}
|
|
74
87
|
catch (err) {
|
|
75
|
-
console.error('Error generating path:', err);
|
|
76
88
|
console.log('Path:', path);
|
|
77
89
|
console.log('Params:', params);
|
|
78
90
|
console.warn(`menu path ${path} is errored due to missing params. If it is not required, please use hidemenu option`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,SAAO,SAAA,CAAA,KAAsB,EAAA,OAAA,EAAA
|
|
1
|
+
{"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,SAAO,SAAA,CAAA,KAAsB,EAAA,OAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/client",
|
|
3
|
-
"version": "10.0.9-alpha.
|
|
3
|
+
"version": "10.0.9-alpha.65",
|
|
4
4
|
"description": "Sample client for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "ff6ea4882047f02ed426382828e8ec5e063317ed",
|
|
41
41
|
"typescript": {
|
|
42
42
|
"definition": "lib/index.d.ts"
|
|
43
43
|
}
|