@copart/ops-tool-kit 1.8.1-alpha.33 → 1.8.1-alpha.35
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 +59 -36
- 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.8.1-alpha.
|
|
36
|
+
const version$5 = "1.8.1-alpha.35";
|
|
37
37
|
const main$1 = "dist/ops-tool-kit.js";
|
|
38
38
|
const style = "dist/ops-tool-kit.css";
|
|
39
39
|
const files = [
|
|
@@ -29079,7 +29079,7 @@ function (_React$Component) {
|
|
|
29079
29079
|
return SettingsView;
|
|
29080
29080
|
}(React__default["default"].Component);
|
|
29081
29081
|
|
|
29082
|
-
var css_248z$6 = ".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: 0px 5px;\r\n font-size: 13px;\r\n width: 95%;\r\n display: flex;\r\n align-items: end;\r\n grid-gap: 20px;\r\n gap: 20px\r\n}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationInfoBox {\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}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationInfoBox b{\r\n color: #171717;\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}\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: 3;\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}\r\n\r\n.utilities_ops-announcements_Banner--notificationInfoBox {\r\n display: flex;\r\n color: #6c7a89;\r\n grid-gap: 6px;\r\n gap: 6px;\r\n font-size: 12px;\r\n margin-bottom: 5px;\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: 16px !important;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--navBtnContainer {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n grid-gap: 5px;\r\n gap: 5px;\r\n font-size: 12px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--navBtnContainer .utilities_ops-announcements_Banner--notificationLeftBtn i{\r\n position: relative;\r\n right: -4px;\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--notificationContainer i{\r\n font-size: 20px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--navBtnContainer i{\r\n font-size: 16px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar {\r\n flex-direction: column;\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: 0px 5px;\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}\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 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}";
|
|
29082
|
+
var css_248z$6 = ".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: 0px 5px;\r\n font-size: 13px;\r\n width: 95%;\r\n display: flex;\r\n align-items: end;\r\n grid-gap: 20px;\r\n gap: 20px\r\n}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationInfoBox {\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}\r\n\r\n.utilities_ops-announcements_Banner--tabNotificationInfoBox b{\r\n color: #171717;\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}\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: 3;\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}\r\n\r\n.utilities_ops-announcements_Banner--notificationInfoBox {\r\n display: flex;\r\n color: #6c7a89;\r\n grid-gap: 6px;\r\n gap: 6px;\r\n font-size: 12px;\r\n margin-bottom: 5px;\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: 16px !important;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--navBtnContainer {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n grid-gap: 5px;\r\n gap: 5px;\r\n font-size: 12px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--navBtnContainer .utilities_ops-announcements_Banner--notificationLeftBtn i{\r\n position: relative;\r\n right: -4px;\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--notificationContainer i{\r\n font-size: 20px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--navBtnContainer i{\r\n font-size: 16px;\r\n}\r\n\r\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar {\r\n flex-direction: column;\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: 0px 5px;\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}\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 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}";
|
|
29083
29083
|
styleInject(css_248z$6);
|
|
29084
29084
|
|
|
29085
29085
|
var _nodeResolve_empty = {};
|
|
@@ -35414,6 +35414,8 @@ var notificationKeysMapper = {
|
|
|
35414
35414
|
|
|
35415
35415
|
var renameKeys = function renameKeys(keysMap) {
|
|
35416
35416
|
return function (obj) {
|
|
35417
|
+
obj.isFirebase = true;
|
|
35418
|
+
obj.uuid = parseInt(obj.uuid);
|
|
35417
35419
|
return reduce$1(function (acc, key) {
|
|
35418
35420
|
return assoc$1(keysMap[key] || key, obj[key], acc);
|
|
35419
35421
|
}, {}, keys$1(obj));
|
|
@@ -35467,6 +35469,10 @@ var getTimeDiff = function getTimeDiff(startsAt) {
|
|
|
35467
35469
|
|
|
35468
35470
|
return '';
|
|
35469
35471
|
};
|
|
35472
|
+
var SanitizeNotificationContent = function SanitizeNotificationContent(str) {
|
|
35473
|
+
var regex = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>|<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi;
|
|
35474
|
+
return str.replace(regex, '');
|
|
35475
|
+
};
|
|
35470
35476
|
|
|
35471
35477
|
var useWindowSize = function useWindowSize() {
|
|
35472
35478
|
var isClient = (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object';
|
|
@@ -35636,7 +35642,7 @@ var Banner = function Banner(props) {
|
|
|
35636
35642
|
})
|
|
35637
35643
|
}, React__default["default"].createElement("span", {
|
|
35638
35644
|
dangerouslySetInnerHTML: {
|
|
35639
|
-
__html: content
|
|
35645
|
+
__html: SanitizeNotificationContent(content)
|
|
35640
35646
|
}
|
|
35641
35647
|
}), action && ActionComponent && React__default["default"].createElement("a", {
|
|
35642
35648
|
href: feedUrl,
|
|
@@ -35645,14 +35651,10 @@ var Banner = function Banner(props) {
|
|
|
35645
35651
|
}, React__default["default"].createElement(coreComponents.Icon, {
|
|
35646
35652
|
name: "open_in_new",
|
|
35647
35653
|
variant: "material"
|
|
35648
|
-
})))), action && ActionComponent && React__default["default"].createElement(
|
|
35649
|
-
style: {
|
|
35650
|
-
minWidth: '20%'
|
|
35651
|
-
}
|
|
35652
|
-
}, React__default["default"].createElement(ActionComponent, {
|
|
35654
|
+
})))), action && ActionComponent && React__default["default"].createElement(ActionComponent, {
|
|
35653
35655
|
notification: notification,
|
|
35654
35656
|
saveActionComponentState: saveActionComponentState
|
|
35655
|
-
}))
|
|
35657
|
+
})), isContentOverFlow && React__default["default"].createElement("div", {
|
|
35656
35658
|
style: {
|
|
35657
35659
|
cursor: 'pointer'
|
|
35658
35660
|
},
|
|
@@ -35700,7 +35702,7 @@ var Banner = function Banner(props) {
|
|
|
35700
35702
|
className: "utilities_ops-announcements_Banner--appBarContentBox"
|
|
35701
35703
|
}, React__default["default"].createElement("span", {
|
|
35702
35704
|
dangerouslySetInnerHTML: {
|
|
35703
|
-
__html: content
|
|
35705
|
+
__html: SanitizeNotificationContent(content)
|
|
35704
35706
|
}
|
|
35705
35707
|
}), action && ActionComponent && React__default["default"].createElement("a", {
|
|
35706
35708
|
href: feedUrl,
|
|
@@ -35792,7 +35794,7 @@ var Banner = function Banner(props) {
|
|
|
35792
35794
|
})
|
|
35793
35795
|
}, React__default["default"].createElement("span", {
|
|
35794
35796
|
dangerouslySetInnerHTML: {
|
|
35795
|
-
__html: content
|
|
35797
|
+
__html: SanitizeNotificationContent(content)
|
|
35796
35798
|
}
|
|
35797
35799
|
}), action && ActionComponent && React__default["default"].createElement("a", {
|
|
35798
35800
|
href: feedUrl,
|
|
@@ -39939,6 +39941,7 @@ var getFirebaseConfig = function getFirebaseConfig() {
|
|
|
39939
39941
|
function attachHandlers(firebase, updateNotifications, updateAllFirebaseNotificationsList) {
|
|
39940
39942
|
var today = getTodayDate();
|
|
39941
39943
|
firebase.database().ref().child('ops-news').orderByChild('ends_at').startAt(today).on('value', function (snapshot) {
|
|
39944
|
+
console.log("@@@snapshot.val()=", snapshot.val());
|
|
39942
39945
|
compose(updateNotifications, filterNotificationsFireBase, mapNotifications, values$1)(snapshot.val());
|
|
39943
39946
|
compose(updateAllFirebaseNotificationsList, mapNotifications, values$1)(snapshot.val());
|
|
39944
39947
|
});
|
|
@@ -39948,12 +39951,9 @@ var getFireBaseNotifications = function getFireBaseNotifications(updateNotificat
|
|
|
39948
39951
|
var firebaseConfig = getFirebaseConfig(); // connect(firebaseConfig)
|
|
39949
39952
|
|
|
39950
39953
|
var firebase;
|
|
39951
|
-
console.log("***before firebase import");
|
|
39952
39954
|
Promise.resolve().then(function () { return index_esm$1; }).then(function (module) {
|
|
39953
|
-
console.log("***after firebase app import");
|
|
39954
39955
|
firebase = module.default;
|
|
39955
39956
|
Promise.resolve().then(function () { return index_esm; }).then(function (module) {
|
|
39956
|
-
console.log("***after firebase DB import");
|
|
39957
39957
|
firebase.initializeApp(firebaseConfig);
|
|
39958
39958
|
attachHandlers(firebase, updateNotifications, updateAllFirebaseNotificationsList);
|
|
39959
39959
|
});
|
|
@@ -40241,37 +40241,35 @@ var AppBar = function AppBar(_ref) {
|
|
|
40241
40241
|
});
|
|
40242
40242
|
};
|
|
40243
40243
|
|
|
40244
|
-
var
|
|
40244
|
+
var filterOut = function filterOut(notifications, notificationToRemove) {
|
|
40245
|
+
var currentNotifications = clone$1(notifications);
|
|
40246
|
+
var filteredNotifications = currentNotifications.filter(function (notification) {
|
|
40247
|
+
return notification.notificationId !== notificationToRemove.notificationId;
|
|
40248
|
+
});
|
|
40249
|
+
return filteredNotifications;
|
|
40250
|
+
};
|
|
40251
|
+
|
|
40252
|
+
var removeNotification = function removeNotification(notificationToRemove) {
|
|
40245
40253
|
setNotifications(function (notifications) {
|
|
40246
|
-
|
|
40247
|
-
var filteredNotifications = currentNotifications.filter(function (notification) {
|
|
40248
|
-
return notification.notificationId !== newNotification.notificationId;
|
|
40249
|
-
});
|
|
40250
|
-
return filteredNotifications;
|
|
40254
|
+
return filterOut(notifications, notificationToRemove);
|
|
40251
40255
|
});
|
|
40252
40256
|
setListOfAllNotifications(function (notifications) {
|
|
40253
|
-
|
|
40254
|
-
|
|
40255
|
-
|
|
40256
|
-
|
|
40257
|
-
return filteredNotifications;
|
|
40257
|
+
return filterOut(notifications, notificationToRemove);
|
|
40258
|
+
});
|
|
40259
|
+
setListOfAllFirebaseNotifications(function (notifications) {
|
|
40260
|
+
return filterOut(notifications, notificationToRemove);
|
|
40258
40261
|
});
|
|
40259
40262
|
};
|
|
40260
40263
|
|
|
40261
40264
|
var updateAllNotificationsList = function updateAllNotificationsList(newNotifications, isSolr) {
|
|
40262
|
-
console.log("$$$isSolr=", isSolr);
|
|
40263
|
-
|
|
40264
40265
|
if (isSolr) {
|
|
40265
|
-
console.log("$$$ in solr notif");
|
|
40266
40266
|
setListOfAllNotifications(function (notifications) {
|
|
40267
40267
|
return filterDuplicateAndSave(notifications, newNotifications);
|
|
40268
40268
|
});
|
|
40269
40269
|
return;
|
|
40270
40270
|
}
|
|
40271
40271
|
|
|
40272
|
-
console.log("$$$newNotifications=", newNotifications);
|
|
40273
40272
|
var check = filterNotifications(newNotifications);
|
|
40274
|
-
console.log("$$$check=", check);
|
|
40275
40273
|
|
|
40276
40274
|
var newNotification = _objectSpread2({}, newNotifications[0]);
|
|
40277
40275
|
|
|
@@ -40280,13 +40278,11 @@ var AppBar = function AppBar(_ref) {
|
|
|
40280
40278
|
var currentDate = new Date();
|
|
40281
40279
|
|
|
40282
40280
|
if (!check.length) {
|
|
40283
|
-
console.log("$$$ in if 1");
|
|
40284
40281
|
removeNotification(newNotification);
|
|
40285
40282
|
} // test for delete, update, new & future notification..
|
|
40286
40283
|
|
|
40287
40284
|
|
|
40288
40285
|
if (new Date(startTime) > currentDate && (newNotification === null || newNotification === void 0 ? void 0 : newNotification.status) === 'A') {
|
|
40289
|
-
console.log("$$$ in if 2");
|
|
40290
40286
|
setListOfAllNotifications(function (notifications) {
|
|
40291
40287
|
return filterDuplicateAndSave(notifications, newNotifications);
|
|
40292
40288
|
});
|
|
@@ -40294,9 +40290,26 @@ var AppBar = function AppBar(_ref) {
|
|
|
40294
40290
|
};
|
|
40295
40291
|
|
|
40296
40292
|
var updateAllFirebaseNotificationsList = function updateAllFirebaseNotificationsList(newNotifications) {
|
|
40297
|
-
|
|
40298
|
-
|
|
40299
|
-
|
|
40293
|
+
var check = filterNotificationsFireBase(newNotifications);
|
|
40294
|
+
|
|
40295
|
+
if (check.length !== newNotifications.length) {
|
|
40296
|
+
var filteredOutNotifications = newNotifications.filter(function (n) {
|
|
40297
|
+
return !check.some(function (x) {
|
|
40298
|
+
return x.id === n.id;
|
|
40299
|
+
});
|
|
40300
|
+
});
|
|
40301
|
+
filteredOutNotifications.forEach(function (notification) {
|
|
40302
|
+
removeNotification(notification);
|
|
40303
|
+
var startTime = moment.utc(notification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
|
|
40304
|
+
var currentDate = new Date();
|
|
40305
|
+
|
|
40306
|
+
if (new Date(startTime) > currentDate) {
|
|
40307
|
+
setListOfAllFirebaseNotifications(function (notifications) {
|
|
40308
|
+
return filterDuplicateAndSave(notifications, newNotifications);
|
|
40309
|
+
});
|
|
40310
|
+
}
|
|
40311
|
+
});
|
|
40312
|
+
}
|
|
40300
40313
|
};
|
|
40301
40314
|
|
|
40302
40315
|
var filterDuplicateAndSave = function filterDuplicateAndSave(notifications, newNotifications) {
|
|
@@ -40307,7 +40320,9 @@ var AppBar = function AppBar(_ref) {
|
|
|
40307
40320
|
var filteredNotifications = notifications.filter(function (notification) {
|
|
40308
40321
|
var _notification$action, _notification$action$;
|
|
40309
40322
|
|
|
40310
|
-
if (notification === null || notification === void 0 ? void 0 : (_notification$action = notification.action) === null || _notification$action === void 0 ? void 0 : (_notification$action$ = _notification$action.componentState) === null || _notification$action$ === void 0 ? void 0 : _notification$action$.completed) {
|
|
40323
|
+
if ((notification === null || notification === void 0 ? void 0 : (_notification$action = notification.action) === null || _notification$action === void 0 ? void 0 : (_notification$action$ = _notification$action.componentState) === null || _notification$action$ === void 0 ? void 0 : _notification$action$.completed) || notificationIds.includes(notification.notificationId) && !notification.isFirebase && newNotifications.find(function (n) {
|
|
40324
|
+
return n.notificationId === notification.notificationId;
|
|
40325
|
+
}).isFirebase) {
|
|
40311
40326
|
actionCompletedNotificationIds.push(notification.notificationId);
|
|
40312
40327
|
return true;
|
|
40313
40328
|
}
|
|
@@ -40339,6 +40354,14 @@ var AppBar = function AppBar(_ref) {
|
|
|
40339
40354
|
return notification;
|
|
40340
40355
|
});
|
|
40341
40356
|
setNotifications(updatedNotifications);
|
|
40357
|
+
var updatedListOfAllNotifications = listOfAllNotifications.map(function (notification) {
|
|
40358
|
+
if (notification.notificationId === id) {
|
|
40359
|
+
notification.actionComponentState = componentState;
|
|
40360
|
+
}
|
|
40361
|
+
|
|
40362
|
+
return notification;
|
|
40363
|
+
});
|
|
40364
|
+
setListOfAllNotifications(updatedListOfAllNotifications);
|
|
40342
40365
|
};
|
|
40343
40366
|
|
|
40344
40367
|
var selectedYard = (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|