@copart/ops-tool-kit 1.10.20 → 1.10.21-alpha.1
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/ops-tool-kit.js +13 -3
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -48,7 +48,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
48
48
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
49
49
|
|
|
50
50
|
const name$r = "@copart/ops-tool-kit";
|
|
51
|
-
const version$6 = "1.10.
|
|
51
|
+
const version$6 = "1.10.21-alpha.1";
|
|
52
52
|
const main$1 = "dist/ops-tool-kit.js";
|
|
53
53
|
const style = "dist/ops-tool-kit.css";
|
|
54
54
|
const files = [
|
|
@@ -37363,6 +37363,13 @@ var getUserData = function getUserData() {
|
|
|
37363
37363
|
appScopes: storage$1.userAppScopes
|
|
37364
37364
|
};
|
|
37365
37365
|
};
|
|
37366
|
+
var userHasChatBotAccess = function userHasChatBotAccess(appFunction) {
|
|
37367
|
+
if (!appFunction) return true;
|
|
37368
|
+
var coreAppPermissions = storage$1.coreAppPermissions;
|
|
37369
|
+
return !isEmpty$2(coreAppPermissions) && !isNil$1(coreAppPermissions.find(function (permission) {
|
|
37370
|
+
return permission.name === appFunction;
|
|
37371
|
+
}));
|
|
37372
|
+
};
|
|
37366
37373
|
var userHasAccess = function userHasAccess(tile) {
|
|
37367
37374
|
var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData();
|
|
37368
37375
|
return allAreTruthy([stackIsAllowed(tile.stack), yardNumberAllowed(user.activeYardNumber, tile), securityLevelAllowed(user.securityLevel, tile), emailAddressAllowed(user.emailAddress, tile), appFunctionIdAllowed(user.coreAppPermissions, user.allPermissionIds, user.permissionIds, user.appScopes, tile), casAccessAllowed(user.hasCasAccess, tile.requireCasAccess)]);
|
|
@@ -37376,6 +37383,7 @@ var accessHelpers = /*#__PURE__*/Object.freeze({
|
|
|
37376
37383
|
appFunctionIdAllowed: appFunctionIdAllowed,
|
|
37377
37384
|
stackIsAllowed: stackIsAllowed,
|
|
37378
37385
|
casAccessAllowed: casAccessAllowed,
|
|
37386
|
+
userHasChatBotAccess: userHasChatBotAccess,
|
|
37379
37387
|
userHasAccess: userHasAccess,
|
|
37380
37388
|
'default': userHasAccess
|
|
37381
37389
|
});
|
|
@@ -60360,9 +60368,11 @@ var AppFrame = function AppFrame(props) {
|
|
|
60360
60368
|
var setChatBotEnableStatus = function setChatBotEnableStatus() {
|
|
60361
60369
|
var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
60362
60370
|
var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
|
|
60363
|
-
var enableChatBot = coreAppConfig.enableChatBot
|
|
60371
|
+
var enableChatBot = coreAppConfig.enableChatBot,
|
|
60372
|
+
chatBotAppFunctionId = coreAppConfig.chatBotAppFunctionId;
|
|
60364
60373
|
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
60365
|
-
var
|
|
60374
|
+
var hasChatBotAccess = userHasChatBotAccess(chatBotAppFunctionId);
|
|
60375
|
+
var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot && hasChatBotAccess : (tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot) && hasChatBotAccess;
|
|
60366
60376
|
console.log("***chatBotEnabled=", chatBotEnabled, coreAppConfig);
|
|
60367
60377
|
console.log("***isCoreRoute=", isCoreRoute, enableChatBot, window.location.pathname, !window.location.pathname.includes('embedded'));
|
|
60368
60378
|
setChatBotEnabled(chatBotEnabled);
|