@copart/ops-tool-kit 1.12.0-alpha.32 → 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 +544 -109
- 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 = [
|
|
@@ -23453,7 +23453,7 @@ var unique = function unique(roles) {
|
|
|
23453
23453
|
};
|
|
23454
23454
|
|
|
23455
23455
|
// Sort roles based on session country
|
|
23456
|
-
var filterRoles$
|
|
23456
|
+
var filterRoles$4 = function filterRoles(roles) {
|
|
23457
23457
|
var filtered = unique(roles).filter(function (role) {
|
|
23458
23458
|
return role.roleName;
|
|
23459
23459
|
});
|
|
@@ -23473,7 +23473,7 @@ var RoleSelector$1 = function RoleSelector(_ref) {
|
|
|
23473
23473
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, {
|
|
23474
23474
|
name: "role",
|
|
23475
23475
|
label: "Role",
|
|
23476
|
-
options: filterRoles$
|
|
23476
|
+
options: filterRoles$4(roles),
|
|
23477
23477
|
onChange: function onChange(value) {
|
|
23478
23478
|
var selectedValue = _typeof(value) === 'object' ? frontEndUtils.regex.beautifyRoleText(value.roleName) : value;
|
|
23479
23479
|
var option = _typeof(value) === 'object' ? value : null;
|
|
@@ -23702,7 +23702,7 @@ var formatPhoneNumber = function formatPhoneNumber() {
|
|
|
23702
23702
|
return "".concat(formattedNumber, " * ").concat(extension);
|
|
23703
23703
|
};
|
|
23704
23704
|
|
|
23705
|
-
var EMPTY_PRINTERS$
|
|
23705
|
+
var EMPTY_PRINTERS$3 = {
|
|
23706
23706
|
barcode_label_printers: '',
|
|
23707
23707
|
check_printers: '',
|
|
23708
23708
|
standard_printers: '',
|
|
@@ -23731,7 +23731,7 @@ var sessionOrDefault = function sessionOrDefault(label) {
|
|
|
23731
23731
|
return function () {
|
|
23732
23732
|
var printer_name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
23733
23733
|
var sessionDashboard = storage$1.getSessionItem('dashboard');
|
|
23734
|
-
sessionDashboard.printers = sessionDashboard.printers || EMPTY_PRINTERS$
|
|
23734
|
+
sessionDashboard.printers = sessionDashboard.printers || EMPTY_PRINTERS$3;
|
|
23735
23735
|
var printerName = sessionDashboard.printers[label];
|
|
23736
23736
|
return !isEmpty$2(printerName) ? printerName : printer_name;
|
|
23737
23737
|
};
|
|
@@ -23760,14 +23760,14 @@ var getActivePrinters = (function (printersData) {
|
|
|
23760
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";
|
|
23761
23761
|
styleInject(css_248z$9);
|
|
23762
23762
|
|
|
23763
|
-
var EMPTY_PRINTERS$
|
|
23763
|
+
var EMPTY_PRINTERS$2 = {
|
|
23764
23764
|
barcode_label_printers: '',
|
|
23765
23765
|
check_printers: '',
|
|
23766
23766
|
standard_printers: '',
|
|
23767
23767
|
windshield_label_printers: '',
|
|
23768
23768
|
text_printers: ''
|
|
23769
23769
|
};
|
|
23770
|
-
var getHierarchyLevel = function getHierarchyLevel(levelId) {
|
|
23770
|
+
var getHierarchyLevel$1 = function getHierarchyLevel(levelId) {
|
|
23771
23771
|
switch (levelId) {
|
|
23772
23772
|
case 0:
|
|
23773
23773
|
return 'country';
|
|
@@ -23777,25 +23777,25 @@ var getHierarchyLevel = function getHierarchyLevel(levelId) {
|
|
|
23777
23777
|
return '';
|
|
23778
23778
|
}
|
|
23779
23779
|
};
|
|
23780
|
-
var isInvalid = either$1(isNil$1, isEmpty$2);
|
|
23781
|
-
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'];
|
|
23782
23782
|
|
|
23783
23783
|
// Handles changes to all inputs.
|
|
23784
|
-
var handleInputChange$
|
|
23784
|
+
var handleInputChange$2 = function handleInputChange(self) {
|
|
23785
23785
|
var yardCountryCode = self.state.selectedCountryA3code;
|
|
23786
23786
|
var handleChange = function handleChange(name) {
|
|
23787
23787
|
return function (value) {
|
|
23788
23788
|
if (name === 'selectedRole') {
|
|
23789
23789
|
var selectedValue = value.selectedValue,
|
|
23790
23790
|
option = value.option;
|
|
23791
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$
|
|
23791
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$2, 'printers');
|
|
23792
23792
|
return self.setState({
|
|
23793
23793
|
selectedRoleOption: option,
|
|
23794
23794
|
selectedRole: selectedValue
|
|
23795
23795
|
});
|
|
23796
23796
|
} else if (name === 'selectedYardNumber') {
|
|
23797
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$
|
|
23798
|
-
self.updatePhoneNumber(activePhoneNumber$
|
|
23797
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$2, 'printers');
|
|
23798
|
+
self.updatePhoneNumber(activePhoneNumber$2());
|
|
23799
23799
|
|
|
23800
23800
|
// Ensure we fetch the proper roles per the entered yard
|
|
23801
23801
|
var oldSelectedYard = self.state.selectedYardNumber;
|
|
@@ -23808,7 +23808,7 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
23808
23808
|
});
|
|
23809
23809
|
if (value !== oldSelectedYard && Boolean(value)) {
|
|
23810
23810
|
self.setState({
|
|
23811
|
-
printersData: EMPTY_PRINTERS$
|
|
23811
|
+
printersData: EMPTY_PRINTERS$2
|
|
23812
23812
|
});
|
|
23813
23813
|
self.getActivePrinters(value, false, yardCountryCode);
|
|
23814
23814
|
}
|
|
@@ -23830,16 +23830,16 @@ var handleInputChange$1 = function handleInputChange(self) {
|
|
|
23830
23830
|
return final;
|
|
23831
23831
|
}, {});
|
|
23832
23832
|
};
|
|
23833
|
-
var getSelectedYard = function getSelectedYard(selectedNumber) {
|
|
23833
|
+
var getSelectedYard$1 = function getSelectedYard(selectedNumber) {
|
|
23834
23834
|
return storage$1.getLocalItem('login').yardList.find(function (yard) {
|
|
23835
23835
|
return yard.number == selectedNumber;
|
|
23836
23836
|
});
|
|
23837
23837
|
};
|
|
23838
|
-
var pickUserSecurityLevel = function pickUserSecurityLevel() {
|
|
23838
|
+
var pickUserSecurityLevel$1 = function pickUserSecurityLevel() {
|
|
23839
23839
|
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23840
23840
|
return obj.userSecurityLevel || '0';
|
|
23841
23841
|
};
|
|
23842
|
-
var saveSettings$
|
|
23842
|
+
var saveSettings$2 = function saveSettings(self) {
|
|
23843
23843
|
return /*#__PURE__*/function () {
|
|
23844
23844
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
23845
23845
|
var _yard$yard_country_co, _yard$yard_country_co2;
|
|
@@ -23861,7 +23861,7 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23861
23861
|
};
|
|
23862
23862
|
dashboardState = storage$1.getLocalItem('dashboard');
|
|
23863
23863
|
cleanedDashboardState = pickBy$1(function (val, key) {
|
|
23864
|
-
return !keysToBeDeleted.includes(key);
|
|
23864
|
+
return !keysToBeDeleted$1.includes(key);
|
|
23865
23865
|
}, dashboardState);
|
|
23866
23866
|
storage$1.setLocalItem('dashboard', cleanedDashboardState);
|
|
23867
23867
|
toPairs$1(self.state).forEach(function (_ref4) {
|
|
@@ -23887,11 +23887,11 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23887
23887
|
if (roleOptionFromState) {
|
|
23888
23888
|
_roleOptionFromState$ = roleOptionFromState.levelId, levelId = _roleOptionFromState$ === void 0 ? -1 : _roleOptionFromState$, _roleOptionFromState$2 = roleOptionFromState.hierarchyId, hierarchyId = _roleOptionFromState$2 === void 0 ? -1 : _roleOptionFromState$2;
|
|
23889
23889
|
storage$1.setLocalItem('settings', {
|
|
23890
|
-
level: getHierarchyLevel(levelId),
|
|
23890
|
+
level: getHierarchyLevel$1(levelId),
|
|
23891
23891
|
id: hierarchyId
|
|
23892
23892
|
}, 'selectedHierarchy');
|
|
23893
23893
|
}
|
|
23894
|
-
if (!(isInvalid(selectedYard) || isInvalid(selectedLanguage) || isInvalid(selectedCurrency))) {
|
|
23894
|
+
if (!(isInvalid$1(selectedYard) || isInvalid$1(selectedLanguage) || isInvalid$1(selectedCurrency))) {
|
|
23895
23895
|
_context.next = 13;
|
|
23896
23896
|
break;
|
|
23897
23897
|
}
|
|
@@ -23914,7 +23914,7 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23914
23914
|
storage$1.setLocalItem('settings', roleName, 'selectedRole');
|
|
23915
23915
|
storage$1.setLocalItem('lastSelectedYard', yard);
|
|
23916
23916
|
storage$1.setLocalItem('dashboard', selectedCurrency || yard.yard_currency, 'selectedCurrency');
|
|
23917
|
-
securityLevel = pickUserSecurityLevel(getSelectedYard(selectedYard));
|
|
23917
|
+
securityLevel = pickUserSecurityLevel$1(getSelectedYard$1(selectedYard));
|
|
23918
23918
|
storage$1.setSessionItem('securityLevel', Number(securityLevel));
|
|
23919
23919
|
_context.next = 24;
|
|
23920
23920
|
return fetcher.getUserScopes();
|
|
@@ -23956,51 +23956,51 @@ var saveSettings$1 = function saveSettings(self) {
|
|
|
23956
23956
|
};
|
|
23957
23957
|
}();
|
|
23958
23958
|
};
|
|
23959
|
-
var selectedYardNumber$
|
|
23959
|
+
var selectedYardNumber$2 = function selectedYardNumber() {
|
|
23960
23960
|
var _storage$getSessionIt;
|
|
23961
23961
|
return (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
23962
23962
|
};
|
|
23963
|
-
var selectedCountry = function selectedCountry() {
|
|
23963
|
+
var selectedCountry$1 = function selectedCountry() {
|
|
23964
23964
|
var _storage$getSessionIt2;
|
|
23965
23965
|
return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
|
|
23966
23966
|
};
|
|
23967
|
-
var selectedLanguage = function selectedLanguage() {
|
|
23967
|
+
var selectedLanguage$1 = function selectedLanguage() {
|
|
23968
23968
|
var _storage$getSessionIt3;
|
|
23969
23969
|
return ((_storage$getSessionIt3 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
|
|
23970
23970
|
};
|
|
23971
|
-
var selectedCurrency = function selectedCurrency() {
|
|
23971
|
+
var selectedCurrency$1 = function selectedCurrency() {
|
|
23972
23972
|
var _storage$getSessionIt4;
|
|
23973
23973
|
return ((_storage$getSessionIt4 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCurrency) || 'USD';
|
|
23974
23974
|
};
|
|
23975
|
-
var selectedCountryA3code$
|
|
23975
|
+
var selectedCountryA3code$2 = function selectedCountryA3code() {
|
|
23976
23976
|
var _storage$getSessionIt5;
|
|
23977
23977
|
return ((_storage$getSessionIt5 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt5 === void 0 ? void 0 : _storage$getSessionIt5.selectedCountryA3code) || 'USA';
|
|
23978
23978
|
};
|
|
23979
|
-
var activePrinters$
|
|
23979
|
+
var activePrinters$2 = function activePrinters() {
|
|
23980
23980
|
var _storage$getLocalItem;
|
|
23981
|
-
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;
|
|
23982
23982
|
};
|
|
23983
|
-
var makeKeyValue$
|
|
23983
|
+
var makeKeyValue$2 = function makeKeyValue(final, target) {
|
|
23984
23984
|
final[target.label] = target.printer_name;
|
|
23985
23985
|
return final;
|
|
23986
23986
|
};
|
|
23987
|
-
var formatActivePrintersForState$
|
|
23987
|
+
var formatActivePrintersForState$2 = function formatActivePrintersForState() {
|
|
23988
23988
|
var activePrinters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
23989
23989
|
var printers = Array.isArray(activePrinters) ? activePrinters : [];
|
|
23990
|
-
return printers.reduce(makeKeyValue$
|
|
23990
|
+
return printers.reduce(makeKeyValue$2, {});
|
|
23991
23991
|
};
|
|
23992
|
-
var activePhoneNumber$
|
|
23992
|
+
var activePhoneNumber$2 = function activePhoneNumber() {
|
|
23993
23993
|
var _storage$getLocalItem2;
|
|
23994
23994
|
return ((_storage$getLocalItem2 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
|
|
23995
23995
|
};
|
|
23996
|
-
var ringCentralEnabled$
|
|
23996
|
+
var ringCentralEnabled$2 = function ringCentralEnabled() {
|
|
23997
23997
|
var _storage$getLocalItem3;
|
|
23998
23998
|
return ((_storage$getLocalItem3 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
|
|
23999
23999
|
};
|
|
24000
|
-
var filterRoles$
|
|
24000
|
+
var filterRoles$3 = function filterRoles(roles, countryCode) {
|
|
24001
24001
|
return compose(uniqBy$1(prop$1('roleName')), filter$1(propEq$1('countryCode', countryCode)))(roles);
|
|
24002
24002
|
};
|
|
24003
|
-
var SettingsView$
|
|
24003
|
+
var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
|
|
24004
24004
|
_inherits$2(SettingsView, _React$Component);
|
|
24005
24005
|
var _super = _createSuper(SettingsView);
|
|
24006
24006
|
function SettingsView() {
|
|
@@ -24011,22 +24011,22 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24011
24011
|
}
|
|
24012
24012
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
24013
24013
|
_defineProperty$1(_assertThisInitialized(_this), "state", _objectSpread2({
|
|
24014
|
-
phoneNumber: activePhoneNumber$
|
|
24015
|
-
ringCentralEnabled: ringCentralEnabled$
|
|
24016
|
-
selectedYardNumber: selectedYardNumber$
|
|
24017
|
-
selectedCountry: selectedCountry(),
|
|
24018
|
-
selectedCountryA3code: selectedCountryA3code$
|
|
24019
|
-
selectedLanguage: selectedLanguage(),
|
|
24020
|
-
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(),
|
|
24021
24021
|
roles: [],
|
|
24022
24022
|
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$1.userRole),
|
|
24023
|
-
printersData: EMPTY_PRINTERS$
|
|
24023
|
+
printersData: EMPTY_PRINTERS$2,
|
|
24024
24024
|
loadingPrinters: false,
|
|
24025
24025
|
oldActivePrinters: null
|
|
24026
|
-
}, EMPTY_PRINTERS$
|
|
24026
|
+
}, EMPTY_PRINTERS$2));
|
|
24027
24027
|
_defineProperty$1(_assertThisInitialized(_this), "fetchRoles", function (countryCode) {
|
|
24028
24028
|
fetcher.getUserRoles(countryCode).then(function (_roles) {
|
|
24029
|
-
var roles = filterRoles$
|
|
24029
|
+
var roles = filterRoles$3(_roles, countryCode);
|
|
24030
24030
|
var selectedRole = _this.state.selectedRole;
|
|
24031
24031
|
_this.setState({
|
|
24032
24032
|
roles: roles
|
|
@@ -24070,12 +24070,12 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24070
24070
|
showLoading: false
|
|
24071
24071
|
});
|
|
24072
24072
|
if (firstTime && storage$1.getLocalItem('dashboard', 'printers')) {
|
|
24073
|
-
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters$
|
|
24074
|
-
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters$
|
|
24073
|
+
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters$2()), {}, {
|
|
24074
|
+
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters$2()) : _this.state.oldActivePrinters
|
|
24075
24075
|
}));
|
|
24076
24076
|
} else {
|
|
24077
24077
|
response = getActivePrinters(printersData);
|
|
24078
|
-
fromatted = formatActivePrintersForState$
|
|
24078
|
+
fromatted = formatActivePrintersForState$2(response);
|
|
24079
24079
|
_this.setState(_objectSpread2({
|
|
24080
24080
|
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, fromatted) : _this.state.oldActivePrinters
|
|
24081
24081
|
}, fromatted));
|
|
@@ -24095,8 +24095,8 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24095
24095
|
phoneNumber: phoneNumber
|
|
24096
24096
|
});
|
|
24097
24097
|
});
|
|
24098
|
-
_defineProperty$1(_assertThisInitialized(_this), "handleInputChange", handleInputChange$
|
|
24099
|
-
_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)));
|
|
24100
24100
|
_defineProperty$1(_assertThisInitialized(_this), "yardsHistory", new Map());
|
|
24101
24101
|
_defineProperty$1(_assertThisInitialized(_this), "setPrinterData", function (name) {
|
|
24102
24102
|
return function (value) {
|
|
@@ -24113,8 +24113,8 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24113
24113
|
getRCExtensionStatus().then(function (response) {
|
|
24114
24114
|
response && resetPhoneSettingsBasedOnRCStatus(response);
|
|
24115
24115
|
_this2.setState({
|
|
24116
|
-
ringCentralEnabled: ringCentralEnabled$
|
|
24117
|
-
phoneNumber: activePhoneNumber$
|
|
24116
|
+
ringCentralEnabled: ringCentralEnabled$2(),
|
|
24117
|
+
phoneNumber: activePhoneNumber$2()
|
|
24118
24118
|
});
|
|
24119
24119
|
});
|
|
24120
24120
|
this.getActivePrinters(this.state.selectedYardNumber, true, this.state.selectedCountryA3code);
|
|
@@ -24190,7 +24190,7 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
24190
24190
|
return SettingsView;
|
|
24191
24191
|
}(React__default["default"].Component);
|
|
24192
24192
|
|
|
24193
|
-
var filterRoles$
|
|
24193
|
+
var filterRoles$2 = function filterRoles(roles) {
|
|
24194
24194
|
return roles.filter(function (role) {
|
|
24195
24195
|
return role.roleName;
|
|
24196
24196
|
});
|
|
@@ -24207,7 +24207,7 @@ var RoleSelector = function RoleSelector(_ref) {
|
|
|
24207
24207
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, {
|
|
24208
24208
|
name: "role",
|
|
24209
24209
|
label: "Role",
|
|
24210
|
-
options: filterRoles$
|
|
24210
|
+
options: filterRoles$2(roles),
|
|
24211
24211
|
onChange: function onChange(value) {
|
|
24212
24212
|
var selectedValue = _typeof(value) === 'object' ? frontEndUtils.regex.beautifyRoleText(value.roleName) : value;
|
|
24213
24213
|
var option = _typeof(value) === 'object' ? value : null;
|
|
@@ -24358,7 +24358,7 @@ var YardNumberMenu = function YardNumberMenu(_ref) {
|
|
|
24358
24358
|
})));
|
|
24359
24359
|
};
|
|
24360
24360
|
|
|
24361
|
-
var EMPTY_PRINTERS = {
|
|
24361
|
+
var EMPTY_PRINTERS$1 = {
|
|
24362
24362
|
barcode_label_printers: '',
|
|
24363
24363
|
check_printers: '',
|
|
24364
24364
|
standard_printers: '',
|
|
@@ -24367,7 +24367,7 @@ var EMPTY_PRINTERS = {
|
|
|
24367
24367
|
};
|
|
24368
24368
|
|
|
24369
24369
|
// Handles changes to all inputs.
|
|
24370
|
-
var handleInputChange = function handleInputChange(self) {
|
|
24370
|
+
var handleInputChange$1 = function handleInputChange(self) {
|
|
24371
24371
|
var handleChange = function handleChange(name) {
|
|
24372
24372
|
return /*#__PURE__*/function () {
|
|
24373
24373
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
|
@@ -24380,7 +24380,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24380
24380
|
break;
|
|
24381
24381
|
}
|
|
24382
24382
|
selectedValue = value.selectedValue, option = value.option;
|
|
24383
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24383
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
24384
24384
|
roleName = option && option.roleName || ''; //pathOr('', ['selectedRoleOption', 'roleName'], nextState)
|
|
24385
24385
|
isValidRole = self.state.roles.find(function (role) {
|
|
24386
24386
|
return role.roleName === roleName;
|
|
@@ -24397,8 +24397,8 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24397
24397
|
hierarchies: hierarchies,
|
|
24398
24398
|
selectedHierarchyOption: null,
|
|
24399
24399
|
selectedYardNumber: null,
|
|
24400
|
-
printersData: EMPTY_PRINTERS
|
|
24401
|
-
}, EMPTY_PRINTERS));
|
|
24400
|
+
printersData: EMPTY_PRINTERS$1
|
|
24401
|
+
}, EMPTY_PRINTERS$1));
|
|
24402
24402
|
case 10:
|
|
24403
24403
|
return _context.abrupt("return", self.setState({
|
|
24404
24404
|
selectedRoleOption: option,
|
|
@@ -24409,7 +24409,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24409
24409
|
_context.next = 32;
|
|
24410
24410
|
break;
|
|
24411
24411
|
}
|
|
24412
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24412
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
24413
24413
|
country = value.country, _value$yard = value.yard, yard = _value$yard === void 0 ? null : _value$yard;
|
|
24414
24414
|
countryId = country && country.split('-')[0];
|
|
24415
24415
|
if (!countryId) {
|
|
@@ -24442,8 +24442,8 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24442
24442
|
level: yard ? 'yard' : 'country'
|
|
24443
24443
|
},
|
|
24444
24444
|
selectedYardNumber: yard,
|
|
24445
|
-
printersData: EMPTY_PRINTERS
|
|
24446
|
-
}, EMPTY_PRINTERS));
|
|
24445
|
+
printersData: EMPTY_PRINTERS$1
|
|
24446
|
+
}, EMPTY_PRINTERS$1));
|
|
24447
24447
|
case 30:
|
|
24448
24448
|
_context.next = 43;
|
|
24449
24449
|
break;
|
|
@@ -24452,7 +24452,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24452
24452
|
_context.next = 43;
|
|
24453
24453
|
break;
|
|
24454
24454
|
}
|
|
24455
|
-
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
|
|
24455
|
+
storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
|
|
24456
24456
|
if (!(value !== self.state.selectedYardNumber && Boolean(value))) {
|
|
24457
24457
|
_context.next = 42;
|
|
24458
24458
|
break;
|
|
@@ -24472,8 +24472,8 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24472
24472
|
return _context.abrupt("return", self.setState(function (state) {
|
|
24473
24473
|
return _objectSpread2({
|
|
24474
24474
|
selectedYardNumber: value,
|
|
24475
|
-
printersData: EMPTY_PRINTERS
|
|
24476
|
-
}, EMPTY_PRINTERS);
|
|
24475
|
+
printersData: EMPTY_PRINTERS$1
|
|
24476
|
+
}, EMPTY_PRINTERS$1);
|
|
24477
24477
|
}));
|
|
24478
24478
|
case 43:
|
|
24479
24479
|
self.setState(function (state) {
|
|
@@ -24495,7 +24495,7 @@ var handleInputChange = function handleInputChange(self) {
|
|
|
24495
24495
|
return final;
|
|
24496
24496
|
}, {});
|
|
24497
24497
|
};
|
|
24498
|
-
var saveSettings = function saveSettings(self) {
|
|
24498
|
+
var saveSettings$1 = function saveSettings(self) {
|
|
24499
24499
|
return /*#__PURE__*/function () {
|
|
24500
24500
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
24501
24501
|
var _yard$yard_country_co, _storage$getLocalItem, _yard$yard_country_co2;
|
|
@@ -24620,30 +24620,30 @@ var saveSettings = function saveSettings(self) {
|
|
|
24620
24620
|
};
|
|
24621
24621
|
}();
|
|
24622
24622
|
};
|
|
24623
|
-
var selectedYardNumber = function selectedYardNumber() {
|
|
24623
|
+
var selectedYardNumber$1 = function selectedYardNumber() {
|
|
24624
24624
|
return storage$1.activeYardNumber;
|
|
24625
24625
|
};
|
|
24626
|
-
var selectedCountryA3code = function selectedCountryA3code() {
|
|
24626
|
+
var selectedCountryA3code$1 = function selectedCountryA3code() {
|
|
24627
24627
|
var _storage$getSessionIt2;
|
|
24628
24628
|
return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code) || 'GBR';
|
|
24629
24629
|
};
|
|
24630
|
-
var activePrinters = function activePrinters() {
|
|
24631
|
-
return storage$1.getLocalItem('dashboard', 'printers') || EMPTY_PRINTERS;
|
|
24630
|
+
var activePrinters$1 = function activePrinters() {
|
|
24631
|
+
return storage$1.getLocalItem('dashboard', 'printers') || EMPTY_PRINTERS$1;
|
|
24632
24632
|
};
|
|
24633
|
-
var makeKeyValue = function makeKeyValue(final, target) {
|
|
24633
|
+
var makeKeyValue$1 = function makeKeyValue(final, target) {
|
|
24634
24634
|
final[target.label] = target.printer_name;
|
|
24635
24635
|
return final;
|
|
24636
24636
|
};
|
|
24637
|
-
var formatActivePrintersForState = function formatActivePrintersForState() {
|
|
24637
|
+
var formatActivePrintersForState$1 = function formatActivePrintersForState() {
|
|
24638
24638
|
var activePrinters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
24639
24639
|
var printers = Array.isArray(activePrinters) ? activePrinters : [];
|
|
24640
|
-
return printers.reduce(makeKeyValue, {});
|
|
24640
|
+
return printers.reduce(makeKeyValue$1, {});
|
|
24641
24641
|
};
|
|
24642
|
-
var activePhoneNumber = function activePhoneNumber() {
|
|
24642
|
+
var activePhoneNumber$1 = function activePhoneNumber() {
|
|
24643
24643
|
var _storage$getLocalItem2;
|
|
24644
24644
|
return ((_storage$getLocalItem2 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
|
|
24645
24645
|
};
|
|
24646
|
-
var ringCentralEnabled = function ringCentralEnabled() {
|
|
24646
|
+
var ringCentralEnabled$1 = function ringCentralEnabled() {
|
|
24647
24647
|
var _storage$getLocalItem3;
|
|
24648
24648
|
return ((_storage$getLocalItem3 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
|
|
24649
24649
|
};
|
|
@@ -24680,10 +24680,10 @@ var getYardOptions = /*#__PURE__*/function () {
|
|
|
24680
24680
|
return _ref7.apply(this, arguments);
|
|
24681
24681
|
};
|
|
24682
24682
|
}();
|
|
24683
|
-
var filterRoles = function filterRoles(roles, invalidCodes) {
|
|
24683
|
+
var filterRoles$1 = function filterRoles(roles, invalidCodes) {
|
|
24684
24684
|
return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$3(includes$1)(invalidCodes), prop$1('countryCode'))))(roles);
|
|
24685
24685
|
};
|
|
24686
|
-
var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
24686
|
+
var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
|
|
24687
24687
|
_inherits$2(SettingsView, _React$Component);
|
|
24688
24688
|
var _super = _createSuper(SettingsView);
|
|
24689
24689
|
function SettingsView() {
|
|
@@ -24694,18 +24694,18 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24694
24694
|
}
|
|
24695
24695
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
24696
24696
|
_defineProperty$1(_assertThisInitialized(_this), "state", _objectSpread2({
|
|
24697
|
-
phoneNumber: activePhoneNumber(),
|
|
24698
|
-
ringCentralEnabled: ringCentralEnabled(),
|
|
24699
|
-
selectedYardNumber: selectedYardNumber(),
|
|
24700
|
-
selectedCountryA3code: selectedCountryA3code(),
|
|
24697
|
+
phoneNumber: activePhoneNumber$1(),
|
|
24698
|
+
ringCentralEnabled: ringCentralEnabled$1(),
|
|
24699
|
+
selectedYardNumber: selectedYardNumber$1(),
|
|
24700
|
+
selectedCountryA3code: selectedCountryA3code$1(),
|
|
24701
24701
|
selectedRole: frontEndUtils.regex.beautifyRoleText(storage$1.userRole),
|
|
24702
24702
|
selectedHierarchy: storage$1.getLocalItem('settings', 'selectedHierarchy') || null,
|
|
24703
24703
|
selectedHierarchyOption: storage$1.getLocalItem('settings', 'selectedHierarchyOption'),
|
|
24704
24704
|
roles: [],
|
|
24705
24705
|
hierarchies: [],
|
|
24706
|
-
printersData: EMPTY_PRINTERS,
|
|
24706
|
+
printersData: EMPTY_PRINTERS$1,
|
|
24707
24707
|
oldActivePrinters: null
|
|
24708
|
-
}, EMPTY_PRINTERS));
|
|
24708
|
+
}, EMPTY_PRINTERS$1));
|
|
24709
24709
|
_defineProperty$1(_assertThisInitialized(_this), "getRCAvailability", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
24710
24710
|
var response;
|
|
24711
24711
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
@@ -24717,8 +24717,8 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24717
24717
|
response = _context4.sent;
|
|
24718
24718
|
resetPhoneSettingsBasedOnRCStatus(response);
|
|
24719
24719
|
_this.setState({
|
|
24720
|
-
ringCentralEnabled: ringCentralEnabled(),
|
|
24721
|
-
phoneNumber: activePhoneNumber()
|
|
24720
|
+
ringCentralEnabled: ringCentralEnabled$1(),
|
|
24721
|
+
phoneNumber: activePhoneNumber$1()
|
|
24722
24722
|
});
|
|
24723
24723
|
case 5:
|
|
24724
24724
|
case "end":
|
|
@@ -24751,12 +24751,12 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24751
24751
|
showLoading: false
|
|
24752
24752
|
});
|
|
24753
24753
|
if (firstTime && storage$1.getLocalItem('dashboard', 'printers')) {
|
|
24754
|
-
_this.setState(_objectSpread2(_objectSpread2({}, activePrinters()), {}, {
|
|
24755
|
-
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
|
|
24756
24756
|
}));
|
|
24757
24757
|
} else {
|
|
24758
24758
|
_activePrinters = getActivePrinters(printersData);
|
|
24759
|
-
update = formatActivePrintersForState(_activePrinters);
|
|
24759
|
+
update = formatActivePrintersForState$1(_activePrinters);
|
|
24760
24760
|
_this.setState(_objectSpread2({
|
|
24761
24761
|
oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, update) : _this.state.oldActivePrinters
|
|
24762
24762
|
}, update));
|
|
@@ -24776,8 +24776,8 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24776
24776
|
phoneNumber: phoneNumber
|
|
24777
24777
|
});
|
|
24778
24778
|
});
|
|
24779
|
-
_defineProperty$1(_assertThisInitialized(_this), "handleInputChange", handleInputChange(_assertThisInitialized(_this)));
|
|
24780
|
-
_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)));
|
|
24781
24781
|
_defineProperty$1(_assertThisInitialized(_this), "setPrinterData", function (name) {
|
|
24782
24782
|
return function (value) {
|
|
24783
24783
|
_this.setState(_defineProperty$1({}, name, value));
|
|
@@ -24798,7 +24798,7 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24798
24798
|
case 2:
|
|
24799
24799
|
_roles = _context6.sent;
|
|
24800
24800
|
// MEA and UK are both valid in UK portal so filter out the rest
|
|
24801
|
-
roles = filterRoles(_roles, ['CAN', 'BRA', 'USA', 'IND']);
|
|
24801
|
+
roles = filterRoles$1(_roles, ['CAN', 'BRA', 'USA', 'IND']);
|
|
24802
24802
|
_context6.next = 6;
|
|
24803
24803
|
return fetcher.getHierarchyOptions(storage$1.userRole);
|
|
24804
24804
|
case 6:
|
|
@@ -24909,7 +24909,390 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
24909
24909
|
return SettingsView;
|
|
24910
24910
|
}(React__default["default"].Component);
|
|
24911
24911
|
|
|
24912
|
-
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";
|
|
24913
25296
|
styleInject(css_248z$8);
|
|
24914
25297
|
|
|
24915
25298
|
var _nodeResolve_empty = {};
|
|
@@ -31472,7 +31855,7 @@ var Banner = function Banner(props) {
|
|
|
31472
31855
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
31473
31856
|
name: alertToIconMapping[categoryDescription.toLowerCase()],
|
|
31474
31857
|
style: {
|
|
31475
|
-
fontSize: '
|
|
31858
|
+
fontSize: '12px'
|
|
31476
31859
|
}
|
|
31477
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", {
|
|
31478
31861
|
className: "utilities_ops-announcements_Banner--appBarContentBox"
|
|
@@ -32672,11 +33055,15 @@ var AppBar$1 = function AppBar(props) {
|
|
|
32672
33055
|
style: {
|
|
32673
33056
|
height: "calc(100vh - ".concat(notifications !== null && notifications !== void 0 && notifications.length ? sideBarTopValue : 48, "px)")
|
|
32674
33057
|
}
|
|
32675
|
-
}, !stack || stack === 'c' ? /*#__PURE__*/React__default["default"].createElement(SettingsView$
|
|
33058
|
+
}, !stack || stack === 'c' ? /*#__PURE__*/React__default["default"].createElement(SettingsView$2, {
|
|
32676
33059
|
onSave: onSave,
|
|
32677
33060
|
onLogoutItemClicked: onLogoutItemClicked,
|
|
32678
33061
|
width: width
|
|
32679
|
-
}) : 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, {
|
|
32680
33067
|
onSave: onSave,
|
|
32681
33068
|
onLogoutItemClicked: onLogoutItemClicked,
|
|
32682
33069
|
width: width
|
|
@@ -46297,6 +46684,7 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46297
46684
|
getCounts = _ref2.getCounts,
|
|
46298
46685
|
activeSubmenu = _ref2.activeSubmenu,
|
|
46299
46686
|
setActiveSubmenu = _ref2.setActiveSubmenu,
|
|
46687
|
+
allowMultipleNavItemsOpen = _ref2.allowMultipleNavItemsOpen,
|
|
46300
46688
|
setShowNavigationCounts = _ref2.setShowNavigationCounts,
|
|
46301
46689
|
countsRef = _ref2.countsRef;
|
|
46302
46690
|
// const withCounts = getCounts && typeof getCounts === 'function'
|
|
@@ -46337,7 +46725,10 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46337
46725
|
setConfigValid(true);
|
|
46338
46726
|
setNavItemsModified(updatedNavItems);
|
|
46339
46727
|
setSelected(selectedItem);
|
|
46340
|
-
|
|
46728
|
+
if (activeMenuItem) setActiveSubmenu(function (menuItems) {
|
|
46729
|
+
return allowMultipleNavItemsOpen ? [].concat(_toConsumableArray(menuItems), [activeMenuItem]) : [activeMenuItem];
|
|
46730
|
+
});
|
|
46731
|
+
// setActiveSubmenu(activeMenuItem)
|
|
46341
46732
|
setConfigDepth(depth);
|
|
46342
46733
|
} else {
|
|
46343
46734
|
setConfigValid(false);
|
|
@@ -46356,7 +46747,7 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46356
46747
|
onMouseLeave: function onMouseLeave() {
|
|
46357
46748
|
return setHover(false);
|
|
46358
46749
|
},
|
|
46359
|
-
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, {
|
|
46360
46751
|
"handleMissingStyleName": "warn"
|
|
46361
46752
|
})
|
|
46362
46753
|
}, isConfigValid ? /*#__PURE__*/React__default["default"].createElement(NavigationMenu, {
|
|
@@ -46366,6 +46757,7 @@ var NavigationBar = function NavigationBar(_ref2) {
|
|
|
46366
46757
|
configDepth: configDepth,
|
|
46367
46758
|
activeSubmenu: activeSubmenu,
|
|
46368
46759
|
setActiveSubmenu: setActiveSubmenu,
|
|
46760
|
+
allowMultipleNavItemsOpen: allowMultipleNavItemsOpen,
|
|
46369
46761
|
selected: selected,
|
|
46370
46762
|
setSelected: setSelected,
|
|
46371
46763
|
getCounts: getCounts,
|
|
@@ -46381,6 +46773,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
|
|
|
46381
46773
|
configDepth = _ref3.configDepth,
|
|
46382
46774
|
activeSubmenu = _ref3.activeSubmenu,
|
|
46383
46775
|
setActiveSubmenu = _ref3.setActiveSubmenu,
|
|
46776
|
+
allowMultipleNavItemsOpen = _ref3.allowMultipleNavItemsOpen,
|
|
46384
46777
|
selected = _ref3.selected,
|
|
46385
46778
|
setSelected = _ref3.setSelected,
|
|
46386
46779
|
getCounts = _ref3.getCounts,
|
|
@@ -46397,16 +46790,29 @@ var NavigationMenu = function NavigationMenu(_ref3) {
|
|
|
46397
46790
|
// if (splitUrl.length - 1 === configDepth) {
|
|
46398
46791
|
if (splitUrl.length - 1) {
|
|
46399
46792
|
if (configDepth === 3) {
|
|
46400
|
-
setActiveSubmenu(
|
|
46401
|
-
|
|
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));
|
|
46402
46800
|
} else if (configDepth === 2) {
|
|
46403
|
-
setActiveSubmenu('/' + splitUrl[1])
|
|
46404
|
-
|
|
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));
|
|
46405
46808
|
} else {
|
|
46406
|
-
|
|
46809
|
+
var _newSelectedUrl2 = splitUrl.slice(1).join('/');
|
|
46810
|
+
setSelected("/".concat(_newSelectedUrl2));
|
|
46811
|
+
// setSelected('/' + splitUrl[1])
|
|
46407
46812
|
}
|
|
46408
46813
|
} else {
|
|
46409
|
-
setActiveSubmenu(null)
|
|
46814
|
+
// setActiveSubmenu(null)
|
|
46815
|
+
if (!allowMultipleNavItemsOpen) setActiveSubmenu([]);
|
|
46410
46816
|
setSelected(null);
|
|
46411
46817
|
}
|
|
46412
46818
|
}
|
|
@@ -46426,6 +46832,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
|
|
|
46426
46832
|
activeSubmenu: activeSubmenu,
|
|
46427
46833
|
navigateFunction: navigateFunction,
|
|
46428
46834
|
setActiveSubmenu: setActiveSubmenu,
|
|
46835
|
+
allowMultipleNavItemsOpen: allowMultipleNavItemsOpen,
|
|
46429
46836
|
selected: selected,
|
|
46430
46837
|
setSelected: setSelected,
|
|
46431
46838
|
redirectUrl: redirectUrl,
|
|
@@ -46442,6 +46849,7 @@ var NavigationMenuLevel1 = function NavigationMenuLevel1(_ref4) {
|
|
|
46442
46849
|
isHover = _ref4.isHover,
|
|
46443
46850
|
activeSubmenu = _ref4.activeSubmenu,
|
|
46444
46851
|
setActiveSubmenu = _ref4.setActiveSubmenu,
|
|
46852
|
+
allowMultipleNavItemsOpen = _ref4.allowMultipleNavItemsOpen,
|
|
46445
46853
|
navigateFunction = _ref4.navigateFunction,
|
|
46446
46854
|
selected = _ref4.selected,
|
|
46447
46855
|
setSelected = _ref4.setSelected,
|
|
@@ -46475,6 +46883,7 @@ var NavigationMenuLevel1 = function NavigationMenuLevel1(_ref4) {
|
|
|
46475
46883
|
setSelected: setSelected,
|
|
46476
46884
|
activeSubmenu: activeSubmenu,
|
|
46477
46885
|
setActiveSubmenu: setActiveSubmenu,
|
|
46886
|
+
allowMultipleNavItemsOpen: allowMultipleNavItemsOpen,
|
|
46478
46887
|
navigateFunction: navigateFunction,
|
|
46479
46888
|
getCounts: getCounts,
|
|
46480
46889
|
setWithCounts: setWithCounts,
|
|
@@ -46490,12 +46899,14 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
|
|
|
46490
46899
|
setSelected = _ref5.setSelected,
|
|
46491
46900
|
activeSubmenu = _ref5.activeSubmenu,
|
|
46492
46901
|
setActiveSubmenu = _ref5.setActiveSubmenu,
|
|
46902
|
+
allowMultipleNavItemsOpen = _ref5.allowMultipleNavItemsOpen,
|
|
46493
46903
|
navigateFunction = _ref5.navigateFunction,
|
|
46494
46904
|
getCounts = _ref5.getCounts,
|
|
46495
46905
|
setWithCounts = _ref5.setWithCounts,
|
|
46496
46906
|
withCounts = _ref5.withCounts,
|
|
46497
46907
|
countsRef = _ref5.countsRef;
|
|
46498
|
-
|
|
46908
|
+
// const isMenuExpanded = activeSubmenu === navItem.fullRoute
|
|
46909
|
+
var isMenuExpanded = activeSubmenu.includes(navItem.fullRoute);
|
|
46499
46910
|
var showCounts = isMenuExpanded && getCounts && typeof getCounts === 'function';
|
|
46500
46911
|
var _useState13 = React.useState(null),
|
|
46501
46912
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
@@ -46538,20 +46949,42 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
|
|
|
46538
46949
|
var handleItemClick = function handleItemClick() {
|
|
46539
46950
|
if (isDisabled) return;
|
|
46540
46951
|
if (hasSubMenuItems) {
|
|
46541
|
-
|
|
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)
|
|
46542
46964
|
if (!isMenuExpanded && showCounts) {
|
|
46543
46965
|
reloadCounts();
|
|
46544
46966
|
}
|
|
46545
46967
|
} else {
|
|
46546
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
|
+
}
|
|
46547
46974
|
}
|
|
46548
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
|
+
}
|
|
46549
46982
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46550
46983
|
className: "utilities_ops-app-frame_NavigationBar_NavigationBar--NavMenuLevel2",
|
|
46551
46984
|
animate: isMenuExpanded ? 'open' : 'closed'
|
|
46552
46985
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46553
46986
|
onClick: handleItemClick,
|
|
46554
|
-
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, {
|
|
46555
46988
|
"handleMissingStyleName": "warn"
|
|
46556
46989
|
})
|
|
46557
46990
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -46561,7 +46994,7 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
|
|
|
46561
46994
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46562
46995
|
className: "utilities_ops-app-frame_NavigationBar_NavigationBar--NavItemName"
|
|
46563
46996
|
}, navItem.name), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46564
|
-
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, {
|
|
46565
46998
|
"handleMissingStyleName": "warn"
|
|
46566
46999
|
})
|
|
46567
47000
|
}, hasSubMenuItems && /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
@@ -46678,7 +47111,8 @@ var AppFrame = function AppFrame(props) {
|
|
|
46678
47111
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46679
47112
|
appBarMounted = _useState2[0],
|
|
46680
47113
|
setAppBarMounted = _useState2[1];
|
|
46681
|
-
|
|
47114
|
+
// const [activeSubmenu, setActiveSubmenu] = useState(null)
|
|
47115
|
+
var _useState3 = React.useState([]),
|
|
46682
47116
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
46683
47117
|
activeSubmenu = _useState4[0],
|
|
46684
47118
|
setActiveSubmenu = _useState4[1];
|
|
@@ -46707,7 +47141,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
46707
47141
|
});
|
|
46708
47142
|
|
|
46709
47143
|
// const showNavigationCounts = props.getCounts && typeof props.getCounts === 'function'
|
|
46710
|
-
var navigationWidth = activeSubmenu && showNavigationCounts ? '100px' : '50px';
|
|
47144
|
+
var navigationWidth = activeSubmenu !== null && activeSubmenu !== void 0 && activeSubmenu.length && showNavigationCounts ? '100px' : '50px';
|
|
46711
47145
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
46712
47146
|
className: "utilities_ops-app-frame_AppFrame_AppFrame--AppFrame",
|
|
46713
47147
|
style: props.handleScrolling ? SCROLL : NO_SCROLL
|
|
@@ -46738,6 +47172,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
46738
47172
|
getCounts: props.getCounts,
|
|
46739
47173
|
activeSubmenu: activeSubmenu,
|
|
46740
47174
|
setActiveSubmenu: setActiveSubmenu,
|
|
47175
|
+
allowMultipleNavItemsOpen: props.allowMultipleNavItemsOpen,
|
|
46741
47176
|
setShowNavigationCounts: setShowNavigationCounts,
|
|
46742
47177
|
countsRef: props.countsRef
|
|
46743
47178
|
}) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|