@copart/ops-tool-kit 1.13.0-beta.1 → 1.13.0-beta.3
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 +1747 -492
- 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$1 = "@copart/ops-tool-kit";
|
|
50
|
-
const version$3 = "1.13.0-beta.
|
|
50
|
+
const version$3 = "1.13.0-beta.3";
|
|
51
51
|
const main$1 = "dist/ops-tool-kit.js";
|
|
52
52
|
const style = "dist/ops-tool-kit.css";
|
|
53
53
|
const files = [
|
|
@@ -2449,22 +2449,22 @@ var stringify$1 = function stringify(target) {
|
|
|
2449
2449
|
|
|
2450
2450
|
emitStorageEvents('local');
|
|
2451
2451
|
emitStorageEvents('session');
|
|
2452
|
-
var getLocalItem = function getLocalItem(key, path) {
|
|
2452
|
+
var getLocalItem$1 = function getLocalItem(key, path) {
|
|
2453
2453
|
var data = parse$1(localStorage[key]) || {};
|
|
2454
2454
|
return path ? getValue$1(data, path) : data;
|
|
2455
2455
|
};
|
|
2456
|
-
var getSessionItem = function getSessionItem(key, path) {
|
|
2456
|
+
var getSessionItem$1 = function getSessionItem(key, path) {
|
|
2457
2457
|
var data = parse$1(sessionStorage[key]) || {};
|
|
2458
2458
|
return path ? getValue$1(data, path) : data;
|
|
2459
2459
|
};
|
|
2460
|
-
var setLocalItem = function setLocalItem(key, value, path) {
|
|
2460
|
+
var setLocalItem$1 = function setLocalItem(key, value, path) {
|
|
2461
2461
|
if (value) {
|
|
2462
|
-
localStorage[key] = stringify$1(path ? setValue(getLocalItem(key), path, value) : value);
|
|
2462
|
+
localStorage[key] = stringify$1(path ? setValue(getLocalItem$1(key), path, value) : value);
|
|
2463
2463
|
}
|
|
2464
2464
|
};
|
|
2465
|
-
var setSessionItem = function setSessionItem(key, value, path) {
|
|
2465
|
+
var setSessionItem$1 = function setSessionItem(key, value, path) {
|
|
2466
2466
|
if (value) {
|
|
2467
|
-
sessionStorage[key] = stringify$1(path ? setValue(getSessionItem(key), path, value) : value);
|
|
2467
|
+
sessionStorage[key] = stringify$1(path ? setValue(getSessionItem$1(key), path, value) : value);
|
|
2468
2468
|
}
|
|
2469
2469
|
};
|
|
2470
2470
|
var getItemFromStorage = function getItemFromStorage(storage) {
|
|
@@ -2485,7 +2485,7 @@ var resetRole = function resetRole() {
|
|
|
2485
2485
|
var newSettings = getItemFromStorage(localStorage)('settings');
|
|
2486
2486
|
localStorage.setItem('settings', newSettings);
|
|
2487
2487
|
};
|
|
2488
|
-
var clearStorage = function clearStorage() {
|
|
2488
|
+
var clearStorage$1 = function clearStorage() {
|
|
2489
2489
|
localStorage.removeItem('login');
|
|
2490
2490
|
localStorage.removeItem('twilio');
|
|
2491
2491
|
//Clear app permissions
|
|
@@ -2502,7 +2502,7 @@ var clearStorage = function clearStorage() {
|
|
|
2502
2502
|
// Clear Mihub related field. Need to revisit this
|
|
2503
2503
|
sessionStorage.removeItem('globalNavResponseObj');
|
|
2504
2504
|
};
|
|
2505
|
-
var setAppContext = function setAppContext() {
|
|
2505
|
+
var setAppContext$1 = function setAppContext() {
|
|
2506
2506
|
var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2507
2507
|
try {
|
|
2508
2508
|
var _window$toolkitEnv, _window$toolkitEnv2, _window$toolkitEnv3;
|
|
@@ -2511,10 +2511,10 @@ var setAppContext = function setAppContext() {
|
|
|
2511
2511
|
}
|
|
2512
2512
|
var isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
2513
2513
|
if (isCoreApp) {
|
|
2514
|
-
setSessionItem('opsportal-core:miHelpBotContext', context);
|
|
2514
|
+
setSessionItem$1('opsportal-core:miHelpBotContext', context);
|
|
2515
2515
|
return;
|
|
2516
2516
|
}
|
|
2517
|
-
var appTiles = storage$
|
|
2517
|
+
var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
|
|
2518
2518
|
var appName = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
2519
2519
|
var appData = appTiles.find(function (tile) {
|
|
2520
2520
|
if (tile.appName) {
|
|
@@ -2525,28 +2525,28 @@ var setAppContext = function setAppContext() {
|
|
|
2525
2525
|
});
|
|
2526
2526
|
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv3 = window.toolkitEnv) !== null && _window$toolkitEnv3 !== void 0 && _window$toolkitEnv3.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
2527
2527
|
if (!appAuthName) throw new Error('appAuthName not found');
|
|
2528
|
-
setSessionItem("".concat(appAuthName, ":miHelpBotContext"), context);
|
|
2528
|
+
setSessionItem$1("".concat(appAuthName, ":miHelpBotContext"), context);
|
|
2529
2529
|
} catch (e) {
|
|
2530
2530
|
console.log('Error while setting context ', e);
|
|
2531
2531
|
}
|
|
2532
2532
|
};
|
|
2533
2533
|
var createOpsStorage = function createOpsStorage() {
|
|
2534
2534
|
return {
|
|
2535
|
-
getLocalItem: getLocalItem,
|
|
2536
|
-
setLocalItem: setLocalItem,
|
|
2537
|
-
getSessionItem: getSessionItem,
|
|
2538
|
-
setSessionItem: setSessionItem,
|
|
2539
|
-
setAppContext: setAppContext,
|
|
2535
|
+
getLocalItem: getLocalItem$1,
|
|
2536
|
+
setLocalItem: setLocalItem$1,
|
|
2537
|
+
getSessionItem: getSessionItem$1,
|
|
2538
|
+
setSessionItem: setSessionItem$1,
|
|
2539
|
+
setAppContext: setAppContext$1,
|
|
2540
2540
|
setItem: function setItem(key, value) {
|
|
2541
2541
|
var _window$toolkitEnv4;
|
|
2542
2542
|
var APP_NAME = (_window$toolkitEnv4 = window.toolkitEnv) !== null && _window$toolkitEnv4 !== void 0 && _window$toolkitEnv4.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
2543
|
-
setLocalItem("".concat(APP_NAME, ":").concat(key), value);
|
|
2543
|
+
setLocalItem$1("".concat(APP_NAME, ":").concat(key), value);
|
|
2544
2544
|
return value;
|
|
2545
2545
|
},
|
|
2546
2546
|
getItem: function getItem(key) {
|
|
2547
2547
|
var _window$toolkitEnv5;
|
|
2548
2548
|
var APP_NAME = (_window$toolkitEnv5 = window.toolkitEnv) !== null && _window$toolkitEnv5 !== void 0 && _window$toolkitEnv5.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
2549
|
-
var value = getLocalItem("".concat(APP_NAME, ":").concat(key));
|
|
2549
|
+
var value = getLocalItem$1("".concat(APP_NAME, ":").concat(key));
|
|
2550
2550
|
return value;
|
|
2551
2551
|
},
|
|
2552
2552
|
get appContext() {
|
|
@@ -2554,10 +2554,10 @@ var createOpsStorage = function createOpsStorage() {
|
|
|
2554
2554
|
var _window$toolkitEnv6;
|
|
2555
2555
|
var isCoreApp = (_window$toolkitEnv6 = window.toolkitEnv) !== null && _window$toolkitEnv6 !== void 0 && _window$toolkitEnv6.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
2556
2556
|
if (isCoreApp) {
|
|
2557
|
-
return getSessionItem('opsportal-core:miHelpBotContext');
|
|
2557
|
+
return getSessionItem$1('opsportal-core:miHelpBotContext');
|
|
2558
2558
|
} else {
|
|
2559
2559
|
var _window$toolkitEnv7, _window$toolkitEnv8;
|
|
2560
|
-
var appTiles = storage$
|
|
2560
|
+
var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
|
|
2561
2561
|
var appName = (_window$toolkitEnv7 = window.toolkitEnv) !== null && _window$toolkitEnv7 !== void 0 && _window$toolkitEnv7.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
2562
2562
|
var appData = appTiles.find(function (tile) {
|
|
2563
2563
|
if (tile.appName) {
|
|
@@ -2567,7 +2567,7 @@ var createOpsStorage = function createOpsStorage() {
|
|
|
2567
2567
|
}
|
|
2568
2568
|
});
|
|
2569
2569
|
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv8 = window.toolkitEnv) !== null && _window$toolkitEnv8 !== void 0 && _window$toolkitEnv8.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
2570
|
-
return appAuthName ? getSessionItem("".concat(appAuthName, ":miHelpBotContext")) : {};
|
|
2570
|
+
return appAuthName ? getSessionItem$1("".concat(appAuthName, ":miHelpBotContext")) : {};
|
|
2571
2571
|
}
|
|
2572
2572
|
} catch (e) {
|
|
2573
2573
|
console.log('App context error, ', e);
|
|
@@ -2578,20 +2578,20 @@ var createOpsStorage = function createOpsStorage() {
|
|
|
2578
2578
|
return getItem('config');
|
|
2579
2579
|
},
|
|
2580
2580
|
get permissions() {
|
|
2581
|
-
return storage$
|
|
2581
|
+
return storage$2.getLocalItem('settings', 'permissions') || [];
|
|
2582
2582
|
},
|
|
2583
2583
|
get permissionIds() {
|
|
2584
|
-
return storage$
|
|
2584
|
+
return storage$2.getLocalItem('settings', 'permissionIds') || [];
|
|
2585
2585
|
},
|
|
2586
2586
|
get allPermissionIds() {
|
|
2587
|
-
return storage$
|
|
2587
|
+
return storage$2.getLocalItem('settings', 'allPermissionIds') || [];
|
|
2588
2588
|
},
|
|
2589
2589
|
get coreAppPermissions() {
|
|
2590
|
-
return storage$
|
|
2590
|
+
return storage$2.getLocalItem('ops_portal:permissions') || [];
|
|
2591
2591
|
},
|
|
2592
2592
|
get currentAppPermissions() {
|
|
2593
2593
|
var _window$toolkitEnv9, _window$toolkitEnv0;
|
|
2594
|
-
var appTiles = storage$
|
|
2594
|
+
var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
|
|
2595
2595
|
var appName = (_window$toolkitEnv9 = window.toolkitEnv) !== null && _window$toolkitEnv9 !== void 0 && _window$toolkitEnv9.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
2596
2596
|
var appData = appTiles.find(function (tile) {
|
|
2597
2597
|
if (tile.appName) {
|
|
@@ -2601,142 +2601,142 @@ var createOpsStorage = function createOpsStorage() {
|
|
|
2601
2601
|
}
|
|
2602
2602
|
});
|
|
2603
2603
|
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv0 = window.toolkitEnv) !== null && _window$toolkitEnv0 !== void 0 && _window$toolkitEnv0.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
2604
|
-
return appAuthName ? storage$
|
|
2604
|
+
return appAuthName ? storage$2.getLocalItem("".concat(appAuthName, ":permissions")) : [];
|
|
2605
2605
|
},
|
|
2606
2606
|
get appScopesAndFunctions() {
|
|
2607
|
-
return getLocalItem('appScopesAndFunctions') || [];
|
|
2607
|
+
return getLocalItem$1('appScopesAndFunctions') || [];
|
|
2608
2608
|
},
|
|
2609
2609
|
get userAppScopes() {
|
|
2610
|
-
return getLocalItem('login', 'userAppScopes') || [];
|
|
2610
|
+
return getLocalItem$1('login', 'userAppScopes') || [];
|
|
2611
2611
|
},
|
|
2612
2612
|
get coreConfig() {
|
|
2613
|
-
return getLocalItem('opsportal-core:config');
|
|
2613
|
+
return getLocalItem$1('opsportal-core:config');
|
|
2614
2614
|
},
|
|
2615
2615
|
get userName() {
|
|
2616
|
-
return getLocalItem('login', 'userData.entity_name');
|
|
2616
|
+
return getLocalItem$1('login', 'userData.entity_name');
|
|
2617
2617
|
},
|
|
2618
2618
|
get userAvailability() {
|
|
2619
|
-
return getLocalItem('dashboard', 'userAvailability');
|
|
2619
|
+
return getLocalItem$1('dashboard', 'userAvailability');
|
|
2620
2620
|
},
|
|
2621
2621
|
get userEmail() {
|
|
2622
|
-
return getLocalItem('login', 'userData.entity_mail');
|
|
2622
|
+
return getLocalItem$1('login', 'userData.entity_mail');
|
|
2623
2623
|
},
|
|
2624
2624
|
get userCopartId() {
|
|
2625
|
-
return getLocalItem('login', 'userData.entity_employee_copart_id');
|
|
2625
|
+
return getLocalItem$1('login', 'userData.entity_employee_copart_id');
|
|
2626
2626
|
},
|
|
2627
2627
|
get userSamAccount() {
|
|
2628
|
-
return getLocalItem('login', 'userData.entity_sam_id');
|
|
2628
|
+
return getLocalItem$1('login', 'userData.entity_sam_id');
|
|
2629
2629
|
},
|
|
2630
2630
|
get userCountry() {
|
|
2631
|
-
return getLocalItem('login', 'userData.entity_country');
|
|
2631
|
+
return getLocalItem$1('login', 'userData.entity_country');
|
|
2632
2632
|
},
|
|
2633
2633
|
get accessToken() {
|
|
2634
|
-
return getLocalItem('login', 'userData.access_token');
|
|
2634
|
+
return getLocalItem$1('login', 'userData.access_token');
|
|
2635
2635
|
},
|
|
2636
2636
|
get refreshToken() {
|
|
2637
|
-
return getLocalItem('login', 'userData.refresh_token');
|
|
2637
|
+
return getLocalItem$1('login', 'userData.refresh_token');
|
|
2638
2638
|
},
|
|
2639
2639
|
get isAuthenticated() {
|
|
2640
|
-
return getLocalItem('login', 'isAuthenticated');
|
|
2640
|
+
return getLocalItem$1('login', 'isAuthenticated');
|
|
2641
2641
|
},
|
|
2642
2642
|
get activeCountry() {
|
|
2643
2643
|
var _getSessionItem;
|
|
2644
|
-
return (_getSessionItem = getSessionItem('dashboard')) === null || _getSessionItem === void 0 ? void 0 : _getSessionItem.selectedCountry;
|
|
2644
|
+
return (_getSessionItem = getSessionItem$1('dashboard')) === null || _getSessionItem === void 0 ? void 0 : _getSessionItem.selectedCountry;
|
|
2645
2645
|
},
|
|
2646
2646
|
get activeLanguage() {
|
|
2647
2647
|
var _getSessionItem2;
|
|
2648
|
-
return ((_getSessionItem2 = getSessionItem('dashboard')) === null || _getSessionItem2 === void 0 ? void 0 : _getSessionItem2.language) || 'en';
|
|
2648
|
+
return ((_getSessionItem2 = getSessionItem$1('dashboard')) === null || _getSessionItem2 === void 0 ? void 0 : _getSessionItem2.language) || 'en';
|
|
2649
2649
|
},
|
|
2650
2650
|
get userSecurityLevel() {
|
|
2651
|
-
return Number(getSessionItem('securityLevel')) || 0;
|
|
2651
|
+
return Number(getSessionItem$1('securityLevel')) || 0;
|
|
2652
2652
|
},
|
|
2653
2653
|
get phoneNumber() {
|
|
2654
2654
|
var _getLocalItem;
|
|
2655
|
-
return (_getLocalItem = getLocalItem('dashboard')) === null || _getLocalItem === void 0 ? void 0 : _getLocalItem.phoneNumber;
|
|
2655
|
+
return (_getLocalItem = getLocalItem$1('dashboard')) === null || _getLocalItem === void 0 ? void 0 : _getLocalItem.phoneNumber;
|
|
2656
2656
|
},
|
|
2657
2657
|
get userRole() {
|
|
2658
2658
|
var _getLocalItem2;
|
|
2659
|
-
return ((_getLocalItem2 = getLocalItem('settings')) === null || _getLocalItem2 === void 0 ? void 0 : _getLocalItem2.selectedRole) || '';
|
|
2659
|
+
return ((_getLocalItem2 = getLocalItem$1('settings')) === null || _getLocalItem2 === void 0 ? void 0 : _getLocalItem2.selectedRole) || '';
|
|
2660
2660
|
},
|
|
2661
2661
|
get hasCasAccess() {
|
|
2662
2662
|
var _getLocalItem3, _getLocalItem3$userDa;
|
|
2663
|
-
return (_getLocalItem3 = getLocalItem('login')) === null || _getLocalItem3 === void 0 ? void 0 : (_getLocalItem3$userDa = _getLocalItem3.userData) === null || _getLocalItem3$userDa === void 0 ? void 0 : _getLocalItem3$userDa.hasCasAccess;
|
|
2663
|
+
return (_getLocalItem3 = getLocalItem$1('login')) === null || _getLocalItem3 === void 0 ? void 0 : (_getLocalItem3$userDa = _getLocalItem3.userData) === null || _getLocalItem3$userDa === void 0 ? void 0 : _getLocalItem3$userDa.hasCasAccess;
|
|
2664
2664
|
},
|
|
2665
2665
|
get activeYardNumber() {
|
|
2666
2666
|
var _getSessionItem3;
|
|
2667
|
-
return (_getSessionItem3 = getSessionItem('dashboard')) === null || _getSessionItem3 === void 0 ? void 0 : _getSessionItem3.selectedYard;
|
|
2667
|
+
return (_getSessionItem3 = getSessionItem$1('dashboard')) === null || _getSessionItem3 === void 0 ? void 0 : _getSessionItem3.selectedYard;
|
|
2668
2668
|
},
|
|
2669
2669
|
get lastSelectedYard() {
|
|
2670
|
-
var data = getLocalItem('lastSelectedYard');
|
|
2670
|
+
var data = getLocalItem$1('lastSelectedYard');
|
|
2671
2671
|
if (data && Object.entries(data).length) {
|
|
2672
2672
|
return data;
|
|
2673
2673
|
}
|
|
2674
2674
|
},
|
|
2675
2675
|
get homeYard() {
|
|
2676
2676
|
var _getLocalItem4;
|
|
2677
|
-
var yardList = ((_getLocalItem4 = getLocalItem('login')) === null || _getLocalItem4 === void 0 ? void 0 : _getLocalItem4.yardList) || [];
|
|
2677
|
+
var yardList = ((_getLocalItem4 = getLocalItem$1('login')) === null || _getLocalItem4 === void 0 ? void 0 : _getLocalItem4.yardList) || [];
|
|
2678
2678
|
return yardList.find(function (yard) {
|
|
2679
2679
|
return yard.isHomeYard === 'Y';
|
|
2680
2680
|
});
|
|
2681
2681
|
},
|
|
2682
2682
|
get selectedHierarchy() {
|
|
2683
|
-
return storage$
|
|
2683
|
+
return storage$2.getLocalItem('settings', 'selectedHierarchy') || {};
|
|
2684
2684
|
},
|
|
2685
2685
|
get selectedHierarchyOption() {
|
|
2686
|
-
return storage$
|
|
2686
|
+
return storage$2.getLocalItem('settings', 'selectedHierarchyOption') || {};
|
|
2687
2687
|
},
|
|
2688
2688
|
get chromePluginData() {
|
|
2689
|
-
return storage$
|
|
2689
|
+
return storage$2.getLocalItem('chromePluginData') || {};
|
|
2690
2690
|
},
|
|
2691
2691
|
get twilioVoiceTask() {
|
|
2692
|
-
return getLocalItem('twilio', 'voiceTask') || {};
|
|
2692
|
+
return getLocalItem$1('twilio', 'voiceTask') || {};
|
|
2693
2693
|
},
|
|
2694
2694
|
get twilioCallAnswered() {
|
|
2695
|
-
return getLocalItem('twilio', 'callAccepted') || false;
|
|
2695
|
+
return getLocalItem$1('twilio', 'callAccepted') || false;
|
|
2696
2696
|
},
|
|
2697
2697
|
get twilioWrapup() {
|
|
2698
|
-
return getLocalItem('twilio', 'wrapUpCall') || false;
|
|
2698
|
+
return getLocalItem$1('twilio', 'wrapUpCall') || false;
|
|
2699
2699
|
},
|
|
2700
2700
|
get twilioEnabledStatus() {
|
|
2701
|
-
return getLocalItem('dashboard', 'twilioEnabled') || false;
|
|
2701
|
+
return getLocalItem$1('dashboard', 'twilioEnabled') || false;
|
|
2702
2702
|
},
|
|
2703
2703
|
get clickToDialEnabledStatus() {
|
|
2704
2704
|
return localStorage.c2dEnabled ? JSON.parse(localStorage.c2dEnabled) : false;
|
|
2705
2705
|
},
|
|
2706
2706
|
get callCapsuleEnabledStatus() {
|
|
2707
|
-
return getLocalItem('dashboard', 'isCallCapsuleEnabled') || false;
|
|
2707
|
+
return getLocalItem$1('dashboard', 'isCallCapsuleEnabled') || false;
|
|
2708
2708
|
},
|
|
2709
2709
|
get flexLoaded() {
|
|
2710
|
-
return getLocalItem('twilio', 'flexLoaded') || false;
|
|
2710
|
+
return getLocalItem$1('twilio', 'flexLoaded') || false;
|
|
2711
2711
|
},
|
|
2712
2712
|
get workerProfileData() {
|
|
2713
|
-
return getLocalItem('twilio', 'workerProfileData') || {};
|
|
2713
|
+
return getLocalItem$1('twilio', 'workerProfileData') || {};
|
|
2714
2714
|
},
|
|
2715
2715
|
get twilioStatus() {
|
|
2716
|
-
return getLocalItem('twilio', 'status') || 'Offline';
|
|
2716
|
+
return getLocalItem$1('twilio', 'status') || 'Offline';
|
|
2717
2717
|
},
|
|
2718
2718
|
get twilioUserStatus() {
|
|
2719
|
-
return getLocalItem('twilio', 'userStatus') || 'Offline';
|
|
2719
|
+
return getLocalItem$1('twilio', 'userStatus') || 'Offline';
|
|
2720
2720
|
},
|
|
2721
2721
|
get twilioCallSid() {
|
|
2722
|
-
return getLocalItem('twilio', 'callSid') || false;
|
|
2722
|
+
return getLocalItem$1('twilio', 'callSid') || false;
|
|
2723
2723
|
},
|
|
2724
2724
|
get twilioWarning() {
|
|
2725
|
-
return getLocalItem('twilio', 'warning') || 'false';
|
|
2725
|
+
return getLocalItem$1('twilio', 'warning') || 'false';
|
|
2726
2726
|
},
|
|
2727
2727
|
clear: function clear() {
|
|
2728
|
-
return clearStorage();
|
|
2728
|
+
return clearStorage$1();
|
|
2729
2729
|
},
|
|
2730
2730
|
logout: function logout() {
|
|
2731
|
-
clearStorage();
|
|
2731
|
+
clearStorage$1();
|
|
2732
2732
|
localStorage.removeItem('c2dEnabled');
|
|
2733
2733
|
localStorage.removeItem('mihelpAgentConversations');
|
|
2734
2734
|
window.location.assign('/logout');
|
|
2735
2735
|
}
|
|
2736
2736
|
};
|
|
2737
2737
|
};
|
|
2738
|
-
var storage$
|
|
2739
|
-
global.storage = storage$
|
|
2738
|
+
var storage$2 = createOpsStorage();
|
|
2739
|
+
global.storage = storage$2;
|
|
2740
2740
|
|
|
2741
2741
|
var DEFAULT_BREADCRUMBS_CONTEXT = {
|
|
2742
2742
|
error: 'You tried to use Breadcrumbs outside of its context.'
|
|
@@ -2866,7 +2866,7 @@ var getCrumbProps = function getCrumbProps(props) {
|
|
|
2866
2866
|
var crumbProps = _objectWithoutProperties(props, _excluded$4);
|
|
2867
2867
|
return crumbProps;
|
|
2868
2868
|
};
|
|
2869
|
-
var Crumb = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
2869
|
+
var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
2870
2870
|
function Crumb() {
|
|
2871
2871
|
var _this;
|
|
2872
2872
|
_classCallCheck$3(this, Crumb);
|
|
@@ -2913,7 +2913,7 @@ var Crumb = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
|
2913
2913
|
}
|
|
2914
2914
|
}]);
|
|
2915
2915
|
}(React__namespace.Component)) || _class;
|
|
2916
|
-
Crumb.defaultProps = {
|
|
2916
|
+
Crumb$1.defaultProps = {
|
|
2917
2917
|
breadcrumbs: {
|
|
2918
2918
|
addCrumb: function addCrumb() {},
|
|
2919
2919
|
removeCrumb: function removeCrumb() {},
|
|
@@ -4943,7 +4943,7 @@ factory["default"] = Wretcher.factory;
|
|
|
4943
4943
|
var getRequestBody = function getRequestBody() {
|
|
4944
4944
|
return {
|
|
4945
4945
|
grant_type: 'refresh_token',
|
|
4946
|
-
refreshToken: storage$
|
|
4946
|
+
refreshToken: storage$2.getLocalItem('login', 'userData.refresh_token')
|
|
4947
4947
|
};
|
|
4948
4948
|
};
|
|
4949
4949
|
var getRequestOptions = function getRequestOptions() {
|
|
@@ -4966,17 +4966,17 @@ var refreshToken = /*#__PURE__*/function () {
|
|
|
4966
4966
|
// TODO: Warn the user that they must log back in
|
|
4967
4967
|
// then send user to login.
|
|
4968
4968
|
devOnly.error('refreshToken - No refreshToken present.');
|
|
4969
|
-
return _context.a(2, storage$
|
|
4969
|
+
return _context.a(2, storage$2.logout());
|
|
4970
4970
|
case 1:
|
|
4971
4971
|
handleUnauthorized = function handleUnauthorized(error) {
|
|
4972
4972
|
// TODO: Warn the user that they must log back in first.
|
|
4973
4973
|
devOnly.error('refreshToken - attempt received unauthorized.');
|
|
4974
|
-
storage$
|
|
4974
|
+
storage$2.logout();
|
|
4975
4975
|
};
|
|
4976
4976
|
handleSuccess = function handleSuccess(data) {
|
|
4977
4977
|
if (data.access_token && data.refresh_token) {
|
|
4978
|
-
storage$
|
|
4979
|
-
storage$
|
|
4978
|
+
storage$2.setLocalItem('login', data.access_token, 'userData.access_token');
|
|
4979
|
+
storage$2.setLocalItem('login', data.refresh_token, 'userData.refresh_token');
|
|
4980
4980
|
}
|
|
4981
4981
|
return data;
|
|
4982
4982
|
};
|
|
@@ -4984,14 +4984,14 @@ var refreshToken = /*#__PURE__*/function () {
|
|
|
4984
4984
|
devOnly.error('refreshToken - badRequest', {
|
|
4985
4985
|
error: error
|
|
4986
4986
|
});
|
|
4987
|
-
storage$
|
|
4987
|
+
storage$2.logout();
|
|
4988
4988
|
};
|
|
4989
4989
|
handleError = function handleError(error) {
|
|
4990
4990
|
devOnly.error('refreshToken - Error refreshing config:', {
|
|
4991
4991
|
error: error
|
|
4992
4992
|
});
|
|
4993
4993
|
devOnly.error('expiring login session:');
|
|
4994
|
-
storage$
|
|
4994
|
+
storage$2.logout();
|
|
4995
4995
|
};
|
|
4996
4996
|
_context.n = 2;
|
|
4997
4997
|
return factory('/refreshToken').options(options).post(body).unauthorized(handleUnauthorized).error(418, handleExpired).json(handleSuccess).catch(handleError);
|
|
@@ -5005,7 +5005,7 @@ var refreshToken = /*#__PURE__*/function () {
|
|
|
5005
5005
|
};
|
|
5006
5006
|
}();
|
|
5007
5007
|
|
|
5008
|
-
var fetcher = axios.create();
|
|
5008
|
+
var fetcher$1 = axios.create();
|
|
5009
5009
|
var store$1 = {
|
|
5010
5010
|
isRefreshing: false
|
|
5011
5011
|
};
|
|
@@ -5025,25 +5025,25 @@ var handleHeaderVersion = function handleHeaderVersion(config) {
|
|
|
5025
5025
|
};
|
|
5026
5026
|
var handleRole = function handleRole(config) {
|
|
5027
5027
|
var _config$headers;
|
|
5028
|
-
(_config$headers = config.headers).AUTHORIZATIONROLE || (_config$headers.AUTHORIZATIONROLE = storage$
|
|
5028
|
+
(_config$headers = config.headers).AUTHORIZATIONROLE || (_config$headers.AUTHORIZATIONROLE = storage$2.userRole);
|
|
5029
5029
|
};
|
|
5030
5030
|
var handleHeaders = function handleHeaders(config) {
|
|
5031
5031
|
var _window$toolkitEnv2;
|
|
5032
5032
|
var stack = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.STACK ? window.toolkitEnv.STACK : process.env.STACK;
|
|
5033
5033
|
var countryCode = countryCodeMapper[stack];
|
|
5034
5034
|
handleHeaderVersion(config);
|
|
5035
|
-
var countryCodeFromStorage = storage$
|
|
5035
|
+
var countryCodeFromStorage = storage$2.activeCountry || countryCode;
|
|
5036
5036
|
var headers = config.headers;
|
|
5037
|
-
var accessToken = storage$
|
|
5037
|
+
var accessToken = storage$2.accessToken;
|
|
5038
5038
|
handleRole(config);
|
|
5039
5039
|
if (stack === 'g') {
|
|
5040
|
-
headers.SELECTEDYARD = storage$
|
|
5040
|
+
headers.SELECTEDYARD = storage$2.activeYardNumber;
|
|
5041
5041
|
headers.site = headers.site || "CPRT".concat(countryCode);
|
|
5042
5042
|
headers.CORRELATIONID = "cobalt-uuid-".concat(nonSecure());
|
|
5043
|
-
headers.languageCode || (headers.languageCode = storage$
|
|
5044
|
-
headers.language || (headers.language = storage$
|
|
5043
|
+
headers.languageCode || (headers.languageCode = storage$2.activeLanguage);
|
|
5044
|
+
headers.language || (headers.language = storage$2.activeLanguage);
|
|
5045
5045
|
} else {
|
|
5046
|
-
headers.languageCode || (headers.languageCode = storage$
|
|
5046
|
+
headers.languageCode || (headers.languageCode = storage$2.activeLanguage);
|
|
5047
5047
|
headers.correlationID || (headers.correlationID = "cas-uuid-".concat(nonSecure()));
|
|
5048
5048
|
}
|
|
5049
5049
|
if (accessToken && headers) {
|
|
@@ -5068,8 +5068,8 @@ var handleHeaders = function handleHeaders(config) {
|
|
|
5068
5068
|
}
|
|
5069
5069
|
}
|
|
5070
5070
|
};
|
|
5071
|
-
fetcher.interceptors.request.use(function (config) {
|
|
5072
|
-
storage$
|
|
5071
|
+
fetcher$1.interceptors.request.use(function (config) {
|
|
5072
|
+
storage$2.getItem('config');
|
|
5073
5073
|
|
|
5074
5074
|
// Solr additional params, pass authorization to Solr search endpoint. Ensure backwards compatibility with old solr call
|
|
5075
5075
|
if (['/solr/', '/search/'].some(function (solrUrl) {
|
|
@@ -5091,7 +5091,7 @@ fetcher.interceptors.request.use(function (config) {
|
|
|
5091
5091
|
console.error(error);
|
|
5092
5092
|
return Promise.reject(error);
|
|
5093
5093
|
});
|
|
5094
|
-
fetcher.interceptors.response.use(function (response) {
|
|
5094
|
+
fetcher$1.interceptors.response.use(function (response) {
|
|
5095
5095
|
return response;
|
|
5096
5096
|
}, /*#__PURE__*/function () {
|
|
5097
5097
|
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(error) {
|
|
@@ -5109,8 +5109,8 @@ fetcher.interceptors.response.use(function (response) {
|
|
|
5109
5109
|
break;
|
|
5110
5110
|
}
|
|
5111
5111
|
// Store current URL to redirect to after login
|
|
5112
|
-
storage$
|
|
5113
|
-
return _context.a(2, storage$
|
|
5112
|
+
storage$2.setSessionItem('redirectUrl', window.location.href);
|
|
5113
|
+
return _context.a(2, storage$2.logout());
|
|
5114
5114
|
case 1:
|
|
5115
5115
|
if (store$1.isRefreshing) {
|
|
5116
5116
|
_context.n = 4;
|
|
@@ -5122,7 +5122,7 @@ fetcher.interceptors.response.use(function (response) {
|
|
|
5122
5122
|
case 2:
|
|
5123
5123
|
_context.v;
|
|
5124
5124
|
_context.n = 3;
|
|
5125
|
-
return fetcher.request(error.response.config);
|
|
5125
|
+
return fetcher$1.request(error.response.config);
|
|
5126
5126
|
case 3:
|
|
5127
5127
|
final = _context.v;
|
|
5128
5128
|
store$1.isRefreshing = false;
|
|
@@ -5137,35 +5137,35 @@ fetcher.interceptors.response.use(function (response) {
|
|
|
5137
5137
|
};
|
|
5138
5138
|
}());
|
|
5139
5139
|
|
|
5140
|
-
Object.defineProperty(fetcher, 'extend', {
|
|
5140
|
+
Object.defineProperty(fetcher$1, 'extend', {
|
|
5141
5141
|
enumerable: false,
|
|
5142
5142
|
value: function value(name, fn) {
|
|
5143
5143
|
var INVALID_NAMES = ['defaults', 'delete', 'put', 'post', 'get', 'head', 'interceptors', 'options', 'patch', 'request'];
|
|
5144
5144
|
var INVALID_NAME_WARNING = "The name of the method used (\"".concat(name, "\") to extend fetcher is invalid.");
|
|
5145
5145
|
!!INVALID_NAMES.includes(name) ? process.env.NODE_ENV !== "production" ? browser$2(false, INVALID_NAME_WARNING) : browser$2(false) : void 0;
|
|
5146
|
-
fetcher[name] = fn;
|
|
5146
|
+
fetcher$1[name] = fn;
|
|
5147
5147
|
}
|
|
5148
5148
|
});
|
|
5149
5149
|
|
|
5150
|
-
var DEFAULT_USER_RULES = {
|
|
5150
|
+
var DEFAULT_USER_RULES$1 = {
|
|
5151
5151
|
allow: [],
|
|
5152
5152
|
deny: []
|
|
5153
5153
|
};
|
|
5154
|
-
var DEFAULT_YARD_NUMBER_RULES = {
|
|
5154
|
+
var DEFAULT_YARD_NUMBER_RULES$1 = {
|
|
5155
5155
|
allow: [],
|
|
5156
5156
|
deny: []
|
|
5157
5157
|
};
|
|
5158
|
-
var DEFAULT_SECURITY_LEVEL_RULES = {
|
|
5158
|
+
var DEFAULT_SECURITY_LEVEL_RULES$1 = {
|
|
5159
5159
|
not: [],
|
|
5160
5160
|
only: [],
|
|
5161
5161
|
lessThan: 100
|
|
5162
5162
|
};
|
|
5163
|
-
var hydrateTiles = (function () {
|
|
5163
|
+
var hydrateTiles$1 = (function () {
|
|
5164
5164
|
var tiles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
5165
5165
|
var prepared = tiles.map(function (tile) {
|
|
5166
|
-
var userRules = _objectSpread2(_objectSpread2({}, DEFAULT_USER_RULES), tile.userRules);
|
|
5167
|
-
var yardRules = _objectSpread2(_objectSpread2({}, DEFAULT_YARD_NUMBER_RULES), tile.yardRules);
|
|
5168
|
-
var securityLevelRules = _objectSpread2(_objectSpread2({}, DEFAULT_SECURITY_LEVEL_RULES), tile.securityLevelRules);
|
|
5166
|
+
var userRules = _objectSpread2(_objectSpread2({}, DEFAULT_USER_RULES$1), tile.userRules);
|
|
5167
|
+
var yardRules = _objectSpread2(_objectSpread2({}, DEFAULT_YARD_NUMBER_RULES$1), tile.yardRules);
|
|
5168
|
+
var securityLevelRules = _objectSpread2(_objectSpread2({}, DEFAULT_SECURITY_LEVEL_RULES$1), tile.securityLevelRules);
|
|
5169
5169
|
return _objectSpread2(_objectSpread2({}, tile), {}, {
|
|
5170
5170
|
yardRules: yardRules,
|
|
5171
5171
|
userRules: userRules,
|
|
@@ -5189,12 +5189,12 @@ var getConfig = /*#__PURE__*/function () {
|
|
|
5189
5189
|
return _context.a(2, Promise.reject(new Error('Error, Please make sure "CONFIG_URI" && "CORE_CONFIG_URI" env variables are configured')));
|
|
5190
5190
|
case 1:
|
|
5191
5191
|
_context.n = 2;
|
|
5192
|
-
return fetcher.get(endpoint);
|
|
5192
|
+
return fetcher$1.get(endpoint);
|
|
5193
5193
|
case 2:
|
|
5194
5194
|
response = _context.v;
|
|
5195
5195
|
config = response.data.data; // Fill in values needed for access checks.
|
|
5196
|
-
config.tiles = hydrateTiles(config.tiles);
|
|
5197
|
-
config.tileOverrides = hydrateTiles(config.tileOverrides);
|
|
5196
|
+
config.tiles = hydrateTiles$1(config.tiles);
|
|
5197
|
+
config.tileOverrides = hydrateTiles$1(config.tileOverrides);
|
|
5198
5198
|
return _context.a(2, config);
|
|
5199
5199
|
case 3:
|
|
5200
5200
|
_context.p = 3;
|
|
@@ -5321,7 +5321,7 @@ var getPermissions = /*#__PURE__*/function () {
|
|
|
5321
5321
|
case 1:
|
|
5322
5322
|
endpoint = (_storage$getLocalItem = storage.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.g2AppPermissions;
|
|
5323
5323
|
_context.n = 2;
|
|
5324
|
-
return fetcher.get("".concat(endpoint).concat(appName), getHeaders$1());
|
|
5324
|
+
return fetcher$1.get("".concat(endpoint).concat(appName), getHeaders$1());
|
|
5325
5325
|
case 2:
|
|
5326
5326
|
response = _context.v;
|
|
5327
5327
|
appDetails = response.data.applications.find(function (app) {
|
|
@@ -5565,10 +5565,10 @@ var getAndStoreConfig = /*#__PURE__*/function () {
|
|
|
5565
5565
|
case 0:
|
|
5566
5566
|
configUri = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.CONFIG_URI ? window.toolkitEnv.CONFIG_URI : process.env.CONFIG_URI;
|
|
5567
5567
|
_context.n = 1;
|
|
5568
|
-
return fetcher.getConfig(configUri);
|
|
5568
|
+
return fetcher$1.getConfig(configUri);
|
|
5569
5569
|
case 1:
|
|
5570
5570
|
config = _context.v;
|
|
5571
|
-
storage$
|
|
5571
|
+
storage$2.setItem('config', config);
|
|
5572
5572
|
case 2:
|
|
5573
5573
|
return _context.a(2);
|
|
5574
5574
|
}
|
|
@@ -5579,13 +5579,13 @@ var getAndStoreConfig = /*#__PURE__*/function () {
|
|
|
5579
5579
|
};
|
|
5580
5580
|
}();
|
|
5581
5581
|
var storeTokens = function storeTokens(data) {
|
|
5582
|
-
storage$
|
|
5583
|
-
storage$
|
|
5582
|
+
storage$2.setLocalItem('login', data.access_token, 'userData.access_token');
|
|
5583
|
+
storage$2.setLocalItem('login', data.refresh_token, 'userData.refresh_token');
|
|
5584
5584
|
};
|
|
5585
5585
|
var storeLoginData = function storeLoginData(data) {
|
|
5586
5586
|
var email = (data.entity_mail || '').toLowerCase();
|
|
5587
5587
|
var managerEmail = (data.entity_manager_mail || '').toLowerCase();
|
|
5588
|
-
storage$
|
|
5588
|
+
storage$2.setLocalItem('login', {
|
|
5589
5589
|
email: email,
|
|
5590
5590
|
managerEmail: managerEmail,
|
|
5591
5591
|
isAuthenticated: !!data.access_token,
|
|
@@ -5646,7 +5646,7 @@ var setupLogin = /*#__PURE__*/function () {
|
|
|
5646
5646
|
entityCasID = ''; // cas ID (only applies to cas users)
|
|
5647
5647
|
_context2.p = 5;
|
|
5648
5648
|
_context2.n = 6;
|
|
5649
|
-
return fetcher.getUserDetails();
|
|
5649
|
+
return fetcher$1.getUserDetails();
|
|
5650
5650
|
case 6:
|
|
5651
5651
|
userDetails = _context2.v;
|
|
5652
5652
|
entityID = userDetails.userId.trim().toUpperCase();
|
|
@@ -5679,14 +5679,14 @@ var setupLogin = /*#__PURE__*/function () {
|
|
|
5679
5679
|
case 10:
|
|
5680
5680
|
storeLoginData(loginData);
|
|
5681
5681
|
_context2.p = 11;
|
|
5682
|
-
endpoint = (_storage$getLocalItem = storage$
|
|
5682
|
+
endpoint = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.appScopesAWS;
|
|
5683
5683
|
_context2.n = 12;
|
|
5684
|
-
return fetcher.get(endpoint).then(function (res) {
|
|
5684
|
+
return fetcher$1.get(endpoint).then(function (res) {
|
|
5685
5685
|
return res.data;
|
|
5686
5686
|
});
|
|
5687
5687
|
case 12:
|
|
5688
5688
|
appFunctions = _context2.v;
|
|
5689
|
-
storage$
|
|
5689
|
+
storage$2.setLocalItem('appScopesAndFunctions', appFunctions);
|
|
5690
5690
|
_context2.n = 14;
|
|
5691
5691
|
break;
|
|
5692
5692
|
case 13:
|
|
@@ -5897,7 +5897,7 @@ var getCompanyCode = function getCompanyCode() {
|
|
|
5897
5897
|
var stack = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.STACK ? window.toolkitEnv.STACK : process.env.STACK;
|
|
5898
5898
|
if (stack === 'c') return 'COPART';
|
|
5899
5899
|
if (stack === 'uk') return 'COPARTUK';
|
|
5900
|
-
if (stack === 'g') return storage$
|
|
5900
|
+
if (stack === 'g') return storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
5901
5901
|
};
|
|
5902
5902
|
var createQuery = function createQuery(activeYardNumber) {
|
|
5903
5903
|
return {
|
|
@@ -5917,13 +5917,13 @@ var getYardNumbers = /*#__PURE__*/function () {
|
|
|
5917
5917
|
while (1) switch (_context.n) {
|
|
5918
5918
|
case 0:
|
|
5919
5919
|
query = querystringify_1.stringify(createQuery(activeYardNumber));
|
|
5920
|
-
endpoint = storage$
|
|
5920
|
+
endpoint = storage$2.getLocalItem('opsportal-core:config').endpoints.yardNumbersSearch;
|
|
5921
5921
|
_context.n = 1;
|
|
5922
|
-
return fetcher.get("".concat(endpoint, "?").concat(query), {
|
|
5922
|
+
return fetcher$1.get("".concat(endpoint, "?").concat(query), {
|
|
5923
5923
|
headers: {
|
|
5924
5924
|
collection: 'yards',
|
|
5925
5925
|
serviceName: 'opsportal',
|
|
5926
|
-
Authorization: "bearer ".concat(storage$
|
|
5926
|
+
Authorization: "bearer ".concat(storage$2.accessToken)
|
|
5927
5927
|
}
|
|
5928
5928
|
});
|
|
5929
5929
|
case 1:
|
|
@@ -5948,9 +5948,9 @@ var getUserDetails = /*#__PURE__*/function () {
|
|
|
5948
5948
|
while (1) switch (_context.p = _context.n) {
|
|
5949
5949
|
case 0:
|
|
5950
5950
|
_context.p = 0;
|
|
5951
|
-
url = storage$
|
|
5951
|
+
url = storage$2.getLocalItem('opsportal-core:config').endpoints.me;
|
|
5952
5952
|
_context.n = 1;
|
|
5953
|
-
return fetcher.get(url);
|
|
5953
|
+
return fetcher$1.get(url);
|
|
5954
5954
|
case 1:
|
|
5955
5955
|
_yield$fetcher$get = _context.v;
|
|
5956
5956
|
data = _yield$fetcher$get.data;
|
|
@@ -5968,7 +5968,7 @@ var getUserDetails = /*#__PURE__*/function () {
|
|
|
5968
5968
|
_context.p = 3;
|
|
5969
5969
|
_t = _context.v;
|
|
5970
5970
|
response = _t.response;
|
|
5971
|
-
storage$
|
|
5971
|
+
storage$2.setLocalItem('login', '');
|
|
5972
5972
|
return _context.a(2, Promise.reject(response.data));
|
|
5973
5973
|
}
|
|
5974
5974
|
}, _callee, null, [[0, 3]]);
|
|
@@ -5986,7 +5986,7 @@ var sendFeedback = /*#__PURE__*/function () {
|
|
|
5986
5986
|
case 0:
|
|
5987
5987
|
_context.p = 0;
|
|
5988
5988
|
_context.n = 1;
|
|
5989
|
-
return fetcher.post('/api/v0/mail/feedback', {
|
|
5989
|
+
return fetcher$1.post('/api/v0/mail/feedback', {
|
|
5990
5990
|
data: data,
|
|
5991
5991
|
feedback: true
|
|
5992
5992
|
}, {
|
|
@@ -6041,7 +6041,7 @@ var getUserPreferences = /*#__PURE__*/function () {
|
|
|
6041
6041
|
appName: appName
|
|
6042
6042
|
});
|
|
6043
6043
|
_context.n = 2;
|
|
6044
|
-
return fetcher.get(url, getHeaders(countryA3code));
|
|
6044
|
+
return fetcher$1.get(url, getHeaders(countryA3code));
|
|
6045
6045
|
case 2:
|
|
6046
6046
|
response = _context.v;
|
|
6047
6047
|
data = response.data;
|
|
@@ -6077,7 +6077,7 @@ var setUserPreferences = /*#__PURE__*/function () {
|
|
|
6077
6077
|
appName: appName
|
|
6078
6078
|
});
|
|
6079
6079
|
_context2.n = 2;
|
|
6080
|
-
return fetcher.put(url, data, getHeaders(countryA3code));
|
|
6080
|
+
return fetcher$1.put(url, data, getHeaders(countryA3code));
|
|
6081
6081
|
case 2:
|
|
6082
6082
|
response = _context2.v;
|
|
6083
6083
|
return _context2.a(2, response.statusText);
|
|
@@ -6101,11 +6101,11 @@ var getUserRoles = /*#__PURE__*/function () {
|
|
|
6101
6101
|
while (1) switch (_context.p = _context.n) {
|
|
6102
6102
|
case 0:
|
|
6103
6103
|
_context.p = 0;
|
|
6104
|
-
url = frontEndUtils.string.substitute(storage$
|
|
6105
|
-
userId: storage$
|
|
6104
|
+
url = frontEndUtils.string.substitute(storage$2.getLocalItem('opsportal-core:config').endpoints.getUserRoles, {
|
|
6105
|
+
userId: storage$2.userEmail
|
|
6106
6106
|
});
|
|
6107
6107
|
_context.n = 1;
|
|
6108
|
-
return fetcher.get(url);
|
|
6108
|
+
return fetcher$1.get(url);
|
|
6109
6109
|
case 1:
|
|
6110
6110
|
response = _context.v;
|
|
6111
6111
|
data = response.data;
|
|
@@ -6135,10 +6135,10 @@ var getHierarchyOptions = /*#__PURE__*/function () {
|
|
|
6135
6135
|
return _regenerator().w(function (_context) {
|
|
6136
6136
|
while (1) switch (_context.n) {
|
|
6137
6137
|
case 0:
|
|
6138
|
-
url = (_storage$getLocalItem = storage$
|
|
6138
|
+
url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.hierarchyOptions;
|
|
6139
6139
|
_context.n = 1;
|
|
6140
|
-
return fetcher.get(frontEndUtils.string.substitute(url, {
|
|
6141
|
-
userId: storage$
|
|
6140
|
+
return fetcher$1.get(frontEndUtils.string.substitute(url, {
|
|
6141
|
+
userId: storage$2.userEmail
|
|
6142
6142
|
}), {
|
|
6143
6143
|
headers: {
|
|
6144
6144
|
roleName: selectedRole,
|
|
@@ -7137,10 +7137,10 @@ var ascend$1 = ascend;
|
|
|
7137
7137
|
* R.isNil(0); //=> false
|
|
7138
7138
|
* R.isNil([]); //=> false
|
|
7139
7139
|
*/
|
|
7140
|
-
var isNil = /*#__PURE__*/_curry1(function isNil(x) {
|
|
7140
|
+
var isNil$1 = /*#__PURE__*/_curry1(function isNil(x) {
|
|
7141
7141
|
return x == null;
|
|
7142
7142
|
});
|
|
7143
|
-
var isNil$
|
|
7143
|
+
var isNil$2 = isNil$1;
|
|
7144
7144
|
|
|
7145
7145
|
function _isFunction(x) {
|
|
7146
7146
|
return Object.prototype.toString.call(x) === '[object Function]';
|
|
@@ -8643,8 +8643,8 @@ var has$2 = has$1;
|
|
|
8643
8643
|
* R.includes([42], [[42]]); //=> true
|
|
8644
8644
|
* R.includes('ba', 'banana'); //=>true
|
|
8645
8645
|
*/
|
|
8646
|
-
var includes = /*#__PURE__*/_curry2(_includes);
|
|
8647
|
-
var includes$
|
|
8646
|
+
var includes$1 = /*#__PURE__*/_curry2(_includes);
|
|
8647
|
+
var includes$2 = includes$1;
|
|
8648
8648
|
|
|
8649
8649
|
/**
|
|
8650
8650
|
* Returns a new list containing only one copy of each element in the original
|
|
@@ -8702,10 +8702,10 @@ var uniqBy$1 = uniqBy;
|
|
|
8702
8702
|
* R.isEmpty({}); //=> true
|
|
8703
8703
|
* R.isEmpty({length: 0}); //=> false
|
|
8704
8704
|
*/
|
|
8705
|
-
var isEmpty = /*#__PURE__*/_curry1(function isEmpty(x) {
|
|
8705
|
+
var isEmpty$1 = /*#__PURE__*/_curry1(function isEmpty(x) {
|
|
8706
8706
|
return x != null && equals$1(x, empty$1(x));
|
|
8707
8707
|
});
|
|
8708
|
-
var isEmpty$
|
|
8708
|
+
var isEmpty$2 = isEmpty$1;
|
|
8709
8709
|
|
|
8710
8710
|
/**
|
|
8711
8711
|
* If the given, non-null object has a value at the given path, returns the
|
|
@@ -9015,18 +9015,18 @@ var getPrintersForYard = /*#__PURE__*/function () {
|
|
|
9015
9015
|
return _regenerator().w(function (_context) {
|
|
9016
9016
|
while (1) switch (_context.p = _context.n) {
|
|
9017
9017
|
case 0:
|
|
9018
|
-
_storage$getLocalItem = storage$
|
|
9018
|
+
_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config'), endpoints = _storage$getLocalItem.endpoints;
|
|
9019
9019
|
allPrinters = {};
|
|
9020
9020
|
check_printers = [];
|
|
9021
9021
|
text_printers = [];
|
|
9022
9022
|
barcode_label_printers = [];
|
|
9023
9023
|
standard_printers = [];
|
|
9024
9024
|
windshield_label_printers = [];
|
|
9025
|
-
country = countryA3code || storage$
|
|
9025
|
+
country = countryA3code || storage$2.getSessionItem('dashboard', 'selectedCountryA3code'); // Fetch all printers from g2print-ws endpoint
|
|
9026
9026
|
_context.p = 1;
|
|
9027
9027
|
g2PrintersUrl = "".concat(endpoints.g2Printers, "&facility=").concat(yardNumber);
|
|
9028
9028
|
_context.n = 2;
|
|
9029
|
-
return fetcher.get(g2PrintersUrl, {
|
|
9029
|
+
return fetcher$1.get(g2PrintersUrl, {
|
|
9030
9030
|
headers: {
|
|
9031
9031
|
country: country
|
|
9032
9032
|
}
|
|
@@ -9088,7 +9088,7 @@ var getInnovationHubToken = /*#__PURE__*/function () {
|
|
|
9088
9088
|
while (1) switch (_context.n) {
|
|
9089
9089
|
case 0:
|
|
9090
9090
|
_context.n = 1;
|
|
9091
|
-
return fetcher.get('/api/v0/auth/innovationHubtoken', {
|
|
9091
|
+
return fetcher$1.get('/api/v0/auth/innovationHubtoken', {
|
|
9092
9092
|
headers: {
|
|
9093
9093
|
'Content-Type': 'application/json; charset=UTF-8'
|
|
9094
9094
|
},
|
|
@@ -9124,7 +9124,7 @@ var getUserScopes = /*#__PURE__*/function () {
|
|
|
9124
9124
|
endpoint = (_storage$getLocalItem = storage.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.hierarchiesAWS;
|
|
9125
9125
|
_context.p = 1;
|
|
9126
9126
|
_context.n = 2;
|
|
9127
|
-
return fetcher.get(endpoint).then(function (res) {
|
|
9127
|
+
return fetcher$1.get(endpoint).then(function (res) {
|
|
9128
9128
|
return res.data;
|
|
9129
9129
|
});
|
|
9130
9130
|
case 2:
|
|
@@ -9184,18 +9184,18 @@ var getCobaltUserFacilities = /*#__PURE__*/function () {
|
|
|
9184
9184
|
while (1) switch (_context.p = _context.n) {
|
|
9185
9185
|
case 0:
|
|
9186
9186
|
_context.p = 0;
|
|
9187
|
-
url = frontEndUtils.string.substitute(storage$
|
|
9187
|
+
url = frontEndUtils.string.substitute(storage$2.coreConfig.endpoints.allFacilitiesNew, {
|
|
9188
9188
|
country: country.toLowerCase()
|
|
9189
9189
|
});
|
|
9190
9190
|
headers = _objectSpread2({
|
|
9191
9191
|
gStackCountry: country,
|
|
9192
9192
|
AUTHORIZATIONROLE: role
|
|
9193
|
-
}, storage$
|
|
9193
|
+
}, storage$2.activeLanguage === 'fi' ? {
|
|
9194
9194
|
language: 'en',
|
|
9195
9195
|
LANGUAGECODE: 'en'
|
|
9196
9196
|
} : {});
|
|
9197
9197
|
_context.n = 1;
|
|
9198
|
-
return fetcher.get(url, {
|
|
9198
|
+
return fetcher$1.get(url, {
|
|
9199
9199
|
headers: headers
|
|
9200
9200
|
});
|
|
9201
9201
|
case 1:
|
|
@@ -9227,10 +9227,10 @@ var getCobaltUserRoles = /*#__PURE__*/function () {
|
|
|
9227
9227
|
while (1) switch (_context.p = _context.n) {
|
|
9228
9228
|
case 0:
|
|
9229
9229
|
_context.p = 0;
|
|
9230
|
-
url = storage$
|
|
9230
|
+
url = storage$2.coreConfig.endpoints.getRoles;
|
|
9231
9231
|
_context.n = 1;
|
|
9232
|
-
return fetcher.get(url, {
|
|
9233
|
-
headers: _objectSpread2(_objectSpread2({}, fetcher.defaults.headers.common), {}, {
|
|
9232
|
+
return fetcher$1.get(url, {
|
|
9233
|
+
headers: _objectSpread2(_objectSpread2({}, fetcher$1.defaults.headers.common), {}, {
|
|
9234
9234
|
gStackCountry: country
|
|
9235
9235
|
})
|
|
9236
9236
|
});
|
|
@@ -9250,24 +9250,24 @@ var getCobaltUserRoles = /*#__PURE__*/function () {
|
|
|
9250
9250
|
};
|
|
9251
9251
|
}();
|
|
9252
9252
|
|
|
9253
|
-
fetcher.login = login;
|
|
9254
|
-
fetcher.oktaLogin = oktaLogin;
|
|
9255
|
-
fetcher.getConfig = getConfig;
|
|
9256
|
-
fetcher.getAppTileData = getAppTileData;
|
|
9257
|
-
fetcher.getYardNumbers = getYardNumbers;
|
|
9258
|
-
fetcher.getUserDetails = getUserDetails;
|
|
9259
|
-
fetcher.sendFeedback = sendFeedback;
|
|
9260
|
-
fetcher.getUserPreferences = getUserPreferences;
|
|
9261
|
-
fetcher.setUserPreferences = setUserPreferences;
|
|
9262
|
-
fetcher.getUserRoles = getUserRoles;
|
|
9263
|
-
fetcher.getHierarchyOptions = getHierarchyOptions;
|
|
9264
|
-
fetcher.getPrintersForYard = getPrintersForYard;
|
|
9265
|
-
fetcher.getPermissions = getPermissions;
|
|
9266
|
-
fetcher.getCoreAppPermissions = getCoreAppPermissions;
|
|
9267
|
-
fetcher.getInnovationHubToken = getInnovationHubToken;
|
|
9268
|
-
fetcher.getUserScopes = getUserScopes;
|
|
9269
|
-
fetcher.getCobaltUserFacilities = getCobaltUserFacilities;
|
|
9270
|
-
fetcher.getCobaltUserRoles = getCobaltUserRoles;
|
|
9253
|
+
fetcher$1.login = login;
|
|
9254
|
+
fetcher$1.oktaLogin = oktaLogin;
|
|
9255
|
+
fetcher$1.getConfig = getConfig;
|
|
9256
|
+
fetcher$1.getAppTileData = getAppTileData;
|
|
9257
|
+
fetcher$1.getYardNumbers = getYardNumbers;
|
|
9258
|
+
fetcher$1.getUserDetails = getUserDetails;
|
|
9259
|
+
fetcher$1.sendFeedback = sendFeedback;
|
|
9260
|
+
fetcher$1.getUserPreferences = getUserPreferences;
|
|
9261
|
+
fetcher$1.setUserPreferences = setUserPreferences;
|
|
9262
|
+
fetcher$1.getUserRoles = getUserRoles;
|
|
9263
|
+
fetcher$1.getHierarchyOptions = getHierarchyOptions;
|
|
9264
|
+
fetcher$1.getPrintersForYard = getPrintersForYard;
|
|
9265
|
+
fetcher$1.getPermissions = getPermissions;
|
|
9266
|
+
fetcher$1.getCoreAppPermissions = getCoreAppPermissions;
|
|
9267
|
+
fetcher$1.getInnovationHubToken = getInnovationHubToken;
|
|
9268
|
+
fetcher$1.getUserScopes = getUserScopes;
|
|
9269
|
+
fetcher$1.getCobaltUserFacilities = getCobaltUserFacilities;
|
|
9270
|
+
fetcher$1.getCobaltUserRoles = getCobaltUserRoles;
|
|
9271
9271
|
|
|
9272
9272
|
var getRouteName = function getRouteName() {
|
|
9273
9273
|
return window.location.pathname.split('/').splice(1)[0];
|
|
@@ -9308,11 +9308,11 @@ var isUserStatusHidden = function isUserStatusHidden() {
|
|
|
9308
9308
|
var isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
9309
9309
|
if (isCoreApp) {
|
|
9310
9310
|
var _storage$coreConfig;
|
|
9311
|
-
return ((_storage$coreConfig = storage$
|
|
9311
|
+
return ((_storage$coreConfig = storage$2.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.hideUserStatus) || false;
|
|
9312
9312
|
}
|
|
9313
|
-
if ((_storage$coreConfig2 = storage$
|
|
9313
|
+
if ((_storage$coreConfig2 = storage$2.coreConfig) !== null && _storage$coreConfig2 !== void 0 && _storage$coreConfig2.checkUserStatusByApp) {
|
|
9314
9314
|
var _window$toolkitEnv2;
|
|
9315
|
-
var appTiles = storage$
|
|
9315
|
+
var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
|
|
9316
9316
|
var appName = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
9317
9317
|
var appData = appTiles.find(function (tile) {
|
|
9318
9318
|
if (tile.appName) {
|
|
@@ -9323,7 +9323,7 @@ var isUserStatusHidden = function isUserStatusHidden() {
|
|
|
9323
9323
|
});
|
|
9324
9324
|
return (appData === null || appData === void 0 ? void 0 : appData.showUserStatus) !== true;
|
|
9325
9325
|
}
|
|
9326
|
-
return ((_storage$coreConfig3 = storage$
|
|
9326
|
+
return ((_storage$coreConfig3 = storage$2.coreConfig) === null || _storage$coreConfig3 === void 0 ? void 0 : _storage$coreConfig3.hideUserStatus) || false;
|
|
9327
9327
|
};
|
|
9328
9328
|
|
|
9329
9329
|
var css_248z$q = ".utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--ConfigFetcher {\r\n}\r\n\r\n.utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--spinner {\r\n margin: 80px 0 40px;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--spinner * {\r\n width: 60px;\r\n height: 60px;\r\n}\r\n";
|
|
@@ -9349,7 +9349,7 @@ var ConfigFetcher = /*#__PURE__*/function (_React$Component) {
|
|
|
9349
9349
|
case 0:
|
|
9350
9350
|
fetchVersion = ++_this._fetchVersion;
|
|
9351
9351
|
isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
9352
|
-
if (!(isCoreApp && (isCoreRoute || isAuthRoute) && !storage$
|
|
9352
|
+
if (!(isCoreApp && (isCoreRoute || isAuthRoute) && !storage$2.isAuthenticated)) {
|
|
9353
9353
|
_context.n = 1;
|
|
9354
9354
|
break;
|
|
9355
9355
|
}
|
|
@@ -9360,7 +9360,7 @@ var ConfigFetcher = /*#__PURE__*/function (_React$Component) {
|
|
|
9360
9360
|
configUri = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.CONFIG_URI ? window.toolkitEnv.CONFIG_URI : process.env.CONFIG_URI;
|
|
9361
9361
|
console.log('[ConfigFetcher] fetching config from:', configUri, 'APP_NAME:', (_window$toolkitEnv3 = window.toolkitEnv) === null || _window$toolkitEnv3 === void 0 ? void 0 : _window$toolkitEnv3.APP_NAME);
|
|
9362
9362
|
_context.n = 2;
|
|
9363
|
-
return fetcher.getConfig(configUri);
|
|
9363
|
+
return fetcher$1.getConfig(configUri);
|
|
9364
9364
|
case 2:
|
|
9365
9365
|
config = _context.v;
|
|
9366
9366
|
if (!(_this._fetchVersion !== fetchVersion)) {
|
|
@@ -9369,7 +9369,7 @@ var ConfigFetcher = /*#__PURE__*/function (_React$Component) {
|
|
|
9369
9369
|
}
|
|
9370
9370
|
return _context.a(2);
|
|
9371
9371
|
case 3:
|
|
9372
|
-
storage$
|
|
9372
|
+
storage$2.setItem('config', config);
|
|
9373
9373
|
if (config.instanaKey) {
|
|
9374
9374
|
window.setUpInstana(config.instanaKey, isCoreApp);
|
|
9375
9375
|
}
|
|
@@ -16204,7 +16204,7 @@ function arraysEqual(array1, array2) {
|
|
|
16204
16204
|
* Fetches an item from session storage without throwing an exception
|
|
16205
16205
|
* @param key The key of the item to fetch from session storage
|
|
16206
16206
|
*/
|
|
16207
|
-
function getItem$
|
|
16207
|
+
function getItem$3(key) {
|
|
16208
16208
|
var result = null;
|
|
16209
16209
|
try {
|
|
16210
16210
|
var win = getWindow$1();
|
|
@@ -16219,7 +16219,7 @@ function getItem$2(key) {
|
|
|
16219
16219
|
* @param key The key of the item to add to session storage
|
|
16220
16220
|
* @param data The data to put into session storage
|
|
16221
16221
|
*/
|
|
16222
|
-
function setItem(key, data) {
|
|
16222
|
+
function setItem$1(key, data) {
|
|
16223
16223
|
var _a;
|
|
16224
16224
|
try {
|
|
16225
16225
|
(_a = getWindow$1()) === null || _a === void 0 ? void 0 : _a.sessionStorage.setItem(key, data);
|
|
@@ -16243,7 +16243,7 @@ function getRTL(theme) {
|
|
|
16243
16243
|
}
|
|
16244
16244
|
if (_isRTL === undefined) {
|
|
16245
16245
|
// Fabric supports persisting the RTL setting between page refreshes via session storage
|
|
16246
|
-
var savedRTL = getItem$
|
|
16246
|
+
var savedRTL = getItem$3(RTL_LOCAL_STORAGE_KEY);
|
|
16247
16247
|
if (savedRTL !== null) {
|
|
16248
16248
|
_isRTL = savedRTL === '1';
|
|
16249
16249
|
setRTL(_isRTL);
|
|
@@ -16268,7 +16268,7 @@ function setRTL(isRTL, persistSetting) {
|
|
|
16268
16268
|
doc.documentElement.setAttribute('dir', isRTL ? 'rtl' : 'ltr');
|
|
16269
16269
|
}
|
|
16270
16270
|
if (persistSetting) {
|
|
16271
|
-
setItem(RTL_LOCAL_STORAGE_KEY, isRTL ? '1' : '0');
|
|
16271
|
+
setItem$1(RTL_LOCAL_STORAGE_KEY, isRTL ? '1' : '0');
|
|
16272
16272
|
}
|
|
16273
16273
|
_isRTL = isRTL;
|
|
16274
16274
|
setRTL$1(_isRTL);
|
|
@@ -17191,7 +17191,7 @@ function _setComponentRef(componentRef, value) {
|
|
|
17191
17191
|
* Fetches an item from local storage without throwing an exception
|
|
17192
17192
|
* @param key The key of the item to fetch from local storage
|
|
17193
17193
|
*/
|
|
17194
|
-
function getItem$
|
|
17194
|
+
function getItem$2(key) {
|
|
17195
17195
|
var result = null;
|
|
17196
17196
|
try {
|
|
17197
17197
|
var win = getWindow$1();
|
|
@@ -17216,7 +17216,7 @@ function getLanguage(persistenceType) {
|
|
|
17216
17216
|
}
|
|
17217
17217
|
if (_language === undefined) {
|
|
17218
17218
|
var doc = getDocument();
|
|
17219
|
-
var savedLanguage = persistenceType === 'localStorage' ? getItem$
|
|
17219
|
+
var savedLanguage = persistenceType === 'localStorage' ? getItem$2(STORAGE_KEY) : persistenceType === 'sessionStorage' ? getItem$3(STORAGE_KEY) : undefined;
|
|
17220
17220
|
if (savedLanguage) {
|
|
17221
17221
|
_language = savedLanguage;
|
|
17222
17222
|
}
|
|
@@ -21473,7 +21473,7 @@ var ProfileDetails = function ProfileDetails(_ref) {
|
|
|
21473
21473
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_ProfileDetails_ProfileDetails--profileDetails"
|
|
21474
21474
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21475
21475
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_ProfileDetails_ProfileDetails--details"
|
|
21476
|
-
}, /*#__PURE__*/React__default["default"].createElement("h3", null, storage$
|
|
21476
|
+
}, /*#__PURE__*/React__default["default"].createElement("h3", null, storage$2.userName), /*#__PURE__*/React__default["default"].createElement("p", null, storage$2.userEmail), Array.isArray(enhancedStatuses) && enhancedStatuses.length > 0 && !userStatusHidden && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21477
21477
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_ProfileDetails_ProfileDetails--statusSelector"
|
|
21478
21478
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Select, {
|
|
21479
21479
|
id: "user-status-select",
|
|
@@ -21646,7 +21646,7 @@ var viewMapper = {
|
|
|
21646
21646
|
};
|
|
21647
21647
|
|
|
21648
21648
|
var getRecommendedHelpArticles = function getRecommendedHelpArticles(helpContent) {
|
|
21649
|
-
var articles = !isNil$
|
|
21649
|
+
var articles = !isNil$2(helpContent) ? _toConsumableArray(helpContent === null || helpContent === void 0 ? void 0 : helpContent.helpArticles) : [];
|
|
21650
21650
|
// const sortedByLikes = sortedBySequence.sort((a, b) => {
|
|
21651
21651
|
// return parseInt(b.likes) - parseInt(a.likes)
|
|
21652
21652
|
// })
|
|
@@ -21660,7 +21660,7 @@ var getRecommendedHelpArticles = function getRecommendedHelpArticles(helpContent
|
|
|
21660
21660
|
};
|
|
21661
21661
|
var getFaqs = function getFaqs(helpContent) {
|
|
21662
21662
|
var _helpContent$faqs$;
|
|
21663
|
-
var faqData = !isNil$
|
|
21663
|
+
var faqData = !isNil$2(helpContent) ? (_helpContent$faqs$ = helpContent.faqs[0]) === null || _helpContent$faqs$ === void 0 ? void 0 : _helpContent$faqs$.content : '';
|
|
21664
21664
|
if (!faqData) return [];
|
|
21665
21665
|
var faqObj = JSON.parse(faqData.slice(faqData.indexOf('wp:acf/faq')).replace('wp:acf/faq', '').replace('/-->', '').trim());
|
|
21666
21666
|
var faqs = [];
|
|
@@ -21677,7 +21677,7 @@ var getFaqs = function getFaqs(helpContent) {
|
|
|
21677
21677
|
return faqs;
|
|
21678
21678
|
};
|
|
21679
21679
|
var getReleaseNotes = function getReleaseNotes(helpContent, mihelpAppPath) {
|
|
21680
|
-
var releasenotes = !isNil$
|
|
21680
|
+
var releasenotes = !isNil$2(helpContent) ? _toConsumableArray(helpContent === null || helpContent === void 0 ? void 0 : helpContent.releaseNotes) : [];
|
|
21681
21681
|
if (!mihelpAppPath) {
|
|
21682
21682
|
var releaseNotesByApp = {};
|
|
21683
21683
|
releasenotes.forEach(function (note) {
|
|
@@ -21723,8 +21723,8 @@ var clearDebounceTimer = function clearDebounceTimer() {
|
|
|
21723
21723
|
clearTimeout(timer);
|
|
21724
21724
|
};
|
|
21725
21725
|
var handleRedirect = function handleRedirect(type, mihelpAppPath, currentArticle) {
|
|
21726
|
-
var country = storage$
|
|
21727
|
-
var coreAppConfig = storage$
|
|
21726
|
+
var country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
21727
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
21728
21728
|
var uri;
|
|
21729
21729
|
switch (type) {
|
|
21730
21730
|
case redirectContants.OPEN_IN_NEW_TAB:
|
|
@@ -22603,13 +22603,13 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22603
22603
|
case 0:
|
|
22604
22604
|
_context.p = 0;
|
|
22605
22605
|
setLoading(true);
|
|
22606
|
-
country = storage$
|
|
22606
|
+
country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
22607
22607
|
app = mihelpAppPath || 'g2-portal';
|
|
22608
|
-
url = (_storage$getLocalItem = storage$
|
|
22608
|
+
url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpContent;
|
|
22609
22609
|
_context.n = 1;
|
|
22610
|
-
return fetcher.get("".concat(url, "?app=").concat(app, "&country=").concat(country), {
|
|
22610
|
+
return fetcher$1.get("".concat(url, "?app=").concat(app, "&country=").concat(country), {
|
|
22611
22611
|
headers: {
|
|
22612
|
-
Authorization: storage$
|
|
22612
|
+
Authorization: storage$2.accessToken
|
|
22613
22613
|
}
|
|
22614
22614
|
});
|
|
22615
22615
|
case 1:
|
|
@@ -22653,14 +22653,14 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22653
22653
|
while (1) switch (_context2.p = _context2.n) {
|
|
22654
22654
|
case 0:
|
|
22655
22655
|
_context2.p = 0;
|
|
22656
|
-
country = storage$
|
|
22656
|
+
country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
22657
22657
|
app = mihelpAppPath || 'g2-portal';
|
|
22658
|
-
url = (_storage$getLocalItem2 = storage$
|
|
22658
|
+
url = (_storage$getLocalItem2 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.mihelpSearch;
|
|
22659
22659
|
setLoading(true);
|
|
22660
22660
|
_context2.n = 1;
|
|
22661
|
-
return fetcher.get("".concat(url, "?s=").concat(searchText, "&country=").concat(country, "&app=").concat(app), {
|
|
22661
|
+
return fetcher$1.get("".concat(url, "?s=").concat(searchText, "&country=").concat(country, "&app=").concat(app), {
|
|
22662
22662
|
headers: {
|
|
22663
|
-
Authorization: storage$
|
|
22663
|
+
Authorization: storage$2.accessToken
|
|
22664
22664
|
}
|
|
22665
22665
|
});
|
|
22666
22666
|
case 1:
|
|
@@ -22815,12 +22815,12 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22815
22815
|
case 0:
|
|
22816
22816
|
_context3.p = 0;
|
|
22817
22817
|
setLoading(true);
|
|
22818
|
-
url = (_storage$getLocalItem3 = storage$
|
|
22818
|
+
url = (_storage$getLocalItem3 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.getMihelpArticle;
|
|
22819
22819
|
id = view === views.FAQ && !isSearchFaq ? faqs.id : article.id || article.ID;
|
|
22820
22820
|
_context3.n = 1;
|
|
22821
|
-
return fetcher.get("".concat(url, "/").concat(id), {
|
|
22821
|
+
return fetcher$1.get("".concat(url, "/").concat(id), {
|
|
22822
22822
|
headers: {
|
|
22823
|
-
Authorization: storage$
|
|
22823
|
+
Authorization: storage$2.accessToken
|
|
22824
22824
|
}
|
|
22825
22825
|
});
|
|
22826
22826
|
case 1:
|
|
@@ -22859,12 +22859,12 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22859
22859
|
case 0:
|
|
22860
22860
|
_context4.p = 0;
|
|
22861
22861
|
setLoading(true);
|
|
22862
|
-
url = (_storage$getLocalItem4 = storage$
|
|
22862
|
+
url = (_storage$getLocalItem4 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem4 === void 0 ? void 0 : _storage$getLocalItem4.mihelpLike;
|
|
22863
22863
|
id = article.id || article.ID;
|
|
22864
22864
|
_context4.n = 1;
|
|
22865
|
-
return fetcher.post("".concat(url, "/").concat(id), null, {
|
|
22865
|
+
return fetcher$1.post("".concat(url, "/").concat(id), null, {
|
|
22866
22866
|
headers: {
|
|
22867
|
-
Authorization: storage$
|
|
22867
|
+
Authorization: storage$2.accessToken
|
|
22868
22868
|
}
|
|
22869
22869
|
});
|
|
22870
22870
|
case 1:
|
|
@@ -22909,12 +22909,12 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22909
22909
|
case 0:
|
|
22910
22910
|
_context5.p = 0;
|
|
22911
22911
|
setLoading(true);
|
|
22912
|
-
url = (_storage$getLocalItem5 = storage$
|
|
22912
|
+
url = (_storage$getLocalItem5 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem5 === void 0 ? void 0 : _storage$getLocalItem5.mihelpDisLike;
|
|
22913
22913
|
id = article.id || article.ID;
|
|
22914
22914
|
_context5.n = 1;
|
|
22915
|
-
return fetcher.post("".concat(url, "/").concat(id), null, {
|
|
22915
|
+
return fetcher$1.post("".concat(url, "/").concat(id), null, {
|
|
22916
22916
|
headers: {
|
|
22917
|
-
Authorization: storage$
|
|
22917
|
+
Authorization: storage$2.accessToken
|
|
22918
22918
|
}
|
|
22919
22919
|
});
|
|
22920
22920
|
case 1:
|
|
@@ -22965,15 +22965,15 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22965
22965
|
case 0:
|
|
22966
22966
|
skipFeedback();
|
|
22967
22967
|
_context6.p = 1;
|
|
22968
|
-
url = (_storage$getLocalItem6 = storage$
|
|
22968
|
+
url = (_storage$getLocalItem6 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem6 === void 0 ? void 0 : _storage$getLocalItem6.mihelpSubmitFeedback;
|
|
22969
22969
|
_context6.n = 2;
|
|
22970
|
-
return fetcher.post(url, {
|
|
22970
|
+
return fetcher$1.post(url, {
|
|
22971
22971
|
message: feedback,
|
|
22972
22972
|
url: window.location.href,
|
|
22973
22973
|
userAgent: navigator.userAgent
|
|
22974
22974
|
}, {
|
|
22975
22975
|
headers: {
|
|
22976
|
-
Authorization: storage$
|
|
22976
|
+
Authorization: storage$2.accessToken
|
|
22977
22977
|
}
|
|
22978
22978
|
});
|
|
22979
22979
|
case 2:
|
|
@@ -22999,15 +22999,15 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22999
22999
|
while (1) switch (_context7.p = _context7.n) {
|
|
23000
23000
|
case 0:
|
|
23001
23001
|
_context7.p = 0;
|
|
23002
|
-
url = (_storage$getLocalItem7 = storage$
|
|
23002
|
+
url = (_storage$getLocalItem7 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem7 === void 0 ? void 0 : _storage$getLocalItem7.mihelpSubmitQuestion;
|
|
23003
23003
|
_context7.n = 1;
|
|
23004
|
-
return fetcher.post(url, {
|
|
23004
|
+
return fetcher$1.post(url, {
|
|
23005
23005
|
question: question,
|
|
23006
23006
|
category: category,
|
|
23007
23007
|
app: title
|
|
23008
23008
|
}, {
|
|
23009
23009
|
headers: {
|
|
23010
|
-
Authorization: storage$
|
|
23010
|
+
Authorization: storage$2.accessToken
|
|
23011
23011
|
}
|
|
23012
23012
|
});
|
|
23013
23013
|
case 1:
|
|
@@ -23534,7 +23534,7 @@ var handleUpdate = function handleUpdate(self) {
|
|
|
23534
23534
|
return _context.a(2, self.setYardOptions(self.props.history.get(yardNumber)));
|
|
23535
23535
|
case 1:
|
|
23536
23536
|
_context.n = 2;
|
|
23537
|
-
return fetcher.getYardNumbers(yardNumber);
|
|
23537
|
+
return fetcher$1.getYardNumbers(yardNumber);
|
|
23538
23538
|
case 2:
|
|
23539
23539
|
yards = _context.v;
|
|
23540
23540
|
yardOptions = filterYards(yards);
|
|
@@ -23616,7 +23616,7 @@ var getRCExtensionStatus = /*#__PURE__*/function () {
|
|
|
23616
23616
|
return _regenerator().w(function (_context) {
|
|
23617
23617
|
while (1) switch (_context.p = _context.n) {
|
|
23618
23618
|
case 0:
|
|
23619
|
-
url = (_storage$getItem$endp = storage$
|
|
23619
|
+
url = (_storage$getItem$endp = storage$2.getItem('config').endpoints) === null || _storage$getItem$endp === void 0 ? void 0 : _storage$getItem$endp.ringCentralEnabledStatus;
|
|
23620
23620
|
if (url) {
|
|
23621
23621
|
_context.n = 1;
|
|
23622
23622
|
break;
|
|
@@ -23625,7 +23625,7 @@ var getRCExtensionStatus = /*#__PURE__*/function () {
|
|
|
23625
23625
|
case 1:
|
|
23626
23626
|
_context.p = 1;
|
|
23627
23627
|
_context.n = 2;
|
|
23628
|
-
return fetcher.get(url);
|
|
23628
|
+
return fetcher$1.get(url);
|
|
23629
23629
|
case 2:
|
|
23630
23630
|
response = _context.v;
|
|
23631
23631
|
return _context.a(2, response.data);
|
|
@@ -23651,7 +23651,7 @@ var resetPhoneSettingsBasedOnRCStatus = function resetPhoneSettingsBasedOnRCStat
|
|
|
23651
23651
|
ringCentralURL = _ref2$ringcentral_lis === void 0 ? '' : _ref2$ringcentral_lis,
|
|
23652
23652
|
_ref2$ringcentral_acc = _ref2.ringcentral_account_id,
|
|
23653
23653
|
ringCentralAccountId = _ref2$ringcentral_acc === void 0 ? '' : _ref2$ringcentral_acc;
|
|
23654
|
-
var dashboardObject = storage$
|
|
23654
|
+
var dashboardObject = storage$2.getLocalItem('dashboard');
|
|
23655
23655
|
if (ringCentralEnabled) {
|
|
23656
23656
|
dashboardObject.ringCentralEnabled = true;
|
|
23657
23657
|
dashboardObject.phoneNumber = formatPhoneNumber(phoneNumber, ringCentralExtension);
|
|
@@ -23665,7 +23665,7 @@ var resetPhoneSettingsBasedOnRCStatus = function resetPhoneSettingsBasedOnRCStat
|
|
|
23665
23665
|
delete dashboardObject.ringCentralEnabled;
|
|
23666
23666
|
}
|
|
23667
23667
|
}
|
|
23668
|
-
storage$
|
|
23668
|
+
storage$2.setLocalItem('dashboard', dashboardObject);
|
|
23669
23669
|
var event = new Event('localStorageChanged');
|
|
23670
23670
|
window.dispatchEvent(event);
|
|
23671
23671
|
};
|
|
@@ -23711,10 +23711,10 @@ var pluckDefault = function pluckDefault(final, _ref3) {
|
|
|
23711
23711
|
var sessionOrDefault = function sessionOrDefault(label) {
|
|
23712
23712
|
return function () {
|
|
23713
23713
|
var printer_name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
23714
|
-
var sessionDashboard = storage$
|
|
23714
|
+
var sessionDashboard = storage$2.getSessionItem('dashboard');
|
|
23715
23715
|
sessionDashboard.printers = sessionDashboard.printers || EMPTY_PRINTERS$2;
|
|
23716
23716
|
var printerName = sessionDashboard.printers[label];
|
|
23717
|
-
return !isEmpty$
|
|
23717
|
+
return !isEmpty$2(printerName) ? printerName : printer_name;
|
|
23718
23718
|
};
|
|
23719
23719
|
};
|
|
23720
23720
|
var chooseActive = function chooseActive(final, _ref5) {
|
|
@@ -23787,7 +23787,7 @@ var Container = /*#__PURE__*/function (_React$Component) {
|
|
|
23787
23787
|
});
|
|
23788
23788
|
_context.p = 1;
|
|
23789
23789
|
_context.n = 2;
|
|
23790
|
-
return fetcher.get(testCallUrl);
|
|
23790
|
+
return fetcher$1.get(testCallUrl);
|
|
23791
23791
|
case 2:
|
|
23792
23792
|
_yield$fetcher$get = _context.v;
|
|
23793
23793
|
data = _yield$fetcher$get.data;
|
|
@@ -23862,8 +23862,8 @@ var generateTestCallUrl = function generateTestCallUrl(_ref2) {
|
|
|
23862
23862
|
var _storage$getLocalItem;
|
|
23863
23863
|
var yardNumber = _ref2.yardNumber,
|
|
23864
23864
|
extension = _ref2.extension;
|
|
23865
|
-
var id = (_storage$getLocalItem = storage$
|
|
23866
|
-
var url = storage$
|
|
23865
|
+
var id = (_storage$getLocalItem = storage$2.getLocalItem('login')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.userData.entity_id;
|
|
23866
|
+
var url = storage$2.getItem('config').endpoints.testCall;
|
|
23867
23867
|
return frontEndUtils.string.substitute(url, {
|
|
23868
23868
|
yardNumber: yardNumber,
|
|
23869
23869
|
extension: extension,
|
|
@@ -23891,7 +23891,7 @@ var getHierarchyLevel = function getHierarchyLevel(levelId) {
|
|
|
23891
23891
|
return '';
|
|
23892
23892
|
}
|
|
23893
23893
|
};
|
|
23894
|
-
var isInvalid = either$1(isNil$
|
|
23894
|
+
var isInvalid = either$1(isNil$2, isEmpty$2);
|
|
23895
23895
|
var keysToBeDeleted = ['openEmailDialog', 'openPhoneDialog', 'searchParam', 'selectedCountry', 'selectedCountryA3code', 'selectedCurrency', 'selectedRole', 'selectedTimeZone', 'selectedYard', 'showPhoneEntryOnEnter', 'yard'];
|
|
23896
23896
|
|
|
23897
23897
|
// Handles changes to all inputs.
|
|
@@ -23902,18 +23902,18 @@ var handleInputChange$2 = function handleInputChange(self) {
|
|
|
23902
23902
|
if (name === 'selectedRole') {
|
|
23903
23903
|
var selectedValue = value.selectedValue,
|
|
23904
23904
|
option = value.option;
|
|
23905
|
-
storage$
|
|
23905
|
+
storage$2.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
23906
23906
|
return self.setState({
|
|
23907
23907
|
selectedRoleOption: option,
|
|
23908
23908
|
selectedRole: selectedValue
|
|
23909
23909
|
});
|
|
23910
23910
|
} else if (name === 'selectedYardNumber') {
|
|
23911
|
-
storage$
|
|
23911
|
+
storage$2.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
23912
23912
|
self.updatePhoneNumber(activePhoneNumber$1());
|
|
23913
23913
|
|
|
23914
23914
|
// Ensure we fetch the proper roles per the entered yard
|
|
23915
23915
|
var oldSelectedYard = self.state.selectedYardNumber;
|
|
23916
|
-
fetcher.getYardNumbers(value).then(function (yards) {
|
|
23916
|
+
fetcher$1.getYardNumbers(value).then(function (yards) {
|
|
23917
23917
|
var currentYard = find$1(propEq$1('yard_number', parseInt(value)), yards);
|
|
23918
23918
|
if (currentYard) yardCountryCode = currentYard.yard_country_code;
|
|
23919
23919
|
self.fetchRoles(yardCountryCode);
|
|
@@ -23945,7 +23945,7 @@ var handleInputChange$2 = function handleInputChange(self) {
|
|
|
23945
23945
|
}, {});
|
|
23946
23946
|
};
|
|
23947
23947
|
var getSelectedYard = function getSelectedYard(selectedNumber) {
|
|
23948
|
-
return storage$
|
|
23948
|
+
return storage$2.getLocalItem('login').yardList.find(function (yard) {
|
|
23949
23949
|
return yard.number == selectedNumber;
|
|
23950
23950
|
});
|
|
23951
23951
|
};
|
|
@@ -23964,20 +23964,20 @@ var saveSettings$2 = function saveSettings(self) {
|
|
|
23964
23964
|
printers = {}; // ******* Hack to be remved ******* create date July 12, 2019 *******
|
|
23965
23965
|
// Just a hack to ensure yard gets changed to avoid issue caused by proquote app which is using old toolkit
|
|
23966
23966
|
// remove this hack once pro quote app update its tool kit version to latest
|
|
23967
|
-
dashboardSessionState = storage$
|
|
23967
|
+
dashboardSessionState = storage$2.getSessionItem('dashboard');
|
|
23968
23968
|
oldSettings = {
|
|
23969
23969
|
selectedCurrency: dashboardSessionState.selectedCurrency,
|
|
23970
23970
|
selectedYard: dashboardSessionState.selectedYard,
|
|
23971
23971
|
selectedCountry: dashboardSessionState.selectedCountry,
|
|
23972
23972
|
language: dashboardSessionState.language,
|
|
23973
|
-
selectedRole: storage$
|
|
23973
|
+
selectedRole: storage$2.getLocalItem('settings').selectedRole,
|
|
23974
23974
|
activePrinters: self.state.oldActivePrinters
|
|
23975
23975
|
};
|
|
23976
|
-
dashboardState = storage$
|
|
23976
|
+
dashboardState = storage$2.getLocalItem('dashboard');
|
|
23977
23977
|
cleanedDashboardState = pickBy$1(function (val, key) {
|
|
23978
23978
|
return !keysToBeDeleted.includes(key);
|
|
23979
23979
|
}, dashboardState);
|
|
23980
|
-
storage$
|
|
23980
|
+
storage$2.setLocalItem('dashboard', cleanedDashboardState);
|
|
23981
23981
|
toPairs$1(self.state).forEach(function (_ref4) {
|
|
23982
23982
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
23983
23983
|
key = _ref5[0],
|
|
@@ -23989,7 +23989,7 @@ var saveSettings$2 = function saveSettings(self) {
|
|
|
23989
23989
|
value = JSON.stringify(value);
|
|
23990
23990
|
}
|
|
23991
23991
|
if (key === 'phoneNumber') {
|
|
23992
|
-
storage$
|
|
23992
|
+
storage$2.setLocalItem('dashboard', value, 'phoneNumber');
|
|
23993
23993
|
}
|
|
23994
23994
|
}
|
|
23995
23995
|
});
|
|
@@ -24000,7 +24000,7 @@ var saveSettings$2 = function saveSettings(self) {
|
|
|
24000
24000
|
roleName = propOr$1('', 'roleName', roleOptionFromState); // Update hierarchy on local storage when role changes
|
|
24001
24001
|
if (roleOptionFromState) {
|
|
24002
24002
|
_roleOptionFromState$ = roleOptionFromState.levelId, levelId = _roleOptionFromState$ === void 0 ? -1 : _roleOptionFromState$, _roleOptionFromState$2 = roleOptionFromState.hierarchyId, hierarchyId = _roleOptionFromState$2 === void 0 ? -1 : _roleOptionFromState$2;
|
|
24003
|
-
storage$
|
|
24003
|
+
storage$2.setLocalItem('settings', {
|
|
24004
24004
|
level: getHierarchyLevel(levelId),
|
|
24005
24005
|
id: hierarchyId
|
|
24006
24006
|
}, 'selectedHierarchy');
|
|
@@ -24012,7 +24012,7 @@ var saveSettings$2 = function saveSettings(self) {
|
|
|
24012
24012
|
return _context.a(2);
|
|
24013
24013
|
case 1:
|
|
24014
24014
|
yard = self.yardsHistory.get(selectedYard)[selectedYard];
|
|
24015
|
-
storage$
|
|
24015
|
+
storage$2.setSessionItem('dashboard', _objectSpread2(_objectSpread2({}, storage$2.getSessionItem('dashboard')), {}, {
|
|
24016
24016
|
selectedCurrency: selectedCurrency || yard.yard_currency,
|
|
24017
24017
|
selectedCountry: (_yard$yard_country_co = yard.yard_country_code) === null || _yard$yard_country_co === void 0 ? void 0 : _yard$yard_country_co.slice(0, 2),
|
|
24018
24018
|
selectedCountryA3code: yard.yard_country_code,
|
|
@@ -24023,21 +24023,21 @@ var saveSettings$2 = function saveSettings(self) {
|
|
|
24023
24023
|
printers: printers,
|
|
24024
24024
|
yard: yard
|
|
24025
24025
|
}));
|
|
24026
|
-
storage$
|
|
24027
|
-
storage$
|
|
24028
|
-
storage$
|
|
24029
|
-
storage$
|
|
24030
|
-
storage$
|
|
24026
|
+
storage$2.setLocalItem('dashboard', printers, 'printers');
|
|
24027
|
+
storage$2.setLocalItem('dashboard', selectedLanguage || 'en', 'language');
|
|
24028
|
+
storage$2.setLocalItem('settings', roleName, 'selectedRole');
|
|
24029
|
+
storage$2.setLocalItem('lastSelectedYard', yard);
|
|
24030
|
+
storage$2.setLocalItem('dashboard', selectedCurrency || yard.yard_currency, 'selectedCurrency');
|
|
24031
24031
|
securityLevel = pickUserSecurityLevel(getSelectedYard(selectedYard));
|
|
24032
|
-
storage$
|
|
24032
|
+
storage$2.setSessionItem('securityLevel', Number(securityLevel));
|
|
24033
24033
|
_context.n = 2;
|
|
24034
|
-
return fetcher.getUserScopes();
|
|
24034
|
+
return fetcher$1.getUserScopes();
|
|
24035
24035
|
case 2:
|
|
24036
24036
|
userScopes = _context.v;
|
|
24037
|
-
storage$
|
|
24037
|
+
storage$2.setLocalItem('login', userScopes, 'userAppScopes');
|
|
24038
24038
|
// persist user preferences
|
|
24039
24039
|
_context.n = 3;
|
|
24040
|
-
return fetcher.setUserPreferences('oph', {
|
|
24040
|
+
return fetcher$1.setUserPreferences('oph', {
|
|
24041
24041
|
selectedCurrency: selectedCurrency || yard.yard_currency,
|
|
24042
24042
|
language: selectedLanguage || 'en',
|
|
24043
24043
|
// TODO Remove this after remove role selection
|
|
@@ -24071,27 +24071,27 @@ var saveSettings$2 = function saveSettings(self) {
|
|
|
24071
24071
|
};
|
|
24072
24072
|
var selectedYardNumber$2 = function selectedYardNumber() {
|
|
24073
24073
|
var _storage$getSessionIt;
|
|
24074
|
-
return (_storage$getSessionIt = storage$
|
|
24074
|
+
return (_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
24075
24075
|
};
|
|
24076
24076
|
var selectedCountry$1 = function selectedCountry() {
|
|
24077
24077
|
var _storage$getSessionIt2;
|
|
24078
|
-
return ((_storage$getSessionIt2 = storage$
|
|
24078
|
+
return ((_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
|
|
24079
24079
|
};
|
|
24080
24080
|
var selectedLanguage$1 = function selectedLanguage() {
|
|
24081
24081
|
var _storage$getSessionIt3;
|
|
24082
|
-
return ((_storage$getSessionIt3 = storage$
|
|
24082
|
+
return ((_storage$getSessionIt3 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
|
|
24083
24083
|
};
|
|
24084
24084
|
var selectedCurrency = function selectedCurrency() {
|
|
24085
24085
|
var _storage$getSessionIt4;
|
|
24086
|
-
return ((_storage$getSessionIt4 = storage$
|
|
24086
|
+
return ((_storage$getSessionIt4 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCurrency) || 'USD';
|
|
24087
24087
|
};
|
|
24088
24088
|
var selectedCountryA3code$2 = function selectedCountryA3code() {
|
|
24089
24089
|
var _storage$getSessionIt5;
|
|
24090
|
-
return ((_storage$getSessionIt5 = storage$
|
|
24090
|
+
return ((_storage$getSessionIt5 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt5 === void 0 ? void 0 : _storage$getSessionIt5.selectedCountryA3code) || 'USA';
|
|
24091
24091
|
};
|
|
24092
24092
|
var activePrinters$1 = function activePrinters() {
|
|
24093
24093
|
var _storage$getLocalItem;
|
|
24094
|
-
return ((_storage$getLocalItem = storage$
|
|
24094
|
+
return ((_storage$getLocalItem = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.printers) || EMPTY_PRINTERS$1;
|
|
24095
24095
|
};
|
|
24096
24096
|
var makeKeyValue$1 = function makeKeyValue(final, target) {
|
|
24097
24097
|
final[target.label] = target.printer_name;
|
|
@@ -24104,11 +24104,11 @@ var formatActivePrintersForState$1 = function formatActivePrintersForState() {
|
|
|
24104
24104
|
};
|
|
24105
24105
|
var activePhoneNumber$1 = function activePhoneNumber() {
|
|
24106
24106
|
var _storage$getLocalItem2;
|
|
24107
|
-
return ((_storage$getLocalItem2 = storage$
|
|
24107
|
+
return ((_storage$getLocalItem2 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
|
|
24108
24108
|
};
|
|
24109
24109
|
var ringCentralEnabled$1 = function ringCentralEnabled() {
|
|
24110
24110
|
var _storage$getLocalItem3;
|
|
24111
|
-
return ((_storage$getLocalItem3 = storage$
|
|
24111
|
+
return ((_storage$getLocalItem3 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
|
|
24112
24112
|
};
|
|
24113
24113
|
var filterRoles$2 = function filterRoles(roles, countryCode) {
|
|
24114
24114
|
return compose(uniqBy$1(prop$1('roleName')), filter$1(propEq$1('countryCode', countryCode)))(roles);
|
|
@@ -24130,13 +24130,13 @@ var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
|
|
|
24130
24130
|
selectedLanguage: selectedLanguage$1(),
|
|
24131
24131
|
selectedCurrency: selectedCurrency(),
|
|
24132
24132
|
roles: [],
|
|
24133
|
-
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$
|
|
24133
|
+
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$2.userRole),
|
|
24134
24134
|
printersData: EMPTY_PRINTERS$1,
|
|
24135
24135
|
loadingPrinters: false,
|
|
24136
24136
|
oldActivePrinters: null
|
|
24137
24137
|
}, EMPTY_PRINTERS$1));
|
|
24138
24138
|
_defineProperty$2(_this, "fetchRoles", function (countryCode) {
|
|
24139
|
-
fetcher.getUserRoles(countryCode).then(function (_roles) {
|
|
24139
|
+
fetcher$1.getUserRoles(countryCode).then(function (_roles) {
|
|
24140
24140
|
var roles = filterRoles$2(_roles, countryCode);
|
|
24141
24141
|
var selectedRole = _this.state.selectedRole;
|
|
24142
24142
|
_this.setState({
|
|
@@ -24172,7 +24172,7 @@ var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
|
|
|
24172
24172
|
showLoading: true
|
|
24173
24173
|
});
|
|
24174
24174
|
_context2.n = 1;
|
|
24175
|
-
return fetcher.getPrintersForYard(yardNumber, countryA3code);
|
|
24175
|
+
return fetcher$1.getPrintersForYard(yardNumber, countryA3code);
|
|
24176
24176
|
case 1:
|
|
24177
24177
|
printersData = _context2.v;
|
|
24178
24178
|
_this.setState({
|
|
@@ -24180,7 +24180,7 @@ var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
|
|
|
24180
24180
|
loadingPrinters: false,
|
|
24181
24181
|
showLoading: false
|
|
24182
24182
|
});
|
|
24183
|
-
if (firstTime && storage$
|
|
24183
|
+
if (firstTime && storage$2.getLocalItem('dashboard', 'printers')) {
|
|
24184
24184
|
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters$1()), {}, {
|
|
24185
24185
|
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters$1()) : _this.state.oldActivePrinters
|
|
24186
24186
|
}));
|
|
@@ -24345,7 +24345,7 @@ var transformYardOptions = function transformYardOptions(option) {
|
|
|
24345
24345
|
return {
|
|
24346
24346
|
id: option.yardId,
|
|
24347
24347
|
level: 'yard',
|
|
24348
|
-
label: !isNil$
|
|
24348
|
+
label: !isNil$2(option.yardName) ? option.yardId : 'NA',
|
|
24349
24349
|
isSelectable: option.hasAccess
|
|
24350
24350
|
};
|
|
24351
24351
|
};
|
|
@@ -24353,7 +24353,7 @@ var transformRegionOptions = function transformRegionOptions(option) {
|
|
|
24353
24353
|
return {
|
|
24354
24354
|
id: option.regionId,
|
|
24355
24355
|
level: 'region',
|
|
24356
|
-
label: !isNil$
|
|
24356
|
+
label: !isNil$2(option.regionName) ? option.regionName : 'NA',
|
|
24357
24357
|
isSelectable: option.hasAccess,
|
|
24358
24358
|
options: frontEndUtils.string.exists(option.yards) && option.yards.map(function (yard) {
|
|
24359
24359
|
return transformYardOptions(yard);
|
|
@@ -24364,7 +24364,7 @@ var transformDivisionOptions = function transformDivisionOptions(option) {
|
|
|
24364
24364
|
return {
|
|
24365
24365
|
id: option.divisionId,
|
|
24366
24366
|
level: 'division',
|
|
24367
|
-
label: isNil$
|
|
24367
|
+
label: isNil$2(option.divisionName) ? 'NA' : option.divisionName,
|
|
24368
24368
|
isSelectable: option.hasAccess,
|
|
24369
24369
|
options: frontEndUtils.string.exists(option.regions) && option.regions.map(function (reg) {
|
|
24370
24370
|
return transformRegionOptions(reg);
|
|
@@ -24375,7 +24375,7 @@ var transformCountriesOption = function transformCountriesOption(option) {
|
|
|
24375
24375
|
return {
|
|
24376
24376
|
id: "".concat(option.countryId, "-").concat(option.countryCode),
|
|
24377
24377
|
level: 'country',
|
|
24378
|
-
label: isNil$
|
|
24378
|
+
label: isNil$2(option.countryName) ? 'NA' : option.countryName,
|
|
24379
24379
|
isSelectable: option.hasAccess,
|
|
24380
24380
|
options: frontEndUtils.string.exists(option.divisions) && option.divisions.map(function (div) {
|
|
24381
24381
|
return transformDivisionOptions(div);
|
|
@@ -24493,7 +24493,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
24493
24493
|
break;
|
|
24494
24494
|
}
|
|
24495
24495
|
selectedValue = value.selectedValue, option = value.option;
|
|
24496
|
-
storage$
|
|
24496
|
+
storage$2.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24497
24497
|
roleName = option && option.roleName || ''; //pathOr('', ['selectedRoleOption', 'roleName'], nextState)
|
|
24498
24498
|
isValidRole = self.state.roles.find(function (role) {
|
|
24499
24499
|
return role.roleName === roleName;
|
|
@@ -24503,7 +24503,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
24503
24503
|
break;
|
|
24504
24504
|
}
|
|
24505
24505
|
_context.n = 1;
|
|
24506
|
-
return fetcher.getHierarchyOptions(roleName);
|
|
24506
|
+
return fetcher$1.getHierarchyOptions(roleName);
|
|
24507
24507
|
case 1:
|
|
24508
24508
|
hierarchies = _context.v;
|
|
24509
24509
|
self.setState(_objectSpread2({
|
|
@@ -24522,7 +24522,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
24522
24522
|
_context.n = 8;
|
|
24523
24523
|
break;
|
|
24524
24524
|
}
|
|
24525
|
-
storage$
|
|
24525
|
+
storage$2.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24526
24526
|
country = value.country, _value$yard = value.yard, yard = _value$yard === void 0 ? null : _value$yard;
|
|
24527
24527
|
countryId = country && country.split('-')[0];
|
|
24528
24528
|
if (!countryId) {
|
|
@@ -24543,7 +24543,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
24543
24543
|
break;
|
|
24544
24544
|
}
|
|
24545
24545
|
_context.n = 5;
|
|
24546
|
-
return fetcher.getYardNumbers(parseInt(yard));
|
|
24546
|
+
return fetcher$1.getYardNumbers(parseInt(yard));
|
|
24547
24547
|
case 5:
|
|
24548
24548
|
currentyards = _context.v;
|
|
24549
24549
|
currentYard = currentyards[0];
|
|
@@ -24565,7 +24565,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
24565
24565
|
_context.n = 11;
|
|
24566
24566
|
break;
|
|
24567
24567
|
}
|
|
24568
|
-
storage$
|
|
24568
|
+
storage$2.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24569
24569
|
if (!(value !== self.state.selectedYardNumber && Boolean(value))) {
|
|
24570
24570
|
_context.n = 10;
|
|
24571
24571
|
break;
|
|
@@ -24576,7 +24576,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
24576
24576
|
break;
|
|
24577
24577
|
}
|
|
24578
24578
|
_context.n = 9;
|
|
24579
|
-
return fetcher.getYardNumbers(parseInt(value));
|
|
24579
|
+
return fetcher$1.getYardNumbers(parseInt(value));
|
|
24580
24580
|
case 9:
|
|
24581
24581
|
_currentyards = _context.v;
|
|
24582
24582
|
_currentYard = _currentyards[0];
|
|
@@ -24615,8 +24615,8 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
24615
24615
|
return _regenerator().w(function (_context2) {
|
|
24616
24616
|
while (1) switch (_context2.n) {
|
|
24617
24617
|
case 0:
|
|
24618
|
-
dashboardSessionState = storage$
|
|
24619
|
-
settingsLocalStorageState = storage$
|
|
24618
|
+
dashboardSessionState = storage$2.getSessionItem('dashboard');
|
|
24619
|
+
settingsLocalStorageState = storage$2.getLocalItem('settings');
|
|
24620
24620
|
oldSettings = {
|
|
24621
24621
|
selectedRole: settingsLocalStorageState.selectedRole,
|
|
24622
24622
|
selectedHierarchyOption: settingsLocalStorageState.selectedHierarchyOption,
|
|
@@ -24639,21 +24639,21 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
24639
24639
|
}
|
|
24640
24640
|
}
|
|
24641
24641
|
if (key === 'phoneNumber') {
|
|
24642
|
-
storage$
|
|
24642
|
+
storage$2.setLocalItem('dashboard', value, 'phoneNumber');
|
|
24643
24643
|
}
|
|
24644
24644
|
});
|
|
24645
24645
|
_self$state = self.state, selectedYard = _self$state.selectedYardNumber, _self$state$selectedH = _self$state.selectedHierarchyOption, selectedHierarchyOption = _self$state$selectedH === void 0 ? {} : _self$state$selectedH, selectedRole = _self$state.selectedRole, _self$state$roles = _self$state.roles, roles = _self$state$roles === void 0 ? [] : _self$state$roles;
|
|
24646
24646
|
roleOptionFromState = roles.find(function (roleOption) {
|
|
24647
24647
|
return frontEndUtils.regex.beautifyRoleText(roleOption.roleName) === selectedRole;
|
|
24648
24648
|
});
|
|
24649
|
-
if (!(!roleOptionFromState || isEmpty$
|
|
24649
|
+
if (!(!roleOptionFromState || isEmpty$2(selectedHierarchyOption))) {
|
|
24650
24650
|
_context2.n = 1;
|
|
24651
24651
|
break;
|
|
24652
24652
|
}
|
|
24653
24653
|
return _context2.a(2);
|
|
24654
24654
|
case 1:
|
|
24655
24655
|
_context2.n = 2;
|
|
24656
|
-
return fetcher.getYardNumbers(selectedYard);
|
|
24656
|
+
return fetcher$1.getYardNumbers(selectedYard);
|
|
24657
24657
|
case 2:
|
|
24658
24658
|
yardNumbers = _context2.v;
|
|
24659
24659
|
yard = yardNumbers[0];
|
|
@@ -24662,7 +24662,7 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
24662
24662
|
countryId: selectedHierarchyOption.country,
|
|
24663
24663
|
level: selectedHierarchyOption.yard ? 'yard' : 'country'
|
|
24664
24664
|
};
|
|
24665
|
-
storage$
|
|
24665
|
+
storage$2.setSessionItem('dashboard', _objectSpread2(_objectSpread2({}, storage$2.getSessionItem('dashboard')), {}, {
|
|
24666
24666
|
selectedCurrency: yard.yard_currency,
|
|
24667
24667
|
selectedCountry: (_yard$yard_country_co = yard.yard_country_code) === null || _yard$yard_country_co === void 0 ? void 0 : _yard$yard_country_co.slice(0, 2),
|
|
24668
24668
|
selectedCountryA3code: yard.yard_country_code,
|
|
@@ -24672,17 +24672,17 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
24672
24672
|
printers: printers,
|
|
24673
24673
|
yard: yard
|
|
24674
24674
|
}));
|
|
24675
|
-
storage$
|
|
24676
|
-
storage$
|
|
24677
|
-
storage$
|
|
24678
|
-
storage$
|
|
24679
|
-
storage$
|
|
24680
|
-
storage$
|
|
24675
|
+
storage$2.setLocalItem('dashboard', printers, 'printers');
|
|
24676
|
+
storage$2.setLocalItem('dashboard', 'en', 'language');
|
|
24677
|
+
storage$2.setLocalItem('settings', roleOptionFromState.roleName, 'selectedRole');
|
|
24678
|
+
storage$2.setLocalItem('settings', selectedHierarchyOption, 'selectedHierarchyOption');
|
|
24679
|
+
storage$2.setLocalItem('settings', selectedHierarchy, 'selectedHierarchy');
|
|
24680
|
+
storage$2.setLocalItem('lastSelectedYard', yard);
|
|
24681
24681
|
_context2.n = 3;
|
|
24682
|
-
return fetcher.getUserScopes();
|
|
24682
|
+
return fetcher$1.getUserScopes();
|
|
24683
24683
|
case 3:
|
|
24684
24684
|
userScopes = _context2.v;
|
|
24685
|
-
storage$
|
|
24685
|
+
storage$2.setLocalItem('login', userScopes, 'userAppScopes');
|
|
24686
24686
|
getSelectedYard = function getSelectedYard() {
|
|
24687
24687
|
var yardList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
24688
24688
|
return yardList.find(function (yard) {
|
|
@@ -24692,11 +24692,11 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
24692
24692
|
pickUserSecurityLevel = function pickUserSecurityLevel(obj) {
|
|
24693
24693
|
return +propOr$1('0', 'userSecurityLevel', obj);
|
|
24694
24694
|
};
|
|
24695
|
-
securityLevel = compose(pickUserSecurityLevel, getSelectedYard)((_storage$getLocalItem = storage$
|
|
24696
|
-
storage$
|
|
24695
|
+
securityLevel = compose(pickUserSecurityLevel, getSelectedYard)((_storage$getLocalItem = storage$2.getLocalItem('login')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.yardList);
|
|
24696
|
+
storage$2.setSessionItem('securityLevel', securityLevel);
|
|
24697
24697
|
// persist user preferences
|
|
24698
24698
|
_context2.n = 4;
|
|
24699
|
-
return fetcher.setUserPreferences('oph', {
|
|
24699
|
+
return fetcher$1.setUserPreferences('oph', {
|
|
24700
24700
|
selectedCurrency: yard.yard_currency,
|
|
24701
24701
|
language: 'en',
|
|
24702
24702
|
// TODO Remove this after remove role selection
|
|
@@ -24732,14 +24732,14 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
24732
24732
|
}();
|
|
24733
24733
|
};
|
|
24734
24734
|
var selectedYardNumber$1 = function selectedYardNumber() {
|
|
24735
|
-
return storage$
|
|
24735
|
+
return storage$2.activeYardNumber;
|
|
24736
24736
|
};
|
|
24737
24737
|
var selectedCountryA3code$1 = function selectedCountryA3code() {
|
|
24738
24738
|
var _storage$getSessionIt2;
|
|
24739
|
-
return ((_storage$getSessionIt2 = storage$
|
|
24739
|
+
return ((_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code) || 'GBR';
|
|
24740
24740
|
};
|
|
24741
24741
|
var activePrinters = function activePrinters() {
|
|
24742
|
-
return storage$
|
|
24742
|
+
return storage$2.getLocalItem('dashboard', 'printers') || EMPTY_PRINTERS;
|
|
24743
24743
|
};
|
|
24744
24744
|
var makeKeyValue = function makeKeyValue(final, target) {
|
|
24745
24745
|
final[target.label] = target.printer_name;
|
|
@@ -24752,11 +24752,11 @@ var formatActivePrintersForState = function formatActivePrintersForState() {
|
|
|
24752
24752
|
};
|
|
24753
24753
|
var activePhoneNumber = function activePhoneNumber() {
|
|
24754
24754
|
var _storage$getLocalItem2;
|
|
24755
|
-
return ((_storage$getLocalItem2 = storage$
|
|
24755
|
+
return ((_storage$getLocalItem2 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
|
|
24756
24756
|
};
|
|
24757
24757
|
var ringCentralEnabled = function ringCentralEnabled() {
|
|
24758
24758
|
var _storage$getLocalItem3;
|
|
24759
|
-
return ((_storage$getLocalItem3 = storage$
|
|
24759
|
+
return ((_storage$getLocalItem3 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
|
|
24760
24760
|
};
|
|
24761
24761
|
var getYardOptions = /*#__PURE__*/function () {
|
|
24762
24762
|
var _ref7 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3(countryId) {
|
|
@@ -24765,9 +24765,9 @@ var getYardOptions = /*#__PURE__*/function () {
|
|
|
24765
24765
|
return _regenerator().w(function (_context3) {
|
|
24766
24766
|
while (1) switch (_context3.n) {
|
|
24767
24767
|
case 0:
|
|
24768
|
-
url = (_storage$getLocalItem4 = storage$
|
|
24768
|
+
url = (_storage$getLocalItem4 = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem4 === void 0 ? void 0 : (_storage$getLocalItem5 = _storage$getLocalItem4.endpoints) === null || _storage$getLocalItem5 === void 0 ? void 0 : _storage$getLocalItem5.yardsOptions;
|
|
24769
24769
|
_context3.n = 1;
|
|
24770
|
-
return fetcher.get(frontEndUtils.string.substitute(url, {
|
|
24770
|
+
return fetcher$1.get(frontEndUtils.string.substitute(url, {
|
|
24771
24771
|
countryId: countryId
|
|
24772
24772
|
}), {
|
|
24773
24773
|
headers: {
|
|
@@ -24789,7 +24789,7 @@ var getYardOptions = /*#__PURE__*/function () {
|
|
|
24789
24789
|
};
|
|
24790
24790
|
}();
|
|
24791
24791
|
var filterRoles = function filterRoles(roles, invalidCodes) {
|
|
24792
|
-
return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$3(includes$
|
|
24792
|
+
return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$3(includes$2)(invalidCodes), prop$1('countryCode'))))(roles);
|
|
24793
24793
|
};
|
|
24794
24794
|
var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
24795
24795
|
function SettingsView() {
|
|
@@ -24804,9 +24804,9 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24804
24804
|
ringCentralEnabled: ringCentralEnabled(),
|
|
24805
24805
|
selectedYardNumber: selectedYardNumber$1(),
|
|
24806
24806
|
selectedCountryA3code: selectedCountryA3code$1(),
|
|
24807
|
-
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$
|
|
24808
|
-
selectedHierarchy: storage$
|
|
24809
|
-
selectedHierarchyOption: storage$
|
|
24807
|
+
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$2.userRole),
|
|
24808
|
+
selectedHierarchy: storage$2.getLocalItem('settings', 'selectedHierarchy') || null,
|
|
24809
|
+
selectedHierarchyOption: storage$2.getLocalItem('settings', 'selectedHierarchyOption'),
|
|
24810
24810
|
roles: [],
|
|
24811
24811
|
hierarchies: [],
|
|
24812
24812
|
printersData: EMPTY_PRINTERS,
|
|
@@ -24848,14 +24848,14 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24848
24848
|
showLoading: true
|
|
24849
24849
|
});
|
|
24850
24850
|
_context5.n = 1;
|
|
24851
|
-
return fetcher.getPrintersForYard(yardNumber, countryA3code);
|
|
24851
|
+
return fetcher$1.getPrintersForYard(yardNumber, countryA3code);
|
|
24852
24852
|
case 1:
|
|
24853
24853
|
printersData = _context5.v;
|
|
24854
24854
|
_this.setState({
|
|
24855
24855
|
printersData: printersData,
|
|
24856
24856
|
showLoading: false
|
|
24857
24857
|
});
|
|
24858
|
-
if (firstTime && storage$
|
|
24858
|
+
if (firstTime && storage$2.getLocalItem('dashboard', 'printers')) {
|
|
24859
24859
|
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters()), {}, {
|
|
24860
24860
|
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters()) : _this.state.oldActivePrinters
|
|
24861
24861
|
}));
|
|
@@ -24899,16 +24899,16 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24899
24899
|
while (1) switch (_context6.n) {
|
|
24900
24900
|
case 0:
|
|
24901
24901
|
_context6.n = 1;
|
|
24902
|
-
return fetcher.getUserRoles(this.state.selectedCountryA3code);
|
|
24902
|
+
return fetcher$1.getUserRoles(this.state.selectedCountryA3code);
|
|
24903
24903
|
case 1:
|
|
24904
24904
|
_roles = _context6.v;
|
|
24905
24905
|
// MEA and UK are both valid in UK portal so filter out the rest
|
|
24906
24906
|
roles = filterRoles(_roles, ['CAN', 'BRA', 'USA', 'IND']);
|
|
24907
24907
|
_context6.n = 2;
|
|
24908
|
-
return fetcher.getHierarchyOptions(storage$
|
|
24908
|
+
return fetcher$1.getHierarchyOptions(storage$2.userRole);
|
|
24909
24909
|
case 2:
|
|
24910
24910
|
hierarchies = _context6.v;
|
|
24911
|
-
_storage$getLocalItem6 = storage$
|
|
24911
|
+
_storage$getLocalItem6 = storage$2.getLocalItem('settings', 'selectedHierarchyOption'), _storage$getLocalItem7 = _storage$getLocalItem6.country, country = _storage$getLocalItem7 === void 0 ? '' : _storage$getLocalItem7;
|
|
24912
24912
|
countryId = country.split('-')[0];
|
|
24913
24913
|
if (!countryId) {
|
|
24914
24914
|
_context6.n = 4;
|
|
@@ -25084,7 +25084,7 @@ var COUNTRIES$1 = {
|
|
|
25084
25084
|
}
|
|
25085
25085
|
};
|
|
25086
25086
|
var validCountry = function validCountry(value) {
|
|
25087
|
-
return value && includes$
|
|
25087
|
+
return value && includes$2(value, keys$3(COUNTRIES$1)) ? locale(COUNTRIES$1[value].name) : value || '';
|
|
25088
25088
|
};
|
|
25089
25089
|
var CountrySelector = function CountrySelector(_ref) {
|
|
25090
25090
|
var handleChange = _ref.handleChange,
|
|
@@ -25124,7 +25124,7 @@ var getRolesMap = function getRolesMap(userRoles) {
|
|
|
25124
25124
|
userRoles.map(function (obj) {
|
|
25125
25125
|
if (has$2(obj.roleName, rolesMap)) rolesMap[obj.roleName] = [].concat(_toConsumableArray(rolesMap[obj.roleName]), [obj.hierarchyId]);else rolesMap[obj.roleName] = [obj.hierarchyId];
|
|
25126
25126
|
});
|
|
25127
|
-
storage$
|
|
25127
|
+
storage$2.setLocalItem('settings', rolesMap, 'rolesMap');
|
|
25128
25128
|
return rolesMap;
|
|
25129
25129
|
};
|
|
25130
25130
|
var getUserRolesFromFetcher = /*#__PURE__*/function () {
|
|
@@ -25134,7 +25134,7 @@ var getUserRolesFromFetcher = /*#__PURE__*/function () {
|
|
|
25134
25134
|
while (1) switch (_context.n) {
|
|
25135
25135
|
case 0:
|
|
25136
25136
|
promises = keys$3(COUNTRIES).map(function (country) {
|
|
25137
|
-
return fetcher.getCobaltUserRoles(COUNTRIES[country].code);
|
|
25137
|
+
return fetcher$1.getCobaltUserRoles(COUNTRIES[country].code);
|
|
25138
25138
|
});
|
|
25139
25139
|
_context.n = 1;
|
|
25140
25140
|
return Promise.all(promises);
|
|
@@ -25146,7 +25146,7 @@ var getUserRolesFromFetcher = /*#__PURE__*/function () {
|
|
|
25146
25146
|
roles: userRoles[index]
|
|
25147
25147
|
};
|
|
25148
25148
|
}).filter(function (roleByCountry) {
|
|
25149
|
-
return !isEmpty$
|
|
25149
|
+
return !isEmpty$2(roleByCountry.roles);
|
|
25150
25150
|
});
|
|
25151
25151
|
return _context.a(2, result);
|
|
25152
25152
|
}
|
|
@@ -25157,13 +25157,13 @@ var getUserRolesFromFetcher = /*#__PURE__*/function () {
|
|
|
25157
25157
|
};
|
|
25158
25158
|
}();
|
|
25159
25159
|
var getSelectedYardNumberAndName = function getSelectedYardNumberAndName() {
|
|
25160
|
-
var _storage$getLocalItem = storage$
|
|
25160
|
+
var _storage$getLocalItem = storage$2.getLocalItem('dashboard'),
|
|
25161
25161
|
selectedYard = _storage$getLocalItem.selectedYard,
|
|
25162
25162
|
yardList = _storage$getLocalItem.yardList;
|
|
25163
25163
|
var selectedYardObject = head$1(filter$1(function (yard) {
|
|
25164
25164
|
return yard.yard_number === selectedYard;
|
|
25165
25165
|
}, yardList)) || {};
|
|
25166
|
-
return !isEmpty$
|
|
25166
|
+
return !isEmpty$2(selectedYardObject) ? "".concat(selectedYardObject.yard_number, " - ").concat(selectedYardObject.yard_name) : null;
|
|
25167
25167
|
};
|
|
25168
25168
|
var getAccessCountries = function getAccessCountries(userRoles) {
|
|
25169
25169
|
return userRoles.map(function (rolesByCountry) {
|
|
@@ -25233,15 +25233,15 @@ var saveSettings = function saveSettings(self) {
|
|
|
25233
25233
|
};
|
|
25234
25234
|
localStorage.setItem('dashboard', JSON.stringify(dashboard));
|
|
25235
25235
|
sessionStorage.setItem('dashboard', JSON.stringify(dashboard));
|
|
25236
|
-
storage$
|
|
25236
|
+
storage$2.setLocalItem('dashboard', {
|
|
25237
25237
|
yard_number: selectedYard
|
|
25238
25238
|
}, 'yard');
|
|
25239
|
-
storage$
|
|
25239
|
+
storage$2.setSessionItem('dashboard', {
|
|
25240
25240
|
yard_number: selectedYard
|
|
25241
25241
|
}, 'yard');
|
|
25242
|
-
storage$
|
|
25243
|
-
storage$
|
|
25244
|
-
storage$
|
|
25242
|
+
storage$2.setLocalItem('dashboard', yardOptions, 'yardList');
|
|
25243
|
+
storage$2.setSessionItem('dashboard', yardOptions, 'yardList');
|
|
25244
|
+
storage$2.setLocalItem('settings', selectedRole, 'selectedRole');
|
|
25245
25245
|
if (self.props.onSave) {
|
|
25246
25246
|
self.props.onSave();
|
|
25247
25247
|
}
|
|
@@ -25249,19 +25249,19 @@ var saveSettings = function saveSettings(self) {
|
|
|
25249
25249
|
};
|
|
25250
25250
|
var selectedYardNumber = function selectedYardNumber() {
|
|
25251
25251
|
var _storage$getSessionIt;
|
|
25252
|
-
return (_storage$getSessionIt = storage$
|
|
25252
|
+
return (_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
25253
25253
|
};
|
|
25254
25254
|
var selectedCountry = function selectedCountry() {
|
|
25255
25255
|
var _storage$getSessionIt2;
|
|
25256
|
-
return ((_storage$getSessionIt2 = storage$
|
|
25256
|
+
return ((_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
|
|
25257
25257
|
};
|
|
25258
25258
|
var selectedLanguage = function selectedLanguage() {
|
|
25259
25259
|
var _storage$getSessionIt3;
|
|
25260
|
-
return ((_storage$getSessionIt3 = storage$
|
|
25260
|
+
return ((_storage$getSessionIt3 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
|
|
25261
25261
|
};
|
|
25262
25262
|
var selectedCountryA3code = function selectedCountryA3code() {
|
|
25263
25263
|
var _storage$getSessionIt4;
|
|
25264
|
-
return ((_storage$getSessionIt4 = storage$
|
|
25264
|
+
return ((_storage$getSessionIt4 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCountryA3code) || 'USA';
|
|
25265
25265
|
};
|
|
25266
25266
|
var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
25267
25267
|
function SettingsView() {
|
|
@@ -25281,7 +25281,7 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
25281
25281
|
userRoles: [],
|
|
25282
25282
|
yardOptions: [],
|
|
25283
25283
|
selectedYardNumberAndName: getSelectedYardNumberAndName() || null,
|
|
25284
|
-
selectedRole: storage$
|
|
25284
|
+
selectedRole: storage$2.getLocalItem('settings').selectedRole || '',
|
|
25285
25285
|
showLoading: false
|
|
25286
25286
|
});
|
|
25287
25287
|
_defineProperty$2(_this, "fetchFacilititesForRole", /*#__PURE__*/function () {
|
|
@@ -25300,7 +25300,7 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
25300
25300
|
});
|
|
25301
25301
|
return _context.a(2);
|
|
25302
25302
|
case 1:
|
|
25303
|
-
if (!includes$
|
|
25303
|
+
if (!includes$2(roleName, pluck$1('roleName', (activeCountryObj === null || activeCountryObj === void 0 ? void 0 : activeCountryObj.roles) || []))) {
|
|
25304
25304
|
_context.n = 7;
|
|
25305
25305
|
break;
|
|
25306
25306
|
}
|
|
@@ -25315,18 +25315,18 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
25315
25315
|
return _context.a(2);
|
|
25316
25316
|
case 3:
|
|
25317
25317
|
_context.n = 4;
|
|
25318
|
-
return fetcher.getCobaltUserFacilities(COUNTRIES[_this.state.selectedCountry].code, roleName);
|
|
25318
|
+
return fetcher$1.getCobaltUserFacilities(COUNTRIES[_this.state.selectedCountry].code, roleName);
|
|
25319
25319
|
case 4:
|
|
25320
25320
|
allFacilities = _context.v;
|
|
25321
25321
|
rolesMap = getRolesMap((activeCountryObj === null || activeCountryObj === void 0 ? void 0 : activeCountryObj.roles) || []);
|
|
25322
|
-
if (!includes$
|
|
25322
|
+
if (!includes$2(_this.state.selectedYardNumber, rolesMap[roleName])) {
|
|
25323
25323
|
_this.setState({
|
|
25324
25324
|
selectedYardNumber: '',
|
|
25325
25325
|
selectedYardNumberAndName: ''
|
|
25326
25326
|
});
|
|
25327
25327
|
}
|
|
25328
25328
|
yardOptions = filter$1(function (yard) {
|
|
25329
|
-
return includes$
|
|
25329
|
+
return includes$2(yard.yard_number, rolesMap[roleName]);
|
|
25330
25330
|
}, allFacilities);
|
|
25331
25331
|
_this.setState({
|
|
25332
25332
|
yardOptions: yardOptions
|
|
@@ -25602,7 +25602,7 @@ function filterOutExpiredNotifications(notifications) {
|
|
|
25602
25602
|
}
|
|
25603
25603
|
function filterOutNotificationForOtherApps(notifications) {
|
|
25604
25604
|
var currentApp = window.location.pathname === '/' ? 'home' : window.location.pathname;
|
|
25605
|
-
var tilesConfig = storage$
|
|
25605
|
+
var tilesConfig = storage$2.getLocalItem('opsportal-core:config').tiles || [];
|
|
25606
25606
|
var tile = tilesConfig.find(function (item) {
|
|
25607
25607
|
return item.path === currentApp || "".concat(item.path, "/") === currentApp || currentApp.startsWith(item.path);
|
|
25608
25608
|
}) || {};
|
|
@@ -25617,8 +25617,8 @@ function filterOutNotificationForOtherApps(notifications) {
|
|
|
25617
25617
|
});
|
|
25618
25618
|
}
|
|
25619
25619
|
function filterOutNotificationByAudience(notifications) {
|
|
25620
|
-
var userEmail = storage$
|
|
25621
|
-
var yardNumber = storage$
|
|
25620
|
+
var userEmail = storage$2.userEmail;
|
|
25621
|
+
var yardNumber = storage$2.activeYardNumber;
|
|
25622
25622
|
// const countryCodes = window.location.hostname.includes('.com') ? ["USA", "CAN"] : ["ARE", "OMN", "BHR", "IRL", "GBR"]
|
|
25623
25623
|
return notifications.filter(function (notification) {
|
|
25624
25624
|
// if (!countryCodes.includes(notification.countryCode)) return false
|
|
@@ -26115,7 +26115,7 @@ var Notifications = function Notifications(_ref) {
|
|
|
26115
26115
|
setLast(notifications.length - 1);
|
|
26116
26116
|
}, [notifications]);
|
|
26117
26117
|
var notification = notifications[i];
|
|
26118
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isNil$
|
|
26118
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isNil$2(notification) && !showSideBar ? /*#__PURE__*/React__default["default"].createElement(Banner, _extends$1({
|
|
26119
26119
|
current: i + 1,
|
|
26120
26120
|
count: notifications.length,
|
|
26121
26121
|
showNavButtons: notifications.length > 1,
|
|
@@ -26317,7 +26317,7 @@ var generateAppBarElements = function generateAppBarElements(props, showCallout)
|
|
|
26317
26317
|
var handleIconClick = props.handleIconClick,
|
|
26318
26318
|
ideaNoteVisible = props.ideaNoteVisible,
|
|
26319
26319
|
mobileMenuVisible = props.mobileMenuVisible;
|
|
26320
|
-
var coreAppConfig = storage$
|
|
26320
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
26321
26321
|
var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures,
|
|
26322
26322
|
showSettingsMenuByTileConfig = coreAppConfig.showSettingsMenuByTileConfig,
|
|
26323
26323
|
enableIdeaNote = coreAppConfig.enableIdeaNote,
|
|
@@ -26412,7 +26412,7 @@ var generateAppBarElements = function generateAppBarElements(props, showCallout)
|
|
|
26412
26412
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
26413
26413
|
name: "earth-americas",
|
|
26414
26414
|
variant: "regular"
|
|
26415
|
-
}), ' ', /*#__PURE__*/React__default["default"].createElement("span", null, getLanguage(storage$
|
|
26415
|
+
}), ' ', /*#__PURE__*/React__default["default"].createElement("span", null, getLanguage(storage$2.activeLanguage)));
|
|
26416
26416
|
}
|
|
26417
26417
|
}, {
|
|
26418
26418
|
key: 'roleAndFlag',
|
|
@@ -26724,7 +26724,7 @@ var ICONS = {
|
|
|
26724
26724
|
};
|
|
26725
26725
|
var AppBar$1 = function AppBar(props) {
|
|
26726
26726
|
var _window$toolkitEnv4;
|
|
26727
|
-
var coreAppConfig = storage$
|
|
26727
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
26728
26728
|
var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures,
|
|
26729
26729
|
ideaNoteUri = coreAppConfig.ideaNoteUri;
|
|
26730
26730
|
var _useState = React.useState(false),
|
|
@@ -28706,7 +28706,7 @@ var ReactModal = /*@__PURE__*/unwrapExports(lib);
|
|
|
28706
28706
|
|
|
28707
28707
|
ReactModal.setAppElement('*');
|
|
28708
28708
|
|
|
28709
|
-
storage$
|
|
28709
|
+
storage$2.flexLoaded;
|
|
28710
28710
|
|
|
28711
28711
|
function LatestReleaseDialog(_ref) {
|
|
28712
28712
|
var release = _ref.release,
|
|
@@ -28971,7 +28971,7 @@ var getCurrentApp = function getCurrentApp() {
|
|
|
28971
28971
|
if (currentApp === 'Ops Home') {
|
|
28972
28972
|
app = 'Ops Home';
|
|
28973
28973
|
} else {
|
|
28974
|
-
var tilesConfig = storage$
|
|
28974
|
+
var tilesConfig = storage$2.getLocalItem('opsportal-core:config').tiles || [];
|
|
28975
28975
|
var isPathMatch = function isPathMatch(item) {
|
|
28976
28976
|
if (item.path === currentApp || "".concat(item.path, "/") === currentApp) return true;
|
|
28977
28977
|
// For sub-routes, require path boundary: next char must be '/' or end of string
|
|
@@ -29038,16 +29038,16 @@ var generateTargets = function generateTargets(notification) {
|
|
|
29038
29038
|
};
|
|
29039
29039
|
//url encode the query string
|
|
29040
29040
|
function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
|
|
29041
|
-
var coreAppConfig = storage$
|
|
29041
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29042
29042
|
var endpoints = coreAppConfig.endpoints;
|
|
29043
|
-
var query = generateQuery(storage$
|
|
29043
|
+
var query = generateQuery(storage$2.activeYardNumber, storage$2.userEmail);
|
|
29044
29044
|
var headers = {
|
|
29045
29045
|
collection: 'notifications',
|
|
29046
29046
|
serviceName: 'notification',
|
|
29047
|
-
Country: storage$
|
|
29048
|
-
Authorization: "bearer ".concat(storage$
|
|
29047
|
+
Country: storage$2.getSessionItem('dashboard', 'selectedCountryA3code'),
|
|
29048
|
+
Authorization: "bearer ".concat(storage$2.accessToken)
|
|
29049
29049
|
};
|
|
29050
|
-
fetcher.get("".concat(endpoints.getG2NotificationsSolr, "?").concat(query), {
|
|
29050
|
+
fetcher$1.get("".concat(endpoints.getG2NotificationsSolr, "?").concat(query), {
|
|
29051
29051
|
headers: headers
|
|
29052
29052
|
}).then(function (res) {
|
|
29053
29053
|
var notificationsList = pathOr$1([], ['data', 'response', 'docs'], res);
|
|
@@ -29094,10 +29094,10 @@ function startWebSocketConnection(updateNotifications, updateAllNotificationsLis
|
|
|
29094
29094
|
var callbacks = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
29095
29095
|
var onOpen = callbacks.onOpen,
|
|
29096
29096
|
onClose = callbacks.onClose;
|
|
29097
|
-
var coreAppConfig = storage$
|
|
29098
|
-
var webSocketURL = "".concat(coreAppConfig.webSocketURL, "/").concat((_storage$getSessionIt = storage$
|
|
29097
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29098
|
+
var webSocketURL = "".concat(coreAppConfig.webSocketURL, "/").concat((_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard, ",").concat(storage$2.userEmail, ",").concat(encodeURIComponent(getCurrentApp()));
|
|
29099
29099
|
var domain = window.location.hostname.slice(window.location.hostname.indexOf('.copart'));
|
|
29100
|
-
var selectedCountryA3code = (_storage$getSessionIt2 = storage$
|
|
29100
|
+
var selectedCountryA3code = (_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code;
|
|
29101
29101
|
var notificationCountry = selectedCountryA3code;
|
|
29102
29102
|
try {
|
|
29103
29103
|
if (coreAppConfig.nchanAvailableCountries) {
|
|
@@ -29113,7 +29113,7 @@ function startWebSocketConnection(updateNotifications, updateAllNotificationsLis
|
|
|
29113
29113
|
browserCookies.set('notification_country', notificationCountry, {
|
|
29114
29114
|
domain: domain
|
|
29115
29115
|
});
|
|
29116
|
-
document.cookie = 'access_token=' + storage$
|
|
29116
|
+
document.cookie = 'access_token=' + storage$2.accessToken + '; path=/;domain=' + domain;
|
|
29117
29117
|
var NOTIFICATION_FLUSH_MS = 150;
|
|
29118
29118
|
var notificationBuffer = [];
|
|
29119
29119
|
var flushTimerId = null;
|
|
@@ -29153,7 +29153,7 @@ function startWebSocketConnection(updateNotifications, updateAllNotificationsLis
|
|
|
29153
29153
|
// Check if this is a user status update message (process immediately)
|
|
29154
29154
|
if ((messageData === null || messageData === void 0 ? void 0 : messageData.type) === 'USER_STATUS_UPDATE') {
|
|
29155
29155
|
var messageEmail = (messageData.userEmail || '').toLowerCase();
|
|
29156
|
-
var currentUserEmail = (storage$
|
|
29156
|
+
var currentUserEmail = (storage$2.userEmail || '').toLowerCase();
|
|
29157
29157
|
if (messageEmail !== currentUserEmail) {
|
|
29158
29158
|
return;
|
|
29159
29159
|
}
|
|
@@ -29200,15 +29200,15 @@ var fetchAvailableStatuses = /*#__PURE__*/function () {
|
|
|
29200
29200
|
return _regenerator().w(function (_context) {
|
|
29201
29201
|
while (1) switch (_context.p = _context.n) {
|
|
29202
29202
|
case 0:
|
|
29203
|
-
coreAppConfig = storage$
|
|
29203
|
+
coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29204
29204
|
endpoints = coreAppConfig.endpoints;
|
|
29205
|
-
email = storage$
|
|
29205
|
+
email = storage$2.userEmail || '';
|
|
29206
29206
|
endpoint = frontEndUtils.string.substitute(endpoints === null || endpoints === void 0 ? void 0 : endpoints.getAvailableStatusesByUser, {
|
|
29207
29207
|
email: email
|
|
29208
29208
|
});
|
|
29209
29209
|
_context.p = 1;
|
|
29210
29210
|
_context.n = 2;
|
|
29211
|
-
return fetcher.get(endpoint);
|
|
29211
|
+
return fetcher$1.get(endpoint);
|
|
29212
29212
|
case 2:
|
|
29213
29213
|
res = _context.v;
|
|
29214
29214
|
availableStatuses = pathOr$1([], ['data'], res);
|
|
@@ -29233,15 +29233,15 @@ var fetchUserStatus = /*#__PURE__*/function () {
|
|
|
29233
29233
|
return _regenerator().w(function (_context2) {
|
|
29234
29234
|
while (1) switch (_context2.p = _context2.n) {
|
|
29235
29235
|
case 0:
|
|
29236
|
-
coreAppConfig = storage$
|
|
29236
|
+
coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29237
29237
|
endpoints = coreAppConfig.endpoints;
|
|
29238
|
-
email = storage$
|
|
29238
|
+
email = storage$2.userEmail || '';
|
|
29239
29239
|
endpoint = frontEndUtils.string.substitute(endpoints === null || endpoints === void 0 ? void 0 : endpoints.getUserStatus, {
|
|
29240
29240
|
email: email
|
|
29241
29241
|
});
|
|
29242
29242
|
_context2.p = 1;
|
|
29243
29243
|
_context2.n = 2;
|
|
29244
|
-
return fetcher.get(endpoint);
|
|
29244
|
+
return fetcher$1.get(endpoint);
|
|
29245
29245
|
case 2:
|
|
29246
29246
|
res = _context2.v;
|
|
29247
29247
|
docs = pathOr$1([], ['data', 'response', 'docs'], res);
|
|
@@ -29266,17 +29266,17 @@ var updateUserStatus = /*#__PURE__*/function () {
|
|
|
29266
29266
|
return _regenerator().w(function (_context3) {
|
|
29267
29267
|
while (1) switch (_context3.p = _context3.n) {
|
|
29268
29268
|
case 0:
|
|
29269
|
-
coreAppConfig = storage$
|
|
29269
|
+
coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29270
29270
|
endpoints = coreAppConfig.endpoints;
|
|
29271
29271
|
endpoint = endpoints === null || endpoints === void 0 ? void 0 : endpoints.updateUserStatus;
|
|
29272
29272
|
requestBody = {
|
|
29273
29273
|
status: statusId,
|
|
29274
|
-
email: storage$
|
|
29274
|
+
email: storage$2.userEmail,
|
|
29275
29275
|
timeStamp: moment.utc().format('YYYY-MM-DD HH:mm:ss')
|
|
29276
29276
|
};
|
|
29277
29277
|
_context3.p = 1;
|
|
29278
29278
|
_context3.n = 2;
|
|
29279
|
-
return fetcher.post(endpoint, requestBody);
|
|
29279
|
+
return fetcher$1.post(endpoint, requestBody);
|
|
29280
29280
|
case 2:
|
|
29281
29281
|
res = _context3.v;
|
|
29282
29282
|
responseData = pathOr$1(null, ['data'], res);
|
|
@@ -29302,18 +29302,18 @@ var sendHeartBeat = /*#__PURE__*/function () {
|
|
|
29302
29302
|
return _regenerator().w(function (_context4) {
|
|
29303
29303
|
while (1) switch (_context4.p = _context4.n) {
|
|
29304
29304
|
case 0:
|
|
29305
|
-
coreAppConfig = storage$
|
|
29305
|
+
coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29306
29306
|
endpoints = coreAppConfig.endpoints;
|
|
29307
29307
|
endpoint = endpoints === null || endpoints === void 0 ? void 0 : endpoints.sendHeartBeat;
|
|
29308
29308
|
requestBody = {
|
|
29309
|
-
email: storage$
|
|
29309
|
+
email: storage$2.userEmail,
|
|
29310
29310
|
timeStamp: moment.utc().format('YYYY-MM-DD HH:mm:ss'),
|
|
29311
|
-
copartId: storage$
|
|
29312
|
-
samAccount: storage$
|
|
29311
|
+
copartId: storage$2.userCopartId,
|
|
29312
|
+
samAccount: storage$2.userSamAccount
|
|
29313
29313
|
};
|
|
29314
29314
|
_context4.p = 1;
|
|
29315
29315
|
_context4.n = 2;
|
|
29316
|
-
return fetcher.post(endpoint, requestBody);
|
|
29316
|
+
return fetcher$1.post(endpoint, requestBody);
|
|
29317
29317
|
case 2:
|
|
29318
29318
|
_context4.n = 4;
|
|
29319
29319
|
break;
|
|
@@ -29343,19 +29343,19 @@ var sendUserInteractionEvent = /*#__PURE__*/function () {
|
|
|
29343
29343
|
while (1) switch (_context5.p = _context5.n) {
|
|
29344
29344
|
case 0:
|
|
29345
29345
|
didInteract = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : false;
|
|
29346
|
-
coreAppConfig = storage$
|
|
29346
|
+
coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29347
29347
|
endpoints = coreAppConfig.endpoints;
|
|
29348
29348
|
endpoint = endpoints === null || endpoints === void 0 ? void 0 : endpoints.sendUserInteractionEvent;
|
|
29349
29349
|
requestBody = {
|
|
29350
|
-
email: storage$
|
|
29350
|
+
email: storage$2.userEmail,
|
|
29351
29351
|
timeStamp: moment.utc().format('YYYY-MM-DD HH:mm:ss'),
|
|
29352
|
-
copartId: storage$
|
|
29353
|
-
samAccount: storage$
|
|
29352
|
+
copartId: storage$2.userCopartId,
|
|
29353
|
+
samAccount: storage$2.userSamAccount,
|
|
29354
29354
|
userConnectivity: didInteract
|
|
29355
29355
|
};
|
|
29356
29356
|
_context5.p = 1;
|
|
29357
29357
|
_context5.n = 2;
|
|
29358
|
-
return fetcher.post(endpoint, requestBody);
|
|
29358
|
+
return fetcher$1.post(endpoint, requestBody);
|
|
29359
29359
|
case 2:
|
|
29360
29360
|
_context5.n = 4;
|
|
29361
29361
|
break;
|
|
@@ -29816,25 +29816,25 @@ var ErrorNotificationProvider = function ErrorNotificationProvider(_ref) {
|
|
|
29816
29816
|
}));
|
|
29817
29817
|
};
|
|
29818
29818
|
|
|
29819
|
-
var allAreTruthy = all$1(equals$1(true));
|
|
29820
|
-
var yardNumberAllowed = function yardNumberAllowed(yardNumber, tile) {
|
|
29819
|
+
var allAreTruthy$1 = all$1(equals$1(true));
|
|
29820
|
+
var yardNumberAllowed$1 = function yardNumberAllowed(yardNumber, tile) {
|
|
29821
29821
|
var _tile$yardRules, _tile$yardRules$allow, _tile$yardRules2, _tile$yardRules3;
|
|
29822
29822
|
// Pass if yardNumber is specifically allowed or if it is not specifically denied.
|
|
29823
|
-
return (_tile$yardRules = tile.yardRules) !== null && _tile$yardRules !== void 0 && (_tile$yardRules$allow = _tile$yardRules.allow) !== null && _tile$yardRules$allow !== void 0 && _tile$yardRules$allow.length ? includes$
|
|
29823
|
+
return (_tile$yardRules = tile.yardRules) !== null && _tile$yardRules !== void 0 && (_tile$yardRules$allow = _tile$yardRules.allow) !== null && _tile$yardRules$allow !== void 0 && _tile$yardRules$allow.length ? includes$2(yardNumber, (_tile$yardRules2 = tile.yardRules) === null || _tile$yardRules2 === void 0 ? void 0 : _tile$yardRules2.allow) : !includes$2(yardNumber, (_tile$yardRules3 = tile.yardRules) === null || _tile$yardRules3 === void 0 ? void 0 : _tile$yardRules3.deny);
|
|
29824
29824
|
};
|
|
29825
|
-
var securityLevelAllowed = function securityLevelAllowed(securityLevel, tile) {
|
|
29825
|
+
var securityLevelAllowed$1 = function securityLevelAllowed(securityLevel, tile) {
|
|
29826
29826
|
var _tile$securityLevelRu, _tile$securityLevelRu2;
|
|
29827
29827
|
// Pass if securityLevel is not in not array or if greater than the lessThan array or requireCasAccess is false.
|
|
29828
|
-
return (tile === null || tile === void 0 ? void 0 : tile.requireCasAccess) === false || !includes$
|
|
29828
|
+
return (tile === null || tile === void 0 ? void 0 : tile.requireCasAccess) === false || !includes$2(securityLevel, (_tile$securityLevelRu = tile.securityLevelRules) === null || _tile$securityLevelRu === void 0 ? void 0 : _tile$securityLevelRu.not) && ((_tile$securityLevelRu2 = tile.securityLevelRules) === null || _tile$securityLevelRu2 === void 0 ? void 0 : _tile$securityLevelRu2.lessThan) > Number(securityLevel);
|
|
29829
29829
|
};
|
|
29830
|
-
var emailAddressAllowed = function emailAddressAllowed(emailAddress, tile) {
|
|
29830
|
+
var emailAddressAllowed$1 = function emailAddressAllowed(emailAddress, tile) {
|
|
29831
29831
|
var _tile$userRules, _tile$userRules2;
|
|
29832
29832
|
// Pass if no emails specified or if email is in allow array.
|
|
29833
|
-
return isEmpty$
|
|
29833
|
+
return isEmpty$2((_tile$userRules = tile.userRules) === null || _tile$userRules === void 0 ? void 0 : _tile$userRules.allow) || includes$2(emailAddress, (_tile$userRules2 = tile.userRules) === null || _tile$userRules2 === void 0 ? void 0 : _tile$userRules2.allow);
|
|
29834
29834
|
};
|
|
29835
29835
|
|
|
29836
29836
|
// permissionIds are for selected role only
|
|
29837
|
-
var appFunctionIdAllowed = function appFunctionIdAllowed() {
|
|
29837
|
+
var appFunctionIdAllowed$1 = function appFunctionIdAllowed() {
|
|
29838
29838
|
var _window$toolkitEnv;
|
|
29839
29839
|
var coreAppPermissions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
29840
29840
|
var permissionIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
@@ -29851,62 +29851,62 @@ var appFunctionIdAllowed = function appFunctionIdAllowed() {
|
|
|
29851
29851
|
if (!id) {
|
|
29852
29852
|
return true; // not defined in config so just allow the tile to be viewed for now
|
|
29853
29853
|
} else if (stack === 'g') {
|
|
29854
|
-
return includes$
|
|
29854
|
+
return includes$2(id, permissionIds);
|
|
29855
29855
|
}
|
|
29856
29856
|
// Check appfunction in opsportal-core permissions
|
|
29857
29857
|
else {
|
|
29858
|
-
return !isEmpty$
|
|
29858
|
+
return !isEmpty$2(coreAppPermissions) && !isNil$2(coreAppPermissions.find(function (permission) {
|
|
29859
29859
|
return permission.name === id;
|
|
29860
29860
|
}));
|
|
29861
29861
|
}
|
|
29862
29862
|
};
|
|
29863
|
-
var stackIsAllowed = function stackIsAllowed(stack) {
|
|
29863
|
+
var stackIsAllowed$1 = function stackIsAllowed(stack) {
|
|
29864
29864
|
return stack ? stack === global.STACK : true;
|
|
29865
29865
|
};
|
|
29866
29866
|
|
|
29867
29867
|
// require cas access is a configurable flag per tile
|
|
29868
29868
|
// while hasAccess is defined at the user level determined by me service
|
|
29869
|
-
var casAccessAllowed = function casAccessAllowed(hasCasAccess) {
|
|
29869
|
+
var casAccessAllowed$1 = function casAccessAllowed(hasCasAccess) {
|
|
29870
29870
|
var requireCasAccess = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
29871
29871
|
// this is just a check for usres who are currently logged in
|
|
29872
|
-
if (isNil$
|
|
29872
|
+
if (isNil$2(hasCasAccess)) return true;
|
|
29873
29873
|
return requireCasAccess === false || requireCasAccess && hasCasAccess;
|
|
29874
29874
|
};
|
|
29875
|
-
var getUserData = function getUserData() {
|
|
29875
|
+
var getUserData$1 = function getUserData() {
|
|
29876
29876
|
return {
|
|
29877
|
-
activeYardNumber: storage$
|
|
29878
|
-
securityLevel: storage$
|
|
29879
|
-
emailAddress: storage$
|
|
29880
|
-
permissionIds: storage$
|
|
29881
|
-
allPermissionIds: storage$
|
|
29882
|
-
hasCasAccess: storage$
|
|
29883
|
-
coreAppPermissions: storage$
|
|
29884
|
-
appScopes: storage$
|
|
29877
|
+
activeYardNumber: storage$2.activeYardNumber,
|
|
29878
|
+
securityLevel: storage$2.userSecurityLevel,
|
|
29879
|
+
emailAddress: storage$2.userEmail,
|
|
29880
|
+
permissionIds: storage$2.permissionIds,
|
|
29881
|
+
allPermissionIds: storage$2.allPermissionIds,
|
|
29882
|
+
hasCasAccess: storage$2.hasCasAccess,
|
|
29883
|
+
coreAppPermissions: storage$2.coreAppPermissions,
|
|
29884
|
+
appScopes: storage$2.userAppScopes
|
|
29885
29885
|
};
|
|
29886
29886
|
};
|
|
29887
|
-
var userHasChatBotAccess = function userHasChatBotAccess(appFunction) {
|
|
29887
|
+
var userHasChatBotAccess$1 = function userHasChatBotAccess(appFunction) {
|
|
29888
29888
|
if (!appFunction) return true;
|
|
29889
|
-
var coreAppPermissions = storage$
|
|
29890
|
-
return !isEmpty$
|
|
29889
|
+
var coreAppPermissions = storage$2.coreAppPermissions;
|
|
29890
|
+
return !isEmpty$2(coreAppPermissions) && !isNil$2(coreAppPermissions.find(function (permission) {
|
|
29891
29891
|
return permission.name === appFunction;
|
|
29892
29892
|
}));
|
|
29893
29893
|
};
|
|
29894
|
-
var userHasAccess = function userHasAccess(tile) {
|
|
29895
|
-
var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData();
|
|
29896
|
-
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)]);
|
|
29894
|
+
var userHasAccess$1 = function userHasAccess(tile) {
|
|
29895
|
+
var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData$1();
|
|
29896
|
+
return allAreTruthy$1([stackIsAllowed$1(tile.stack), yardNumberAllowed$1(user.activeYardNumber, tile), securityLevelAllowed$1(user.securityLevel, tile), emailAddressAllowed$1(user.emailAddress, tile), appFunctionIdAllowed$1(user.coreAppPermissions, user.allPermissionIds, user.permissionIds, user.appScopes, tile), casAccessAllowed$1(user.hasCasAccess, tile.requireCasAccess)]);
|
|
29897
29897
|
};
|
|
29898
29898
|
|
|
29899
|
-
var accessHelpers = /*#__PURE__*/Object.freeze({
|
|
29899
|
+
var accessHelpers$1 = /*#__PURE__*/Object.freeze({
|
|
29900
29900
|
__proto__: null,
|
|
29901
|
-
yardNumberAllowed: yardNumberAllowed,
|
|
29902
|
-
securityLevelAllowed: securityLevelAllowed,
|
|
29903
|
-
emailAddressAllowed: emailAddressAllowed,
|
|
29904
|
-
appFunctionIdAllowed: appFunctionIdAllowed,
|
|
29905
|
-
stackIsAllowed: stackIsAllowed,
|
|
29906
|
-
casAccessAllowed: casAccessAllowed,
|
|
29907
|
-
userHasChatBotAccess: userHasChatBotAccess,
|
|
29908
|
-
userHasAccess: userHasAccess,
|
|
29909
|
-
'default': userHasAccess
|
|
29901
|
+
yardNumberAllowed: yardNumberAllowed$1,
|
|
29902
|
+
securityLevelAllowed: securityLevelAllowed$1,
|
|
29903
|
+
emailAddressAllowed: emailAddressAllowed$1,
|
|
29904
|
+
appFunctionIdAllowed: appFunctionIdAllowed$1,
|
|
29905
|
+
stackIsAllowed: stackIsAllowed$1,
|
|
29906
|
+
casAccessAllowed: casAccessAllowed$1,
|
|
29907
|
+
userHasChatBotAccess: userHasChatBotAccess$1,
|
|
29908
|
+
userHasAccess: userHasAccess$1,
|
|
29909
|
+
'default': userHasAccess$1
|
|
29910
29910
|
});
|
|
29911
29911
|
|
|
29912
29912
|
var css_248z$5 = ".utilities_ops-app-frame_AppBar_AppBar--AppBar {\r\n background: var(--primaryBlue);\r\n background: var(--primaryBlue);\r\n color: var(--white);\r\n color: var(--white);\r\n height: 64px;\r\n width: 100vw;\r\n padding: 0 20px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n}\r\n\r\n.__AppBar-item.__AppBar-phoneUnvailable > div, .__AppBar-item.__AppBar-phoneAvailable > div {\r\n margin-bottom: 2px;\r\n}\r\n\r\nbutton[name='Clear Cookies'] {\r\n font-size: 12px;\r\n opacity: 0.5;\r\n text-transform: uppercase;\r\n color: #f00;\r\n font-weight: 700;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBar_AppBar--left {\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBar_AppBar--right {\r\n display: flex;\r\n align-items: center;\r\n}\r\n";
|
|
@@ -29918,11 +29918,11 @@ var APP_BAR_CONFIGS = {
|
|
|
29918
29918
|
uk: ['flag', 'role', 'yard', 'phone']
|
|
29919
29919
|
};
|
|
29920
29920
|
|
|
29921
|
-
var coreAppConfig = storage$
|
|
29921
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29922
29922
|
var notificationsSource = pathOr$1([], ['notificationsSource'])(coreAppConfig);
|
|
29923
29923
|
var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures;
|
|
29924
29924
|
var getIdeaNoteEnabledStatus = function getIdeaNoteEnabledStatus(tileData) {
|
|
29925
|
-
var coreAppConfig = storage$
|
|
29925
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
29926
29926
|
if (isCoreRoute || coreAppConfig.enableIdeaNoteGlobally) {
|
|
29927
29927
|
return coreAppConfig.enableIdeaNote;
|
|
29928
29928
|
} else {
|
|
@@ -29970,7 +29970,7 @@ var getAvailableStatusFromStatuses = function getAvailableStatusFromStatuses(sta
|
|
|
29970
29970
|
var CountryFlag = function CountryFlag() {
|
|
29971
29971
|
var _storage$activeCountr;
|
|
29972
29972
|
return /*#__PURE__*/React__default["default"].createElement(Flag, {
|
|
29973
|
-
countryCode: (_storage$activeCountr = storage$
|
|
29973
|
+
countryCode: (_storage$activeCountr = storage$2.activeCountry) === null || _storage$activeCountr === void 0 ? void 0 : _storage$activeCountr.toLowerCase()
|
|
29974
29974
|
});
|
|
29975
29975
|
};
|
|
29976
29976
|
var AppBar = function AppBar(_ref) {
|
|
@@ -29985,7 +29985,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
29985
29985
|
searchComponent = _ref.searchComponent,
|
|
29986
29986
|
showNavIconInHeader = _ref.showNavIconInHeader,
|
|
29987
29987
|
setIsNavBarOpen = _ref.setIsNavBarOpen;
|
|
29988
|
-
SETTINGS_ITEMS[0].name = storage$
|
|
29988
|
+
SETTINGS_ITEMS[0].name = storage$2.userName;
|
|
29989
29989
|
|
|
29990
29990
|
// Escape hatch for forceUpdate function
|
|
29991
29991
|
var _useReducer = React.useReducer(function (x) {
|
|
@@ -30049,11 +30049,11 @@ var AppBar = function AppBar(_ref) {
|
|
|
30049
30049
|
while (1) switch (_context.p = _context.n) {
|
|
30050
30050
|
case 0:
|
|
30051
30051
|
_context.p = 0;
|
|
30052
|
-
url = (_storage$getLocalItem = storage$
|
|
30052
|
+
url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpCss;
|
|
30053
30053
|
_context.n = 1;
|
|
30054
30054
|
return axios.get(url, {
|
|
30055
30055
|
headers: {
|
|
30056
|
-
Authorization: storage$
|
|
30056
|
+
Authorization: storage$2.accessToken
|
|
30057
30057
|
}
|
|
30058
30058
|
});
|
|
30059
30059
|
case 1:
|
|
@@ -30093,13 +30093,13 @@ var AppBar = function AppBar(_ref) {
|
|
|
30093
30093
|
while (1) switch (_context2.p = _context2.n) {
|
|
30094
30094
|
case 0:
|
|
30095
30095
|
_context2.p = 0;
|
|
30096
|
-
country = storage$
|
|
30096
|
+
country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
30097
30097
|
app = mihelpAppPath || 'g2-portal';
|
|
30098
|
-
url = (_storage$getLocalItem2 = storage$
|
|
30098
|
+
url = (_storage$getLocalItem2 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.getMihelpLatestRelease;
|
|
30099
30099
|
_context2.n = 1;
|
|
30100
30100
|
return axios.get("".concat(url, "?app=").concat(app, "&country=").concat(country), {
|
|
30101
30101
|
headers: {
|
|
30102
|
-
Authorization: storage$
|
|
30102
|
+
Authorization: storage$2.accessToken
|
|
30103
30103
|
}
|
|
30104
30104
|
});
|
|
30105
30105
|
case 1:
|
|
@@ -30108,7 +30108,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30108
30108
|
_context2.n = 6;
|
|
30109
30109
|
break;
|
|
30110
30110
|
}
|
|
30111
|
-
latestReleaseFromStorage = storage$
|
|
30111
|
+
latestReleaseFromStorage = storage$2.getLocalItem("".concat(app, ":latestRelease"));
|
|
30112
30112
|
hasLatestReleaseInStorage = Boolean(((_latestReleaseFromSto = latestReleaseFromStorage) === null || _latestReleaseFromSto === void 0 ? void 0 : (_latestReleaseFromSto2 = _latestReleaseFromSto.release) === null || _latestReleaseFromSto2 === void 0 ? void 0 : _latestReleaseFromSto2.id) && ((_latestReleaseFromSto3 = latestReleaseFromStorage) === null || _latestReleaseFromSto3 === void 0 ? void 0 : _latestReleaseFromSto3.viewedDate));
|
|
30113
30113
|
if (hasLatestReleaseInStorage) {
|
|
30114
30114
|
_context2.n = 5;
|
|
@@ -30116,13 +30116,13 @@ var AppBar = function AppBar(_ref) {
|
|
|
30116
30116
|
}
|
|
30117
30117
|
_context2.p = 2;
|
|
30118
30118
|
_context2.n = 3;
|
|
30119
|
-
return fetcher.getUserPreferences("".concat(app, "-latestRelease"), country);
|
|
30119
|
+
return fetcher$1.getUserPreferences("".concat(app, "-latestRelease"), country);
|
|
30120
30120
|
case 3:
|
|
30121
30121
|
latestReleaseFromPreferences = _context2.v;
|
|
30122
30122
|
hasLatestReleaseInPreferences = Boolean((latestReleaseFromPreferences === null || latestReleaseFromPreferences === void 0 ? void 0 : (_latestReleaseFromPre = latestReleaseFromPreferences.release) === null || _latestReleaseFromPre === void 0 ? void 0 : _latestReleaseFromPre.id) && (latestReleaseFromPreferences === null || latestReleaseFromPreferences === void 0 ? void 0 : latestReleaseFromPreferences.viewedDate));
|
|
30123
30123
|
if (hasLatestReleaseInPreferences) {
|
|
30124
30124
|
latestReleaseFromStorage = latestReleaseFromPreferences;
|
|
30125
|
-
storage$
|
|
30125
|
+
storage$2.setLocalItem("".concat(app, ":latestRelease"), latestReleaseFromStorage);
|
|
30126
30126
|
}
|
|
30127
30127
|
_context2.n = 5;
|
|
30128
30128
|
break;
|
|
@@ -30169,8 +30169,8 @@ var AppBar = function AppBar(_ref) {
|
|
|
30169
30169
|
viewedDate: new Date()
|
|
30170
30170
|
};
|
|
30171
30171
|
app = mihelpAppPath || 'g2-portal';
|
|
30172
|
-
countryA3code = storage$
|
|
30173
|
-
storage$
|
|
30172
|
+
countryA3code = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
30173
|
+
storage$2.setLocalItem("".concat(app, ":latestRelease"), releasedata);
|
|
30174
30174
|
setLatestRelease(null);
|
|
30175
30175
|
setShowMihelpTooltip(true);
|
|
30176
30176
|
setTimeout(function () {
|
|
@@ -30178,7 +30178,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30178
30178
|
}, 5000);
|
|
30179
30179
|
_context3.p = 1;
|
|
30180
30180
|
_context3.n = 2;
|
|
30181
|
-
return fetcher.setUserPreferences("".concat(app, "-latestRelease"), releasedata, countryA3code);
|
|
30181
|
+
return fetcher$1.setUserPreferences("".concat(app, "-latestRelease"), releasedata, countryA3code);
|
|
30182
30182
|
case 2:
|
|
30183
30183
|
_context3.n = 4;
|
|
30184
30184
|
break;
|
|
@@ -30223,18 +30223,18 @@ var AppBar = function AppBar(_ref) {
|
|
|
30223
30223
|
});
|
|
30224
30224
|
}
|
|
30225
30225
|
});
|
|
30226
|
-
return storage$
|
|
30226
|
+
return storage$2.logout();
|
|
30227
30227
|
}
|
|
30228
30228
|
};
|
|
30229
30229
|
var isIdeaNoteEnabled = getIdeaNoteEnabledStatus(tileData);
|
|
30230
30230
|
var handleHelpClick = function handleHelpClick() {
|
|
30231
|
-
var country = storage$
|
|
30231
|
+
var country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
30232
30232
|
var uri = mihelpAppPath ? "".concat(coreAppConfig.mihelpUri, "/applications/").concat(mihelpAppPath, "?re=").concat(country.toLowerCase()) : "".concat(coreAppConfig.mihelpUri, "?re=").concat(country.toLowerCase());
|
|
30233
30233
|
window.open(uri, '_blank');
|
|
30234
30234
|
};
|
|
30235
30235
|
var feedbackConfig = function feedbackConfig() {
|
|
30236
30236
|
var _storage$coreConfig;
|
|
30237
|
-
return (_storage$coreConfig = storage$
|
|
30237
|
+
return (_storage$coreConfig = storage$2.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.feedbackDialog;
|
|
30238
30238
|
};
|
|
30239
30239
|
var navigateTo = function navigateTo(where) {
|
|
30240
30240
|
return function () {
|
|
@@ -30384,7 +30384,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30384
30384
|
});
|
|
30385
30385
|
setListOfAllNotifications(updatedListOfAllNotifications);
|
|
30386
30386
|
};
|
|
30387
|
-
var selectedYard = (_storage$getSessionIt = storage$
|
|
30387
|
+
var selectedYard = (_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
30388
30388
|
var handleUserStatusUpdate = /*#__PURE__*/function () {
|
|
30389
30389
|
var _ref5 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4(statusValue) {
|
|
30390
30390
|
var previousStatus, updatedStatus, _t5;
|
|
@@ -30393,14 +30393,14 @@ var AppBar = function AppBar(_ref) {
|
|
|
30393
30393
|
case 0:
|
|
30394
30394
|
previousStatus = currentUserStatus;
|
|
30395
30395
|
setCurrentUserStatus(statusValue);
|
|
30396
|
-
storage$
|
|
30396
|
+
storage$2.setLocalItem('dashboard', statusValue, 'userAvailability');
|
|
30397
30397
|
_context4.p = 1;
|
|
30398
30398
|
_context4.n = 2;
|
|
30399
30399
|
return updateUserStatus(statusValue);
|
|
30400
30400
|
case 2:
|
|
30401
30401
|
updatedStatus = _context4.v;
|
|
30402
30402
|
setCurrentUserStatus(updatedStatus);
|
|
30403
|
-
storage$
|
|
30403
|
+
storage$2.setLocalItem('dashboard', updatedStatus, 'userAvailability');
|
|
30404
30404
|
_context4.n = 4;
|
|
30405
30405
|
break;
|
|
30406
30406
|
case 3:
|
|
@@ -30409,7 +30409,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30409
30409
|
console.error('Failed to update user status:', _t5);
|
|
30410
30410
|
showError('Failed to update user status.');
|
|
30411
30411
|
setCurrentUserStatus(previousStatus);
|
|
30412
|
-
storage$
|
|
30412
|
+
storage$2.setLocalItem('dashboard', previousStatus, 'userAvailability');
|
|
30413
30413
|
case 4:
|
|
30414
30414
|
return _context4.a(2);
|
|
30415
30415
|
}
|
|
@@ -30421,7 +30421,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30421
30421
|
}();
|
|
30422
30422
|
var updateUserStatusFromWebSocket = function updateUserStatusFromWebSocket(newStatus) {
|
|
30423
30423
|
setCurrentUserStatus(newStatus);
|
|
30424
|
-
storage$
|
|
30424
|
+
storage$2.setLocalItem('dashboard', newStatus, 'userAvailability');
|
|
30425
30425
|
};
|
|
30426
30426
|
React.useEffect(function () {
|
|
30427
30427
|
if (isSystemMarkedOffline(currentUserStatus) && !isUserStatusHidden()) {
|
|
@@ -30522,7 +30522,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30522
30522
|
});
|
|
30523
30523
|
var tileConfigAccess = true;
|
|
30524
30524
|
if (currentTile) {
|
|
30525
|
-
tileConfigAccess = userHasAccess(currentTile);
|
|
30525
|
+
tileConfigAccess = userHasAccess$1(currentTile);
|
|
30526
30526
|
}
|
|
30527
30527
|
if (history.location.pathname !== '/logout' && history.location.pathname !== '/login' && localStorage.getItem('login') && tileConfigAccess) {
|
|
30528
30528
|
if (notificationsSource.includes('Nchan')) {
|
|
@@ -30593,14 +30593,14 @@ var AppBar = function AppBar(_ref) {
|
|
|
30593
30593
|
break;
|
|
30594
30594
|
}
|
|
30595
30595
|
setCurrentUserStatus(finalStatus);
|
|
30596
|
-
storage$
|
|
30596
|
+
storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
30597
30597
|
_context5.p = 4;
|
|
30598
30598
|
_context5.n = 5;
|
|
30599
30599
|
return updateUserStatus(finalStatus);
|
|
30600
30600
|
case 5:
|
|
30601
30601
|
updatedStatus = _context5.v;
|
|
30602
30602
|
setCurrentUserStatus(updatedStatus);
|
|
30603
|
-
storage$
|
|
30603
|
+
storage$2.setLocalItem('dashboard', updatedStatus, 'userAvailability');
|
|
30604
30604
|
_context5.n = 7;
|
|
30605
30605
|
break;
|
|
30606
30606
|
case 6:
|
|
@@ -30613,7 +30613,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30613
30613
|
break;
|
|
30614
30614
|
case 8:
|
|
30615
30615
|
setCurrentUserStatus(finalStatus);
|
|
30616
|
-
storage$
|
|
30616
|
+
storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
30617
30617
|
case 9:
|
|
30618
30618
|
_context5.n = 11;
|
|
30619
30619
|
break;
|
|
@@ -30681,7 +30681,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
30681
30681
|
var MIN_INTERACTION_MS = 10000;
|
|
30682
30682
|
var heartBeatIntervalMs = Math.max((parseInt(coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.heartBeatInterval, 10) || 30) * 1000, MIN_HEARTBEAT_MS);
|
|
30683
30683
|
var userInteractionIntervalMs = Math.max((parseInt(coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.userInteractionInterval, 10) || 60) * 1000, MIN_INTERACTION_MS);
|
|
30684
|
-
var userKey = storage$
|
|
30684
|
+
var userKey = storage$2.userEmail || '';
|
|
30685
30685
|
var updateLastInteractionTime = function updateLastInteractionTime() {
|
|
30686
30686
|
recordUserInteraction(userKey);
|
|
30687
30687
|
};
|
|
@@ -30720,8 +30720,8 @@ var AppBar = function AppBar(_ref) {
|
|
|
30720
30720
|
var STACK = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.STACK ? window.toolkitEnv.STACK : process.env.STACK;
|
|
30721
30721
|
STACK = STACK || 'c';
|
|
30722
30722
|
var modifiedSettings = SETTINGS_ITEMS;
|
|
30723
|
-
modifiedSettings[0]['name'] = storage$
|
|
30724
|
-
var _storage$chromePlugin = storage$
|
|
30723
|
+
modifiedSettings[0]['name'] = storage$2.userName;
|
|
30724
|
+
var _storage$chromePlugin = storage$2.chromePluginData.ringcentral,
|
|
30725
30725
|
ringcentral = _storage$chromePlugin === void 0 ? {
|
|
30726
30726
|
phoneStatus: '',
|
|
30727
30727
|
phoneStatusProcessing: false
|
|
@@ -30736,25 +30736,25 @@ var AppBar = function AppBar(_ref) {
|
|
|
30736
30736
|
setNotificationHeightFlag: setNotificationHeightFlag
|
|
30737
30737
|
}), /*#__PURE__*/React__default["default"].createElement(AppBar$1, {
|
|
30738
30738
|
moduleName: "OPS PORTAL",
|
|
30739
|
-
isLoggedOn: storage$
|
|
30739
|
+
isLoggedOn: storage$2.isAuthenticated,
|
|
30740
30740
|
config: APP_BAR_CONFIGS[STACK],
|
|
30741
|
-
role: storage$
|
|
30741
|
+
role: storage$2.userRole,
|
|
30742
30742
|
navigateTo: navigateTo,
|
|
30743
|
-
phoneNumber: storage$
|
|
30744
|
-
userEmail: storage$
|
|
30745
|
-
language: storage$
|
|
30743
|
+
phoneNumber: storage$2.phoneNumber,
|
|
30744
|
+
userEmail: storage$2.userEmail,
|
|
30745
|
+
language: storage$2.activeLanguage,
|
|
30746
30746
|
showSearchBar: false,
|
|
30747
|
-
homeYard: (_storage$getSessionIt2 = storage$
|
|
30747
|
+
homeYard: (_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.homeYard,
|
|
30748
30748
|
logoutItems: modifiedSettings,
|
|
30749
|
-
countryCode: storage$
|
|
30750
|
-
yardNumber: storage$
|
|
30749
|
+
countryCode: storage$2.activeCountry,
|
|
30750
|
+
yardNumber: storage$2.activeYardNumber,
|
|
30751
30751
|
onRenderFlag: CountryFlag,
|
|
30752
30752
|
onLogoutItemClicked: handleSettingsItemClick,
|
|
30753
30753
|
handleHelpClick: handleHelpClick,
|
|
30754
30754
|
isMihelpEnabled: isMihelpEnabled,
|
|
30755
30755
|
isIdeaNoteEnabled: isIdeaNoteEnabled,
|
|
30756
|
-
sendFeedback: fetcher.sendFeedback,
|
|
30757
|
-
getInnovationHubToken: fetcher.getInnovationHubToken,
|
|
30756
|
+
sendFeedback: fetcher$1.sendFeedback,
|
|
30757
|
+
getInnovationHubToken: fetcher$1.getInnovationHubToken,
|
|
30758
30758
|
feedbackConfig: feedbackConfig(),
|
|
30759
30759
|
stack: STACK,
|
|
30760
30760
|
phoneStatusObject: ringcentral,
|
|
@@ -30852,10 +30852,10 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
30852
30852
|
case 1:
|
|
30853
30853
|
// If user is NOT authenticated and route is not login/logout, always deny
|
|
30854
30854
|
// and re-route to "/login".
|
|
30855
|
-
if (!storage$
|
|
30856
|
-
if (isLogoutRoute) storage$
|
|
30855
|
+
if (!storage$2.isAuthenticated) {
|
|
30856
|
+
if (isLogoutRoute) storage$2.clear();
|
|
30857
30857
|
// Store current URL to redirect to after login
|
|
30858
|
-
storage$
|
|
30858
|
+
storage$2.setSessionItem('redirectUrl', window.location.href);
|
|
30859
30859
|
this.denyAccess(FAILED_AUTHENTICATION_CHECK_REASON);
|
|
30860
30860
|
window.location.assign('/login');
|
|
30861
30861
|
}
|
|
@@ -30881,7 +30881,7 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
30881
30881
|
return _context.a(2, this.allowAccess(PASS_BECAUSE_RESTRICTIONS_DISABLED));
|
|
30882
30882
|
case 3:
|
|
30883
30883
|
_context.n = 4;
|
|
30884
|
-
return fetcher.getAppTileData();
|
|
30884
|
+
return fetcher$1.getAppTileData();
|
|
30885
30885
|
case 4:
|
|
30886
30886
|
appTile = _context.v;
|
|
30887
30887
|
if (appTile) {
|
|
@@ -30894,7 +30894,7 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
30894
30894
|
break;
|
|
30895
30895
|
}
|
|
30896
30896
|
_context.n = 5;
|
|
30897
|
-
return fetcher.getPermissions(appAuthName);
|
|
30897
|
+
return fetcher$1.getPermissions(appAuthName);
|
|
30898
30898
|
case 5:
|
|
30899
30899
|
return _context.a(2, this.allowAccess(PATH_NOT_FOUND));
|
|
30900
30900
|
case 6:
|
|
@@ -30909,17 +30909,17 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
30909
30909
|
break;
|
|
30910
30910
|
}
|
|
30911
30911
|
_context.n = 7;
|
|
30912
|
-
return fetcher.getCoreAppPermissions();
|
|
30912
|
+
return fetcher$1.getCoreAppPermissions();
|
|
30913
30913
|
case 7:
|
|
30914
30914
|
if (!appTile.appAuthName) {
|
|
30915
30915
|
_context.n = 8;
|
|
30916
30916
|
break;
|
|
30917
30917
|
}
|
|
30918
30918
|
_context.n = 8;
|
|
30919
|
-
return fetcher.getPermissions(appTile.appAuthName, appTile.useAppScopes);
|
|
30919
|
+
return fetcher$1.getPermissions(appTile.appAuthName, appTile.useAppScopes);
|
|
30920
30920
|
case 8:
|
|
30921
30921
|
// If there are rules, evaluate and act accordingly.
|
|
30922
|
-
tileConfigAccess = userHasAccess(appTile);
|
|
30922
|
+
tileConfigAccess = userHasAccess$1(appTile);
|
|
30923
30923
|
if (tileConfigAccess) {
|
|
30924
30924
|
this.allowAccess('Tile restrictions passed.');
|
|
30925
30925
|
} else {
|
|
@@ -52410,12 +52410,12 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52410
52410
|
}
|
|
52411
52411
|
};
|
|
52412
52412
|
React.useEffect(function () {
|
|
52413
|
-
var conversationsFromSession = storage$
|
|
52414
|
-
var conversationsToBeSaved = !isEmpty$
|
|
52413
|
+
var conversationsFromSession = storage$2.getLocalItem('mihelpAgentConversations');
|
|
52414
|
+
var conversationsToBeSaved = !isEmpty$2(conversationsFromSession) ? conversationsFromSession : [];
|
|
52415
52415
|
setConversations(conversationsToBeSaved);
|
|
52416
|
-
var feedbacksFromSession = storage$
|
|
52417
|
-
var lastSentApp = storage$
|
|
52418
|
-
var feedbacksToBeSaved = !isEmpty$
|
|
52416
|
+
var feedbacksFromSession = storage$2.getLocalItem('mihelpAgentFeedbacks');
|
|
52417
|
+
var lastSentApp = storage$2.getLocalItem('mihelpAgentLastSentApp');
|
|
52418
|
+
var feedbacksToBeSaved = !isEmpty$2(feedbacksFromSession) ? feedbacksFromSession : {};
|
|
52419
52419
|
setFeedbacks(feedbacksToBeSaved);
|
|
52420
52420
|
setLastSentFromApp(lastSentApp);
|
|
52421
52421
|
if (conversationsToBeSaved.length) {
|
|
@@ -52438,7 +52438,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52438
52438
|
var handleStorageChange = function handleStorageChange(event) {
|
|
52439
52439
|
if (event.key === 'mihelpAgentConversations') {
|
|
52440
52440
|
var conversationsFromSession = JSON.parse(event.newValue);
|
|
52441
|
-
var conversationsToBeSaved = !isEmpty$
|
|
52441
|
+
var conversationsToBeSaved = !isEmpty$2(conversationsFromSession) ? conversationsFromSession : [];
|
|
52442
52442
|
setConversations(conversationsToBeSaved);
|
|
52443
52443
|
if (conversationsToBeSaved.length) {
|
|
52444
52444
|
saveCurrentContext(conversationsToBeSaved);
|
|
@@ -52448,7 +52448,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52448
52448
|
}
|
|
52449
52449
|
if (event.key === 'mihelpAgentFeedbacks') {
|
|
52450
52450
|
var feedbacksFromSession = JSON.parse(event.newValue);
|
|
52451
|
-
var feedbacksToBeSaved = !isEmpty$
|
|
52451
|
+
var feedbacksToBeSaved = !isEmpty$2(feedbacksFromSession) ? feedbacksFromSession : {};
|
|
52452
52452
|
setFeedbacks(feedbacksToBeSaved);
|
|
52453
52453
|
}
|
|
52454
52454
|
if (event.key === 'mihelpAgentLastSentApp') {
|
|
@@ -52472,8 +52472,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52472
52472
|
var getSystemPrompt = function getSystemPrompt(prompt) {
|
|
52473
52473
|
var context = {};
|
|
52474
52474
|
try {
|
|
52475
|
-
if (storage$
|
|
52476
|
-
context = storage$
|
|
52475
|
+
if (storage$2.appContext) {
|
|
52476
|
+
context = storage$2.appContext;
|
|
52477
52477
|
}
|
|
52478
52478
|
} catch (e) {
|
|
52479
52479
|
console.log('App context error');
|
|
@@ -52501,7 +52501,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52501
52501
|
_context.p = 1;
|
|
52502
52502
|
newMessages = _toConsumableArray(sanitizeMessages(messages));
|
|
52503
52503
|
isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
52504
|
-
appTiles = storage$
|
|
52504
|
+
appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
|
|
52505
52505
|
appName = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
52506
52506
|
appData = appTiles.find(function (tile) {
|
|
52507
52507
|
if (tile.appName) {
|
|
@@ -52528,11 +52528,11 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52528
52528
|
content: getSystemPrompt(systemPrompt)
|
|
52529
52529
|
});
|
|
52530
52530
|
}
|
|
52531
|
-
if (storage$
|
|
52532
|
-
setCurrentContext(storage$
|
|
52531
|
+
if (storage$2.appContext) {
|
|
52532
|
+
setCurrentContext(storage$2.appContext);
|
|
52533
52533
|
}
|
|
52534
|
-
} else if (!equals$1(currentContext, storage$
|
|
52535
|
-
setCurrentContext(storage$
|
|
52534
|
+
} else if (!equals$1(currentContext, storage$2.appContext) || lastSentFromApp !== currentAppName) {
|
|
52535
|
+
setCurrentContext(storage$2.appContext);
|
|
52536
52536
|
newMessages.splice(newMessages.length - 1, 0, {
|
|
52537
52537
|
role: 'system',
|
|
52538
52538
|
content: getSystemPrompt(systemPrompt)
|
|
@@ -52558,11 +52558,11 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52558
52558
|
app_name: currentAppName,
|
|
52559
52559
|
k: contextChunks,
|
|
52560
52560
|
top_n: contextTopMessagesCount,
|
|
52561
|
-
user_email: storage$
|
|
52561
|
+
user_email: storage$2.userEmail
|
|
52562
52562
|
};
|
|
52563
|
-
endpoint = (_storage$getLocalItem = storage$
|
|
52563
|
+
endpoint = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.mihelpChat;
|
|
52564
52564
|
_context.n = 2;
|
|
52565
|
-
return fetcher.post(endpoint, payload, {
|
|
52565
|
+
return fetcher$1.post(endpoint, payload, {
|
|
52566
52566
|
headers: {
|
|
52567
52567
|
'Content-Type': 'application/json'
|
|
52568
52568
|
}
|
|
@@ -52578,8 +52578,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52578
52578
|
id: nonSecure()
|
|
52579
52579
|
}]);
|
|
52580
52580
|
setConversations(newConversations);
|
|
52581
|
-
storage$
|
|
52582
|
-
storage$
|
|
52581
|
+
storage$2.setLocalItem('mihelpAgentConversations', newConversations);
|
|
52582
|
+
storage$2.setLocalItem('mihelpAgentLastSentApp', currentAppName);
|
|
52583
52583
|
_context.n = 5;
|
|
52584
52584
|
break;
|
|
52585
52585
|
case 3:
|
|
@@ -52668,9 +52668,9 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52668
52668
|
}, [quickReplies]);
|
|
52669
52669
|
var handleNewConversation = function handleNewConversation() {
|
|
52670
52670
|
setConversations([]);
|
|
52671
|
-
storage$
|
|
52672
|
-
storage$
|
|
52673
|
-
storage$
|
|
52671
|
+
storage$2.setLocalItem('mihelpAgentConversations', []);
|
|
52672
|
+
storage$2.setLocalItem('mihelpAgentFeedbacks', {});
|
|
52673
|
+
storage$2.setLocalItem('mihelpAgentLastSentApp', '');
|
|
52674
52674
|
setMessageError(false);
|
|
52675
52675
|
setCurrentContext(null);
|
|
52676
52676
|
};
|
|
@@ -52760,7 +52760,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52760
52760
|
payload = {
|
|
52761
52761
|
feedback: feedback
|
|
52762
52762
|
};
|
|
52763
|
-
feedbackEndpoint = (_storage$getLocalItem3 = storage$
|
|
52763
|
+
feedbackEndpoint = (_storage$getLocalItem3 = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem3 === void 0 ? void 0 : (_storage$getLocalItem4 = _storage$getLocalItem3.endpoints) === null || _storage$getLocalItem4 === void 0 ? void 0 : _storage$getLocalItem4.mihelpChatFeedback;
|
|
52764
52764
|
if (feedbackEndpoint) {
|
|
52765
52765
|
_context3.n = 1;
|
|
52766
52766
|
break;
|
|
@@ -52773,7 +52773,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52773
52773
|
setIsFeedbackLoading(true);
|
|
52774
52774
|
_context3.p = 2;
|
|
52775
52775
|
_context3.n = 3;
|
|
52776
|
-
return fetcher.put(endpoint, payload, {
|
|
52776
|
+
return fetcher$1.put(endpoint, payload, {
|
|
52777
52777
|
headers: {
|
|
52778
52778
|
'Content-Type': 'application/json'
|
|
52779
52779
|
}
|
|
@@ -52785,7 +52785,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52785
52785
|
}) : conversation;
|
|
52786
52786
|
});
|
|
52787
52787
|
setConversations(newConversations);
|
|
52788
|
-
storage$
|
|
52788
|
+
storage$2.setLocalItem('mihelpAgentConversations', newConversations);
|
|
52789
52789
|
_context3.n = 5;
|
|
52790
52790
|
break;
|
|
52791
52791
|
case 4:
|
|
@@ -52844,9 +52844,9 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52844
52844
|
chat_history: chatHistoryWithoutSystemPrompts,
|
|
52845
52845
|
retrieved_documents: Currentconversation === null || Currentconversation === void 0 ? void 0 : Currentconversation.retrievedDocuments,
|
|
52846
52846
|
timestamp: new Date().toISOString(),
|
|
52847
|
-
user_email: storage$
|
|
52847
|
+
user_email: storage$2.userEmail
|
|
52848
52848
|
};
|
|
52849
|
-
endpoint = (_storage$getLocalItem5 = storage$
|
|
52849
|
+
endpoint = (_storage$getLocalItem5 = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem5 === void 0 ? void 0 : (_storage$getLocalItem6 = _storage$getLocalItem5.endpoints) === null || _storage$getLocalItem6 === void 0 ? void 0 : _storage$getLocalItem6.mihelpChatFeedback;
|
|
52850
52850
|
if (endpoint) {
|
|
52851
52851
|
_context4.n = 3;
|
|
52852
52852
|
break;
|
|
@@ -52858,7 +52858,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52858
52858
|
setIsFeedbackLoading(true);
|
|
52859
52859
|
_context4.p = 4;
|
|
52860
52860
|
_context4.n = 5;
|
|
52861
|
-
return fetcher.post(endpoint, payload, {
|
|
52861
|
+
return fetcher$1.post(endpoint, payload, {
|
|
52862
52862
|
headers: {
|
|
52863
52863
|
'Content-Type': 'application/json'
|
|
52864
52864
|
}
|
|
@@ -52875,8 +52875,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
52875
52875
|
newFeedbacks = _objectSpread2(_objectSpread2({}, feedbacks), {}, _defineProperty$2({}, Currentconversation === null || Currentconversation === void 0 ? void 0 : Currentconversation.id, chatHistoryWithoutSystemPrompts));
|
|
52876
52876
|
setFeedbacks(newFeedbacks);
|
|
52877
52877
|
setConversations(newConversations);
|
|
52878
|
-
storage$
|
|
52879
|
-
storage$
|
|
52878
|
+
storage$2.setLocalItem('mihelpAgentConversations', newConversations);
|
|
52879
|
+
storage$2.setLocalItem('mihelpAgentFeedbacks', newFeedbacks);
|
|
52880
52880
|
_context4.n = 7;
|
|
52881
52881
|
break;
|
|
52882
52882
|
case 6:
|
|
@@ -63546,7 +63546,7 @@ var velocityReact = {
|
|
|
63546
63546
|
|
|
63547
63547
|
var unitlist = ["", "K", "M", "T"];
|
|
63548
63548
|
var formatNumber = function formatNumber(number) {
|
|
63549
|
-
if (isNil$
|
|
63549
|
+
if (isNil$2(number)) return '';
|
|
63550
63550
|
var sign = Math.sign(number);
|
|
63551
63551
|
var unit = 0;
|
|
63552
63552
|
while (Math.abs(number) > 1000) {
|
|
@@ -63832,7 +63832,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
|
|
|
63832
63832
|
var reloadCounts = function reloadCounts(menuItemName, setCountsLoading) {
|
|
63833
63833
|
getCounts(menuItemName).then(function (result) {
|
|
63834
63834
|
setCounts(result);
|
|
63835
|
-
setWithCounts(!isEmpty$
|
|
63835
|
+
setWithCounts(!isEmpty$2(result));
|
|
63836
63836
|
if (setCountsLoading) setCountsLoading(false);
|
|
63837
63837
|
}).catch(function () {
|
|
63838
63838
|
if (setCountsLoading) setCountsLoading(false);
|
|
@@ -64385,7 +64385,7 @@ var NavigationMenuLevel3 = function NavigationMenuLevel3(_ref6) {
|
|
|
64385
64385
|
className: "utilities_ops-app-frame_NavigationBar_NavigationBar--expandButton"
|
|
64386
64386
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
64387
64387
|
name: isMenuExpanded ? 'chevron-up' : 'chevron-down'
|
|
64388
|
-
})), (countsLoading || !isNil$
|
|
64388
|
+
})), (countsLoading || !isNil$2(countText)) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
64389
64389
|
className: "utilities_ops-app-frame_NavigationBar_NavigationBar--NavItemCount"
|
|
64390
64390
|
}, countsLoading ? /*#__PURE__*/React__default["default"].createElement(coreComponents.Spinner, {
|
|
64391
64391
|
size: "xxs"
|
|
@@ -64395,9 +64395,9 @@ var NavigationMenuLevel3 = function NavigationMenuLevel3(_ref6) {
|
|
|
64395
64395
|
var css_248z$1 = ".utilities_ops-app-frame_AppFrame_AppFrame--AppFrame {\r\n background: var(--paleGray);\r\n background: var(--paleGray);\r\n height: 100vh;\r\n max-height: 100vh;\r\n height: 100dvh;\r\n max-height: 100dvh;\r\n display: flex;\r\n flex-direction: column;\r\n flex-basis: 0;\r\n /* padding-top: env(safe-area-inset-top, 0px); */\r\n /* position: sticky;\r\n top: 0; */\r\n}\r\n\r\n.utilities_ops-app-frame_AppFrame_AppFrame--header {\r\n flex: 0 1 auto;\r\n display: flex;\r\n flex-direction: column;\r\n /* padding-top: env(safe-area-inset-top, 0px); */\r\n /* position: sticky;\r\n top: 0; */\r\n}\r\n\r\n/* Wrapper that contains the app being developed. */\r\n\r\n.utilities_ops-app-frame_AppFrame_AppFrame--AppContainer {\r\n flex: 1 1 auto;\r\n position: relative;\r\n min-height: 0;\r\n}\r\n";
|
|
64396
64396
|
styleInject(css_248z$1);
|
|
64397
64397
|
|
|
64398
|
-
if (!storage$
|
|
64399
|
-
var lastSelectedYard = storage$
|
|
64400
|
-
var dashboardLocalItem = storage$
|
|
64398
|
+
if (!storage$2.activeYardNumber) {
|
|
64399
|
+
var lastSelectedYard = storage$2.getLocalItem('lastSelectedYard');
|
|
64400
|
+
var dashboardLocalItem = storage$2.getLocalItem('dashboard');
|
|
64401
64401
|
var dashboardSessionItem = {};
|
|
64402
64402
|
if (!equals$1(lastSelectedYard, {})) {
|
|
64403
64403
|
dashboardSessionItem = {
|
|
@@ -64453,28 +64453,28 @@ var AppFrame = function AppFrame(props) {
|
|
|
64453
64453
|
isNavBarOpen = _useState10[0],
|
|
64454
64454
|
setIsNavBarOpen = _useState10[1];
|
|
64455
64455
|
var setChatBotEnableStatus = function setChatBotEnableStatus() {
|
|
64456
|
-
var coreAppConfig = storage$
|
|
64456
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
64457
64457
|
var tileData = findAppData(coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.tiles, coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.tileOverrides) || {};
|
|
64458
64458
|
var _ref = coreAppConfig || {},
|
|
64459
64459
|
enableChatBot = _ref.enableChatBot,
|
|
64460
64460
|
chatBotAppFunctionId = _ref.chatBotAppFunctionId;
|
|
64461
64461
|
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
64462
|
-
var hasChatBotAccess = userHasChatBotAccess(chatBotAppFunctionId);
|
|
64462
|
+
var hasChatBotAccess = userHasChatBotAccess$1(chatBotAppFunctionId);
|
|
64463
64463
|
var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot && hasChatBotAccess : (tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot) && hasChatBotAccess;
|
|
64464
64464
|
setChatBotEnabled(chatBotEnabled);
|
|
64465
64465
|
chatBotEnabledRef.current = chatBotEnabled;
|
|
64466
64466
|
};
|
|
64467
64467
|
React.useEffect(function () {
|
|
64468
64468
|
// Check if config and permissions are loaded, start polling if not
|
|
64469
|
-
var coreAppConfig = storage$
|
|
64470
|
-
var coreAppPermissions = storage$
|
|
64469
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
64470
|
+
var coreAppPermissions = storage$2.coreAppPermissions;
|
|
64471
64471
|
var isConfigLoaded = coreAppConfig && Object.keys(coreAppConfig).length > 0;
|
|
64472
64472
|
var isPermissionsLoaded = coreAppPermissions && Array.isArray(coreAppPermissions) && coreAppPermissions.length >= 0;
|
|
64473
64473
|
if (!isConfigLoaded || !isPermissionsLoaded) {
|
|
64474
64474
|
// Poll for config and permissions until both are available
|
|
64475
64475
|
var pollInterval = setInterval(function () {
|
|
64476
|
-
var config = storage$
|
|
64477
|
-
var permissions = storage$
|
|
64476
|
+
var config = storage$2.getLocalItem('opsportal-core:config');
|
|
64477
|
+
var permissions = storage$2.coreAppPermissions;
|
|
64478
64478
|
var configLoaded = config && Object.keys(config).length > 0;
|
|
64479
64479
|
var permissionsLoaded = permissions && Array.isArray(permissions) && permissions.length >= 0;
|
|
64480
64480
|
if (configLoaded && permissionsLoaded) {
|
|
@@ -64486,8 +64486,8 @@ var AppFrame = function AppFrame(props) {
|
|
|
64486
64486
|
// Stop polling after 5 seconds
|
|
64487
64487
|
var timeoutId = setTimeout(function () {
|
|
64488
64488
|
clearInterval(pollInterval);
|
|
64489
|
-
var finalConfig = storage$
|
|
64490
|
-
var finalPermissions = storage$
|
|
64489
|
+
var finalConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
64490
|
+
var finalPermissions = storage$2.coreAppPermissions;
|
|
64491
64491
|
var configLoaded = finalConfig && Object.keys(finalConfig).length > 0;
|
|
64492
64492
|
var permissionsLoaded = finalPermissions && Array.isArray(finalPermissions) && finalPermissions.length >= 0;
|
|
64493
64493
|
if (configLoaded && permissionsLoaded) {
|
|
@@ -64572,7 +64572,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
64572
64572
|
setIsNavBarOpen: setIsNavBarOpen
|
|
64573
64573
|
})), /*#__PURE__*/React__default["default"].createElement("main", {
|
|
64574
64574
|
className: "utilities_ops-app-frame_AppFrame_AppFrame--AppContainer"
|
|
64575
|
-
}, props.showNavigation && storage$
|
|
64575
|
+
}, props.showNavigation && storage$2.isAuthenticated ? /*#__PURE__*/React__default["default"].createElement(NavigationBar, {
|
|
64576
64576
|
navigateTo: props.navigateTo,
|
|
64577
64577
|
history: props.history,
|
|
64578
64578
|
navItems: props.navItems
|
|
@@ -64620,9 +64620,9 @@ var logOutboundCalls = /*#__PURE__*/function () {
|
|
|
64620
64620
|
return _regenerator().w(function (_context) {
|
|
64621
64621
|
while (1) switch (_context.n) {
|
|
64622
64622
|
case 0:
|
|
64623
|
-
url = (_storage$getLocalItem = storage$
|
|
64623
|
+
url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.logOutboundCalls;
|
|
64624
64624
|
_context.n = 1;
|
|
64625
|
-
return fetcher.post(url, data, {
|
|
64625
|
+
return fetcher$1.post(url, data, {
|
|
64626
64626
|
headers: {
|
|
64627
64627
|
'Content-Type': 'application/json'
|
|
64628
64628
|
}
|
|
@@ -64817,11 +64817,11 @@ function Snippet(_ref) {
|
|
|
64817
64817
|
window.open(article === null || article === void 0 ? void 0 : (_article$linkedArticl = article.linkedArticle) === null || _article$linkedArticl === void 0 ? void 0 : _article$linkedArticl.url, '_blank');
|
|
64818
64818
|
};
|
|
64819
64819
|
var openEditPage = function openEditPage() {
|
|
64820
|
-
var coreAppConfig = storage$
|
|
64820
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
64821
64821
|
window.open("".concat(coreAppConfig.mihelpUri, "/wp-admin/post.php?post=").concat(article.id, "&action=edit"), '_blank');
|
|
64822
64822
|
};
|
|
64823
64823
|
var canEdit = function canEdit() {
|
|
64824
|
-
return storage$
|
|
64824
|
+
return storage$2.coreAppPermissions.some(function (permission) {
|
|
64825
64825
|
return ['administer_site', 'manage_content'].includes(permission.name);
|
|
64826
64826
|
});
|
|
64827
64827
|
};
|
|
@@ -67980,7 +67980,7 @@ function ContextualHelp(_ref) {
|
|
|
67980
67980
|
_useState2 = _slicedToArray(_useState, 2),
|
|
67981
67981
|
article = _useState2[0],
|
|
67982
67982
|
setArticle = _useState2[1];
|
|
67983
|
-
var coreAppConfig = storage$
|
|
67983
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
67984
67984
|
var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
|
|
67985
67985
|
var mihelpAppPath = !isCoreRoute ? tileData.mihelpAppPath : null;
|
|
67986
67986
|
var isMihelpEnabled;
|
|
@@ -68021,12 +68021,12 @@ function ContextualHelp(_ref) {
|
|
|
68021
68021
|
return _regenerator().w(function (_context) {
|
|
68022
68022
|
while (1) switch (_context.p = _context.n) {
|
|
68023
68023
|
case 0:
|
|
68024
|
-
url = (_storage$getLocalItem = storage$
|
|
68024
|
+
url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpArticle;
|
|
68025
68025
|
_context.p = 1;
|
|
68026
68026
|
_context.n = 2;
|
|
68027
|
-
return fetcher.get("".concat(url, "/").concat(id), {
|
|
68027
|
+
return fetcher$1.get("".concat(url, "/").concat(id), {
|
|
68028
68028
|
headers: {
|
|
68029
|
-
Authorization: storage$
|
|
68029
|
+
Authorization: storage$2.accessToken
|
|
68030
68030
|
}
|
|
68031
68031
|
});
|
|
68032
68032
|
case 2:
|
|
@@ -68073,6 +68073,1260 @@ function ContextualHelp(_ref) {
|
|
|
68073
68073
|
})));
|
|
68074
68074
|
}
|
|
68075
68075
|
|
|
68076
|
+
var pending = new Map();
|
|
68077
|
+
function requestId() {
|
|
68078
|
+
return "bridge-".concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 9));
|
|
68079
|
+
}
|
|
68080
|
+
function post(eventType, eventProps) {
|
|
68081
|
+
if (typeof window === 'undefined' || !window.parent) return;
|
|
68082
|
+
window.parent.postMessage({
|
|
68083
|
+
eventType: eventType,
|
|
68084
|
+
eventProps: eventProps || {}
|
|
68085
|
+
}, '*');
|
|
68086
|
+
}
|
|
68087
|
+
function handleMessage(event) {
|
|
68088
|
+
var data = event.data;
|
|
68089
|
+
if (!data || !data.eventType) return;
|
|
68090
|
+
var _data$eventProps = data.eventProps,
|
|
68091
|
+
eventProps = _data$eventProps === void 0 ? {} : _data$eventProps;
|
|
68092
|
+
var id = eventProps.requestId;
|
|
68093
|
+
if (!id || !pending.has(id)) return;
|
|
68094
|
+
var _pending$get = pending.get(id),
|
|
68095
|
+
resolve = _pending$get.resolve,
|
|
68096
|
+
reject = _pending$get.reject;
|
|
68097
|
+
pending.delete(id);
|
|
68098
|
+
switch (data.eventType) {
|
|
68099
|
+
case 'FETCH_RESPONSE':
|
|
68100
|
+
if ('error' in eventProps) {
|
|
68101
|
+
var _eventProps$error, _eventProps$error2, _eventProps$error3, _eventProps$error4, _eventProps$error5;
|
|
68102
|
+
var err = new Error(((_eventProps$error = eventProps.error) === null || _eventProps$error === void 0 ? void 0 : _eventProps$error.message) || 'Fetch failed');
|
|
68103
|
+
err.response = ((_eventProps$error2 = eventProps.error) === null || _eventProps$error2 === void 0 ? void 0 : _eventProps$error2.status) != null ? {
|
|
68104
|
+
data: (_eventProps$error3 = eventProps.error) === null || _eventProps$error3 === void 0 ? void 0 : _eventProps$error3.data,
|
|
68105
|
+
status: (_eventProps$error4 = eventProps.error) === null || _eventProps$error4 === void 0 ? void 0 : _eventProps$error4.status,
|
|
68106
|
+
headers: (_eventProps$error5 = eventProps.error) === null || _eventProps$error5 === void 0 ? void 0 : _eventProps$error5.headers
|
|
68107
|
+
} : eventProps.error;
|
|
68108
|
+
reject(err);
|
|
68109
|
+
} else {
|
|
68110
|
+
resolve(eventProps.result);
|
|
68111
|
+
}
|
|
68112
|
+
break;
|
|
68113
|
+
case 'STORAGE_RESPONSE':
|
|
68114
|
+
resolve(eventProps.result);
|
|
68115
|
+
break;
|
|
68116
|
+
case 'ACCESS_RESPONSE':
|
|
68117
|
+
resolve(eventProps.result);
|
|
68118
|
+
break;
|
|
68119
|
+
case 'INIT_DATA':
|
|
68120
|
+
resolve(eventProps.result);
|
|
68121
|
+
break;
|
|
68122
|
+
}
|
|
68123
|
+
}
|
|
68124
|
+
if (typeof window !== 'undefined') {
|
|
68125
|
+
window.addEventListener('message', handleMessage, false);
|
|
68126
|
+
}
|
|
68127
|
+
function sendFetchRequest(payload) {
|
|
68128
|
+
return new Promise(function (resolve, reject) {
|
|
68129
|
+
var id = requestId();
|
|
68130
|
+
pending.set(id, {
|
|
68131
|
+
resolve: resolve,
|
|
68132
|
+
reject: reject
|
|
68133
|
+
});
|
|
68134
|
+
post('FETCH_REQUEST', _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
68135
|
+
requestId: id
|
|
68136
|
+
}));
|
|
68137
|
+
});
|
|
68138
|
+
}
|
|
68139
|
+
function sendStorageGet(payload) {
|
|
68140
|
+
return new Promise(function (resolve) {
|
|
68141
|
+
var id = requestId();
|
|
68142
|
+
pending.set(id, {
|
|
68143
|
+
resolve: resolve,
|
|
68144
|
+
reject: function reject() {}
|
|
68145
|
+
});
|
|
68146
|
+
post('STORAGE_GET', _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
68147
|
+
requestId: id
|
|
68148
|
+
}));
|
|
68149
|
+
});
|
|
68150
|
+
}
|
|
68151
|
+
function sendStorageSet(payload) {
|
|
68152
|
+
return new Promise(function (resolve) {
|
|
68153
|
+
var id = requestId();
|
|
68154
|
+
pending.set(id, {
|
|
68155
|
+
resolve: resolve,
|
|
68156
|
+
reject: function reject() {}
|
|
68157
|
+
});
|
|
68158
|
+
post('STORAGE_SET', _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
68159
|
+
requestId: id
|
|
68160
|
+
}));
|
|
68161
|
+
});
|
|
68162
|
+
}
|
|
68163
|
+
function getInitData() {
|
|
68164
|
+
return new Promise(function (_resolve) {
|
|
68165
|
+
var id = requestId();
|
|
68166
|
+
var timer = setTimeout(function () {
|
|
68167
|
+
if (pending.has(id)) {
|
|
68168
|
+
pending.delete(id);
|
|
68169
|
+
_resolve(null);
|
|
68170
|
+
}
|
|
68171
|
+
}, 5000);
|
|
68172
|
+
pending.set(id, {
|
|
68173
|
+
resolve: function resolve(result) {
|
|
68174
|
+
clearTimeout(timer);
|
|
68175
|
+
_resolve(result);
|
|
68176
|
+
},
|
|
68177
|
+
reject: function reject() {
|
|
68178
|
+
clearTimeout(timer);
|
|
68179
|
+
_resolve(null);
|
|
68180
|
+
}
|
|
68181
|
+
});
|
|
68182
|
+
post('GET_INIT_DATA', {
|
|
68183
|
+
requestId: id
|
|
68184
|
+
});
|
|
68185
|
+
});
|
|
68186
|
+
}
|
|
68187
|
+
function postUpdateUri(uri) {
|
|
68188
|
+
var isPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
68189
|
+
post('UPDATE_URI', {
|
|
68190
|
+
uri: uri,
|
|
68191
|
+
isPath: isPath
|
|
68192
|
+
});
|
|
68193
|
+
}
|
|
68194
|
+
function postUpdateCrumbs(crumbs) {
|
|
68195
|
+
post('UPDATE_CRUMBS', {
|
|
68196
|
+
crumbs: crumbs
|
|
68197
|
+
});
|
|
68198
|
+
}
|
|
68199
|
+
function postNavConfig(navItems) {
|
|
68200
|
+
post('SET_NAV_CONFIG', {
|
|
68201
|
+
navItems: navItems
|
|
68202
|
+
});
|
|
68203
|
+
}
|
|
68204
|
+
function postAppEnv(toolkitEnv, mihelpAgentProps) {
|
|
68205
|
+
post('SET_APP_ENV', {
|
|
68206
|
+
toolkitEnv: toolkitEnv,
|
|
68207
|
+
mihelpAgentProps: mihelpAgentProps
|
|
68208
|
+
});
|
|
68209
|
+
}
|
|
68210
|
+
function addMessageListener(callback) {
|
|
68211
|
+
var handler = function handler(event) {
|
|
68212
|
+
var data = event.data;
|
|
68213
|
+
if (data && data.eventType) callback(data);
|
|
68214
|
+
};
|
|
68215
|
+
window.addEventListener('message', handler, false);
|
|
68216
|
+
return function () {
|
|
68217
|
+
return window.removeEventListener('message', handler);
|
|
68218
|
+
};
|
|
68219
|
+
}
|
|
68220
|
+
function extractUriFromFullPath(fullPath) {
|
|
68221
|
+
try {
|
|
68222
|
+
var url = new URL(fullPath);
|
|
68223
|
+
return url.pathname || '/';
|
|
68224
|
+
} catch (_) {}
|
|
68225
|
+
return null;
|
|
68226
|
+
}
|
|
68227
|
+
function getInitialUri() {
|
|
68228
|
+
if (typeof window !== 'undefined' && window.__IFRAME_EARLY_LOAD_URI != null) {
|
|
68229
|
+
var uri = window.__IFRAME_EARLY_LOAD_URI;
|
|
68230
|
+
return Promise.resolve(uri === '' ? '/' : uri);
|
|
68231
|
+
}
|
|
68232
|
+
return new Promise(function (resolve) {
|
|
68233
|
+
function onMessage(event) {
|
|
68234
|
+
if (event.data && event.data.eventType === 'LOAD_URI' && event.data.eventProps) {
|
|
68235
|
+
window.removeEventListener('message', onMessage);
|
|
68236
|
+
clearTimeout(timer);
|
|
68237
|
+
var _uri = event.data.eventProps.uri;
|
|
68238
|
+
if (_uri == null && event.data.eventProps.fullPath) {
|
|
68239
|
+
_uri = extractUriFromFullPath(event.data.eventProps.fullPath);
|
|
68240
|
+
}
|
|
68241
|
+
resolve(_uri == null || _uri === '' ? '/' : _uri);
|
|
68242
|
+
}
|
|
68243
|
+
}
|
|
68244
|
+
window.addEventListener('message', onMessage, false);
|
|
68245
|
+
var timer = setTimeout(function () {
|
|
68246
|
+
window.removeEventListener('message', onMessage);
|
|
68247
|
+
var early = typeof window !== 'undefined' && window.__IFRAME_EARLY_LOAD_URI;
|
|
68248
|
+
resolve(early || '/');
|
|
68249
|
+
}, 3000);
|
|
68250
|
+
});
|
|
68251
|
+
}
|
|
68252
|
+
|
|
68253
|
+
var requestInterceptors = [];
|
|
68254
|
+
var responseInterceptors = [];
|
|
68255
|
+
function applyRequestInterceptors(config) {
|
|
68256
|
+
var chain = Promise.resolve(config);
|
|
68257
|
+
requestInterceptors.forEach(function (_ref) {
|
|
68258
|
+
var fulfilled = _ref.fulfilled,
|
|
68259
|
+
rejected = _ref.rejected;
|
|
68260
|
+
chain = chain.then(fulfilled, rejected);
|
|
68261
|
+
});
|
|
68262
|
+
return chain;
|
|
68263
|
+
}
|
|
68264
|
+
function applyResponseInterceptors(response) {
|
|
68265
|
+
var chain = Promise.resolve(response);
|
|
68266
|
+
responseInterceptors.forEach(function (_ref2) {
|
|
68267
|
+
var fulfilled = _ref2.fulfilled,
|
|
68268
|
+
rejected = _ref2.rejected;
|
|
68269
|
+
chain = chain.then(fulfilled, rejected);
|
|
68270
|
+
});
|
|
68271
|
+
return chain;
|
|
68272
|
+
}
|
|
68273
|
+
function applyResponseErrorInterceptors(error) {
|
|
68274
|
+
var chain = Promise.reject(error);
|
|
68275
|
+
responseInterceptors.forEach(function (_ref3) {
|
|
68276
|
+
var fulfilled = _ref3.fulfilled,
|
|
68277
|
+
rejected = _ref3.rejected;
|
|
68278
|
+
chain = chain.then(fulfilled, rejected);
|
|
68279
|
+
});
|
|
68280
|
+
return chain;
|
|
68281
|
+
}
|
|
68282
|
+
function request(config) {
|
|
68283
|
+
return applyRequestInterceptors(_objectSpread2({
|
|
68284
|
+
headers: {}
|
|
68285
|
+
}, config)).then(function (finalConfig) {
|
|
68286
|
+
var _finalConfig$method = finalConfig.method,
|
|
68287
|
+
method = _finalConfig$method === void 0 ? 'get' : _finalConfig$method,
|
|
68288
|
+
url = finalConfig.url,
|
|
68289
|
+
params = finalConfig.params,
|
|
68290
|
+
data = finalConfig.data,
|
|
68291
|
+
_finalConfig$headers = finalConfig.headers,
|
|
68292
|
+
headers = _finalConfig$headers === void 0 ? {} : _finalConfig$headers;
|
|
68293
|
+
return sendFetchRequest({
|
|
68294
|
+
method: (method || 'get').toLowerCase(),
|
|
68295
|
+
url: url,
|
|
68296
|
+
params: params,
|
|
68297
|
+
data: data,
|
|
68298
|
+
headers: headers
|
|
68299
|
+
});
|
|
68300
|
+
}).then(function (result) {
|
|
68301
|
+
return applyResponseInterceptors({
|
|
68302
|
+
data: result.data,
|
|
68303
|
+
status: result.status,
|
|
68304
|
+
headers: result.headers || {}
|
|
68305
|
+
});
|
|
68306
|
+
}, function (err) {
|
|
68307
|
+
return applyResponseErrorInterceptors(err);
|
|
68308
|
+
});
|
|
68309
|
+
}
|
|
68310
|
+
var DEFAULT_USER_RULES = {
|
|
68311
|
+
allow: [],
|
|
68312
|
+
deny: []
|
|
68313
|
+
};
|
|
68314
|
+
var DEFAULT_YARD_NUMBER_RULES = {
|
|
68315
|
+
allow: [],
|
|
68316
|
+
deny: []
|
|
68317
|
+
};
|
|
68318
|
+
var DEFAULT_SECURITY_LEVEL_RULES = {
|
|
68319
|
+
not: [],
|
|
68320
|
+
only: [],
|
|
68321
|
+
lessThan: 100
|
|
68322
|
+
};
|
|
68323
|
+
function hydrateTiles() {
|
|
68324
|
+
var tiles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
68325
|
+
return tiles.map(function (tile) {
|
|
68326
|
+
return _objectSpread2(_objectSpread2({}, tile), {}, {
|
|
68327
|
+
yardRules: _objectSpread2(_objectSpread2({}, DEFAULT_YARD_NUMBER_RULES), tile.yardRules),
|
|
68328
|
+
userRules: _objectSpread2(_objectSpread2({}, DEFAULT_USER_RULES), tile.userRules),
|
|
68329
|
+
securityLevelRules: _objectSpread2(_objectSpread2({}, DEFAULT_SECURITY_LEVEL_RULES), tile.securityLevelRules)
|
|
68330
|
+
});
|
|
68331
|
+
});
|
|
68332
|
+
}
|
|
68333
|
+
var fetcher = {
|
|
68334
|
+
request: request,
|
|
68335
|
+
get: function get(url) {
|
|
68336
|
+
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
68337
|
+
return request(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
68338
|
+
method: 'get',
|
|
68339
|
+
url: url
|
|
68340
|
+
}));
|
|
68341
|
+
},
|
|
68342
|
+
post: function post(url, data) {
|
|
68343
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
68344
|
+
return request(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
68345
|
+
method: 'post',
|
|
68346
|
+
url: url,
|
|
68347
|
+
data: data
|
|
68348
|
+
}));
|
|
68349
|
+
},
|
|
68350
|
+
put: function put(url, data) {
|
|
68351
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
68352
|
+
return request(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
68353
|
+
method: 'put',
|
|
68354
|
+
url: url,
|
|
68355
|
+
data: data
|
|
68356
|
+
}));
|
|
68357
|
+
},
|
|
68358
|
+
delete: function _delete(url) {
|
|
68359
|
+
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
68360
|
+
return request(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
68361
|
+
method: 'delete',
|
|
68362
|
+
url: url
|
|
68363
|
+
}));
|
|
68364
|
+
},
|
|
68365
|
+
patch: function patch(url, data) {
|
|
68366
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
68367
|
+
return request(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
68368
|
+
method: 'patch',
|
|
68369
|
+
url: url,
|
|
68370
|
+
data: data
|
|
68371
|
+
}));
|
|
68372
|
+
},
|
|
68373
|
+
interceptors: {
|
|
68374
|
+
request: {
|
|
68375
|
+
use: function use(fulfilled, rejected) {
|
|
68376
|
+
requestInterceptors.push({
|
|
68377
|
+
fulfilled: fulfilled,
|
|
68378
|
+
rejected: rejected
|
|
68379
|
+
});
|
|
68380
|
+
}
|
|
68381
|
+
},
|
|
68382
|
+
response: {
|
|
68383
|
+
use: function use(fulfilled, rejected) {
|
|
68384
|
+
responseInterceptors.push({
|
|
68385
|
+
fulfilled: fulfilled,
|
|
68386
|
+
rejected: rejected
|
|
68387
|
+
});
|
|
68388
|
+
}
|
|
68389
|
+
}
|
|
68390
|
+
},
|
|
68391
|
+
getConfig: function () {
|
|
68392
|
+
var _getConfig = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(endpoint) {
|
|
68393
|
+
var response, config;
|
|
68394
|
+
return _regenerator().w(function (_context) {
|
|
68395
|
+
while (1) switch (_context.n) {
|
|
68396
|
+
case 0:
|
|
68397
|
+
if (endpoint) {
|
|
68398
|
+
_context.n = 1;
|
|
68399
|
+
break;
|
|
68400
|
+
}
|
|
68401
|
+
return _context.a(2, Promise.reject(new Error('Error, Please make sure "CONFIG_URI" && "CORE_CONFIG_URI" env variables are configured')));
|
|
68402
|
+
case 1:
|
|
68403
|
+
_context.n = 2;
|
|
68404
|
+
return fetcher.get(endpoint);
|
|
68405
|
+
case 2:
|
|
68406
|
+
response = _context.v;
|
|
68407
|
+
config = response.data.data;
|
|
68408
|
+
config.tiles = hydrateTiles(config.tiles);
|
|
68409
|
+
config.tileOverrides = hydrateTiles(config.tileOverrides);
|
|
68410
|
+
return _context.a(2, config);
|
|
68411
|
+
}
|
|
68412
|
+
}, _callee);
|
|
68413
|
+
}));
|
|
68414
|
+
function getConfig(_x) {
|
|
68415
|
+
return _getConfig.apply(this, arguments);
|
|
68416
|
+
}
|
|
68417
|
+
return getConfig;
|
|
68418
|
+
}(),
|
|
68419
|
+
getAppTileData: function () {
|
|
68420
|
+
var _getAppTileData = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
68421
|
+
var _window$toolkitEnv;
|
|
68422
|
+
var coreConfigUri, config;
|
|
68423
|
+
return _regenerator().w(function (_context2) {
|
|
68424
|
+
while (1) switch (_context2.n) {
|
|
68425
|
+
case 0:
|
|
68426
|
+
coreConfigUri = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.CORE_CONFIG_URI ? window.toolkitEnv.CORE_CONFIG_URI : process.env.CORE_CONFIG_URI;
|
|
68427
|
+
_context2.n = 1;
|
|
68428
|
+
return fetcher.getConfig(coreConfigUri);
|
|
68429
|
+
case 1:
|
|
68430
|
+
config = _context2.v;
|
|
68431
|
+
return _context2.a(2, config);
|
|
68432
|
+
}
|
|
68433
|
+
}, _callee2);
|
|
68434
|
+
}));
|
|
68435
|
+
function getAppTileData() {
|
|
68436
|
+
return _getAppTileData.apply(this, arguments);
|
|
68437
|
+
}
|
|
68438
|
+
return getAppTileData;
|
|
68439
|
+
}(),
|
|
68440
|
+
getPermissions: function () {
|
|
68441
|
+
var _getPermissions = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3(appName, useAppScopes) {
|
|
68442
|
+
var response;
|
|
68443
|
+
return _regenerator().w(function (_context3) {
|
|
68444
|
+
while (1) switch (_context3.n) {
|
|
68445
|
+
case 0:
|
|
68446
|
+
_context3.n = 1;
|
|
68447
|
+
return fetcher.get("/api/permissions/".concat(appName));
|
|
68448
|
+
case 1:
|
|
68449
|
+
response = _context3.v;
|
|
68450
|
+
return _context3.a(2, response.data);
|
|
68451
|
+
}
|
|
68452
|
+
}, _callee3);
|
|
68453
|
+
}));
|
|
68454
|
+
function getPermissions(_x2, _x3) {
|
|
68455
|
+
return _getPermissions.apply(this, arguments);
|
|
68456
|
+
}
|
|
68457
|
+
return getPermissions;
|
|
68458
|
+
}(),
|
|
68459
|
+
getCoreAppPermissions: function () {
|
|
68460
|
+
var _getCoreAppPermissions = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
68461
|
+
return _regenerator().w(function (_context4) {
|
|
68462
|
+
while (1) switch (_context4.n) {
|
|
68463
|
+
case 0:
|
|
68464
|
+
return _context4.a(2, fetcher.getPermissions('ops_portal'));
|
|
68465
|
+
}
|
|
68466
|
+
}, _callee4);
|
|
68467
|
+
}));
|
|
68468
|
+
function getCoreAppPermissions() {
|
|
68469
|
+
return _getCoreAppPermissions.apply(this, arguments);
|
|
68470
|
+
}
|
|
68471
|
+
return getCoreAppPermissions;
|
|
68472
|
+
}(),
|
|
68473
|
+
getUserPreferences: function () {
|
|
68474
|
+
var _getUserPreferences = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
68475
|
+
var appName,
|
|
68476
|
+
_config$endpoints,
|
|
68477
|
+
storage,
|
|
68478
|
+
config,
|
|
68479
|
+
urlTemplate,
|
|
68480
|
+
url,
|
|
68481
|
+
country,
|
|
68482
|
+
response,
|
|
68483
|
+
_args5 = arguments,
|
|
68484
|
+
_t;
|
|
68485
|
+
return _regenerator().w(function (_context5) {
|
|
68486
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
68487
|
+
case 0:
|
|
68488
|
+
appName = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : '';
|
|
68489
|
+
_context5.p = 1;
|
|
68490
|
+
storage = require("./storage").default;
|
|
68491
|
+
config = storage.getLocalItem('opsportal-core:config');
|
|
68492
|
+
urlTemplate = config === null || config === void 0 ? void 0 : (_config$endpoints = config.endpoints) === null || _config$endpoints === void 0 ? void 0 : _config$endpoints.userPreferences;
|
|
68493
|
+
if (urlTemplate) {
|
|
68494
|
+
_context5.n = 2;
|
|
68495
|
+
break;
|
|
68496
|
+
}
|
|
68497
|
+
return _context5.a(2, {});
|
|
68498
|
+
case 2:
|
|
68499
|
+
url = urlTemplate.replace(/\{appName\}/g, appName);
|
|
68500
|
+
country = storage.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
68501
|
+
_context5.n = 3;
|
|
68502
|
+
return fetcher.get(url, {
|
|
68503
|
+
headers: {
|
|
68504
|
+
country: country,
|
|
68505
|
+
source: 'OPS_PORTAL'
|
|
68506
|
+
}
|
|
68507
|
+
});
|
|
68508
|
+
case 3:
|
|
68509
|
+
response = _context5.v;
|
|
68510
|
+
return _context5.a(2, response.data);
|
|
68511
|
+
case 4:
|
|
68512
|
+
_context5.p = 4;
|
|
68513
|
+
_t = _context5.v;
|
|
68514
|
+
return _context5.a(2, Promise.reject(_t));
|
|
68515
|
+
}
|
|
68516
|
+
}, _callee5, null, [[1, 4]]);
|
|
68517
|
+
}));
|
|
68518
|
+
function getUserPreferences() {
|
|
68519
|
+
return _getUserPreferences.apply(this, arguments);
|
|
68520
|
+
}
|
|
68521
|
+
return getUserPreferences;
|
|
68522
|
+
}(),
|
|
68523
|
+
setUserPreferences: function () {
|
|
68524
|
+
var _setUserPreferences = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
68525
|
+
var appName,
|
|
68526
|
+
data,
|
|
68527
|
+
_config$endpoints2,
|
|
68528
|
+
storage,
|
|
68529
|
+
config,
|
|
68530
|
+
urlTemplate,
|
|
68531
|
+
url,
|
|
68532
|
+
country,
|
|
68533
|
+
response,
|
|
68534
|
+
_args6 = arguments,
|
|
68535
|
+
_t2;
|
|
68536
|
+
return _regenerator().w(function (_context6) {
|
|
68537
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
68538
|
+
case 0:
|
|
68539
|
+
appName = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : '';
|
|
68540
|
+
data = _args6.length > 1 ? _args6[1] : undefined;
|
|
68541
|
+
_context6.p = 1;
|
|
68542
|
+
storage = require("./storage").default;
|
|
68543
|
+
config = storage.getLocalItem('opsportal-core:config');
|
|
68544
|
+
urlTemplate = config === null || config === void 0 ? void 0 : (_config$endpoints2 = config.endpoints) === null || _config$endpoints2 === void 0 ? void 0 : _config$endpoints2.userPreferences;
|
|
68545
|
+
if (urlTemplate) {
|
|
68546
|
+
_context6.n = 2;
|
|
68547
|
+
break;
|
|
68548
|
+
}
|
|
68549
|
+
return _context6.a(2, '');
|
|
68550
|
+
case 2:
|
|
68551
|
+
url = urlTemplate.replace(/\{appName\}/g, appName);
|
|
68552
|
+
country = storage.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
68553
|
+
_context6.n = 3;
|
|
68554
|
+
return fetcher.put(url, data, {
|
|
68555
|
+
headers: {
|
|
68556
|
+
country: country,
|
|
68557
|
+
source: 'OPS_PORTAL'
|
|
68558
|
+
}
|
|
68559
|
+
});
|
|
68560
|
+
case 3:
|
|
68561
|
+
response = _context6.v;
|
|
68562
|
+
return _context6.a(2, response.statusText);
|
|
68563
|
+
case 4:
|
|
68564
|
+
_context6.p = 4;
|
|
68565
|
+
_t2 = _context6.v;
|
|
68566
|
+
return _context6.a(2, Promise.reject(_t2));
|
|
68567
|
+
}
|
|
68568
|
+
}, _callee6, null, [[1, 4]]);
|
|
68569
|
+
}));
|
|
68570
|
+
function setUserPreferences() {
|
|
68571
|
+
return _setUserPreferences.apply(this, arguments);
|
|
68572
|
+
}
|
|
68573
|
+
return setUserPreferences;
|
|
68574
|
+
}(),
|
|
68575
|
+
getPrintersForYard: function () {
|
|
68576
|
+
var _getPrintersForYard = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee7(yardNumber) {
|
|
68577
|
+
var _config$endpoints3, storage, config, url, response;
|
|
68578
|
+
return _regenerator().w(function (_context7) {
|
|
68579
|
+
while (1) switch (_context7.p = _context7.n) {
|
|
68580
|
+
case 0:
|
|
68581
|
+
_context7.p = 0;
|
|
68582
|
+
storage = require("./storage").default;
|
|
68583
|
+
config = storage.getLocalItem('opsportal-core:config');
|
|
68584
|
+
url = config === null || config === void 0 ? void 0 : (_config$endpoints3 = config.endpoints) === null || _config$endpoints3 === void 0 ? void 0 : _config$endpoints3.printersByYard;
|
|
68585
|
+
if (url) {
|
|
68586
|
+
_context7.n = 1;
|
|
68587
|
+
break;
|
|
68588
|
+
}
|
|
68589
|
+
return _context7.a(2, {});
|
|
68590
|
+
case 1:
|
|
68591
|
+
_context7.n = 2;
|
|
68592
|
+
return fetcher.get("".concat(url).concat(yardNumber));
|
|
68593
|
+
case 2:
|
|
68594
|
+
response = _context7.v;
|
|
68595
|
+
return _context7.a(2, response.data);
|
|
68596
|
+
case 3:
|
|
68597
|
+
_context7.p = 3;
|
|
68598
|
+
_context7.v;
|
|
68599
|
+
return _context7.a(2, {});
|
|
68600
|
+
}
|
|
68601
|
+
}, _callee7, null, [[0, 3]]);
|
|
68602
|
+
}));
|
|
68603
|
+
function getPrintersForYard(_x4) {
|
|
68604
|
+
return _getPrintersForYard.apply(this, arguments);
|
|
68605
|
+
}
|
|
68606
|
+
return getPrintersForYard;
|
|
68607
|
+
}(),
|
|
68608
|
+
login: function () {
|
|
68609
|
+
var _login = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
68610
|
+
return _regenerator().w(function (_context8) {
|
|
68611
|
+
while (1) switch (_context8.n) {
|
|
68612
|
+
case 0:
|
|
68613
|
+
return _context8.a(2, {});
|
|
68614
|
+
}
|
|
68615
|
+
}, _callee8);
|
|
68616
|
+
}));
|
|
68617
|
+
function login() {
|
|
68618
|
+
return _login.apply(this, arguments);
|
|
68619
|
+
}
|
|
68620
|
+
return login;
|
|
68621
|
+
}(),
|
|
68622
|
+
oktaLogin: function () {
|
|
68623
|
+
var _oktaLogin = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
68624
|
+
return _regenerator().w(function (_context9) {
|
|
68625
|
+
while (1) switch (_context9.n) {
|
|
68626
|
+
case 0:
|
|
68627
|
+
return _context9.a(2, {});
|
|
68628
|
+
}
|
|
68629
|
+
}, _callee9);
|
|
68630
|
+
}));
|
|
68631
|
+
function oktaLogin() {
|
|
68632
|
+
return _oktaLogin.apply(this, arguments);
|
|
68633
|
+
}
|
|
68634
|
+
return oktaLogin;
|
|
68635
|
+
}(),
|
|
68636
|
+
getYardNumbers: function () {
|
|
68637
|
+
var _getYardNumbers = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
68638
|
+
return _regenerator().w(function (_context0) {
|
|
68639
|
+
while (1) switch (_context0.n) {
|
|
68640
|
+
case 0:
|
|
68641
|
+
return _context0.a(2, []);
|
|
68642
|
+
}
|
|
68643
|
+
}, _callee0);
|
|
68644
|
+
}));
|
|
68645
|
+
function getYardNumbers() {
|
|
68646
|
+
return _getYardNumbers.apply(this, arguments);
|
|
68647
|
+
}
|
|
68648
|
+
return getYardNumbers;
|
|
68649
|
+
}(),
|
|
68650
|
+
getUserDetails: function () {
|
|
68651
|
+
var _getUserDetails = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
68652
|
+
return _regenerator().w(function (_context1) {
|
|
68653
|
+
while (1) switch (_context1.n) {
|
|
68654
|
+
case 0:
|
|
68655
|
+
return _context1.a(2, {});
|
|
68656
|
+
}
|
|
68657
|
+
}, _callee1);
|
|
68658
|
+
}));
|
|
68659
|
+
function getUserDetails() {
|
|
68660
|
+
return _getUserDetails.apply(this, arguments);
|
|
68661
|
+
}
|
|
68662
|
+
return getUserDetails;
|
|
68663
|
+
}(),
|
|
68664
|
+
sendFeedback: function () {
|
|
68665
|
+
var _sendFeedback = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee10() {
|
|
68666
|
+
return _regenerator().w(function (_context10) {
|
|
68667
|
+
while (1) switch (_context10.n) {
|
|
68668
|
+
case 0:
|
|
68669
|
+
return _context10.a(2, {});
|
|
68670
|
+
}
|
|
68671
|
+
}, _callee10);
|
|
68672
|
+
}));
|
|
68673
|
+
function sendFeedback() {
|
|
68674
|
+
return _sendFeedback.apply(this, arguments);
|
|
68675
|
+
}
|
|
68676
|
+
return sendFeedback;
|
|
68677
|
+
}(),
|
|
68678
|
+
getUserRoles: function () {
|
|
68679
|
+
var _getUserRoles = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
68680
|
+
return _regenerator().w(function (_context11) {
|
|
68681
|
+
while (1) switch (_context11.n) {
|
|
68682
|
+
case 0:
|
|
68683
|
+
return _context11.a(2, []);
|
|
68684
|
+
}
|
|
68685
|
+
}, _callee11);
|
|
68686
|
+
}));
|
|
68687
|
+
function getUserRoles() {
|
|
68688
|
+
return _getUserRoles.apply(this, arguments);
|
|
68689
|
+
}
|
|
68690
|
+
return getUserRoles;
|
|
68691
|
+
}(),
|
|
68692
|
+
getHierarchyOptions: function () {
|
|
68693
|
+
var _getHierarchyOptions = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee12() {
|
|
68694
|
+
return _regenerator().w(function (_context12) {
|
|
68695
|
+
while (1) switch (_context12.n) {
|
|
68696
|
+
case 0:
|
|
68697
|
+
return _context12.a(2, []);
|
|
68698
|
+
}
|
|
68699
|
+
}, _callee12);
|
|
68700
|
+
}));
|
|
68701
|
+
function getHierarchyOptions() {
|
|
68702
|
+
return _getHierarchyOptions.apply(this, arguments);
|
|
68703
|
+
}
|
|
68704
|
+
return getHierarchyOptions;
|
|
68705
|
+
}(),
|
|
68706
|
+
getInnovationHubToken: function () {
|
|
68707
|
+
var _getInnovationHubToken = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee13() {
|
|
68708
|
+
return _regenerator().w(function (_context13) {
|
|
68709
|
+
while (1) switch (_context13.n) {
|
|
68710
|
+
case 0:
|
|
68711
|
+
return _context13.a(2, {});
|
|
68712
|
+
}
|
|
68713
|
+
}, _callee13);
|
|
68714
|
+
}));
|
|
68715
|
+
function getInnovationHubToken() {
|
|
68716
|
+
return _getInnovationHubToken.apply(this, arguments);
|
|
68717
|
+
}
|
|
68718
|
+
return getInnovationHubToken;
|
|
68719
|
+
}(),
|
|
68720
|
+
getUserScopes: function () {
|
|
68721
|
+
var _getUserScopes = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee14() {
|
|
68722
|
+
return _regenerator().w(function (_context14) {
|
|
68723
|
+
while (1) switch (_context14.n) {
|
|
68724
|
+
case 0:
|
|
68725
|
+
return _context14.a(2, []);
|
|
68726
|
+
}
|
|
68727
|
+
}, _callee14);
|
|
68728
|
+
}));
|
|
68729
|
+
function getUserScopes() {
|
|
68730
|
+
return _getUserScopes.apply(this, arguments);
|
|
68731
|
+
}
|
|
68732
|
+
return getUserScopes;
|
|
68733
|
+
}(),
|
|
68734
|
+
getCobaltUserFacilities: function () {
|
|
68735
|
+
var _getCobaltUserFacilities = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
68736
|
+
return _regenerator().w(function (_context15) {
|
|
68737
|
+
while (1) switch (_context15.n) {
|
|
68738
|
+
case 0:
|
|
68739
|
+
return _context15.a(2, []);
|
|
68740
|
+
}
|
|
68741
|
+
}, _callee15);
|
|
68742
|
+
}));
|
|
68743
|
+
function getCobaltUserFacilities() {
|
|
68744
|
+
return _getCobaltUserFacilities.apply(this, arguments);
|
|
68745
|
+
}
|
|
68746
|
+
return getCobaltUserFacilities;
|
|
68747
|
+
}(),
|
|
68748
|
+
getCobaltUserRoles: function () {
|
|
68749
|
+
var _getCobaltUserRoles = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee16() {
|
|
68750
|
+
return _regenerator().w(function (_context16) {
|
|
68751
|
+
while (1) switch (_context16.n) {
|
|
68752
|
+
case 0:
|
|
68753
|
+
return _context16.a(2, []);
|
|
68754
|
+
}
|
|
68755
|
+
}, _callee16);
|
|
68756
|
+
}));
|
|
68757
|
+
function getCobaltUserRoles() {
|
|
68758
|
+
return _getCobaltUserRoles.apply(this, arguments);
|
|
68759
|
+
}
|
|
68760
|
+
return getCobaltUserRoles;
|
|
68761
|
+
}()
|
|
68762
|
+
};
|
|
68763
|
+
|
|
68764
|
+
function getAppName() {
|
|
68765
|
+
var _window$toolkitEnv;
|
|
68766
|
+
return (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.APP_NAME ? window.toolkitEnv.APP_NAME : typeof process !== 'undefined' && process.env && process.env.APP_NAME || 'test-app';
|
|
68767
|
+
}
|
|
68768
|
+
function getByPath(obj, path) {
|
|
68769
|
+
if (obj == null) return undefined;
|
|
68770
|
+
var parts = path.split('.');
|
|
68771
|
+
var value = obj;
|
|
68772
|
+
for (var i = 0; i < parts.length && value != null; i++) {
|
|
68773
|
+
value = value[parts[i]];
|
|
68774
|
+
}
|
|
68775
|
+
return value;
|
|
68776
|
+
}
|
|
68777
|
+
function setByPath(obj, path, value) {
|
|
68778
|
+
if (obj == null) obj = {};
|
|
68779
|
+
var parts = path.split('.');
|
|
68780
|
+
var current = obj;
|
|
68781
|
+
for (var i = 0; i < parts.length - 1; i++) {
|
|
68782
|
+
if (current[parts[i]] == null) current[parts[i]] = {};
|
|
68783
|
+
current = current[parts[i]];
|
|
68784
|
+
}
|
|
68785
|
+
current[parts[parts.length - 1]] = value;
|
|
68786
|
+
return obj;
|
|
68787
|
+
}
|
|
68788
|
+
var cache = {
|
|
68789
|
+
local: {},
|
|
68790
|
+
session: {}
|
|
68791
|
+
};
|
|
68792
|
+
function setInitCache(initData) {
|
|
68793
|
+
if (!initData) return;
|
|
68794
|
+
cache = _objectSpread2({
|
|
68795
|
+
local: {},
|
|
68796
|
+
session: {}
|
|
68797
|
+
}, initData);
|
|
68798
|
+
if (initData.login != null) cache.local.login = initData.login;
|
|
68799
|
+
if (initData.settings != null) cache.local.settings = initData.settings;
|
|
68800
|
+
if (initData.dashboard != null) cache.session.dashboard = initData.dashboard;
|
|
68801
|
+
}
|
|
68802
|
+
function setExtraLocal(key, value) {
|
|
68803
|
+
cache.local[key] = value;
|
|
68804
|
+
}
|
|
68805
|
+
function getInitDataForBootstrap() {
|
|
68806
|
+
return getInitData();
|
|
68807
|
+
}
|
|
68808
|
+
function getLocalItem(key, path) {
|
|
68809
|
+
var value = cache.local[key] ?? cache[key];
|
|
68810
|
+
var out = path ? getByPath(value, path) : value;
|
|
68811
|
+
if (out !== undefined) return out;
|
|
68812
|
+
if (key === 'login') return cache.login;
|
|
68813
|
+
if (key === 'settings') return cache.settings;
|
|
68814
|
+
return undefined;
|
|
68815
|
+
}
|
|
68816
|
+
function setLocalItem(key, value, path) {
|
|
68817
|
+
sendStorageSet({
|
|
68818
|
+
op: 'setLocalItem',
|
|
68819
|
+
key: key,
|
|
68820
|
+
value: value,
|
|
68821
|
+
path: path
|
|
68822
|
+
});
|
|
68823
|
+
if (path) {
|
|
68824
|
+
var existing = cache.local[key] ?? cache[key] ?? {};
|
|
68825
|
+
cache.local[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
68826
|
+
} else {
|
|
68827
|
+
cache.local[key] = value;
|
|
68828
|
+
if (key === 'login') cache.login = value;
|
|
68829
|
+
if (key === 'settings') cache.settings = value;
|
|
68830
|
+
}
|
|
68831
|
+
}
|
|
68832
|
+
function getSessionItem(key, path) {
|
|
68833
|
+
var value = cache.session[key] ?? cache[key];
|
|
68834
|
+
var out = path ? getByPath(value, path) : value;
|
|
68835
|
+
if (out !== undefined) return out;
|
|
68836
|
+
if (key === 'dashboard') return cache.dashboard;
|
|
68837
|
+
return undefined;
|
|
68838
|
+
}
|
|
68839
|
+
function setSessionItem(key, value, path) {
|
|
68840
|
+
sendStorageSet({
|
|
68841
|
+
op: 'setSessionItem',
|
|
68842
|
+
key: key,
|
|
68843
|
+
value: value,
|
|
68844
|
+
path: path
|
|
68845
|
+
});
|
|
68846
|
+
if (path) {
|
|
68847
|
+
var existing = cache.session[key] ?? cache[key] ?? {};
|
|
68848
|
+
cache.session[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
68849
|
+
} else {
|
|
68850
|
+
cache.session[key] = value;
|
|
68851
|
+
if (key === 'dashboard') cache.dashboard = value;
|
|
68852
|
+
}
|
|
68853
|
+
}
|
|
68854
|
+
function getItem$1(key) {
|
|
68855
|
+
var APP_NAME = getAppName();
|
|
68856
|
+
var namespaced = "".concat(APP_NAME, ":").concat(key);
|
|
68857
|
+
return cache.local[namespaced] ?? cache[key];
|
|
68858
|
+
}
|
|
68859
|
+
function setItem(key, value) {
|
|
68860
|
+
var APP_NAME = getAppName();
|
|
68861
|
+
var namespaced = "".concat(APP_NAME, ":").concat(key);
|
|
68862
|
+
sendStorageSet({
|
|
68863
|
+
op: 'setLocalItem',
|
|
68864
|
+
key: namespaced,
|
|
68865
|
+
value: value
|
|
68866
|
+
});
|
|
68867
|
+
cache.local[namespaced] = value;
|
|
68868
|
+
cache[key] = value;
|
|
68869
|
+
return value;
|
|
68870
|
+
}
|
|
68871
|
+
function setAppContext() {
|
|
68872
|
+
var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
68873
|
+
try {
|
|
68874
|
+
var _window$toolkitEnv2, _storage$getLocalItem, _window$toolkitEnv3;
|
|
68875
|
+
if (_typeof$1(context) !== 'object' || context === null || Array.isArray(context)) {
|
|
68876
|
+
context = {};
|
|
68877
|
+
}
|
|
68878
|
+
var isCoreApp = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
68879
|
+
if (isCoreApp) {
|
|
68880
|
+
setSessionItem('opsportal-core:miHelpBotContext', context);
|
|
68881
|
+
return;
|
|
68882
|
+
}
|
|
68883
|
+
var appTiles = ((_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.tiles) || [];
|
|
68884
|
+
var appName = getAppName();
|
|
68885
|
+
var appData = appTiles.find(function (tile) {
|
|
68886
|
+
return tile.appName ? tile.appName === appName : tile.path === "/".concat(appName);
|
|
68887
|
+
});
|
|
68888
|
+
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv3 = window.toolkitEnv) !== null && _window$toolkitEnv3 !== void 0 && _window$toolkitEnv3.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
68889
|
+
if (!appAuthName) throw new Error('appAuthName not found');
|
|
68890
|
+
setSessionItem("".concat(appAuthName, ":miHelpBotContext"), context);
|
|
68891
|
+
} catch (e) {
|
|
68892
|
+
console.log('Error while setting context ', e);
|
|
68893
|
+
}
|
|
68894
|
+
}
|
|
68895
|
+
function clearStorage() {
|
|
68896
|
+
sendStorageSet({
|
|
68897
|
+
op: 'clear'
|
|
68898
|
+
});
|
|
68899
|
+
}
|
|
68900
|
+
var storage$1 = {
|
|
68901
|
+
getLocalItem: getLocalItem,
|
|
68902
|
+
setLocalItem: setLocalItem,
|
|
68903
|
+
getSessionItem: getSessionItem,
|
|
68904
|
+
setSessionItem: setSessionItem,
|
|
68905
|
+
getItem: getItem$1,
|
|
68906
|
+
setItem: setItem,
|
|
68907
|
+
setAppContext: setAppContext,
|
|
68908
|
+
get appContext() {
|
|
68909
|
+
try {
|
|
68910
|
+
var _window$toolkitEnv4, _storage$getLocalItem2, _window$toolkitEnv5;
|
|
68911
|
+
var isCoreApp = (_window$toolkitEnv4 = window.toolkitEnv) !== null && _window$toolkitEnv4 !== void 0 && _window$toolkitEnv4.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
68912
|
+
if (isCoreApp) {
|
|
68913
|
+
return getSessionItem('opsportal-core:miHelpBotContext');
|
|
68914
|
+
}
|
|
68915
|
+
var appTiles = ((_storage$getLocalItem2 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.tiles) || [];
|
|
68916
|
+
var appName = getAppName();
|
|
68917
|
+
var appData = appTiles.find(function (tile) {
|
|
68918
|
+
return tile.appName ? tile.appName === appName : tile.path === "/".concat(appName);
|
|
68919
|
+
});
|
|
68920
|
+
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv5 = window.toolkitEnv) !== null && _window$toolkitEnv5 !== void 0 && _window$toolkitEnv5.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
68921
|
+
return appAuthName ? getSessionItem("".concat(appAuthName, ":miHelpBotContext")) : {};
|
|
68922
|
+
} catch (e) {
|
|
68923
|
+
console.log('App context error, ', e);
|
|
68924
|
+
return '';
|
|
68925
|
+
}
|
|
68926
|
+
},
|
|
68927
|
+
get config() {
|
|
68928
|
+
return getItem$1('config');
|
|
68929
|
+
},
|
|
68930
|
+
get coreConfig() {
|
|
68931
|
+
return getLocalItem('opsportal-core:config');
|
|
68932
|
+
},
|
|
68933
|
+
get permissions() {
|
|
68934
|
+
return getLocalItem('settings', 'permissions') || [];
|
|
68935
|
+
},
|
|
68936
|
+
get permissionIds() {
|
|
68937
|
+
return getLocalItem('settings', 'permissionIds') || [];
|
|
68938
|
+
},
|
|
68939
|
+
get allPermissionIds() {
|
|
68940
|
+
return getLocalItem('settings', 'allPermissionIds') || [];
|
|
68941
|
+
},
|
|
68942
|
+
get coreAppPermissions() {
|
|
68943
|
+
return getLocalItem('ops_portal:permissions') || [];
|
|
68944
|
+
},
|
|
68945
|
+
get currentAppPermissions() {
|
|
68946
|
+
var _storage$getLocalItem3, _window$toolkitEnv6;
|
|
68947
|
+
var appTiles = ((_storage$getLocalItem3 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.tiles) || [];
|
|
68948
|
+
var appName = getAppName();
|
|
68949
|
+
var appData = appTiles.find(function (tile) {
|
|
68950
|
+
return tile.appName ? tile.appName === appName : tile.path === "/".concat(appName);
|
|
68951
|
+
});
|
|
68952
|
+
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv6 = window.toolkitEnv) !== null && _window$toolkitEnv6 !== void 0 && _window$toolkitEnv6.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
68953
|
+
return appAuthName ? storage$1.getLocalItem("".concat(appAuthName, ":permissions")) : [];
|
|
68954
|
+
},
|
|
68955
|
+
get appScopesAndFunctions() {
|
|
68956
|
+
return getLocalItem('appScopesAndFunctions') || [];
|
|
68957
|
+
},
|
|
68958
|
+
get userAppScopes() {
|
|
68959
|
+
return getLocalItem('login', 'userAppScopes') || [];
|
|
68960
|
+
},
|
|
68961
|
+
get userName() {
|
|
68962
|
+
return getLocalItem('login', 'userData.entity_name');
|
|
68963
|
+
},
|
|
68964
|
+
get userAvailability() {
|
|
68965
|
+
return getLocalItem('dashboard', 'userAvailability');
|
|
68966
|
+
},
|
|
68967
|
+
get userEmail() {
|
|
68968
|
+
return getLocalItem('login', 'userData.entity_mail');
|
|
68969
|
+
},
|
|
68970
|
+
get userCopartId() {
|
|
68971
|
+
return getLocalItem('login', 'userData.entity_employee_copart_id');
|
|
68972
|
+
},
|
|
68973
|
+
get userSamAccount() {
|
|
68974
|
+
return getLocalItem('login', 'userData.entity_sam_id');
|
|
68975
|
+
},
|
|
68976
|
+
get userCountry() {
|
|
68977
|
+
return getLocalItem('login', 'userData.entity_country');
|
|
68978
|
+
},
|
|
68979
|
+
get accessToken() {
|
|
68980
|
+
return getLocalItem('login', 'userData.access_token');
|
|
68981
|
+
},
|
|
68982
|
+
get refreshToken() {
|
|
68983
|
+
return getLocalItem('login', 'userData.refresh_token');
|
|
68984
|
+
},
|
|
68985
|
+
get isAuthenticated() {
|
|
68986
|
+
return getLocalItem('login', 'isAuthenticated');
|
|
68987
|
+
},
|
|
68988
|
+
get activeCountry() {
|
|
68989
|
+
var _getSessionItem;
|
|
68990
|
+
return (_getSessionItem = getSessionItem('dashboard')) === null || _getSessionItem === void 0 ? void 0 : _getSessionItem.selectedCountry;
|
|
68991
|
+
},
|
|
68992
|
+
get activeLanguage() {
|
|
68993
|
+
var _getSessionItem2;
|
|
68994
|
+
return ((_getSessionItem2 = getSessionItem('dashboard')) === null || _getSessionItem2 === void 0 ? void 0 : _getSessionItem2.language) || 'en';
|
|
68995
|
+
},
|
|
68996
|
+
get userSecurityLevel() {
|
|
68997
|
+
return Number(getSessionItem('securityLevel')) || 0;
|
|
68998
|
+
},
|
|
68999
|
+
get phoneNumber() {
|
|
69000
|
+
var _getLocalItem;
|
|
69001
|
+
return (_getLocalItem = getLocalItem('dashboard')) === null || _getLocalItem === void 0 ? void 0 : _getLocalItem.phoneNumber;
|
|
69002
|
+
},
|
|
69003
|
+
get userRole() {
|
|
69004
|
+
var _getLocalItem2;
|
|
69005
|
+
return ((_getLocalItem2 = getLocalItem('settings')) === null || _getLocalItem2 === void 0 ? void 0 : _getLocalItem2.selectedRole) || '';
|
|
69006
|
+
},
|
|
69007
|
+
get hasCasAccess() {
|
|
69008
|
+
var _getLocalItem3, _getLocalItem3$userDa;
|
|
69009
|
+
return (_getLocalItem3 = getLocalItem('login')) === null || _getLocalItem3 === void 0 ? void 0 : (_getLocalItem3$userDa = _getLocalItem3.userData) === null || _getLocalItem3$userDa === void 0 ? void 0 : _getLocalItem3$userDa.hasCasAccess;
|
|
69010
|
+
},
|
|
69011
|
+
get activeYardNumber() {
|
|
69012
|
+
var _getSessionItem3;
|
|
69013
|
+
return (_getSessionItem3 = getSessionItem('dashboard')) === null || _getSessionItem3 === void 0 ? void 0 : _getSessionItem3.selectedYard;
|
|
69014
|
+
},
|
|
69015
|
+
get lastSelectedYard() {
|
|
69016
|
+
var data = getLocalItem('lastSelectedYard');
|
|
69017
|
+
if (data && Object.entries(data).length) {
|
|
69018
|
+
return data;
|
|
69019
|
+
}
|
|
69020
|
+
},
|
|
69021
|
+
get homeYard() {
|
|
69022
|
+
var _getLocalItem4;
|
|
69023
|
+
var yardList = ((_getLocalItem4 = getLocalItem('login')) === null || _getLocalItem4 === void 0 ? void 0 : _getLocalItem4.yardList) || [];
|
|
69024
|
+
return yardList.find(function (yard) {
|
|
69025
|
+
return yard.isHomeYard === 'Y';
|
|
69026
|
+
});
|
|
69027
|
+
},
|
|
69028
|
+
get selectedHierarchy() {
|
|
69029
|
+
return storage$1.getLocalItem('settings', 'selectedHierarchy') || {};
|
|
69030
|
+
},
|
|
69031
|
+
get selectedHierarchyOption() {
|
|
69032
|
+
return storage$1.getLocalItem('settings', 'selectedHierarchyOption') || {};
|
|
69033
|
+
},
|
|
69034
|
+
get chromePluginData() {
|
|
69035
|
+
return storage$1.getLocalItem('chromePluginData') || {};
|
|
69036
|
+
},
|
|
69037
|
+
get twilioVoiceTask() {
|
|
69038
|
+
return getLocalItem('twilio', 'voiceTask') || {};
|
|
69039
|
+
},
|
|
69040
|
+
get twilioCallAnswered() {
|
|
69041
|
+
return getLocalItem('twilio', 'callAccepted') || false;
|
|
69042
|
+
},
|
|
69043
|
+
get twilioWrapup() {
|
|
69044
|
+
return getLocalItem('twilio', 'wrapUpCall') || false;
|
|
69045
|
+
},
|
|
69046
|
+
get twilioEnabledStatus() {
|
|
69047
|
+
return getLocalItem('dashboard', 'twilioEnabled') || false;
|
|
69048
|
+
},
|
|
69049
|
+
get clickToDialEnabledStatus() {
|
|
69050
|
+
return cache.local.c2dEnabled ? JSON.parse(cache.local.c2dEnabled) : false;
|
|
69051
|
+
},
|
|
69052
|
+
get callCapsuleEnabledStatus() {
|
|
69053
|
+
return getLocalItem('dashboard', 'isCallCapsuleEnabled') || false;
|
|
69054
|
+
},
|
|
69055
|
+
get flexLoaded() {
|
|
69056
|
+
return getLocalItem('twilio', 'flexLoaded') || false;
|
|
69057
|
+
},
|
|
69058
|
+
get workerProfileData() {
|
|
69059
|
+
return getLocalItem('twilio', 'workerProfileData') || {};
|
|
69060
|
+
},
|
|
69061
|
+
get twilioStatus() {
|
|
69062
|
+
return getLocalItem('twilio', 'status') || 'Offline';
|
|
69063
|
+
},
|
|
69064
|
+
get twilioUserStatus() {
|
|
69065
|
+
return getLocalItem('twilio', 'userStatus') || 'Offline';
|
|
69066
|
+
},
|
|
69067
|
+
get twilioCallSid() {
|
|
69068
|
+
return getLocalItem('twilio', 'callSid') || false;
|
|
69069
|
+
},
|
|
69070
|
+
get twilioWarning() {
|
|
69071
|
+
return getLocalItem('twilio', 'warning') || 'false';
|
|
69072
|
+
},
|
|
69073
|
+
clear: function clear() {
|
|
69074
|
+
return clearStorage();
|
|
69075
|
+
},
|
|
69076
|
+
logout: function logout() {
|
|
69077
|
+
clearStorage();
|
|
69078
|
+
window.location.assign('/logout');
|
|
69079
|
+
}
|
|
69080
|
+
};
|
|
69081
|
+
|
|
69082
|
+
var isEmpty = function isEmpty(arr) {
|
|
69083
|
+
return !arr || arr.length === 0;
|
|
69084
|
+
};
|
|
69085
|
+
var includes = function includes(val, arr) {
|
|
69086
|
+
return Array.isArray(arr) && arr.includes(val);
|
|
69087
|
+
};
|
|
69088
|
+
var isNil = function isNil(v) {
|
|
69089
|
+
return v == null;
|
|
69090
|
+
};
|
|
69091
|
+
var allAreTruthy = function allAreTruthy(arr) {
|
|
69092
|
+
return arr.every(function (v) {
|
|
69093
|
+
return v === true;
|
|
69094
|
+
});
|
|
69095
|
+
};
|
|
69096
|
+
var yardNumberAllowed = function yardNumberAllowed(yardNumber, tile) {
|
|
69097
|
+
var _tile$yardRules, _tile$yardRules$allow, _tile$yardRules2, _tile$yardRules3;
|
|
69098
|
+
return (_tile$yardRules = tile.yardRules) !== null && _tile$yardRules !== void 0 && (_tile$yardRules$allow = _tile$yardRules.allow) !== null && _tile$yardRules$allow !== void 0 && _tile$yardRules$allow.length ? includes(yardNumber, (_tile$yardRules2 = tile.yardRules) === null || _tile$yardRules2 === void 0 ? void 0 : _tile$yardRules2.allow) : !includes(yardNumber, (_tile$yardRules3 = tile.yardRules) === null || _tile$yardRules3 === void 0 ? void 0 : _tile$yardRules3.deny);
|
|
69099
|
+
};
|
|
69100
|
+
var securityLevelAllowed = function securityLevelAllowed(securityLevel, tile) {
|
|
69101
|
+
var _tile$securityLevelRu, _tile$securityLevelRu2;
|
|
69102
|
+
return (tile === null || tile === void 0 ? void 0 : tile.requireCasAccess) === false || !includes(securityLevel, (_tile$securityLevelRu = tile.securityLevelRules) === null || _tile$securityLevelRu === void 0 ? void 0 : _tile$securityLevelRu.not) && ((_tile$securityLevelRu2 = tile.securityLevelRules) === null || _tile$securityLevelRu2 === void 0 ? void 0 : _tile$securityLevelRu2.lessThan) > Number(securityLevel);
|
|
69103
|
+
};
|
|
69104
|
+
var emailAddressAllowed = function emailAddressAllowed(emailAddress, tile) {
|
|
69105
|
+
var _tile$userRules, _tile$userRules2;
|
|
69106
|
+
return isEmpty((_tile$userRules = tile.userRules) === null || _tile$userRules === void 0 ? void 0 : _tile$userRules.allow) || includes(emailAddress, (_tile$userRules2 = tile.userRules) === null || _tile$userRules2 === void 0 ? void 0 : _tile$userRules2.allow);
|
|
69107
|
+
};
|
|
69108
|
+
var appFunctionIdAllowed = function appFunctionIdAllowed() {
|
|
69109
|
+
var _window$toolkitEnv;
|
|
69110
|
+
var coreAppPermissions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
69111
|
+
var permissionIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
69112
|
+
var appScopes = arguments.length > 3 ? arguments[3] : undefined;
|
|
69113
|
+
var tile = arguments.length > 4 ? arguments[4] : undefined;
|
|
69114
|
+
var stack = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.STACK ? window.toolkitEnv.STACK : process.env.STACK;
|
|
69115
|
+
if (tile.useAppScopes) {
|
|
69116
|
+
var userAppScopes = Array.isArray(appScopes) ? appScopes : [];
|
|
69117
|
+
return tile.appAuthName && userAppScopes.some(function (appScope) {
|
|
69118
|
+
return appScope.appName === tile.appAuthName;
|
|
69119
|
+
});
|
|
69120
|
+
}
|
|
69121
|
+
var id = tile.appFunctionId;
|
|
69122
|
+
if (!id) {
|
|
69123
|
+
return true;
|
|
69124
|
+
} else if (stack === 'g') {
|
|
69125
|
+
return includes(id, permissionIds);
|
|
69126
|
+
} else {
|
|
69127
|
+
return !isEmpty(coreAppPermissions) && !isNil(coreAppPermissions.find(function (permission) {
|
|
69128
|
+
return permission.name === id;
|
|
69129
|
+
}));
|
|
69130
|
+
}
|
|
69131
|
+
};
|
|
69132
|
+
var stackIsAllowed = function stackIsAllowed(stack) {
|
|
69133
|
+
return stack ? stack === global.STACK : true;
|
|
69134
|
+
};
|
|
69135
|
+
var casAccessAllowed = function casAccessAllowed(hasCasAccess) {
|
|
69136
|
+
var requireCasAccess = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
69137
|
+
if (isNil(hasCasAccess)) return true;
|
|
69138
|
+
return requireCasAccess === false || requireCasAccess && hasCasAccess;
|
|
69139
|
+
};
|
|
69140
|
+
var getUserData = function getUserData() {
|
|
69141
|
+
return {
|
|
69142
|
+
activeYardNumber: storage$1.activeYardNumber,
|
|
69143
|
+
securityLevel: storage$1.userSecurityLevel,
|
|
69144
|
+
emailAddress: storage$1.userEmail,
|
|
69145
|
+
permissionIds: storage$1.permissionIds,
|
|
69146
|
+
allPermissionIds: storage$1.allPermissionIds,
|
|
69147
|
+
hasCasAccess: storage$1.hasCasAccess,
|
|
69148
|
+
coreAppPermissions: storage$1.coreAppPermissions,
|
|
69149
|
+
appScopes: storage$1.userAppScopes
|
|
69150
|
+
};
|
|
69151
|
+
};
|
|
69152
|
+
var userHasChatBotAccess = function userHasChatBotAccess(appFunction) {
|
|
69153
|
+
if (!appFunction) return true;
|
|
69154
|
+
var coreAppPermissions = storage$1.coreAppPermissions;
|
|
69155
|
+
return !isEmpty(coreAppPermissions) && !isNil(coreAppPermissions.find(function (permission) {
|
|
69156
|
+
return permission.name === appFunction;
|
|
69157
|
+
}));
|
|
69158
|
+
};
|
|
69159
|
+
var userHasAccess = function userHasAccess(tile) {
|
|
69160
|
+
var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData();
|
|
69161
|
+
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)]);
|
|
69162
|
+
};
|
|
69163
|
+
var accessHelpers = {
|
|
69164
|
+
yardNumberAllowed: yardNumberAllowed,
|
|
69165
|
+
securityLevelAllowed: securityLevelAllowed,
|
|
69166
|
+
emailAddressAllowed: emailAddressAllowed,
|
|
69167
|
+
appFunctionIdAllowed: appFunctionIdAllowed,
|
|
69168
|
+
stackIsAllowed: stackIsAllowed,
|
|
69169
|
+
casAccessAllowed: casAccessAllowed,
|
|
69170
|
+
userHasChatBotAccess: userHasChatBotAccess,
|
|
69171
|
+
userHasAccess: userHasAccess
|
|
69172
|
+
};
|
|
69173
|
+
|
|
69174
|
+
var CrumbContext = React.createContext(null);
|
|
69175
|
+
var crumbId = 0;
|
|
69176
|
+
function CrumbProvider(_ref) {
|
|
69177
|
+
var children = _ref.children,
|
|
69178
|
+
navigate = _ref.navigate;
|
|
69179
|
+
var _useState = React.useState([]),
|
|
69180
|
+
_useState2 = _slicedToArray(_useState, 2);
|
|
69181
|
+
_useState2[0];
|
|
69182
|
+
var setTrail = _useState2[1];
|
|
69183
|
+
var _useState3 = React.useState(function () {
|
|
69184
|
+
return navigate;
|
|
69185
|
+
}),
|
|
69186
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
69187
|
+
navigateRef = _useState4[0],
|
|
69188
|
+
setNavigateRef = _useState4[1];
|
|
69189
|
+
React.useEffect(function () {
|
|
69190
|
+
setNavigateRef(function () {
|
|
69191
|
+
return navigate;
|
|
69192
|
+
});
|
|
69193
|
+
}, [navigate]);
|
|
69194
|
+
React.useEffect(function () {
|
|
69195
|
+
var remove = addMessageListener(function (data) {
|
|
69196
|
+
var _data$eventProps;
|
|
69197
|
+
if (data.eventType === 'CRUMB_CLICKED' && ((_data$eventProps = data.eventProps) === null || _data$eventProps === void 0 ? void 0 : _data$eventProps.path) != null && navigateRef) {
|
|
69198
|
+
navigateRef(data.eventProps.path);
|
|
69199
|
+
}
|
|
69200
|
+
});
|
|
69201
|
+
return remove;
|
|
69202
|
+
}, [navigateRef]);
|
|
69203
|
+
var register = React.useCallback(function (entry) {
|
|
69204
|
+
var id = ++crumbId;
|
|
69205
|
+
setTrail(function (prev) {
|
|
69206
|
+
var next = [].concat(_toConsumableArray(prev), [_objectSpread2({
|
|
69207
|
+
id: id
|
|
69208
|
+
}, entry)]);
|
|
69209
|
+
postUpdateCrumbs(next.map(function (_ref2) {
|
|
69210
|
+
var path = _ref2.path,
|
|
69211
|
+
name = _ref2.name;
|
|
69212
|
+
return {
|
|
69213
|
+
path: path || '',
|
|
69214
|
+
name: name
|
|
69215
|
+
};
|
|
69216
|
+
}));
|
|
69217
|
+
return next;
|
|
69218
|
+
});
|
|
69219
|
+
return id;
|
|
69220
|
+
}, []);
|
|
69221
|
+
var unregister = React.useCallback(function (id) {
|
|
69222
|
+
setTrail(function (prev) {
|
|
69223
|
+
var next = prev.filter(function (item) {
|
|
69224
|
+
return item.id !== id;
|
|
69225
|
+
});
|
|
69226
|
+
postUpdateCrumbs(next.map(function (_ref3) {
|
|
69227
|
+
var path = _ref3.path,
|
|
69228
|
+
name = _ref3.name;
|
|
69229
|
+
return {
|
|
69230
|
+
path: path || '',
|
|
69231
|
+
name: name
|
|
69232
|
+
};
|
|
69233
|
+
}));
|
|
69234
|
+
return next;
|
|
69235
|
+
});
|
|
69236
|
+
}, []);
|
|
69237
|
+
var update = React.useCallback(function (id, entry) {
|
|
69238
|
+
setTrail(function (prev) {
|
|
69239
|
+
var next = prev.map(function (item) {
|
|
69240
|
+
return item.id === id ? _objectSpread2(_objectSpread2({}, item), entry) : item;
|
|
69241
|
+
});
|
|
69242
|
+
postUpdateCrumbs(next.map(function (_ref4) {
|
|
69243
|
+
var path = _ref4.path,
|
|
69244
|
+
name = _ref4.name;
|
|
69245
|
+
return {
|
|
69246
|
+
path: path || '',
|
|
69247
|
+
name: name
|
|
69248
|
+
};
|
|
69249
|
+
}));
|
|
69250
|
+
return next;
|
|
69251
|
+
});
|
|
69252
|
+
}, []);
|
|
69253
|
+
var value = React.useMemo(function () {
|
|
69254
|
+
return {
|
|
69255
|
+
register: register,
|
|
69256
|
+
unregister: unregister,
|
|
69257
|
+
update: update
|
|
69258
|
+
};
|
|
69259
|
+
}, [register, unregister, update]);
|
|
69260
|
+
return /*#__PURE__*/React__default["default"].createElement(CrumbContext.Provider, {
|
|
69261
|
+
value: value
|
|
69262
|
+
}, children);
|
|
69263
|
+
}
|
|
69264
|
+
function useCrumbContext() {
|
|
69265
|
+
return React.useContext(CrumbContext);
|
|
69266
|
+
}
|
|
69267
|
+
|
|
69268
|
+
function getCrumbLabel(children) {
|
|
69269
|
+
var _children$props;
|
|
69270
|
+
if (children == null) return '';
|
|
69271
|
+
if (typeof children === 'string') return children;
|
|
69272
|
+
if (Array.isArray(children)) return children.map(getCrumbLabel).join('');
|
|
69273
|
+
if (React__default["default"].isValidElement(children) && ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.children) != null) return getCrumbLabel(children.props.children);
|
|
69274
|
+
return String(children);
|
|
69275
|
+
}
|
|
69276
|
+
function Crumb(_ref) {
|
|
69277
|
+
var to = _ref.to,
|
|
69278
|
+
children = _ref.children;
|
|
69279
|
+
var ctx = useCrumbContext();
|
|
69280
|
+
var idRef = React.useRef(null);
|
|
69281
|
+
var path = to != null ? to : '';
|
|
69282
|
+
var name = getCrumbLabel(children);
|
|
69283
|
+
React.useEffect(function () {
|
|
69284
|
+
if (!ctx) return;
|
|
69285
|
+
idRef.current = ctx.register({
|
|
69286
|
+
path: path,
|
|
69287
|
+
name: name
|
|
69288
|
+
});
|
|
69289
|
+
return function () {
|
|
69290
|
+
if (idRef.current != null) ctx.unregister(idRef.current);
|
|
69291
|
+
};
|
|
69292
|
+
}, [ctx]);
|
|
69293
|
+
React.useEffect(function () {
|
|
69294
|
+
if (ctx && idRef.current != null) {
|
|
69295
|
+
ctx.update(idRef.current, {
|
|
69296
|
+
path: path,
|
|
69297
|
+
name: name
|
|
69298
|
+
});
|
|
69299
|
+
}
|
|
69300
|
+
}, [ctx, path, name]);
|
|
69301
|
+
return null;
|
|
69302
|
+
}
|
|
69303
|
+
|
|
69304
|
+
var iframeFacade = {
|
|
69305
|
+
AppFrame: AppFrame,
|
|
69306
|
+
CallLogger: CallLogger,
|
|
69307
|
+
AutoRefresh: AutoRefresh,
|
|
69308
|
+
ContextualHelp: ContextualHelp,
|
|
69309
|
+
fetcher: fetcher,
|
|
69310
|
+
storage: storage$1,
|
|
69311
|
+
accessHelpers: accessHelpers,
|
|
69312
|
+
Crumb: Crumb,
|
|
69313
|
+
CrumbProvider: CrumbProvider,
|
|
69314
|
+
useCrumbContext: useCrumbContext,
|
|
69315
|
+
bridge: {
|
|
69316
|
+
postUpdateUri: postUpdateUri,
|
|
69317
|
+
postUpdateCrumbs: postUpdateCrumbs,
|
|
69318
|
+
postNavConfig: postNavConfig,
|
|
69319
|
+
postAppEnv: postAppEnv,
|
|
69320
|
+
addMessageListener: addMessageListener,
|
|
69321
|
+
getInitData: getInitData,
|
|
69322
|
+
getInitialUri: getInitialUri,
|
|
69323
|
+
setInitCache: setInitCache,
|
|
69324
|
+
setExtraLocal: setExtraLocal,
|
|
69325
|
+
getInitDataForBootstrap: getInitDataForBootstrap,
|
|
69326
|
+
sendStorageGet: sendStorageGet
|
|
69327
|
+
}
|
|
69328
|
+
};
|
|
69329
|
+
|
|
68076
69330
|
setup({
|
|
68077
69331
|
pkg: pkg
|
|
68078
69332
|
});
|
|
@@ -79655,8 +80909,9 @@ exports.AppFrame = AppFrame;
|
|
|
79655
80909
|
exports.AutoRefresh = AutoRefresh;
|
|
79656
80910
|
exports.CallLogger = CallLogger;
|
|
79657
80911
|
exports.ContextualHelp = ContextualHelp;
|
|
79658
|
-
exports.Crumb = Crumb;
|
|
79659
|
-
exports.accessHelpers = accessHelpers;
|
|
79660
|
-
exports.fetcher = fetcher;
|
|
79661
|
-
exports.
|
|
80912
|
+
exports.Crumb = Crumb$1;
|
|
80913
|
+
exports.accessHelpers = accessHelpers$1;
|
|
80914
|
+
exports.fetcher = fetcher$1;
|
|
80915
|
+
exports.iframeFacade = iframeFacade;
|
|
80916
|
+
exports.storage = storage$2;
|
|
79662
80917
|
//# sourceMappingURL=ops-tool-kit.js.map
|