datastake-daf 0.6.601 → 0.6.602
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/utils/index.js +19 -0
- package/package.json +1 -1
- package/src/helpers/user.js +23 -1
- package/src/utils.js +1 -1
package/dist/utils/index.js
CHANGED
|
@@ -7782,6 +7782,24 @@ const mapModulesFromApps = (user, APP) => {
|
|
|
7782
7782
|
}, {});
|
|
7783
7783
|
}
|
|
7784
7784
|
};
|
|
7785
|
+
function getRedirectPath(user, fallback = '', app, isDatastake) {
|
|
7786
|
+
if (user.approvalStatus === "pending") {
|
|
7787
|
+
const modules = Object.keys(user.modules);
|
|
7788
|
+
const _app = modules[0] || app;
|
|
7789
|
+
if (_app) {
|
|
7790
|
+
return `/${_app}/confirm`;
|
|
7791
|
+
}
|
|
7792
|
+
}
|
|
7793
|
+
if (user.modules && Object.keys(user.modules).length) {
|
|
7794
|
+
const modules = Object.keys(user.modules);
|
|
7795
|
+
const f = (fallback || '')[0] === '/' ? (fallback || '').substring(1) : fallback || '';
|
|
7796
|
+
const fallbackRoute = f.split('/');
|
|
7797
|
+
if (fallbackRoute.length > 1 && fallbackRoute[0] === 'app' && modules.includes(fallbackRoute[1])) {
|
|
7798
|
+
return fallback;
|
|
7799
|
+
}
|
|
7800
|
+
}
|
|
7801
|
+
return isDatastake ? `/${app}/app` : '/app';
|
|
7802
|
+
}
|
|
7785
7803
|
|
|
7786
7804
|
const en = {
|
|
7787
7805
|
"No planning required": "No planning required",
|
|
@@ -14092,6 +14110,7 @@ exports.getOptionConfig = getOptionConfig;
|
|
|
14092
14110
|
exports.getOptionLabel = getOptionLabel;
|
|
14093
14111
|
exports.getRangeOfTicks = getRangeOfTicks;
|
|
14094
14112
|
exports.getRedirectLink = getRedirectLink;
|
|
14113
|
+
exports.getRedirectPath = getRedirectPath;
|
|
14095
14114
|
exports.getTagColor = getTagColor;
|
|
14096
14115
|
exports.getToken = getToken;
|
|
14097
14116
|
exports.groupSubsections = groupSubsections;
|
package/package.json
CHANGED
package/src/helpers/user.js
CHANGED
|
@@ -170,4 +170,26 @@ export const mapModulesFromApps = (user, APP) => {
|
|
|
170
170
|
return all;
|
|
171
171
|
}, {});
|
|
172
172
|
}
|
|
173
|
-
};
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export function getRedirectPath(user, fallback = '', app, isDatastake) {
|
|
176
|
+
if (user.approvalStatus === "pending") {
|
|
177
|
+
const modules = Object.keys(user.modules);
|
|
178
|
+
const _app = modules[0] || app;
|
|
179
|
+
|
|
180
|
+
if (_app) {
|
|
181
|
+
return `/${_app}/confirm`;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (user.modules && Object.keys(user.modules).length) {
|
|
186
|
+
const modules = Object.keys(user.modules);
|
|
187
|
+
const f = (fallback || '')[0] === '/' ? (fallback || '').substring(1) : (fallback || '');
|
|
188
|
+
const fallbackRoute = f.split('/');
|
|
189
|
+
if (fallbackRoute.length > 1 && fallbackRoute[0] === 'app' && modules.includes(fallbackRoute[1])) {
|
|
190
|
+
return fallback;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return isDatastake ? `/${app}/app` : '/app';
|
|
195
|
+
}
|
package/src/utils.js
CHANGED
|
@@ -21,7 +21,7 @@ export { getOptionConfig, getOptionLabel } from './@daf/core/components/DynamicV
|
|
|
21
21
|
|
|
22
22
|
export { defaultMapConfig } from './@daf/hooks/useMapHelper.js';
|
|
23
23
|
|
|
24
|
-
export { getInterface, modules, isSuperAdmin, isModuleApproved, userHasInterface, userIsAdmin, createModule, mapModulesFromApps } from './helpers/user.js'
|
|
24
|
+
export { getInterface, modules, isSuperAdmin, isModuleApproved, userHasInterface, userIsAdmin, createModule, mapModulesFromApps, getRedirectPath } from './helpers/user.js'
|
|
25
25
|
|
|
26
26
|
export { default as locales } from './constants/locales/index.js';
|
|
27
27
|
|