@copart/ops-tool-kit 1.12.0-alpha.31 → 1.12.0-alpha.33
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 +570 -118
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -32,7 +32,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
32
32
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
33
33
|
|
|
34
34
|
const name$r = "@copart/ops-tool-kit";
|
|
35
|
-
const version$7 = "1.12.0-alpha.
|
|
35
|
+
const version$7 = "1.12.0-alpha.33";
|
|
36
36
|
const main$1 = "dist/ops-tool-kit.js";
|
|
37
37
|
const style = "dist/ops-tool-kit.css";
|
|
38
38
|
const files = [
|
|
@@ -21528,11 +21528,12 @@ var MobileMenu = function MobileMenu(props) {
|
|
|
21528
21528
|
var closeSidebar = props.closeSidebar,
|
|
21529
21529
|
logout = props.logout,
|
|
21530
21530
|
items = props.items,
|
|
21531
|
-
notifications = props.notifications
|
|
21531
|
+
notifications = props.notifications,
|
|
21532
|
+
sideBarTopValue = props.sideBarTopValue;
|
|
21532
21533
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21533
21534
|
className: "utilities_ops-app-frame_AppBarComponent_MobileMenu_MobileMenu--mobileMenuSidebarWrapper",
|
|
21534
21535
|
style: {
|
|
21535
|
-
top: notifications !== null && notifications !== void 0 && notifications.length ?
|
|
21536
|
+
top: notifications !== null && notifications !== void 0 && notifications.length ? "".concat(sideBarTopValue, "px") : '48px'
|
|
21536
21537
|
},
|
|
21537
21538
|
onClick: closeSidebar
|
|
21538
21539
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -23452,7 +23453,7 @@ var unique = function unique(roles) {
|
|
|
23452
23453
|
};
|
|
23453
23454
|
|
|
23454
23455
|
// Sort roles based on session country
|
|
23455
|
-
var filterRoles$
|
|
23456
|
+
var filterRoles$4 = function filterRoles(roles) {
|
|
23456
23457
|
var filtered = unique(roles).filter(function (role) {
|
|
23457
23458
|
return role.roleName;
|
|
23458
23459
|
});
|
|
@@ -23472,7 +23473,7 @@ var RoleSelector$1 = function RoleSelector(_ref) {
|
|
|
23472
23473
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, {
|
|
23473
23474
|
name: "role",
|
|
23474
23475
|
label: "Role",
|
|
23475
|
-
options: filterRoles$
|
|
23476
|
+
options: filterRoles$4(roles),
|
|
23476
23477
|
onChange: function onChange(value) {
|
|
23477
23478
|
var selectedValue = _typeof(value) === 'object' ? frontEndUtils.regex.beautifyRoleText(value.roleName) : value;
|
|
23478
23479
|
var option = _typeof(value) === 'object' ? value : null;
|
|
@@ -23701,7 +23702,7 @@ var formatPhoneNumber = function formatPhoneNumber() {
|
|
|
23701
23702
|
return "".concat(formattedNumber, " * ").concat(extension);
|
|
23702
23703
|
};
|
|
23703
23704
|
|
|
23704
|
-
var EMPTY_PRINTERS$
|
|
23705
|
+
var EMPTY_PRINTERS$3 = {
|
|
23705
23706
|
barcode_label_printers: '',
|
|
23706
23707
|
check_printers: '',
|
|
23707
23708
|
standard_printers: '',
|
|
@@ -23730,7 +23731,7 @@ var sessionOrDefault = function sessionOrDefault(label) {
|
|
|
23730
23731
|
return function () {
|
|
23731
23732
|
var printer_name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
23732
23733
|
var sessionDashboard = storage$1.getSessionItem('dashboard');
|
|
23733
|
-
sessionDashboard.printers = sessionDashboard.printers || EMPTY_PRINTERS$
|
|
23734
|
+
sessionDashboard.printers = sessionDashboard.printers || EMPTY_PRINTERS$3;
|
|
23734
23735
|
var printerName = sessionDashboard.printers[label];
|
|
23735
23736
|
return !isEmpty$2(printerName) ? printerName : printer_name;
|
|
23736
23737
|
};
|
|
@@ -23759,14 +23760,14 @@ var getActivePrinters = (function (printersData) {
|
|
|
23759
23760
|
var css_248z$9 = ".utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--title {\r\n font-weight: 500;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--inputRow {\r\n display: flex;\r\n width: 100%;\r\n align-items: flex-end;\r\n position: relative;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--inputRow .ms-TextField-errorMessage {\r\n position: absolute;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--textField {\r\n position: relative;\r\n display: flex;\r\n align-items: flex-end;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--prefix {\r\n margin: 5px;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--testCallButton {\r\n margin-left: 12px;\r\n}\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--prefix8 {\r\n margin: auto 2px auto 0;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--PhoneNumberSettings input {\r\n margin-right: 12px;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--smallInfo {\r\n margin-top: 2px;\r\n opacity: 0.5;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--PhoneNumberSettings small {\r\n margin-bottom: 12px;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--statusIndicator {\r\n position: absolute;\r\n right: 5px;\r\n height: 30px;\r\n display: flex;\r\n bottom: 1px;\r\n align-items: center;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--PhoneNumberSettings .utilities_ops-app-frame_AppBarComponent_Settings_PhoneNumberSettings_styles_PhoneNumberSettings--statusIndicator .ms-Spinner-circle {\r\n max-width: 20px !important;\r\n max-height: 20px !important;\r\n right: 5px;\r\n}\r\n\r\nmaterial-icon[name='check'] {\r\n color: rgb(100, 181, 10);\r\n font-size: 12px;\r\n}\r\n\r\nmaterial-icon[name='error_outline'] {\r\n color: #a80000;\r\n font-size: 12px;\r\n}\r\n";
|
|
23760
23761
|
styleInject(css_248z$9);
|
|
23761
23762
|
|
|
23762
|
-
var EMPTY_PRINTERS$
|
|
23763
|
+
var EMPTY_PRINTERS$2 = {
|
|
23763
23764
|
barcode_label_printers: '',
|
|
23764
23765
|
check_printers: '',
|
|
23765
23766
|
standard_printers: '',
|
|
23766
23767
|
windshield_label_printers: '',
|
|
23767
23768
|
text_printers: ''
|
|
23768
23769
|
};
|
|
23769
|
-
var getHierarchyLevel = function getHierarchyLevel(levelId) {
|
|
23770
|
+
var getHierarchyLevel$1 = function getHierarchyLevel(levelId) {
|
|
23770
23771
|
switch (levelId) {
|
|
23771
23772
|
case 0:
|
|
23772
23773
|
return 'country';
|
|
@@ -23776,25 +23777,25 @@ var getHierarchyLevel = function getHierarchyLevel(levelId) {
|
|
|
23776
23777
|
return '';
|
|
23777
23778
|
}
|
|
23778
23779
|
};
|
|
23779
|
-
var isInvalid = either$1(isNil$1, isEmpty$2);
|
|
23780
|
-
var keysToBeDeleted = ['openEmailDialog', 'openPhoneDialog', 'searchParam', 'selectedCountry', 'selectedCountryA3code', 'selectedCurrency', 'selectedRole', 'selectedTimeZone', 'selectedYard', 'showPhoneEntryOnEnter', 'yard'];
|
|
23780
|
+
var isInvalid$1 = either$1(isNil$1, isEmpty$2);
|
|
23781
|
+
var keysToBeDeleted$1 = ['openEmailDialog', 'openPhoneDialog', 'searchParam', 'selectedCountry', 'selectedCountryA3code', 'selectedCurrency', 'selectedRole', 'selectedTimeZone', 'selectedYard', 'showPhoneEntryOnEnter', 'yard'];
|
|
23781
23782
|
|
|
23782
23783
|
// Handles changes to all inputs.
|
|
23783
|
-
var handleInputChange$
|
|
23784
|
+
var handleInputChange$2 = function handleInputChange(self) {
|
|
23784
23785
|
var yardCountryCode = self.state.selectedCountryA3code;
|
|
23785
23786
|
var handleChange = function handleChange(name) {
|
|
23786
23787
|
return function (value) {
|
|
23787
23788
|
if (name === 'selectedRole') {
|
|
23788
23789
|
var selectedValue = value.selectedValue,
|
|
23789
23790
|
option = value.option;
|
|
23790
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$
|
|
23791
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$2, 'printers');
|
|
23791
23792
|
return self.setState({
|
|
23792
23793
|
selectedRoleOption: option,
|
|
23793
23794
|
selectedRole: selectedValue
|
|
23794
23795
|
});
|
|
23795
23796
|
} else if (name === 'selectedYardNumber') {
|
|
23796
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$
|
|
23797
|
-
self.updatePhoneNumber(activePhoneNumber$
|
|
23797
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$2, 'printers');
|
|
23798
|
+
self.updatePhoneNumber(activePhoneNumber$2());
|
|
23798
23799
|
|
|
23799
23800
|
// Ensure we fetch the proper roles per the entered yard
|
|
23800
23801
|
var oldSelectedYard = self.state.selectedYardNumber;
|
|
@@ -23807,7 +23808,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
23807
23808
|
});
|
|
23808
23809
|
if (value !== oldSelectedYard && Boolean(value)) {
|
|
23809
23810
|
self.setState({
|
|
23810
|
-
printersData: EMPTY_PRINTERS$
|
|
23811
|
+
printersData: EMPTY_PRINTERS$2
|
|
23811
23812
|
});
|
|
23812
23813
|
self.getActivePrinters(value, false, yardCountryCode);
|
|
23813
23814
|
}
|
|
@@ -23829,16 +23830,16 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
23829
23830
|
return final;
|
|
23830
23831
|
}, {});
|
|
23831
23832
|
};
|
|
23832
|
-
var getSelectedYard = function getSelectedYard(selectedNumber) {
|
|
23833
|
+
var getSelectedYard$1 = function getSelectedYard(selectedNumber) {
|
|
23833
23834
|
return storage$1.getLocalItem('login').yardList.find(function (yard) {
|
|
23834
23835
|
return yard.number == selectedNumber;
|
|
23835
23836
|
});
|
|
23836
23837
|
};
|
|
23837
|
-
var pickUserSecurityLevel = function pickUserSecurityLevel() {
|
|
23838
|
+
var pickUserSecurityLevel$1 = function pickUserSecurityLevel() {
|
|
23838
23839
|
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23839
23840
|
return obj.userSecurityLevel || '0';
|
|
23840
23841
|
};
|
|
23841
|
-
var saveSettings$
|
|
23842
|
+
var saveSettings$2 = function saveSettings(self) {
|
|
23842
23843
|
return /*#__PURE__*/function () {
|
|
23843
23844
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
23844
23845
|
var _yard$yard_country_co, _yard$yard_country_co2;
|
|
@@ -23860,7 +23861,7 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23860
23861
|
};
|
|
23861
23862
|
dashboardState = storage$1.getLocalItem('dashboard');
|
|
23862
23863
|
cleanedDashboardState = pickBy$1(function (val, key) {
|
|
23863
|
-
return !keysToBeDeleted.includes(key);
|
|
23864
|
+
return !keysToBeDeleted$1.includes(key);
|
|
23864
23865
|
}, dashboardState);
|
|
23865
23866
|
storage$1.setLocalItem('dashboard', cleanedDashboardState);
|
|
23866
23867
|
toPairs$1(self.state).forEach(function (_ref4) {
|
|
@@ -23886,11 +23887,11 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23886
23887
|
if (roleOptionFromState) {
|
|
23887
23888
|
_roleOptionFromState$ = roleOptionFromState.levelId, levelId = _roleOptionFromState$ === void 0 ? -1 : _roleOptionFromState$, _roleOptionFromState$2 = roleOptionFromState.hierarchyId, hierarchyId = _roleOptionFromState$2 === void 0 ? -1 : _roleOptionFromState$2;
|
|
23888
23889
|
storage$1.setLocalItem('settings', {
|
|
23889
|
-
level: getHierarchyLevel(levelId),
|
|
23890
|
+
level: getHierarchyLevel$1(levelId),
|
|
23890
23891
|
id: hierarchyId
|
|
23891
23892
|
}, 'selectedHierarchy');
|
|
23892
23893
|
}
|
|
23893
|
-
if (!(isInvalid(selectedYard) || isInvalid(selectedLanguage) || isInvalid(selectedCurrency))) {
|
|
23894
|
+
if (!(isInvalid$1(selectedYard) || isInvalid$1(selectedLanguage) || isInvalid$1(selectedCurrency))) {
|
|
23894
23895
|
_context.next = 13;
|
|
23895
23896
|
break;
|
|
23896
23897
|
}
|
|
@@ -23913,7 +23914,7 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23913
23914
|
storage$1.setLocalItem('settings', roleName, 'selectedRole');
|
|
23914
23915
|
storage$1.setLocalItem('lastSelectedYard', yard);
|
|
23915
23916
|
storage$1.setLocalItem('dashboard', selectedCurrency || yard.yard_currency, 'selectedCurrency');
|
|
23916
|
-
securityLevel = pickUserSecurityLevel(getSelectedYard(selectedYard));
|
|
23917
|
+
securityLevel = pickUserSecurityLevel$1(getSelectedYard$1(selectedYard));
|
|
23917
23918
|
storage$1.setSessionItem('securityLevel', Number(securityLevel));
|
|
23918
23919
|
_context.next = 24;
|
|
23919
23920
|
return fetcher.getUserScopes();
|
|
@@ -23955,51 +23956,51 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23955
23956
|
};
|
|
23956
23957
|
}();
|
|
23957
23958
|
};
|
|
23958
|
-
var selectedYardNumber$
|
|
23959
|
+
var selectedYardNumber$2 = function selectedYardNumber() {
|
|
23959
23960
|
var _storage$getSessionIt;
|
|
23960
23961
|
return (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
23961
23962
|
};
|
|
23962
|
-
var selectedCountry = function selectedCountry() {
|
|
23963
|
+
var selectedCountry$1 = function selectedCountry() {
|
|
23963
23964
|
var _storage$getSessionIt2;
|
|
23964
23965
|
return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
|
|
23965
23966
|
};
|
|
23966
|
-
var selectedLanguage = function selectedLanguage() {
|
|
23967
|
+
var selectedLanguage$1 = function selectedLanguage() {
|
|
23967
23968
|
var _storage$getSessionIt3;
|
|
23968
23969
|
return ((_storage$getSessionIt3 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
|
|
23969
23970
|
};
|
|
23970
|
-
var selectedCurrency = function selectedCurrency() {
|
|
23971
|
+
var selectedCurrency$1 = function selectedCurrency() {
|
|
23971
23972
|
var _storage$getSessionIt4;
|
|
23972
23973
|
return ((_storage$getSessionIt4 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCurrency) || 'USD';
|
|
23973
23974
|
};
|
|
23974
|
-
var selectedCountryA3code$
|
|
23975
|
+
var selectedCountryA3code$2 = function selectedCountryA3code() {
|
|
23975
23976
|
var _storage$getSessionIt5;
|
|
23976
23977
|
return ((_storage$getSessionIt5 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt5 === void 0 ? void 0 : _storage$getSessionIt5.selectedCountryA3code) || 'USA';
|
|
23977
23978
|
};
|
|
23978
|
-
var activePrinters$
|
|
23979
|
+
var activePrinters$2 = function activePrinters() {
|
|
23979
23980
|
var _storage$getLocalItem;
|
|
23980
|
-
return ((_storage$getLocalItem = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.printers) || EMPTY_PRINTERS$
|
|
23981
|
+
return ((_storage$getLocalItem = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.printers) || EMPTY_PRINTERS$2;
|
|
23981
23982
|
};
|
|
23982
|
-
var makeKeyValue$
|
|
23983
|
+
var makeKeyValue$2 = function makeKeyValue(final, target) {
|
|
23983
23984
|
final[target.label] = target.printer_name;
|
|
23984
23985
|
return final;
|
|
23985
23986
|
};
|
|
23986
|
-
var formatActivePrintersForState$
|
|
23987
|
+
var formatActivePrintersForState$2 = function formatActivePrintersForState() {
|
|
23987
23988
|
var activePrinters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
23988
23989
|
var printers = Array.isArray(activePrinters) ? activePrinters : [];
|
|
23989
|
-
return printers.reduce(makeKeyValue$
|
|
23990
|
+
return printers.reduce(makeKeyValue$2, {});
|
|
23990
23991
|
};
|
|
23991
|
-
var activePhoneNumber$
|
|
23992
|
+
var activePhoneNumber$2 = function activePhoneNumber() {
|
|
23992
23993
|
var _storage$getLocalItem2;
|
|
23993
23994
|
return ((_storage$getLocalItem2 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
|
|
23994
23995
|
};
|
|
23995
|
-
var ringCentralEnabled$
|
|
23996
|
+
var ringCentralEnabled$2 = function ringCentralEnabled() {
|
|
23996
23997
|
var _storage$getLocalItem3;
|
|
23997
23998
|
return ((_storage$getLocalItem3 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
|
|
23998
23999
|
};
|
|
23999
|
-
var filterRoles$
|
|
24000
|
+
var filterRoles$3 = function filterRoles(roles, countryCode) {
|
|
24000
24001
|
return compose(uniqBy$1(prop$1('roleName')), filter$1(propEq$1('countryCode', countryCode)))(roles);
|
|
24001
24002
|
};
|
|
24002
|
-
var SettingsView$
|
|
24003
|
+
var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
|
|
24003
24004
|
_inherits$2(SettingsView, _React$Component);
|
|
24004
24005
|
var _super = _createSuper(SettingsView);
|
|
24005
24006
|
function SettingsView() {
|
|
@@ -24010,22 +24011,22 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24010
24011
|
}
|
|
24011
24012
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
24012
24013
|
_defineProperty$1(_assertThisInitialized(_this), "state", _objectSpread2({
|
|
24013
|
-
phoneNumber: activePhoneNumber$
|
|
24014
|
-
ringCentralEnabled: ringCentralEnabled$
|
|
24015
|
-
selectedYardNumber: selectedYardNumber$
|
|
24016
|
-
selectedCountry: selectedCountry(),
|
|
24017
|
-
selectedCountryA3code: selectedCountryA3code$
|
|
24018
|
-
selectedLanguage: selectedLanguage(),
|
|
24019
|
-
selectedCurrency: selectedCurrency(),
|
|
24014
|
+
phoneNumber: activePhoneNumber$2(),
|
|
24015
|
+
ringCentralEnabled: ringCentralEnabled$2(),
|
|
24016
|
+
selectedYardNumber: selectedYardNumber$2(),
|
|
24017
|
+
selectedCountry: selectedCountry$1(),
|
|
24018
|
+
selectedCountryA3code: selectedCountryA3code$2(),
|
|
24019
|
+
selectedLanguage: selectedLanguage$1(),
|
|
24020
|
+
selectedCurrency: selectedCurrency$1(),
|
|
24020
24021
|
roles: [],
|
|
24021
24022
|
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$1.userRole),
|
|
24022
|
-
printersData: EMPTY_PRINTERS$
|
|
24023
|
+
printersData: EMPTY_PRINTERS$2,
|
|
24023
24024
|
loadingPrinters: false,
|
|
24024
24025
|
oldActivePrinters: null
|
|
24025
|
-
}, EMPTY_PRINTERS$
|
|
24026
|
+
}, EMPTY_PRINTERS$2));
|
|
24026
24027
|
_defineProperty$1(_assertThisInitialized(_this), "fetchRoles", function (countryCode) {
|
|
24027
24028
|
fetcher.getUserRoles(countryCode).then(function (_roles) {
|
|
24028
|
-
var roles = filterRoles$
|
|
24029
|
+
var roles = filterRoles$3(_roles, countryCode);
|
|
24029
24030
|
var selectedRole = _this.state.selectedRole;
|
|
24030
24031
|
_this.setState({
|
|
24031
24032
|
roles: roles
|
|
@@ -24069,12 +24070,12 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24069
24070
|
showLoading: false
|
|
24070
24071
|
});
|
|
24071
24072
|
if (firstTime && storage$1.getLocalItem('dashboard', 'printers')) {
|
|
24072
|
-
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters$
|
|
24073
|
-
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters$
|
|
24073
|
+
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters$2()), {}, {
|
|
24074
|
+
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters$2()) : _this.state.oldActivePrinters
|
|
24074
24075
|
}));
|
|
24075
24076
|
} else {
|
|
24076
24077
|
response = getActivePrinters(printersData);
|
|
24077
|
-
fromatted = formatActivePrintersForState$
|
|
24078
|
+
fromatted = formatActivePrintersForState$2(response);
|
|
24078
24079
|
_this.setState(_objectSpread2({
|
|
24079
24080
|
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, fromatted) : _this.state.oldActivePrinters
|
|
24080
24081
|
}, fromatted));
|
|
@@ -24094,8 +24095,8 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24094
24095
|
phoneNumber: phoneNumber
|
|
24095
24096
|
});
|
|
24096
24097
|
});
|
|
24097
|
-
_defineProperty$1(_assertThisInitialized(_this), "handleInputChange", handleInputChange$
|
|
24098
|
-
_defineProperty$1(_assertThisInitialized(_this), "saveSettings", saveSettings$
|
|
24098
|
+
_defineProperty$1(_assertThisInitialized(_this), "handleInputChange", handleInputChange$2(_assertThisInitialized(_this)));
|
|
24099
|
+
_defineProperty$1(_assertThisInitialized(_this), "saveSettings", saveSettings$2(_assertThisInitialized(_this)));
|
|
24099
24100
|
_defineProperty$1(_assertThisInitialized(_this), "yardsHistory", new Map());
|
|
24100
24101
|
_defineProperty$1(_assertThisInitialized(_this), "setPrinterData", function (name) {
|
|
24101
24102
|
return function (value) {
|
|
@@ -24112,8 +24113,8 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24112
24113
|
getRCExtensionStatus().then(function (response) {
|
|
24113
24114
|
response && resetPhoneSettingsBasedOnRCStatus(response);
|
|
24114
24115
|
_this2.setState({
|
|
24115
|
-
ringCentralEnabled: ringCentralEnabled$
|
|
24116
|
-
phoneNumber: activePhoneNumber$
|
|
24116
|
+
ringCentralEnabled: ringCentralEnabled$2(),
|
|
24117
|
+
phoneNumber: activePhoneNumber$2()
|
|
24117
24118
|
});
|
|
24118
24119
|
});
|
|
24119
24120
|
this.getActivePrinters(this.state.selectedYardNumber, true, this.state.selectedCountryA3code);
|
|
@@ -24189,7 +24190,7 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24189
24190
|
return SettingsView;
|
|
24190
24191
|
}(React__default["default"].Component);
|
|
24191
24192
|
|
|
24192
|
-
var filterRoles$
|
|
24193
|
+
var filterRoles$2 = function filterRoles(roles) {
|
|
24193
24194
|
return roles.filter(function (role) {
|
|
24194
24195
|
return role.roleName;
|
|
24195
24196
|
});
|
|
@@ -24206,7 +24207,7 @@ var RoleSelector = function RoleSelector(_ref) {
|
|
|
24206
24207
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, {
|
|
24207
24208
|
name: "role",
|
|
24208
24209
|
label: "Role",
|
|
24209
|
-
options: filterRoles$
|
|
24210
|
+
options: filterRoles$2(roles),
|
|
24210
24211
|
onChange: function onChange(value) {
|
|
24211
24212
|
var selectedValue = _typeof(value) === 'object' ? frontEndUtils.regex.beautifyRoleText(value.roleName) : value;
|
|
24212
24213
|
var option = _typeof(value) === 'object' ? value : null;
|
|
@@ -24357,7 +24358,7 @@ var YardNumberMenu = function YardNumberMenu(_ref) {
|
|
|
24357
24358
|
})));
|
|
24358
24359
|
};
|
|
24359
24360
|
|
|
24360
|
-
var EMPTY_PRINTERS = {
|
|
24361
|
+
var EMPTY_PRINTERS$1 = {
|
|
24361
24362
|
barcode_label_printers: '',
|
|
24362
24363
|
check_printers: '',
|
|
24363
24364
|
standard_printers: '',
|
|
@@ -24366,7 +24367,7 @@ var EMPTY_PRINTERS = {
|
|
|
24366
24367
|
};
|
|
24367
24368
|
|
|
24368
24369
|
// Handles changes to all inputs.
|
|
24369
|
-
var handleInputChange = function handleInputChange(self) {
|
|
24370
|
+
var handleInputChange$1 = function handleInputChange(self) {
|
|
24370
24371
|
var handleChange = function handleChange(name) {
|
|
24371
24372
|
return /*#__PURE__*/function () {
|
|
24372
24373
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
|
@@ -24379,7 +24380,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24379
24380
|
break;
|
|
24380
24381
|
}
|
|
24381
24382
|
selectedValue = value.selectedValue, option = value.option;
|
|
24382
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24383
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
24383
24384
|
roleName = option && option.roleName || ''; //pathOr('', ['selectedRoleOption', 'roleName'], nextState)
|
|
24384
24385
|
isValidRole = self.state.roles.find(function (role) {
|
|
24385
24386
|
return role.roleName === roleName;
|
|
@@ -24396,8 +24397,8 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24396
24397
|
hierarchies: hierarchies,
|
|
24397
24398
|
selectedHierarchyOption: null,
|
|
24398
24399
|
selectedYardNumber: null,
|
|
24399
|
-
printersData: EMPTY_PRINTERS
|
|
24400
|
-
}, EMPTY_PRINTERS));
|
|
24400
|
+
printersData: EMPTY_PRINTERS$1
|
|
24401
|
+
}, EMPTY_PRINTERS$1));
|
|
24401
24402
|
case 10:
|
|
24402
24403
|
return _context.abrupt("return", self.setState({
|
|
24403
24404
|
selectedRoleOption: option,
|
|
@@ -24408,7 +24409,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24408
24409
|
_context.next = 32;
|
|
24409
24410
|
break;
|
|
24410
24411
|
}
|
|
24411
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24412
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
24412
24413
|
country = value.country, _value$yard = value.yard, yard = _value$yard === void 0 ? null : _value$yard;
|
|
24413
24414
|
countryId = country && country.split('-')[0];
|
|
24414
24415
|
if (!countryId) {
|
|
@@ -24441,8 +24442,8 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24441
24442
|
level: yard ? 'yard' : 'country'
|
|
24442
24443
|
},
|
|
24443
24444
|
selectedYardNumber: yard,
|
|
24444
|
-
printersData: EMPTY_PRINTERS
|
|
24445
|
-
}, EMPTY_PRINTERS));
|
|
24445
|
+
printersData: EMPTY_PRINTERS$1
|
|
24446
|
+
}, EMPTY_PRINTERS$1));
|
|
24446
24447
|
case 30:
|
|
24447
24448
|
_context.next = 43;
|
|
24448
24449
|
break;
|
|
@@ -24451,7 +24452,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24451
24452
|
_context.next = 43;
|
|
24452
24453
|
break;
|
|
24453
24454
|
}
|
|
24454
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24455
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
24455
24456
|
if (!(value !== self.state.selectedYardNumber && Boolean(value))) {
|
|
24456
24457
|
_context.next = 42;
|
|
24457
24458
|
break;
|
|
@@ -24471,8 +24472,8 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24471
24472
|
return _context.abrupt("return", self.setState(function (state) {
|
|
24472
24473
|
return _objectSpread2({
|
|
24473
24474
|
selectedYardNumber: value,
|
|
24474
|
-
printersData: EMPTY_PRINTERS
|
|
24475
|
-
}, EMPTY_PRINTERS);
|
|
24475
|
+
printersData: EMPTY_PRINTERS$1
|
|
24476
|
+
}, EMPTY_PRINTERS$1);
|
|
24476
24477
|
}));
|
|
24477
24478
|
case 43:
|
|
24478
24479
|
self.setState(function (state) {
|
|
@@ -24494,7 +24495,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24494
24495
|
return final;
|
|
24495
24496
|
}, {});
|
|
24496
24497
|
};
|
|
24497
|
-
var saveSettings = function saveSettings(self) {
|
|
24498
|
+
var saveSettings$1 = function saveSettings(self) {
|
|
24498
24499
|
return /*#__PURE__*/function () {
|
|
24499
24500
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
24500
24501
|
var _yard$yard_country_co, _storage$getLocalItem, _yard$yard_country_co2;
|
|
@@ -24619,30 +24620,30 @@ var saveSettings = function saveSettings(self) {
|
|
|
24619
24620
|
};
|
|
24620
24621
|
}();
|
|
24621
24622
|
};
|
|
24622
|
-
var selectedYardNumber = function selectedYardNumber() {
|
|
24623
|
+
var selectedYardNumber$1 = function selectedYardNumber() {
|
|
24623
24624
|
return storage$1.activeYardNumber;
|
|
24624
24625
|
};
|
|
24625
|
-
var selectedCountryA3code = function selectedCountryA3code() {
|
|
24626
|
+
var selectedCountryA3code$1 = function selectedCountryA3code() {
|
|
24626
24627
|
var _storage$getSessionIt2;
|
|
24627
24628
|
return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code) || 'GBR';
|
|
24628
24629
|
};
|
|
24629
|
-
var activePrinters = function activePrinters() {
|
|
24630
|
-
return storage$1.getLocalItem('dashboard', 'printers') || EMPTY_PRINTERS;
|
|
24630
|
+
var activePrinters$1 = function activePrinters() {
|
|
24631
|
+
return storage$1.getLocalItem('dashboard', 'printers') || EMPTY_PRINTERS$1;
|
|
24631
24632
|
};
|
|
24632
|
-
var makeKeyValue = function makeKeyValue(final, target) {
|
|
24633
|
+
var makeKeyValue$1 = function makeKeyValue(final, target) {
|
|
24633
24634
|
final[target.label] = target.printer_name;
|
|
24634
24635
|
return final;
|
|
24635
24636
|
};
|
|
24636
|
-
var formatActivePrintersForState = function formatActivePrintersForState() {
|
|
24637
|
+
var formatActivePrintersForState$1 = function formatActivePrintersForState() {
|
|
24637
24638
|
var activePrinters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
24638
24639
|
var printers = Array.isArray(activePrinters) ? activePrinters : [];
|
|
24639
|
-
return printers.reduce(makeKeyValue, {});
|
|
24640
|
+
return printers.reduce(makeKeyValue$1, {});
|
|
24640
24641
|
};
|
|
24641
|
-
var activePhoneNumber = function activePhoneNumber() {
|
|
24642
|
+
var activePhoneNumber$1 = function activePhoneNumber() {
|
|
24642
24643
|
var _storage$getLocalItem2;
|
|
24643
24644
|
return ((_storage$getLocalItem2 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
|
|
24644
24645
|
};
|
|
24645
|
-
var ringCentralEnabled = function ringCentralEnabled() {
|
|
24646
|
+
var ringCentralEnabled$1 = function ringCentralEnabled() {
|
|
24646
24647
|
var _storage$getLocalItem3;
|
|
24647
24648
|
return ((_storage$getLocalItem3 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
|
|
24648
24649
|
};
|
|
@@ -24679,10 +24680,10 @@ var getYardOptions = /*#__PURE__*/function () {
|
|
|
24679
24680
|
return _ref7.apply(this, arguments);
|
|
24680
24681
|
};
|
|
24681
24682
|
}();
|
|
24682
|
-
var filterRoles = function filterRoles(roles, invalidCodes) {
|
|
24683
|
+
var filterRoles$1 = function filterRoles(roles, invalidCodes) {
|
|
24683
24684
|
return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$3(includes$1)(invalidCodes), prop$1('countryCode'))))(roles);
|
|
24684
24685
|
};
|
|
24685
|
-
var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
24686
|
+
var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
24686
24687
|
_inherits$2(SettingsView, _React$Component);
|
|
24687
24688
|
var _super = _createSuper(SettingsView);
|
|
24688
24689
|
function SettingsView() {
|
|
@@ -24693,18 +24694,18 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24693
24694
|
}
|
|
24694
24695
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
24695
24696
|
_defineProperty$1(_assertThisInitialized(_this), "state", _objectSpread2({
|
|
24696
|
-
phoneNumber: activePhoneNumber(),
|
|
24697
|
-
ringCentralEnabled: ringCentralEnabled(),
|
|
24698
|
-
selectedYardNumber: selectedYardNumber(),
|
|
24699
|
-
selectedCountryA3code: selectedCountryA3code(),
|
|
24697
|
+
phoneNumber: activePhoneNumber$1(),
|
|
24698
|
+
ringCentralEnabled: ringCentralEnabled$1(),
|
|
24699
|
+
selectedYardNumber: selectedYardNumber$1(),
|
|
24700
|
+
selectedCountryA3code: selectedCountryA3code$1(),
|
|
24700
24701
|
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$1.userRole),
|
|
24701
24702
|
selectedHierarchy: storage$1.getLocalItem('settings', 'selectedHierarchy') || null,
|
|
24702
24703
|
selectedHierarchyOption: storage$1.getLocalItem('settings', 'selectedHierarchyOption'),
|
|
24703
24704
|
roles: [],
|
|
24704
24705
|
hierarchies: [],
|
|
24705
|
-
printersData: EMPTY_PRINTERS,
|
|
24706
|
+
printersData: EMPTY_PRINTERS$1,
|
|
24706
24707
|
oldActivePrinters: null
|
|
24707
|
-
}, EMPTY_PRINTERS));
|
|
24708
|
+
}, EMPTY_PRINTERS$1));
|
|
24708
24709
|
_defineProperty$1(_assertThisInitialized(_this), "getRCAvailability", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
24709
24710
|
var response;
|
|
24710
24711
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
@@ -24716,8 +24717,8 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24716
24717
|
response = _context4.sent;
|
|
24717
24718
|
resetPhoneSettingsBasedOnRCStatus(response);
|
|
24718
24719
|
_this.setState({
|
|
24719
|
-
ringCentralEnabled: ringCentralEnabled(),
|
|
24720
|
-
phoneNumber: activePhoneNumber()
|
|
24720
|
+
ringCentralEnabled: ringCentralEnabled$1(),
|
|
24721
|
+
phoneNumber: activePhoneNumber$1()
|
|
24721
24722
|
});
|
|
24722
24723
|
case 5:
|
|
24723
24724
|
case "end":
|
|
@@ -24750,12 +24751,12 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24750
24751
|
showLoading: false
|
|
24751
24752
|
});
|
|
24752
24753
|
if (firstTime && storage$1.getLocalItem('dashboard', 'printers')) {
|
|
24753
|
-
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters()), {}, {
|
|
24754
|
-
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters()) : _this.state.oldActivePrinters
|
|
24754
|
+
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters$1()), {}, {
|
|
24755
|
+
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters$1()) : _this.state.oldActivePrinters
|
|
24755
24756
|
}));
|
|
24756
24757
|
} else {
|
|
24757
24758
|
_activePrinters = getActivePrinters(printersData);
|
|
24758
|
-
update = formatActivePrintersForState(_activePrinters);
|
|
24759
|
+
update = formatActivePrintersForState$1(_activePrinters);
|
|
24759
24760
|
_this.setState(_objectSpread2({
|
|
24760
24761
|
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, update) : _this.state.oldActivePrinters
|
|
24761
24762
|
}, update));
|
|
@@ -24775,8 +24776,8 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24775
24776
|
phoneNumber: phoneNumber
|
|
24776
24777
|
});
|
|
24777
24778
|
});
|
|
24778
|
-
_defineProperty$1(_assertThisInitialized(_this), "handleInputChange", handleInputChange(_assertThisInitialized(_this)));
|
|
24779
|
-
_defineProperty$1(_assertThisInitialized(_this), "saveSettings", saveSettings(_assertThisInitialized(_this)));
|
|
24779
|
+
_defineProperty$1(_assertThisInitialized(_this), "handleInputChange", handleInputChange$1(_assertThisInitialized(_this)));
|
|
24780
|
+
_defineProperty$1(_assertThisInitialized(_this), "saveSettings", saveSettings$1(_assertThisInitialized(_this)));
|
|
24780
24781
|
_defineProperty$1(_assertThisInitialized(_this), "setPrinterData", function (name) {
|
|
24781
24782
|
return function (value) {
|
|
24782
24783
|
_this.setState(_defineProperty$1({}, name, value));
|
|
@@ -24797,7 +24798,7 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24797
24798
|
case 2:
|
|
24798
24799
|
_roles = _context6.sent;
|
|
24799
24800
|
// MEA and UK are both valid in UK portal so filter out the rest
|
|
24800
|
-
roles = filterRoles(_roles, ['CAN', 'BRA', 'USA', 'IND']);
|
|
24801
|
+
roles = filterRoles$1(_roles, ['CAN', 'BRA', 'USA', 'IND']);
|
|
24801
24802
|
_context6.next = 6;
|
|
24802
24803
|
return fetcher.getHierarchyOptions(storage$1.userRole);
|
|
24803
24804
|
case 6:
|
|
@@ -24908,7 +24909,390 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24908
24909
|
return SettingsView;
|
|
24909
24910
|
}(React__default["default"].Component);
|
|
24910
24911
|
|
|
24911
|
-
var
|
|
24912
|
+
var EMPTY_PRINTERS = {
|
|
24913
|
+
barcode_label_printers: '',
|
|
24914
|
+
check_printers: '',
|
|
24915
|
+
standard_printers: '',
|
|
24916
|
+
windshield_label_printers: '',
|
|
24917
|
+
text_printers: ''
|
|
24918
|
+
};
|
|
24919
|
+
var getHierarchyLevel = function getHierarchyLevel(levelId) {
|
|
24920
|
+
switch (levelId) {
|
|
24921
|
+
case 0:
|
|
24922
|
+
return 'country';
|
|
24923
|
+
case 100:
|
|
24924
|
+
return 'yard';
|
|
24925
|
+
default:
|
|
24926
|
+
return '';
|
|
24927
|
+
}
|
|
24928
|
+
};
|
|
24929
|
+
var isInvalid = either$1(isNil$1, isEmpty$2);
|
|
24930
|
+
var keysToBeDeleted = ['openEmailDialog', 'openPhoneDialog', 'searchParam', 'selectedCountry', 'selectedCountryA3code', 'selectedCurrency', 'selectedRole', 'selectedTimeZone', 'selectedYard', 'showPhoneEntryOnEnter', 'yard'];
|
|
24931
|
+
|
|
24932
|
+
// Handles changes to all inputs.
|
|
24933
|
+
var handleInputChange = function handleInputChange(self) {
|
|
24934
|
+
var yardCountryCode = self.state.selectedCountryA3code;
|
|
24935
|
+
var handleChange = function handleChange(name) {
|
|
24936
|
+
return function (value) {
|
|
24937
|
+
if (name === 'selectedRole') {
|
|
24938
|
+
var selectedValue = value.selectedValue,
|
|
24939
|
+
option = value.option;
|
|
24940
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24941
|
+
return self.setState({
|
|
24942
|
+
selectedRoleOption: option,
|
|
24943
|
+
selectedRole: selectedValue
|
|
24944
|
+
});
|
|
24945
|
+
} else if (name === 'selectedYardNumber') {
|
|
24946
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24947
|
+
self.updatePhoneNumber(activePhoneNumber());
|
|
24948
|
+
|
|
24949
|
+
// Ensure we fetch the proper roles per the entered yard
|
|
24950
|
+
var oldSelectedYard = self.state.selectedYardNumber;
|
|
24951
|
+
fetcher.getYardNumbers(value).then(function (yards) {
|
|
24952
|
+
var currentYard = find$1(propEq$1('yard_number', parseInt(value)), yards);
|
|
24953
|
+
if (currentYard) yardCountryCode = currentYard.yard_country_code;
|
|
24954
|
+
self.fetchRoles(yardCountryCode);
|
|
24955
|
+
self.setState({
|
|
24956
|
+
selectedCountryA3code: yardCountryCode
|
|
24957
|
+
});
|
|
24958
|
+
if (value !== oldSelectedYard && Boolean(value)) {
|
|
24959
|
+
self.setState({
|
|
24960
|
+
printersData: EMPTY_PRINTERS
|
|
24961
|
+
});
|
|
24962
|
+
self.getActivePrinters(value, false, yardCountryCode);
|
|
24963
|
+
}
|
|
24964
|
+
});
|
|
24965
|
+
return self.setState(function (state) {
|
|
24966
|
+
return {
|
|
24967
|
+
selectedRole: '',
|
|
24968
|
+
selectedYardNumber: value
|
|
24969
|
+
};
|
|
24970
|
+
});
|
|
24971
|
+
}
|
|
24972
|
+
self.setState(function (state) {
|
|
24973
|
+
return _defineProperty$1({}, name, value);
|
|
24974
|
+
});
|
|
24975
|
+
};
|
|
24976
|
+
};
|
|
24977
|
+
return Object.keys(self.state).reduce(function (final, key) {
|
|
24978
|
+
final[key] = handleChange(key);
|
|
24979
|
+
return final;
|
|
24980
|
+
}, {});
|
|
24981
|
+
};
|
|
24982
|
+
var getSelectedYard = function getSelectedYard(selectedNumber) {
|
|
24983
|
+
return storage$1.getLocalItem('login').yardList.find(function (yard) {
|
|
24984
|
+
return yard.number == selectedNumber;
|
|
24985
|
+
});
|
|
24986
|
+
};
|
|
24987
|
+
var pickUserSecurityLevel = function pickUserSecurityLevel() {
|
|
24988
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24989
|
+
return obj.userSecurityLevel || '0';
|
|
24990
|
+
};
|
|
24991
|
+
var saveSettings = function saveSettings(self) {
|
|
24992
|
+
return /*#__PURE__*/function () {
|
|
24993
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
24994
|
+
var _yard$yard_country_co, _yard$yard_country_co2;
|
|
24995
|
+
var printers, dashboardSessionState, oldSettings, dashboardState, cleanedDashboardState, _self$state, selectedYard, selectedRole, selectedLanguage, selectedCurrency, roles, roleOptionFromState, roleName, _roleOptionFromState$, levelId, _roleOptionFromState$2, hierarchyId, yard, securityLevel, userScopes, newSettings;
|
|
24996
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
24997
|
+
while (1) switch (_context.prev = _context.next) {
|
|
24998
|
+
case 0:
|
|
24999
|
+
printers = {}; // ******* Hack to be remved ******* create date July 12, 2019 *******
|
|
25000
|
+
// Just a hack to ensure yard gets changed to avoid issue caused by proquote app which is using old toolkit
|
|
25001
|
+
// remove this hack once pro quote app update its tool kit version to latest
|
|
25002
|
+
dashboardSessionState = storage$1.getSessionItem('dashboard');
|
|
25003
|
+
oldSettings = {
|
|
25004
|
+
selectedCurrency: dashboardSessionState.selectedCurrency,
|
|
25005
|
+
selectedYard: dashboardSessionState.selectedYard,
|
|
25006
|
+
selectedCountry: dashboardSessionState.selectedCountry,
|
|
25007
|
+
language: dashboardSessionState.language,
|
|
25008
|
+
selectedRole: storage$1.getLocalItem('settings').selectedRole,
|
|
25009
|
+
activePrinters: self.state.oldActivePrinters
|
|
25010
|
+
};
|
|
25011
|
+
dashboardState = storage$1.getLocalItem('dashboard');
|
|
25012
|
+
cleanedDashboardState = pickBy$1(function (val, key) {
|
|
25013
|
+
return !keysToBeDeleted.includes(key);
|
|
25014
|
+
}, dashboardState);
|
|
25015
|
+
storage$1.setLocalItem('dashboard', cleanedDashboardState);
|
|
25016
|
+
toPairs$1(self.state).forEach(function (_ref4) {
|
|
25017
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
25018
|
+
key = _ref5[0],
|
|
25019
|
+
value = _ref5[1];
|
|
25020
|
+
if (key.endsWith('_printers')) {
|
|
25021
|
+
printers[key] = (value || '').toUpperCase();
|
|
25022
|
+
} else {
|
|
25023
|
+
if (key === 'printersData') {
|
|
25024
|
+
value = JSON.stringify(value);
|
|
25025
|
+
}
|
|
25026
|
+
if (key === 'phoneNumber') {
|
|
25027
|
+
storage$1.setLocalItem('dashboard', value, 'phoneNumber');
|
|
25028
|
+
}
|
|
25029
|
+
}
|
|
25030
|
+
});
|
|
25031
|
+
_self$state = self.state, selectedYard = _self$state.selectedYardNumber, selectedRole = _self$state.selectedRole, selectedLanguage = _self$state.selectedLanguage, selectedCurrency = _self$state.selectedCurrency, roles = _self$state.roles, _self$state.selectedRoleOption;
|
|
25032
|
+
roleOptionFromState = roles.find(function (roleOption) {
|
|
25033
|
+
return frontEndUtils.regex.beautifyRoleText(roleOption.roleName) === selectedRole;
|
|
25034
|
+
}) || head$1(roles);
|
|
25035
|
+
roleName = propOr$1('', 'roleName', roleOptionFromState); // Update hierarchy on local storage when role changes
|
|
25036
|
+
if (roleOptionFromState) {
|
|
25037
|
+
_roleOptionFromState$ = roleOptionFromState.levelId, levelId = _roleOptionFromState$ === void 0 ? -1 : _roleOptionFromState$, _roleOptionFromState$2 = roleOptionFromState.hierarchyId, hierarchyId = _roleOptionFromState$2 === void 0 ? -1 : _roleOptionFromState$2;
|
|
25038
|
+
storage$1.setLocalItem('settings', {
|
|
25039
|
+
level: getHierarchyLevel(levelId),
|
|
25040
|
+
id: hierarchyId
|
|
25041
|
+
}, 'selectedHierarchy');
|
|
25042
|
+
}
|
|
25043
|
+
if (!(isInvalid(selectedYard) || isInvalid(selectedLanguage) || isInvalid(selectedCurrency))) {
|
|
25044
|
+
_context.next = 13;
|
|
25045
|
+
break;
|
|
25046
|
+
}
|
|
25047
|
+
return _context.abrupt("return");
|
|
25048
|
+
case 13:
|
|
25049
|
+
yard = self.yardsHistory.get(selectedYard)[selectedYard];
|
|
25050
|
+
storage$1.setSessionItem('dashboard', _objectSpread2(_objectSpread2({}, storage$1.getSessionItem('dashboard')), {}, {
|
|
25051
|
+
selectedCurrency: selectedCurrency || yard.yard_currency,
|
|
25052
|
+
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),
|
|
25053
|
+
selectedCountryA3code: yard.yard_country_code,
|
|
25054
|
+
selectedYard: yard.yard_number,
|
|
25055
|
+
selectedTimeZone: yard.time_zone,
|
|
25056
|
+
language: selectedLanguage || 'en',
|
|
25057
|
+
selectedRole: roleName,
|
|
25058
|
+
printers: printers,
|
|
25059
|
+
yard: yard
|
|
25060
|
+
}));
|
|
25061
|
+
storage$1.setLocalItem('dashboard', printers, 'printers');
|
|
25062
|
+
storage$1.setLocalItem('dashboard', selectedLanguage || 'en', 'language');
|
|
25063
|
+
storage$1.setLocalItem('settings', roleName, 'selectedRole');
|
|
25064
|
+
storage$1.setLocalItem('lastSelectedYard', yard);
|
|
25065
|
+
storage$1.setLocalItem('dashboard', selectedCurrency || yard.yard_currency, 'selectedCurrency');
|
|
25066
|
+
securityLevel = pickUserSecurityLevel(getSelectedYard(selectedYard));
|
|
25067
|
+
storage$1.setSessionItem('securityLevel', Number(securityLevel));
|
|
25068
|
+
_context.next = 24;
|
|
25069
|
+
return fetcher.getUserScopes();
|
|
25070
|
+
case 24:
|
|
25071
|
+
userScopes = _context.sent;
|
|
25072
|
+
storage$1.setLocalItem('login', userScopes, 'userAppScopes');
|
|
25073
|
+
// persist user preferences
|
|
25074
|
+
_context.next = 28;
|
|
25075
|
+
return fetcher.setUserPreferences('oph', {
|
|
25076
|
+
selectedCurrency: selectedCurrency || yard.yard_currency,
|
|
25077
|
+
language: selectedLanguage || 'en',
|
|
25078
|
+
// TODO Remove this after remove role selection
|
|
25079
|
+
selectedRole: roleName,
|
|
25080
|
+
printers: printers,
|
|
25081
|
+
yard: yard,
|
|
25082
|
+
securityLevel: securityLevel
|
|
25083
|
+
}, 'USA');
|
|
25084
|
+
case 28:
|
|
25085
|
+
self.setState({
|
|
25086
|
+
oldActivePrinters: printers
|
|
25087
|
+
});
|
|
25088
|
+
newSettings = {
|
|
25089
|
+
selectedCurrency: selectedCurrency || yard.yard_currency,
|
|
25090
|
+
selectedYard: yard.yard_number,
|
|
25091
|
+
selectedCountry: (_yard$yard_country_co2 = yard.yard_country_code) === null || _yard$yard_country_co2 === void 0 ? void 0 : _yard$yard_country_co2.slice(0, 2),
|
|
25092
|
+
language: selectedLanguage || 'en',
|
|
25093
|
+
selectedRole: roleName,
|
|
25094
|
+
activePrinters: self.activePrinters
|
|
25095
|
+
};
|
|
25096
|
+
self.props.onSave(oldSettings, newSettings);
|
|
25097
|
+
case 31:
|
|
25098
|
+
case "end":
|
|
25099
|
+
return _context.stop();
|
|
25100
|
+
}
|
|
25101
|
+
}, _callee);
|
|
25102
|
+
}));
|
|
25103
|
+
return function (_x) {
|
|
25104
|
+
return _ref3.apply(this, arguments);
|
|
25105
|
+
};
|
|
25106
|
+
}();
|
|
25107
|
+
};
|
|
25108
|
+
var selectedYardNumber = function selectedYardNumber() {
|
|
25109
|
+
var _storage$getSessionIt;
|
|
25110
|
+
return (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
25111
|
+
};
|
|
25112
|
+
var selectedCountry = function selectedCountry() {
|
|
25113
|
+
var _storage$getSessionIt2;
|
|
25114
|
+
return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
|
|
25115
|
+
};
|
|
25116
|
+
var selectedLanguage = function selectedLanguage() {
|
|
25117
|
+
var _storage$getSessionIt3;
|
|
25118
|
+
return ((_storage$getSessionIt3 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
|
|
25119
|
+
};
|
|
25120
|
+
var selectedCurrency = function selectedCurrency() {
|
|
25121
|
+
var _storage$getSessionIt4;
|
|
25122
|
+
return ((_storage$getSessionIt4 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCurrency) || 'USD';
|
|
25123
|
+
};
|
|
25124
|
+
var selectedCountryA3code = function selectedCountryA3code() {
|
|
25125
|
+
var _storage$getSessionIt5;
|
|
25126
|
+
return ((_storage$getSessionIt5 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt5 === void 0 ? void 0 : _storage$getSessionIt5.selectedCountryA3code) || 'USA';
|
|
25127
|
+
};
|
|
25128
|
+
var activePrinters = function activePrinters() {
|
|
25129
|
+
var _storage$getLocalItem;
|
|
25130
|
+
return ((_storage$getLocalItem = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.printers) || EMPTY_PRINTERS;
|
|
25131
|
+
};
|
|
25132
|
+
var makeKeyValue = function makeKeyValue(final, target) {
|
|
25133
|
+
final[target.label] = target.printer_name;
|
|
25134
|
+
return final;
|
|
25135
|
+
};
|
|
25136
|
+
var formatActivePrintersForState = function formatActivePrintersForState() {
|
|
25137
|
+
var activePrinters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25138
|
+
var printers = Array.isArray(activePrinters) ? activePrinters : [];
|
|
25139
|
+
return printers.reduce(makeKeyValue, {});
|
|
25140
|
+
};
|
|
25141
|
+
var activePhoneNumber = function activePhoneNumber() {
|
|
25142
|
+
var _storage$getLocalItem2;
|
|
25143
|
+
return ((_storage$getLocalItem2 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
|
|
25144
|
+
};
|
|
25145
|
+
var ringCentralEnabled = function ringCentralEnabled() {
|
|
25146
|
+
var _storage$getLocalItem3;
|
|
25147
|
+
return ((_storage$getLocalItem3 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
|
|
25148
|
+
};
|
|
25149
|
+
var filterRoles = function filterRoles(roles, countryCode) {
|
|
25150
|
+
return compose(uniqBy$1(prop$1('roleName')), filter$1(propEq$1('countryCode', countryCode)))(roles);
|
|
25151
|
+
};
|
|
25152
|
+
var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
25153
|
+
_inherits$2(SettingsView, _React$Component);
|
|
25154
|
+
var _super = _createSuper(SettingsView);
|
|
25155
|
+
function SettingsView() {
|
|
25156
|
+
var _this;
|
|
25157
|
+
_classCallCheck$2(this, SettingsView);
|
|
25158
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25159
|
+
args[_key] = arguments[_key];
|
|
25160
|
+
}
|
|
25161
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
25162
|
+
_defineProperty$1(_assertThisInitialized(_this), "state", _objectSpread2({
|
|
25163
|
+
phoneNumber: activePhoneNumber(),
|
|
25164
|
+
ringCentralEnabled: ringCentralEnabled(),
|
|
25165
|
+
selectedYardNumber: selectedYardNumber(),
|
|
25166
|
+
selectedCountry: selectedCountry(),
|
|
25167
|
+
selectedCountryA3code: selectedCountryA3code(),
|
|
25168
|
+
selectedLanguage: selectedLanguage(),
|
|
25169
|
+
selectedCurrency: selectedCurrency(),
|
|
25170
|
+
roles: [],
|
|
25171
|
+
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$1.userRole),
|
|
25172
|
+
printersData: EMPTY_PRINTERS,
|
|
25173
|
+
loadingPrinters: false,
|
|
25174
|
+
oldActivePrinters: null
|
|
25175
|
+
}, EMPTY_PRINTERS));
|
|
25176
|
+
_defineProperty$1(_assertThisInitialized(_this), "fetchRoles", function (countryCode) {
|
|
25177
|
+
fetcher.getUserRoles(countryCode).then(function (_roles) {
|
|
25178
|
+
var roles = filterRoles(_roles, countryCode);
|
|
25179
|
+
var selectedRole = _this.state.selectedRole;
|
|
25180
|
+
_this.setState({
|
|
25181
|
+
roles: roles
|
|
25182
|
+
});
|
|
25183
|
+
if (selectedRole && !find$1(compose(equals$1(selectedRole), frontEndUtils.regex.beautifyRoleText, prop$1('roleName')), roles)) {
|
|
25184
|
+
_this.setState({
|
|
25185
|
+
selectedRole: ''
|
|
25186
|
+
});
|
|
25187
|
+
}
|
|
25188
|
+
}).catch(function (err) {
|
|
25189
|
+
_this.setState({
|
|
25190
|
+
roles: [],
|
|
25191
|
+
selectedRole: ''
|
|
25192
|
+
});
|
|
25193
|
+
});
|
|
25194
|
+
});
|
|
25195
|
+
_defineProperty$1(_assertThisInitialized(_this), "getActivePrinters", /*#__PURE__*/function () {
|
|
25196
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(yardNumber) {
|
|
25197
|
+
var firstTime,
|
|
25198
|
+
countryA3code,
|
|
25199
|
+
printersData,
|
|
25200
|
+
response,
|
|
25201
|
+
fromatted,
|
|
25202
|
+
_args2 = arguments;
|
|
25203
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25204
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
25205
|
+
case 0:
|
|
25206
|
+
firstTime = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : false;
|
|
25207
|
+
countryA3code = _args2.length > 2 ? _args2[2] : undefined;
|
|
25208
|
+
_this.setState({
|
|
25209
|
+
loadingPrinters: true,
|
|
25210
|
+
showLoading: true
|
|
25211
|
+
});
|
|
25212
|
+
_context2.next = 5;
|
|
25213
|
+
return fetcher.getPrintersForYard(yardNumber, countryA3code);
|
|
25214
|
+
case 5:
|
|
25215
|
+
printersData = _context2.sent;
|
|
25216
|
+
_this.setState({
|
|
25217
|
+
printersData: printersData,
|
|
25218
|
+
loadingPrinters: false,
|
|
25219
|
+
showLoading: false
|
|
25220
|
+
});
|
|
25221
|
+
if (firstTime && storage$1.getLocalItem('dashboard', 'printers')) {
|
|
25222
|
+
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters()), {}, {
|
|
25223
|
+
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters()) : _this.state.oldActivePrinters
|
|
25224
|
+
}));
|
|
25225
|
+
} else {
|
|
25226
|
+
response = getActivePrinters(printersData);
|
|
25227
|
+
fromatted = formatActivePrintersForState(response);
|
|
25228
|
+
_this.setState(_objectSpread2({
|
|
25229
|
+
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, fromatted) : _this.state.oldActivePrinters
|
|
25230
|
+
}, fromatted));
|
|
25231
|
+
}
|
|
25232
|
+
case 8:
|
|
25233
|
+
case "end":
|
|
25234
|
+
return _context2.stop();
|
|
25235
|
+
}
|
|
25236
|
+
}, _callee2);
|
|
25237
|
+
}));
|
|
25238
|
+
return function (_x2) {
|
|
25239
|
+
return _ref6.apply(this, arguments);
|
|
25240
|
+
};
|
|
25241
|
+
}());
|
|
25242
|
+
_defineProperty$1(_assertThisInitialized(_this), "updatePhoneNumber", function (phoneNumber) {
|
|
25243
|
+
_this.setState({
|
|
25244
|
+
phoneNumber: phoneNumber
|
|
25245
|
+
});
|
|
25246
|
+
});
|
|
25247
|
+
_defineProperty$1(_assertThisInitialized(_this), "handleInputChange", handleInputChange(_assertThisInitialized(_this)));
|
|
25248
|
+
_defineProperty$1(_assertThisInitialized(_this), "saveSettings", saveSettings(_assertThisInitialized(_this)));
|
|
25249
|
+
_defineProperty$1(_assertThisInitialized(_this), "yardsHistory", new Map());
|
|
25250
|
+
_defineProperty$1(_assertThisInitialized(_this), "setPrinterData", function (name) {
|
|
25251
|
+
return function (value) {
|
|
25252
|
+
_this.setState(_defineProperty$1({}, name, value));
|
|
25253
|
+
};
|
|
25254
|
+
});
|
|
25255
|
+
return _this;
|
|
25256
|
+
} // componentWillMount() {
|
|
25257
|
+
// this.fetchRoles(this.state.selectedCountryA3code)
|
|
25258
|
+
// getRCExtensionStatus().then((response) => {
|
|
25259
|
+
// response && resetPhoneSettingsBasedOnRCStatus(response)
|
|
25260
|
+
// this.setState({
|
|
25261
|
+
// ringCentralEnabled: ringCentralEnabled(),
|
|
25262
|
+
// phoneNumber: activePhoneNumber(),
|
|
25263
|
+
// })
|
|
25264
|
+
// })
|
|
25265
|
+
// this.getActivePrinters(
|
|
25266
|
+
// this.state.selectedYardNumber,
|
|
25267
|
+
// true,
|
|
25268
|
+
// this.state.selectedCountryA3code,
|
|
25269
|
+
// )
|
|
25270
|
+
// }
|
|
25271
|
+
_createClass$2(SettingsView, [{
|
|
25272
|
+
key: "activePrinters",
|
|
25273
|
+
get: function get() {
|
|
25274
|
+
return {
|
|
25275
|
+
barcode_label_printers: this.state.barcode_label_printers,
|
|
25276
|
+
check_printers: this.state.check_printers,
|
|
25277
|
+
standard_printers: this.state.standard_printers,
|
|
25278
|
+
windshield_label_printers: this.state.windshield_label_printers,
|
|
25279
|
+
text_printers: this.state.text_printers
|
|
25280
|
+
};
|
|
25281
|
+
}
|
|
25282
|
+
}, {
|
|
25283
|
+
key: "render",
|
|
25284
|
+
value: function render() {
|
|
25285
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
25286
|
+
className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--settingsForm"
|
|
25287
|
+
}, this.props.width > 760 && /*#__PURE__*/React__default["default"].createElement(ProfileDetails, {
|
|
25288
|
+
logout: this.props.onLogoutItemClicked
|
|
25289
|
+
}));
|
|
25290
|
+
}
|
|
25291
|
+
}]);
|
|
25292
|
+
return SettingsView;
|
|
25293
|
+
}(React__default["default"].Component);
|
|
25294
|
+
|
|
25295
|
+
var css_248z$8 = ".utilities_ops-announcements_Banner--appBarContentBox {\r\n word-break: break-all;\r\n white-space: pre-wrap;\r\n font-weight: 600;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBarContent {\r\n padding: 10px 10px;\r\n font-size: 13px;\r\n width: 95%;\r\n display: flex;\r\n align-items: center;\r\n grid-gap: 20px;\r\n gap: 20px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationInfoBar {\r\n display: flex;\r\n color: #6c7a89;\r\n grid-gap: 8px;\r\n gap: 8px;\r\n width: 90%;\r\n font-size: 12px;\r\n align-items: center;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationInfoBar b {\r\n color: #171717;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationInfoBox {\r\n color: white;\r\n width: 26px;\r\n min-height: 26px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBarContentBox {\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n overflow: hidden;\r\n /* font-weight: 600; */\r\n /* autoprefixer: off */\r\n -webkit-box-orient: vertical;\r\n /* autoprefixer: on */\r\n font-size: 12px;\r\n color: #201f1e;\r\n cursor: default;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBarContentBox * {\r\n display: inline;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBarContentBox a {\r\n text-decoration: underline;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationBarContentBox {\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n overflow: hidden;\r\n width: 95%;\r\n /* font-weight: 600; */\r\n /* autoprefixer: off */\r\n -webkit-box-orient: vertical;\r\n /* autoprefixer: on */\r\n font-size: 12px;\r\n padding: 5px 5px;\r\n min-height: 20px;\r\n padding: 4px 5px 3px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationInfoBox b {\r\n color: #171717;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationInfoBox i {\r\n font-size: 20px !important;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBtnContainer {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n grid-gap: 10px;\r\n gap: 10px;\r\n font-size: 12px;\r\n align-items: center;\r\n padding: 0px 10px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationLeftBtn i {\r\n position: relative;\r\n right: -4px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationCountContainer {\r\n width: 50px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationContainer {\r\n display: flex;\r\n flex-direction: row;\r\n /* padding: 10px 10px; */\r\n grid-gap: 5px;\r\n gap: 5px;\r\n min-height: 40px;\r\n width: 100%;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--sideBar.utilities_ops-announcements_Banner--notificationContainer {\r\n padding: 8px 6px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationInfoBox {\r\n color: white;\r\n width: 52px;\r\n min-height: 52px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--sideNotificationInfoBox {\r\n color: white;\r\n width: 20px;\r\n height: 20px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n margin-right: 6px;\r\n}\r\n.utilities_ops-announcements_Banner--notificationBarBtn {\r\n width: 52px;\r\n min-height: 52px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn {\r\n width: auto;\r\n min-height: auto;\r\n align-items: flex-start;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationBtnContainer i {\r\n font-size: 22px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn i {\r\n font-size: 20px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar {\r\n flex-direction: column;\r\n /* padding: 10px 10px; */\r\n grid-gap: 0px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar i {\r\n font-size: 13px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--arrowTipContainer {\r\n width: 0px;\r\n height: 0px;\r\n border-left: 8px solid transparent;\r\n border-right: 8px solid transparent;\r\n border-bottom: 13px solid white;\r\n position: absolute;\r\n top: 51px;\r\n right: 50px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--appBarContentWrapper {\r\n padding-right: 10px;\r\n font-size: 12px;\r\n flex: 1 1 0%;\r\n display: flex;\r\n flex-direction: column;\r\n grid-gap: 4px;\r\n gap: 4px;\r\n margin-top: 5px;\r\n max-width: 100%;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--appBarContentWrapper {\r\n padding-left: 10px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--appBarContentWrapper b {\r\n color: #171717;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--feedUrl {\r\n text-decoration: none !important;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--feedUrl i {\r\n font-size: 14px;\r\n cursor: pointer;\r\n color: #1d5ab9;\r\n left: 2px;\r\n position: relative;\r\n top: 2px;\r\n margin-right: 3px;\r\n}\r\n\r\n@media (max-width: 1760px) {\r\n .utilities_ops-announcements_Banner--notificationBarContent input {\r\n width: 331px !important;\r\n }\r\n}\r\n";
|
|
24912
25296
|
styleInject(css_248z$8);
|
|
24913
25297
|
|
|
24914
25298
|
var _nodeResolve_empty = {};
|
|
@@ -31276,6 +31660,13 @@ var alertInfoColorMapping = {
|
|
|
31276
31660
|
information: 'var(--blue)',
|
|
31277
31661
|
success: 'rgb(50 179 55)'
|
|
31278
31662
|
};
|
|
31663
|
+
// const alertInfoColorMapping = {
|
|
31664
|
+
// alert: '#C50F1F',
|
|
31665
|
+
// warning: '#FFAA44',
|
|
31666
|
+
// information: '#0F4CAB',
|
|
31667
|
+
// success: '#067E3C',
|
|
31668
|
+
// }
|
|
31669
|
+
|
|
31279
31670
|
var alertToIconMapping = {
|
|
31280
31671
|
alert: 'circle-exclamation',
|
|
31281
31672
|
warning: 'triangle-exclamation',
|
|
@@ -31447,6 +31838,15 @@ var Banner = function Banner(props) {
|
|
|
31447
31838
|
style: {
|
|
31448
31839
|
backgroundColor: alertBackgroundColorMapping[categoryDescription.toLowerCase()]
|
|
31449
31840
|
}
|
|
31841
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31842
|
+
className: "utilities_ops-announcements_Banner--appBarContentWrapper",
|
|
31843
|
+
style: {
|
|
31844
|
+
borderLeft: "2px solid ".concat(alertInfoColorMapping[categoryDescription.toLowerCase()])
|
|
31845
|
+
}
|
|
31846
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31847
|
+
style: {
|
|
31848
|
+
display: 'flex'
|
|
31849
|
+
}
|
|
31450
31850
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31451
31851
|
className: "utilities_ops-announcements_Banner--sideNotificationInfoBox",
|
|
31452
31852
|
style: {
|
|
@@ -31455,11 +31855,9 @@ var Banner = function Banner(props) {
|
|
|
31455
31855
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
31456
31856
|
name: alertToIconMapping[categoryDescription.toLowerCase()],
|
|
31457
31857
|
style: {
|
|
31458
|
-
fontSize: '
|
|
31858
|
+
fontSize: '12px'
|
|
31459
31859
|
}
|
|
31460
|
-
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31461
|
-
className: "utilities_ops-announcements_Banner--appBarContentWrapper"
|
|
31462
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", null, sourceApplication && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("b", null, sourceApplication), " -"), " ", timeDiff), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31860
|
+
})), sourceApplication && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("b", null, sourceApplication), " -"), " ", timeDiff), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31463
31861
|
className: "utilities_ops-announcements_Banner--appBarContentBox"
|
|
31464
31862
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
31465
31863
|
dangerouslySetInnerHTML: {
|
|
@@ -31489,7 +31887,8 @@ var Banner = function Banner(props) {
|
|
|
31489
31887
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
31490
31888
|
style: {
|
|
31491
31889
|
cursor: 'pointer',
|
|
31492
|
-
color: '#8A8886'
|
|
31890
|
+
color: '#8A8886',
|
|
31891
|
+
fontSize: '20px'
|
|
31493
31892
|
},
|
|
31494
31893
|
name: "close",
|
|
31495
31894
|
variant: "material"
|
|
@@ -31546,7 +31945,7 @@ var Banner = function Banner(props) {
|
|
|
31546
31945
|
name: "xmark"
|
|
31547
31946
|
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31548
31947
|
style: {
|
|
31549
|
-
minHeight: '
|
|
31948
|
+
minHeight: '25px'
|
|
31550
31949
|
}
|
|
31551
31950
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31552
31951
|
className: "utilities_ops-announcements_Banner--tabNotificationBarContentBox",
|
|
@@ -31571,7 +31970,7 @@ var Banner = function Banner(props) {
|
|
|
31571
31970
|
variant: "material"
|
|
31572
31971
|
}))), action && ActionComponent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31573
31972
|
style: {
|
|
31574
|
-
|
|
31973
|
+
padding: '5px'
|
|
31575
31974
|
}
|
|
31576
31975
|
}, /*#__PURE__*/React__default["default"].createElement(ActionComponent, {
|
|
31577
31976
|
notification: notification,
|
|
@@ -32656,11 +33055,15 @@ var AppBar$1 = function AppBar(props) {
|
|
|
32656
33055
|
style: {
|
|
32657
33056
|
height: "calc(100vh - ".concat(notifications !== null && notifications !== void 0 && notifications.length ? sideBarTopValue : 48, "px)")
|
|
32658
33057
|
}
|
|
32659
|
-
}, !stack || stack === 'c' ? /*#__PURE__*/React__default["default"].createElement(SettingsView$
|
|
33058
|
+
}, !stack || stack === 'c' ? /*#__PURE__*/React__default["default"].createElement(SettingsView$2, {
|
|
32660
33059
|
onSave: onSave,
|
|
32661
33060
|
onLogoutItemClicked: onLogoutItemClicked,
|
|
32662
33061
|
width: width
|
|
32663
|
-
}) : null, stack === 'uk' ? /*#__PURE__*/React__default["default"].createElement(SettingsView, {
|
|
33062
|
+
}) : null, stack === 'uk' ? /*#__PURE__*/React__default["default"].createElement(SettingsView$1, {
|
|
33063
|
+
onSave: onSave,
|
|
33064
|
+
onLogoutItemClicked: onLogoutItemClicked,
|
|
33065
|
+
width: width
|
|
33066
|
+
}) : null, stack === 'g' ? /*#__PURE__*/React__default["default"].createElement(SettingsView, {
|
|
32664
33067
|
onSave: onSave,
|
|
32665
33068
|
onLogoutItemClicked: onLogoutItemClicked,
|
|
32666
33069
|
width: width
|
|
@@ -32668,7 +33071,8 @@ var AppBar$1 = function AppBar(props) {
|
|
|
32668
33071
|
closeSidebar: closeSidebar,
|
|
32669
33072
|
logout: onLogoutItemClicked,
|
|
32670
33073
|
items: mobileMenuItems,
|
|
32671
|
-
notifications: notifications
|
|
33074
|
+
notifications: notifications,
|
|
33075
|
+
sideBarTopValue: sideBarTopValue
|
|
32672
33076
|
}));
|
|
32673
33077
|
};
|
|
32674
33078
|
AppBar$1.defaultProps = {
|
|
@@ -46280,6 +46684,7 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46280
46684
|
getCounts = _ref2.getCounts,
|
|
46281
46685
|
activeSubmenu = _ref2.activeSubmenu,
|
|
46282
46686
|
setActiveSubmenu = _ref2.setActiveSubmenu,
|
|
46687
|
+
allowMultipleNavItemsOpen = _ref2.allowMultipleNavItemsOpen,
|
|
46283
46688
|
setShowNavigationCounts = _ref2.setShowNavigationCounts,
|
|
46284
46689
|
countsRef = _ref2.countsRef;
|
|
46285
46690
|
// const withCounts = getCounts && typeof getCounts === 'function'
|
|
@@ -46320,7 +46725,10 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46320
46725
|
setConfigValid(true);
|
|
46321
46726
|
setNavItemsModified(updatedNavItems);
|
|
46322
46727
|
setSelected(selectedItem);
|
|
46323
|
-
|
|
46728
|
+
if (activeMenuItem) setActiveSubmenu(function (menuItems) {
|
|
46729
|
+
return allowMultipleNavItemsOpen ? [].concat(_toConsumableArray(menuItems), [activeMenuItem]) : [activeMenuItem];
|
|
46730
|
+
});
|
|
46731
|
+
// setActiveSubmenu(activeMenuItem)
|
|
46324
46732
|
setConfigDepth(depth);
|
|
46325
46733
|
} else {
|
|
46326
46734
|
setConfigValid(false);
|
|
@@ -46339,7 +46747,7 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46339
46747
|
onMouseLeave: function onMouseLeave() {
|
|
46340
46748
|
return setHover(false);
|
|
46341
46749
|
},
|
|
46342
|
-
className: _getClassName("NavBarContainer ".concat(activeSubmenu && withCounts ? 'withCounts' : '', " ").concat(getCounts && typeof getCounts === 'function' ? 'countsAvailable' : ''), _styleModuleImportMap$1, {
|
|
46750
|
+
className: _getClassName("NavBarContainer ".concat(activeSubmenu !== null && activeSubmenu !== void 0 && activeSubmenu.length && withCounts ? 'withCounts' : '', " ").concat(getCounts && typeof getCounts === 'function' ? 'countsAvailable' : ''), _styleModuleImportMap$1, {
|
|
46343
46751
|
"handleMissingStyleName": "warn"
|
|
46344
46752
|
})
|
|
46345
46753
|
}, isConfigValid ? /*#__PURE__*/React__default["default"].createElement(NavigationMenu, {
|
|
@@ -46349,6 +46757,7 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46349
46757
|
configDepth: configDepth,
|
|
46350
46758
|
activeSubmenu: activeSubmenu,
|
|
46351
46759
|
setActiveSubmenu: setActiveSubmenu,
|
|
46760
|
+
allowMultipleNavItemsOpen: allowMultipleNavItemsOpen,
|
|
46352
46761
|
selected: selected,
|
|
46353
46762
|
setSelected: setSelected,
|
|
46354
46763
|
getCounts: getCounts,
|
|
@@ -46364,6 +46773,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
|
|
|
46364
46773
|
configDepth = _ref3.configDepth,
|
|
46365
46774
|
activeSubmenu = _ref3.activeSubmenu,
|
|
46366
46775
|
setActiveSubmenu = _ref3.setActiveSubmenu,
|
|
46776
|
+
allowMultipleNavItemsOpen = _ref3.allowMultipleNavItemsOpen,
|
|
46367
46777
|
selected = _ref3.selected,
|
|
46368
46778
|
setSelected = _ref3.setSelected,
|
|
46369
46779
|
getCounts = _ref3.getCounts,
|
|
@@ -46380,16 +46790,29 @@ var NavigationMenu = function NavigationMenu(_ref3) {
|
|
|
46380
46790
|
// if (splitUrl.length - 1 === configDepth) {
|
|
46381
46791
|
if (splitUrl.length - 1) {
|
|
46382
46792
|
if (configDepth === 3) {
|
|
46383
|
-
setActiveSubmenu(
|
|
46384
|
-
|
|
46793
|
+
setActiveSubmenu(function (menuItems) {
|
|
46794
|
+
return allowMultipleNavItemsOpen ? [].concat(_toConsumableArray(menuItems), ["/".concat(splitUrl[1], "/").concat(splitUrl[2])]) : ["/".concat(splitUrl[1], "/").concat(splitUrl[2])];
|
|
46795
|
+
});
|
|
46796
|
+
// setActiveSubmenu('/' + splitUrl[1] + '/' + splitUrl[2])
|
|
46797
|
+
var newSelectedUrl = splitUrl.slice(1).join('/');
|
|
46798
|
+
// setSelected('/' + splitUrl[1] + '/' + splitUrl[2] + '/' + splitUrl[3])
|
|
46799
|
+
setSelected("/".concat(newSelectedUrl));
|
|
46385
46800
|
} else if (configDepth === 2) {
|
|
46386
|
-
setActiveSubmenu('/' + splitUrl[1])
|
|
46387
|
-
|
|
46801
|
+
// setActiveSubmenu('/' + splitUrl[1])
|
|
46802
|
+
setActiveSubmenu(function (menuItems) {
|
|
46803
|
+
return allowMultipleNavItemsOpen ? [].concat(_toConsumableArray(menuItems), ["/".concat(splitUrl[1])]) : ["/".concat(splitUrl[1])];
|
|
46804
|
+
});
|
|
46805
|
+
var _newSelectedUrl = splitUrl.slice(1).join('/');
|
|
46806
|
+
// setSelected('/' + splitUrl[1] + '/' + splitUrl[2])
|
|
46807
|
+
setSelected("/".concat(_newSelectedUrl));
|
|
46388
46808
|
} else {
|
|
46389
|
-
|
|
46809
|
+
var _newSelectedUrl2 = splitUrl.slice(1).join('/');
|
|
46810
|
+
setSelected("/".concat(_newSelectedUrl2));
|
|
46811
|
+
// setSelected('/' + splitUrl[1])
|
|
46390
46812
|
}
|
|
46391
46813
|
} else {
|
|
46392
|
-
setActiveSubmenu(null)
|
|
46814
|
+
// setActiveSubmenu(null)
|
|
46815
|
+
if (!allowMultipleNavItemsOpen) setActiveSubmenu([]);
|
|
46393
46816
|
setSelected(null);
|
|
46394
46817
|
}
|
|
46395
46818
|
}
|
|
@@ -46409,6 +46832,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
|
|
|
46409
46832
|
activeSubmenu: activeSubmenu,
|
|
46410
46833
|
navigateFunction: navigateFunction,
|
|
46411
46834
|
setActiveSubmenu: setActiveSubmenu,
|
|
46835
|
+
allowMultipleNavItemsOpen: allowMultipleNavItemsOpen,
|
|
46412
46836
|
selected: selected,
|
|
46413
46837
|
setSelected: setSelected,
|
|
46414
46838
|
redirectUrl: redirectUrl,
|
|
@@ -46425,6 +46849,7 @@ var NavigationMenuLevel1 = function NavigationMenuLevel1(_ref4) {
|
|
|
46425
46849
|
isHover = _ref4.isHover,
|
|
46426
46850
|
activeSubmenu = _ref4.activeSubmenu,
|
|
46427
46851
|
setActiveSubmenu = _ref4.setActiveSubmenu,
|
|
46852
|
+
allowMultipleNavItemsOpen = _ref4.allowMultipleNavItemsOpen,
|
|
46428
46853
|
navigateFunction = _ref4.navigateFunction,
|
|
46429
46854
|
selected = _ref4.selected,
|
|
46430
46855
|
setSelected = _ref4.setSelected,
|
|
@@ -46458,6 +46883,7 @@ var NavigationMenuLevel1 = function NavigationMenuLevel1(_ref4) {
|
|
|
46458
46883
|
setSelected: setSelected,
|
|
46459
46884
|
activeSubmenu: activeSubmenu,
|
|
46460
46885
|
setActiveSubmenu: setActiveSubmenu,
|
|
46886
|
+
allowMultipleNavItemsOpen: allowMultipleNavItemsOpen,
|
|
46461
46887
|
navigateFunction: navigateFunction,
|
|
46462
46888
|
getCounts: getCounts,
|
|
46463
46889
|
setWithCounts: setWithCounts,
|
|
@@ -46473,12 +46899,14 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
|
|
|
46473
46899
|
setSelected = _ref5.setSelected,
|
|
46474
46900
|
activeSubmenu = _ref5.activeSubmenu,
|
|
46475
46901
|
setActiveSubmenu = _ref5.setActiveSubmenu,
|
|
46902
|
+
allowMultipleNavItemsOpen = _ref5.allowMultipleNavItemsOpen,
|
|
46476
46903
|
navigateFunction = _ref5.navigateFunction,
|
|
46477
46904
|
getCounts = _ref5.getCounts,
|
|
46478
46905
|
setWithCounts = _ref5.setWithCounts,
|
|
46479
46906
|
withCounts = _ref5.withCounts,
|
|
46480
46907
|
countsRef = _ref5.countsRef;
|
|
46481
|
-
|
|
46908
|
+
// const isMenuExpanded = activeSubmenu === navItem.fullRoute
|
|
46909
|
+
var isMenuExpanded = activeSubmenu.includes(navItem.fullRoute);
|
|
46482
46910
|
var showCounts = isMenuExpanded && getCounts && typeof getCounts === 'function';
|
|
46483
46911
|
var _useState13 = React.useState(null),
|
|
46484
46912
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
@@ -46521,20 +46949,42 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
|
|
|
46521
46949
|
var handleItemClick = function handleItemClick() {
|
|
46522
46950
|
if (isDisabled) return;
|
|
46523
46951
|
if (hasSubMenuItems) {
|
|
46524
|
-
|
|
46952
|
+
if (!isMenuExpanded) {
|
|
46953
|
+
setActiveSubmenu(function (menuItems) {
|
|
46954
|
+
return allowMultipleNavItemsOpen ? [].concat(_toConsumableArray(menuItems), [navItem.fullRoute]) : [navItem.fullRoute];
|
|
46955
|
+
});
|
|
46956
|
+
} else {
|
|
46957
|
+
setActiveSubmenu(function (menuItems) {
|
|
46958
|
+
return _toConsumableArray(menuItems).filter(function (item) {
|
|
46959
|
+
return item !== navItem.fullRoute;
|
|
46960
|
+
});
|
|
46961
|
+
});
|
|
46962
|
+
}
|
|
46963
|
+
// setActiveSubmenu(isMenuExpanded ? null : navItem.fullRoute)
|
|
46525
46964
|
if (!isMenuExpanded && showCounts) {
|
|
46526
46965
|
reloadCounts();
|
|
46527
46966
|
}
|
|
46528
46967
|
} else {
|
|
46529
46968
|
navigateToItem(navItem);
|
|
46969
|
+
var pathSplit = window.location.pathname.split('/');
|
|
46970
|
+
var path = "/".concat(pathSplit[pathSplit.length - 1]);
|
|
46971
|
+
if (path === navItem.fullRoute && !allowMultipleNavItemsOpen) {
|
|
46972
|
+
setActiveSubmenu([navItem.fullRoute]);
|
|
46973
|
+
}
|
|
46530
46974
|
}
|
|
46531
46975
|
};
|
|
46976
|
+
var highlight;
|
|
46977
|
+
if (navItem !== null && navItem !== void 0 && navItem.subMenuItems || !allowMultipleNavItemsOpen) {
|
|
46978
|
+
highlight = isMenuExpanded;
|
|
46979
|
+
} else if (allowMultipleNavItemsOpen) {
|
|
46980
|
+
highlight = selected === navItem.fullRoute;
|
|
46981
|
+
}
|
|
46532
46982
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46533
46983
|
className: "utilities_ops-app-frame_NavigationBar_NavigationBar--NavMenuLevel2",
|
|
46534
46984
|
animate: isMenuExpanded ? 'open' : 'closed'
|
|
46535
46985
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46536
46986
|
onClick: handleItemClick,
|
|
46537
|
-
className: _getClassName("NavItem ".concat(
|
|
46987
|
+
className: _getClassName("NavItem ".concat(highlight ? 'expandedMenu' : '', " ").concat(selected === navItem.fullRoute && navItem !== null && navItem !== void 0 && navItem.subMenuItems ? 'NavItemSelected' : '', " ").concat(isDisabled ? 'disabled' : ''), _styleModuleImportMap$1, {
|
|
46538
46988
|
"handleMissingStyleName": "warn"
|
|
46539
46989
|
})
|
|
46540
46990
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -46544,7 +46994,7 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
|
|
|
46544
46994
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46545
46995
|
className: "utilities_ops-app-frame_NavigationBar_NavigationBar--NavItemName"
|
|
46546
46996
|
}, navItem.name), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46547
|
-
className: _getClassName("expandButton ".concat(activeSubmenu && withCounts ? 'showExpandIcons' : ''), _styleModuleImportMap$1, {
|
|
46997
|
+
className: _getClassName("expandButton ".concat(activeSubmenu !== null && activeSubmenu !== void 0 && activeSubmenu.length && withCounts ? 'showExpandIcons' : ''), _styleModuleImportMap$1, {
|
|
46548
46998
|
"handleMissingStyleName": "warn"
|
|
46549
46999
|
})
|
|
46550
47000
|
}, hasSubMenuItems && /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
@@ -46661,7 +47111,8 @@ var AppFrame = function AppFrame(props) {
|
|
|
46661
47111
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46662
47112
|
appBarMounted = _useState2[0],
|
|
46663
47113
|
setAppBarMounted = _useState2[1];
|
|
46664
|
-
|
|
47114
|
+
// const [activeSubmenu, setActiveSubmenu] = useState(null)
|
|
47115
|
+
var _useState3 = React.useState([]),
|
|
46665
47116
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
46666
47117
|
activeSubmenu = _useState4[0],
|
|
46667
47118
|
setActiveSubmenu = _useState4[1];
|
|
@@ -46690,7 +47141,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
46690
47141
|
});
|
|
46691
47142
|
|
|
46692
47143
|
// const showNavigationCounts = props.getCounts && typeof props.getCounts === 'function'
|
|
46693
|
-
var navigationWidth = activeSubmenu && showNavigationCounts ? '100px' : '50px';
|
|
47144
|
+
var navigationWidth = activeSubmenu !== null && activeSubmenu !== void 0 && activeSubmenu.length && showNavigationCounts ? '100px' : '50px';
|
|
46694
47145
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46695
47146
|
className: "utilities_ops-app-frame_AppFrame_AppFrame--AppFrame",
|
|
46696
47147
|
style: props.handleScrolling ? SCROLL : NO_SCROLL
|
|
@@ -46721,6 +47172,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
46721
47172
|
getCounts: props.getCounts,
|
|
46722
47173
|
activeSubmenu: activeSubmenu,
|
|
46723
47174
|
setActiveSubmenu: setActiveSubmenu,
|
|
47175
|
+
allowMultipleNavItemsOpen: props.allowMultipleNavItemsOpen,
|
|
46724
47176
|
setShowNavigationCounts: setShowNavigationCounts,
|
|
46725
47177
|
countsRef: props.countsRef
|
|
46726
47178
|
}) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|