@copart/ops-tool-kit 1.12.6-alpha.0 → 1.12.6-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ops-tool-kit.js +238 -106
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
47
47
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
48
48
|
|
|
49
49
|
const name$r = "@copart/ops-tool-kit";
|
|
50
|
-
const version$8 = "1.12.6-alpha.
|
|
50
|
+
const version$8 = "1.12.6-alpha.2";
|
|
51
51
|
const main$1 = "dist/ops-tool-kit.js";
|
|
52
52
|
const style = "dist/ops-tool-kit.css";
|
|
53
53
|
const files = [
|
|
@@ -2622,6 +2622,9 @@ var createOpsStorage = function createOpsStorage() {
|
|
|
2622
2622
|
get userEmail() {
|
|
2623
2623
|
return getLocalItem('login', 'userData.entity_mail');
|
|
2624
2624
|
},
|
|
2625
|
+
get userCountry() {
|
|
2626
|
+
return getLocalItem('login', 'userData.entity_country');
|
|
2627
|
+
},
|
|
2625
2628
|
get accessToken() {
|
|
2626
2629
|
return getLocalItem('login', 'userData.access_token');
|
|
2627
2630
|
},
|
|
@@ -20654,7 +20657,13 @@ var locales = {
|
|
|
20654
20657
|
};
|
|
20655
20658
|
var language = 'en';
|
|
20656
20659
|
var locale = function locale(text) {
|
|
20657
|
-
|
|
20660
|
+
// Try to get translation for the current language
|
|
20661
|
+
var translation = pathOr$1(null, [language, text], locales);
|
|
20662
|
+
// If language doesn't exist or translation is missing, fallback to English
|
|
20663
|
+
if (translation === null || !locales[language]) {
|
|
20664
|
+
return pathOr$1(text, ['en', text], locales);
|
|
20665
|
+
}
|
|
20666
|
+
return translation;
|
|
20658
20667
|
};
|
|
20659
20668
|
|
|
20660
20669
|
var FEEDBACK_ENHANCEMENT_LINK = " https://coparto365.sharepoint.com/Innovations/PCI2016/default.aspx";
|
|
@@ -23334,6 +23343,10 @@ var finnish = {
|
|
|
23334
23343
|
code: 'fi',
|
|
23335
23344
|
description: 'Finnish'
|
|
23336
23345
|
};
|
|
23346
|
+
var portuguese = {
|
|
23347
|
+
code: 'pt',
|
|
23348
|
+
description: 'Portuguese'
|
|
23349
|
+
};
|
|
23337
23350
|
var getLanguages = function getLanguages() {
|
|
23338
23351
|
var selectedCountry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
23339
23352
|
var stack = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'c';
|
|
@@ -23383,7 +23396,8 @@ var getLanguages = function getLanguages() {
|
|
|
23383
23396
|
en: english
|
|
23384
23397
|
},
|
|
23385
23398
|
BR: {
|
|
23386
|
-
en: english
|
|
23399
|
+
en: english,
|
|
23400
|
+
pt: portuguese
|
|
23387
23401
|
},
|
|
23388
23402
|
default: stack === 'c' ? {
|
|
23389
23403
|
en: english,
|
|
@@ -35512,57 +35526,108 @@ var getFireBaseNotifications = function getFireBaseNotifications(updateNotificat
|
|
|
35512
35526
|
});
|
|
35513
35527
|
};
|
|
35514
35528
|
|
|
35515
|
-
var fetchAvailableStatuses = function
|
|
35516
|
-
var
|
|
35517
|
-
|
|
35518
|
-
|
|
35519
|
-
|
|
35520
|
-
|
|
35521
|
-
|
|
35522
|
-
|
|
35523
|
-
|
|
35524
|
-
|
|
35525
|
-
|
|
35526
|
-
|
|
35527
|
-
|
|
35528
|
-
|
|
35529
|
-
|
|
35530
|
-
|
|
35531
|
-
|
|
35532
|
-
|
|
35533
|
-
|
|
35534
|
-
|
|
35535
|
-
|
|
35536
|
-
|
|
35537
|
-
|
|
35538
|
-
|
|
35539
|
-
|
|
35540
|
-
|
|
35541
|
-
|
|
35542
|
-
}
|
|
35543
|
-
})
|
|
35544
|
-
|
|
35545
|
-
|
|
35546
|
-
}
|
|
35547
|
-
};
|
|
35548
|
-
var
|
|
35549
|
-
var
|
|
35550
|
-
|
|
35551
|
-
|
|
35552
|
-
|
|
35553
|
-
|
|
35554
|
-
|
|
35555
|
-
|
|
35556
|
-
|
|
35557
|
-
|
|
35558
|
-
|
|
35559
|
-
|
|
35560
|
-
|
|
35561
|
-
|
|
35562
|
-
|
|
35563
|
-
|
|
35564
|
-
|
|
35565
|
-
|
|
35529
|
+
var fetchAvailableStatuses = /*#__PURE__*/function () {
|
|
35530
|
+
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
35531
|
+
var coreAppConfig, endpoints, country, endpoint, res, availableStatuses, _t;
|
|
35532
|
+
return _regenerator().w(function (_context) {
|
|
35533
|
+
while (1) switch (_context.p = _context.n) {
|
|
35534
|
+
case 0:
|
|
35535
|
+
coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
35536
|
+
endpoints = coreAppConfig.endpoints;
|
|
35537
|
+
country = storage$1.userCountry || 'US';
|
|
35538
|
+
endpoint = frontEndUtils.string.substitute(endpoints.getAvailableStatuses, {
|
|
35539
|
+
country: country
|
|
35540
|
+
});
|
|
35541
|
+
_context.p = 1;
|
|
35542
|
+
_context.n = 2;
|
|
35543
|
+
return fetcher.get(endpoint);
|
|
35544
|
+
case 2:
|
|
35545
|
+
res = _context.v;
|
|
35546
|
+
availableStatuses = pathOr$1([], ['data'], res);
|
|
35547
|
+
return _context.a(2, availableStatuses);
|
|
35548
|
+
case 3:
|
|
35549
|
+
_context.p = 3;
|
|
35550
|
+
_t = _context.v;
|
|
35551
|
+
console.error('Failed to fetch available statuses:', _t);
|
|
35552
|
+
throw _t;
|
|
35553
|
+
case 4:
|
|
35554
|
+
return _context.a(2);
|
|
35555
|
+
}
|
|
35556
|
+
}, _callee, null, [[1, 3]]);
|
|
35557
|
+
}));
|
|
35558
|
+
return function fetchAvailableStatuses() {
|
|
35559
|
+
return _ref.apply(this, arguments);
|
|
35560
|
+
};
|
|
35561
|
+
}();
|
|
35562
|
+
var fetchUserStatus = /*#__PURE__*/function () {
|
|
35563
|
+
var _ref2 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
35564
|
+
var coreAppConfig, endpoints, email, endpoint, _docs$, res, docs, _t2;
|
|
35565
|
+
return _regenerator().w(function (_context2) {
|
|
35566
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
35567
|
+
case 0:
|
|
35568
|
+
coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
35569
|
+
endpoints = coreAppConfig.endpoints;
|
|
35570
|
+
email = storage$1.userEmail || '';
|
|
35571
|
+
endpoint = frontEndUtils.string.substitute(endpoints.getUserStatus, {
|
|
35572
|
+
email: email
|
|
35573
|
+
});
|
|
35574
|
+
_context2.p = 1;
|
|
35575
|
+
_context2.n = 2;
|
|
35576
|
+
return fetcher.get(endpoint);
|
|
35577
|
+
case 2:
|
|
35578
|
+
res = _context2.v;
|
|
35579
|
+
docs = pathOr$1([], ['data', 'response', 'docs'], res);
|
|
35580
|
+
return _context2.a(2, ((_docs$ = docs[0]) === null || _docs$ === void 0 ? void 0 : _docs$.user_availability) || null);
|
|
35581
|
+
case 3:
|
|
35582
|
+
_context2.p = 3;
|
|
35583
|
+
_t2 = _context2.v;
|
|
35584
|
+
console.error('Failed to fetch user status:', _t2);
|
|
35585
|
+
throw _t2;
|
|
35586
|
+
case 4:
|
|
35587
|
+
return _context2.a(2);
|
|
35588
|
+
}
|
|
35589
|
+
}, _callee2, null, [[1, 3]]);
|
|
35590
|
+
}));
|
|
35591
|
+
return function fetchUserStatus() {
|
|
35592
|
+
return _ref2.apply(this, arguments);
|
|
35593
|
+
};
|
|
35594
|
+
}();
|
|
35595
|
+
var updateUserStatus = /*#__PURE__*/function () {
|
|
35596
|
+
var _ref3 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3(statusId) {
|
|
35597
|
+
var coreAppConfig, endpoints, endpoint, requestBody, res, responseData, updatedStatus, _t3;
|
|
35598
|
+
return _regenerator().w(function (_context3) {
|
|
35599
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
35600
|
+
case 0:
|
|
35601
|
+
coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
35602
|
+
endpoints = coreAppConfig.endpoints;
|
|
35603
|
+
endpoint = endpoints.updateUserStatus;
|
|
35604
|
+
requestBody = {
|
|
35605
|
+
status: statusId,
|
|
35606
|
+
email: storage$1.userEmail,
|
|
35607
|
+
timeStamp: moment.utc().format('YYYY-MM-DD HH:mm:ss')
|
|
35608
|
+
};
|
|
35609
|
+
_context3.p = 1;
|
|
35610
|
+
_context3.n = 2;
|
|
35611
|
+
return fetcher.post(endpoint, requestBody);
|
|
35612
|
+
case 2:
|
|
35613
|
+
res = _context3.v;
|
|
35614
|
+
responseData = pathOr$1(null, ['data'], res);
|
|
35615
|
+
updatedStatus = (responseData === null || responseData === void 0 ? void 0 : responseData.status) || null;
|
|
35616
|
+
return _context3.a(2, updatedStatus);
|
|
35617
|
+
case 3:
|
|
35618
|
+
_context3.p = 3;
|
|
35619
|
+
_t3 = _context3.v;
|
|
35620
|
+
console.error('Failed to update user status:', _t3);
|
|
35621
|
+
throw _t3;
|
|
35622
|
+
case 4:
|
|
35623
|
+
return _context3.a(2);
|
|
35624
|
+
}
|
|
35625
|
+
}, _callee3, null, [[1, 3]]);
|
|
35626
|
+
}));
|
|
35627
|
+
return function updateUserStatus(_x) {
|
|
35628
|
+
return _ref3.apply(this, arguments);
|
|
35629
|
+
};
|
|
35630
|
+
}();
|
|
35566
35631
|
|
|
35567
35632
|
var css_248z$6 = ".utilities_ops-app-frame_ErrorNotification_ErrorNotification--notificationWrapper {\r\n display: flex;\r\n width: -webkit-fit-content;\r\n width: -moz-fit-content;\r\n width: fit-content;\r\n background-color: #f1f1f1;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\r\n border-radius: 4px;\r\n -webkit-animation: utilities_ops-app-frame_ErrorNotification_ErrorNotification--slideUp 0.3s ease-out;\r\n animation: utilities_ops-app-frame_ErrorNotification_ErrorNotification--slideUp 0.3s ease-out;\r\n pointer-events: auto;\r\n}\r\n\r\n@-webkit-keyframes utilities_ops-app-frame_ErrorNotification_ErrorNotification--slideUp {\r\n from {\r\n -webkit-transform: translateY(100%);\r\n transform: translateY(100%);\r\n opacity: 0;\r\n }\r\n to {\r\n -webkit-transform: translateY(0);\r\n transform: translateY(0);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes utilities_ops-app-frame_ErrorNotification_ErrorNotification--slideUp {\r\n from {\r\n -webkit-transform: translateY(100%);\r\n transform: translateY(100%);\r\n opacity: 0;\r\n }\r\n to {\r\n -webkit-transform: translateY(0);\r\n transform: translateY(0);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n";
|
|
35568
35633
|
styleInject(css_248z$6);
|
|
@@ -36243,20 +36308,40 @@ var AppBar = function AppBar(_ref) {
|
|
|
36243
36308
|
setListOfAllNotifications(updatedListOfAllNotifications);
|
|
36244
36309
|
};
|
|
36245
36310
|
var selectedYard = (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
36246
|
-
var handleUserStatusUpdate = function
|
|
36247
|
-
var
|
|
36248
|
-
|
|
36249
|
-
|
|
36250
|
-
|
|
36251
|
-
|
|
36252
|
-
|
|
36253
|
-
|
|
36254
|
-
|
|
36255
|
-
|
|
36256
|
-
|
|
36257
|
-
|
|
36258
|
-
|
|
36259
|
-
|
|
36311
|
+
var handleUserStatusUpdate = /*#__PURE__*/function () {
|
|
36312
|
+
var _ref4 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3(statusValue) {
|
|
36313
|
+
var previousStatus, updatedStatus, _t3;
|
|
36314
|
+
return _regenerator().w(function (_context3) {
|
|
36315
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
36316
|
+
case 0:
|
|
36317
|
+
previousStatus = currentUserStatus;
|
|
36318
|
+
setCurrentUserStatus(statusValue);
|
|
36319
|
+
storage$1.setLocalItem('dashboard', statusValue, 'userAvailability');
|
|
36320
|
+
_context3.p = 1;
|
|
36321
|
+
_context3.n = 2;
|
|
36322
|
+
return updateUserStatus(statusValue);
|
|
36323
|
+
case 2:
|
|
36324
|
+
updatedStatus = _context3.v;
|
|
36325
|
+
setCurrentUserStatus(updatedStatus);
|
|
36326
|
+
storage$1.setLocalItem('dashboard', updatedStatus, 'userAvailability');
|
|
36327
|
+
_context3.n = 4;
|
|
36328
|
+
break;
|
|
36329
|
+
case 3:
|
|
36330
|
+
_context3.p = 3;
|
|
36331
|
+
_t3 = _context3.v;
|
|
36332
|
+
console.error('Failed to update user status:', _t3);
|
|
36333
|
+
showError('Failed to update user status.');
|
|
36334
|
+
setCurrentUserStatus(previousStatus);
|
|
36335
|
+
storage$1.setLocalItem('dashboard', previousStatus, 'userAvailability');
|
|
36336
|
+
case 4:
|
|
36337
|
+
return _context3.a(2);
|
|
36338
|
+
}
|
|
36339
|
+
}, _callee3, null, [[1, 3]]);
|
|
36340
|
+
}));
|
|
36341
|
+
return function handleUserStatusUpdate(_x) {
|
|
36342
|
+
return _ref4.apply(this, arguments);
|
|
36343
|
+
};
|
|
36344
|
+
}();
|
|
36260
36345
|
var updateUserStatusFromWebSocket = function updateUserStatusFromWebSocket(newStatus) {
|
|
36261
36346
|
setCurrentUserStatus(newStatus);
|
|
36262
36347
|
storage$1.setLocalItem('dashboard', newStatus, 'userAvailability');
|
|
@@ -36324,48 +36409,95 @@ var AppBar = function AppBar(_ref) {
|
|
|
36324
36409
|
getFireBaseNotifications(updateNotifications, updateAllFirebaseNotificationsList, delay);
|
|
36325
36410
|
setFirebaseinitialized(true);
|
|
36326
36411
|
}
|
|
36327
|
-
|
|
36328
|
-
|
|
36329
|
-
|
|
36330
|
-
|
|
36331
|
-
|
|
36332
|
-
|
|
36333
|
-
|
|
36334
|
-
|
|
36335
|
-
|
|
36336
|
-
|
|
36337
|
-
|
|
36338
|
-
|
|
36339
|
-
|
|
36340
|
-
|
|
36341
|
-
|
|
36342
|
-
|
|
36343
|
-
|
|
36344
|
-
|
|
36345
|
-
|
|
36346
|
-
|
|
36347
|
-
|
|
36348
|
-
|
|
36349
|
-
|
|
36412
|
+
var loadUserStatus = /*#__PURE__*/function () {
|
|
36413
|
+
var _ref5 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
36414
|
+
var statuses, userStatus, statusList, statusListLower, isValidStatus, finalStatus, offlineIndex, updatedStatus, _t4, _t5;
|
|
36415
|
+
return _regenerator().w(function (_context4) {
|
|
36416
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
36417
|
+
case 0:
|
|
36418
|
+
_context4.p = 0;
|
|
36419
|
+
_context4.n = 1;
|
|
36420
|
+
return fetchAvailableStatuses();
|
|
36421
|
+
case 1:
|
|
36422
|
+
statuses = _context4.v;
|
|
36423
|
+
setAvailableStatuses(statuses);
|
|
36424
|
+
_context4.n = 2;
|
|
36425
|
+
return fetchUserStatus();
|
|
36426
|
+
case 2:
|
|
36427
|
+
userStatus = _context4.v;
|
|
36428
|
+
if (!(userStatus === null)) {
|
|
36429
|
+
_context4.n = 3;
|
|
36430
|
+
break;
|
|
36431
|
+
}
|
|
36432
|
+
setAvailableStatuses([]);
|
|
36433
|
+
return _context4.a(2);
|
|
36434
|
+
case 3:
|
|
36435
|
+
statusList = statuses.map(function (s) {
|
|
36436
|
+
return s.status;
|
|
36437
|
+
});
|
|
36438
|
+
statusListLower = statusList.map(function (s) {
|
|
36439
|
+
return s.toLowerCase();
|
|
36440
|
+
});
|
|
36441
|
+
isValidStatus = userStatus && statusListLower.includes(userStatus.toLowerCase());
|
|
36442
|
+
finalStatus = userStatus;
|
|
36443
|
+
if (isValidStatus) {
|
|
36444
|
+
_context4.n = 8;
|
|
36445
|
+
break;
|
|
36446
|
+
}
|
|
36447
|
+
offlineIndex = statusListLower.indexOf('offline');
|
|
36448
|
+
if (offlineIndex !== -1) {
|
|
36449
|
+
finalStatus = statusList[offlineIndex];
|
|
36450
|
+
} else if (statuses.length > 0) {
|
|
36451
|
+
finalStatus = statuses[0].status;
|
|
36452
|
+
}
|
|
36453
|
+
if (!finalStatus) {
|
|
36454
|
+
_context4.n = 7;
|
|
36455
|
+
break;
|
|
36456
|
+
}
|
|
36457
|
+
setCurrentUserStatus(finalStatus);
|
|
36458
|
+
storage$1.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
36459
|
+
_context4.p = 4;
|
|
36460
|
+
_context4.n = 5;
|
|
36461
|
+
return updateUserStatus(finalStatus);
|
|
36462
|
+
case 5:
|
|
36463
|
+
updatedStatus = _context4.v;
|
|
36350
36464
|
setCurrentUserStatus(updatedStatus);
|
|
36351
36465
|
storage$1.setLocalItem('dashboard', updatedStatus, 'userAvailability');
|
|
36352
|
-
|
|
36353
|
-
|
|
36466
|
+
_context4.n = 7;
|
|
36467
|
+
break;
|
|
36468
|
+
case 6:
|
|
36469
|
+
_context4.p = 6;
|
|
36470
|
+
_t4 = _context4.v;
|
|
36471
|
+
console.error('Failed to update defaulted user status:', _t4);
|
|
36354
36472
|
showError('Failed to set default user status.');
|
|
36355
|
-
|
|
36473
|
+
case 7:
|
|
36474
|
+
_context4.n = 9;
|
|
36475
|
+
break;
|
|
36476
|
+
case 8:
|
|
36477
|
+
setCurrentUserStatus(finalStatus);
|
|
36478
|
+
storage$1.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
36479
|
+
case 9:
|
|
36480
|
+
_context4.n = 11;
|
|
36481
|
+
break;
|
|
36482
|
+
case 10:
|
|
36483
|
+
_context4.p = 10;
|
|
36484
|
+
_t5 = _context4.v;
|
|
36485
|
+
console.error('Failed to load user status:', _t5);
|
|
36486
|
+
if (_t5.message && _t5.message.includes('available statuses')) {
|
|
36487
|
+
showError('Failed to fetch available statuses.');
|
|
36488
|
+
} else {
|
|
36489
|
+
showError('Failed to fetch user status.');
|
|
36490
|
+
}
|
|
36491
|
+
case 11:
|
|
36492
|
+
return _context4.a(2);
|
|
36356
36493
|
}
|
|
36357
|
-
}
|
|
36358
|
-
|
|
36359
|
-
|
|
36360
|
-
|
|
36361
|
-
}
|
|
36362
|
-
|
|
36363
|
-
|
|
36364
|
-
});
|
|
36365
|
-
}, function (error) {
|
|
36366
|
-
console.error('Failed to fetch available statuses:', error);
|
|
36367
|
-
showError('Failed to fetch available statuses.');
|
|
36368
|
-
});
|
|
36494
|
+
}, _callee4, null, [[4, 6], [0, 10]]);
|
|
36495
|
+
}));
|
|
36496
|
+
return function loadUserStatus() {
|
|
36497
|
+
return _ref5.apply(this, arguments);
|
|
36498
|
+
};
|
|
36499
|
+
}();
|
|
36500
|
+
loadUserStatus();
|
|
36369
36501
|
}
|
|
36370
36502
|
}
|
|
36371
36503
|
}, [selectedYard, pathname]);
|