@copart/ops-tool-kit 1.10.0-alpha.24 → 1.10.0-alpha.27
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 +20 -6
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -33,7 +33,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
33
33
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
34
34
|
|
|
35
35
|
const name$f = "@copart/ops-tool-kit";
|
|
36
|
-
const version$5 = "1.10.0-alpha.
|
|
36
|
+
const version$5 = "1.10.0-alpha.27";
|
|
37
37
|
const main$1 = "dist/ops-tool-kit.js";
|
|
38
38
|
const style = "dist/ops-tool-kit.css";
|
|
39
39
|
const files = [
|
|
@@ -41577,7 +41577,7 @@ var generateQuery = function generateQuery(yardNumber, email) {
|
|
|
41577
41577
|
var startDateTsUTC = moment.utc(new Date()).add(1, 'days').format('YYYY-MM-DDTHH:mm:ss[Z]');
|
|
41578
41578
|
var EndDateTsUTC = moment.utc(new Date()).format('YYYY-MM-DDTHH:mm:ss[Z]');
|
|
41579
41579
|
var countryCodes = window.location.hostname.includes('.com') ? '"USA", "CAN"' : '"ARE", "OMN", "BHR", "IRL", "GBR"';
|
|
41580
|
-
return "fq=(facilities:".concat(yardNumber, " OR user_details:\"").concat(email, "\" OR group_user_details:\"").concat(email, "\" OR applications:\"").concat(encodeURIComponent(getCurrentApp()), "\")&fq=((start_date_timezone:\"UTC\" AND end_date_timezone:\"UTC\" AND start_date_ts_utc:[* TO ").concat(startDateTsUTC, "] AND end_date_ts_utc:[").concat(EndDateTsUTC, " TO *]) OR (!start_date_timezone:\"UTC\" AND !end_date_timezone:\"UTC\" AND start_date_ts_utc:[* TO ").concat(startDateTs, "] AND end_date_ts_utc:[").concat(EndDateTs, " TO *]) OR (!start_date_timezone:\"UTC\" AND end_date_timezone:\"UTC\" AND start_date_ts_utc:[* TO ").concat(startDateTs, "] AND end_date_ts_utc:[").concat(EndDateTsUTC, " TO *]))&fq=(operating_country_a3_code:(").concat(countryCodes, "))&fq=status:A&rows=10000&q=*:*");
|
|
41580
|
+
return "fq=(facilities:".concat(yardNumber, " OR user_details:\"").concat(email, "\" OR group_user_details:\"").concat(email, "\" OR applications:\"").concat(encodeURIComponent(getCurrentApp()), "\")&fq=((start_date_timezone:\"UTC\" AND end_date_timezone:\"UTC\" AND start_date_ts_utc:[* TO ").concat(startDateTsUTC, "] AND end_date_ts_utc:[").concat(EndDateTsUTC, " TO *]) OR (!start_date_timezone:\"UTC\" AND !end_date_timezone:\"UTC\" AND start_date_ts_utc:[* TO ").concat(startDateTs, "] AND end_date_ts_utc:[").concat(EndDateTs, " TO *]) OR (!start_date_timezone:\"UTC\" AND end_date_timezone:\"UTC\" AND start_date_ts_utc:[* TO ").concat(startDateTs, "] AND end_date_ts_utc:[").concat(EndDateTsUTC, " TO *]))&fq=(operating_country_a3_code:(").concat(countryCodes, ") OR destination_type:(\"groups\",\"users\"))&fq=status:A&rows=10000&q=*:*");
|
|
41581
41581
|
};
|
|
41582
41582
|
|
|
41583
41583
|
var generateTargets = function generateTargets(notification) {
|
|
@@ -41728,7 +41728,7 @@ function startWebSocketConnection(updateNotifications, updateAllNotificationsLis
|
|
|
41728
41728
|
}
|
|
41729
41729
|
|
|
41730
41730
|
var getFirebaseConfig = function getFirebaseConfig() {
|
|
41731
|
-
var appConfig = storage$1.
|
|
41731
|
+
var appConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
41732
41732
|
return appConfig.runConfig ? appConfig.runConfig.firebaseConfig : appConfig.firebaseConfig;
|
|
41733
41733
|
};
|
|
41734
41734
|
|
|
@@ -41740,7 +41740,9 @@ function attachHandlers(firebase, updateNotifications, updateAllFirebaseNotifica
|
|
|
41740
41740
|
var today = getTodayDate();
|
|
41741
41741
|
firebase.database().ref().child('ops-news').orderByChild('ends_at').startAt(today).on('value', function (snapshot) {
|
|
41742
41742
|
compose(updateNotifications, filterNotificationsFireBase, mapNotifications, values$1)(snapshot.val());
|
|
41743
|
-
|
|
41743
|
+
setTimeout(function () {
|
|
41744
|
+
compose(updateAllFirebaseNotificationsList, mapNotifications, values$1)(snapshot.val());
|
|
41745
|
+
}, 500);
|
|
41744
41746
|
});
|
|
41745
41747
|
}
|
|
41746
41748
|
|
|
@@ -42184,6 +42186,11 @@ var AppBar = function AppBar(_ref) {
|
|
|
42184
42186
|
firebaseInitialized = _useState20[0],
|
|
42185
42187
|
setFirebaseinitialized = _useState20[1];
|
|
42186
42188
|
|
|
42189
|
+
var listOfAllNotificationsRef = React.useRef(listOfAllNotifications);
|
|
42190
|
+
React.useEffect(function () {
|
|
42191
|
+
listOfAllNotificationsRef.current = listOfAllNotifications;
|
|
42192
|
+
}, [listOfAllNotifications]);
|
|
42193
|
+
|
|
42187
42194
|
var updateNotifications = function updateNotifications(newNotifications) {
|
|
42188
42195
|
setNotifications(function (notifications) {
|
|
42189
42196
|
return filterDuplicateAndSave(notifications, newNotifications);
|
|
@@ -42250,7 +42257,6 @@ var AppBar = function AppBar(_ref) {
|
|
|
42250
42257
|
var _notification$newsTar;
|
|
42251
42258
|
|
|
42252
42259
|
if (notification === null || notification === void 0 ? void 0 : (_notification$newsTar = notification.newsTarget) === null || _notification$newsTar === void 0 ? void 0 : _notification$newsTar.audience_value) {
|
|
42253
|
-
removeNotification(notification);
|
|
42254
42260
|
var startTime = moment.utc(notification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
|
|
42255
42261
|
var currentDate = new Date();
|
|
42256
42262
|
|
|
@@ -42258,6 +42264,8 @@ var AppBar = function AppBar(_ref) {
|
|
|
42258
42264
|
setListOfAllFirebaseNotifications(function (notifications) {
|
|
42259
42265
|
return filterDuplicateAndSave(notifications, newNotifications);
|
|
42260
42266
|
});
|
|
42267
|
+
} else {
|
|
42268
|
+
removeNotification(notification);
|
|
42261
42269
|
}
|
|
42262
42270
|
}
|
|
42263
42271
|
});
|
|
@@ -42282,6 +42290,12 @@ var AppBar = function AppBar(_ref) {
|
|
|
42282
42290
|
return !notificationIds.includes(notification.notificationId);
|
|
42283
42291
|
});
|
|
42284
42292
|
var filterednewNotifications = newNotifications.filter(function (notification) {
|
|
42293
|
+
if (notification.isFirebase && listOfAllNotificationsRef.current.find(function (n) {
|
|
42294
|
+
return n.notificationId === notification.notificationId;
|
|
42295
|
+
})) {
|
|
42296
|
+
return false;
|
|
42297
|
+
}
|
|
42298
|
+
|
|
42285
42299
|
return !actionCompletedNotificationIds.includes(notification.notificationId);
|
|
42286
42300
|
});
|
|
42287
42301
|
return sortNotifications([].concat(_toConsumableArray(filterednewNotifications), _toConsumableArray(filteredNotifications)));
|
|
@@ -42390,7 +42404,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
42390
42404
|
if (listOfAllFirebaseNotifications.length) {
|
|
42391
42405
|
compose(updateNotifications, filterNotificationsFireBase)(listOfAllFirebaseNotifications);
|
|
42392
42406
|
}
|
|
42393
|
-
},
|
|
42407
|
+
}, 21000);
|
|
42394
42408
|
return function () {
|
|
42395
42409
|
clearInterval(interval);
|
|
42396
42410
|
};
|