@copart/ops-tool-kit 1.12.3-alpha.1 → 1.12.3-alpha.2
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
|
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
47
47
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
48
48
|
|
|
49
49
|
const name$r = "@copart/ops-tool-kit";
|
|
50
|
-
const version$8 = "1.12.3-alpha.
|
|
50
|
+
const version$8 = "1.12.3-alpha.2";
|
|
51
51
|
const main$1 = "dist/ops-tool-kit.js";
|
|
52
52
|
const style = "dist/ops-tool-kit.css";
|
|
53
53
|
const files = [
|
|
@@ -35098,6 +35098,13 @@ var getUserData = function getUserData() {
|
|
|
35098
35098
|
appScopes: storage$1.userAppScopes
|
|
35099
35099
|
};
|
|
35100
35100
|
};
|
|
35101
|
+
var userHasChatBotAccess = function userHasChatBotAccess(appFunction) {
|
|
35102
|
+
if (!appFunction) return true;
|
|
35103
|
+
var coreAppPermissions = storage$1.coreAppPermissions;
|
|
35104
|
+
return !isEmpty$2(coreAppPermissions) && !isNil$1(coreAppPermissions.find(function (permission) {
|
|
35105
|
+
return permission.name === appFunction;
|
|
35106
|
+
}));
|
|
35107
|
+
};
|
|
35101
35108
|
var userHasAccess = function userHasAccess(tile) {
|
|
35102
35109
|
var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData();
|
|
35103
35110
|
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)]);
|
|
@@ -35111,6 +35118,7 @@ var accessHelpers = /*#__PURE__*/Object.freeze({
|
|
|
35111
35118
|
appFunctionIdAllowed: appFunctionIdAllowed,
|
|
35112
35119
|
stackIsAllowed: stackIsAllowed,
|
|
35113
35120
|
casAccessAllowed: casAccessAllowed,
|
|
35121
|
+
userHasChatBotAccess: userHasChatBotAccess,
|
|
35114
35122
|
userHasAccess: userHasAccess,
|
|
35115
35123
|
'default': userHasAccess
|
|
35116
35124
|
});
|
|
@@ -69096,9 +69104,11 @@ var AppFrame = function AppFrame(props) {
|
|
|
69096
69104
|
var setChatBotEnableStatus = function setChatBotEnableStatus() {
|
|
69097
69105
|
var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
69098
69106
|
var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
|
|
69099
|
-
var enableChatBot = coreAppConfig.enableChatBot
|
|
69107
|
+
var enableChatBot = coreAppConfig.enableChatBot,
|
|
69108
|
+
chatBotAppFunctionId = coreAppConfig.chatBotAppFunctionId;
|
|
69100
69109
|
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
69101
|
-
var
|
|
69110
|
+
var hasChatBotAccess = userHasChatBotAccess(chatBotAppFunctionId);
|
|
69111
|
+
var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot && hasChatBotAccess : (tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot) && hasChatBotAccess;
|
|
69102
69112
|
console.log("***chatBotEnabled=", chatBotEnabled, coreAppConfig);
|
|
69103
69113
|
console.log("***isCoreRoute=", isCoreRoute, enableChatBot, window.location.pathname, !window.location.pathname.includes('embedded'));
|
|
69104
69114
|
setChatBotEnabled(chatBotEnabled);
|