@copart/ops-tool-kit 1.8.1-alpha.4 → 1.8.1-alpha.5

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.
@@ -33,7 +33,7 @@ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
33
33
  var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
34
34
 
35
35
  const name$f = "@copart/ops-tool-kit";
36
- const version$5 = "1.8.1-alpha.4";
36
+ const version$5 = "1.8.1-alpha.5";
37
37
  const main$1 = "dist/ops-tool-kit.js";
38
38
  const style = "dist/ops-tool-kit.css";
39
39
  const files = [
@@ -35524,10 +35524,10 @@ function filterOutNotificationForOtherAppsFirebase(notifications) {
35524
35524
  }
35525
35525
 
35526
35526
  function filterOutNotificationForOtherApps(notifications) {
35527
- var currentApp = window.location.pathname === '/' ? 'home' : window.location.pathname.split('/')[1];
35527
+ var currentApp = window.location.pathname === '/' ? 'home' : window.location.pathname;
35528
35528
  var tilesConfig = storage$1.getLocalItem('opsportal-core:config').tiles || [];
35529
35529
  var tile = tilesConfig.find(function (item) {
35530
- return item.path === "/".concat(currentApp);
35530
+ return item.path === currentApp;
35531
35531
  }) || {};
35532
35532
  return notifications.filter(function (notification) {
35533
35533
  var targetApps = pathOr$1(null, ['targetAudience', 'targetApplications'])(notification);
@@ -36700,6 +36700,12 @@ var AppBar$1 = function AppBar(props) {
36700
36700
  return width > 760 ? '40vw' : width > 500 ? '70vw' : '80vw';
36701
36701
  };
36702
36702
 
36703
+ var closeSidebar = function closeSidebar(e) {
36704
+ if (e.target.className.includes("sideBarWrapper")) {
36705
+ setNotificationsVisible(false);
36706
+ }
36707
+ };
36708
+
36703
36709
  return React__default["default"].createElement("div", {
36704
36710
  "data-e2e": "cc-AppBar",
36705
36711
  className: "utilities_ops-app-frame_AppBarComponent_AppBar--root"
@@ -36805,7 +36811,8 @@ var AppBar$1 = function AppBar(props) {
36805
36811
  backgroundColor: 'white'
36806
36812
  }
36807
36813
  })), notificationsVisible && React__default["default"].createElement("div", {
36808
- className: "utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper"
36814
+ className: "utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper",
36815
+ onClick: closeSidebar
36809
36816
  }, React__default["default"].createElement("div", {
36810
36817
  className: "utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv",
36811
36818
  style: {
@@ -42039,7 +42046,8 @@ var generateQuery = function generateQuery(yardNumber, email) {
42039
42046
  var EndDateTs = moment(new Date()).local().format("YYYY-MM-DDTHH:mm:ss[Z]");
42040
42047
  var startDateTsUTC = moment.utc(new Date()).add(1, 'days').format("YYYY-MM-DDTHH:mm:ss[Z]");
42041
42048
  var EndDateTsUTC = moment.utc(new Date()).format("YYYY-MM-DDTHH:mm:ss[Z]");
42042
- return "fq=(facilities:".concat(yardNumber, " OR user_details:\"").concat(email, "\")&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:\"USA\")&fq=status:A&rows=10000&q=*:*");
42049
+ var countryCode = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
42050
+ return "fq=(facilities:".concat(yardNumber, " OR user_details:\"").concat(email, "\")&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(countryCode, "\")&fq=status:A&rows=10000&q=*:*");
42043
42051
  };
42044
42052
 
42045
42053
  var generateTargets = function generateTargets(notification) {
@@ -42085,7 +42093,7 @@ function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
42085
42093
  var headers = {
42086
42094
  collection: "notifications",
42087
42095
  serviceName: "notification",
42088
- Country: "USA"
42096
+ Country: storage$1.getSessionItem('dashboard', 'selectedCountryA3code')
42089
42097
  };
42090
42098
  fetcher.get("".concat(endpoints.getG2NotificationsSolr, "?").concat(query), {
42091
42099
  headers: headers
@@ -42105,10 +42113,10 @@ function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
42105
42113
  notification.sourcePlatform = notification.source_platform;
42106
42114
  notification.timeZoneType = notification.timezone_type;
42107
42115
  notification.targetAudience = {
42108
- targetApplications: [{
42116
+ targetApplications: notification.applications ? [{
42109
42117
  platform: notification.source_platform,
42110
42118
  applications: notification.applications
42111
- }],
42119
+ }] : null,
42112
42120
  targets: _toConsumableArray(generateTargets(notification))
42113
42121
  };
42114
42122
  return notification;
@@ -49969,7 +49977,8 @@ var AppBar = function AppBar(_ref) {
49969
49977
  setAppBarMounted = _ref.setAppBarMounted,
49970
49978
  onSettingsSaved = _ref.onSettingsSaved,
49971
49979
  showTitle = _ref.showTitle,
49972
- title = _ref.title;
49980
+ title = _ref.title,
49981
+ pathname = _ref.pathname;
49973
49982
  SETTINGS_ITEMS[0].name = storage$1.userName; // Escape hatch for forceUpdate function
49974
49983
 
49975
49984
  var _useReducer = React.useReducer(function (x) {
@@ -50151,7 +50160,7 @@ var AppBar = function AppBar(_ref) {
50151
50160
  setFirebaseinitialized(true);
50152
50161
  }
50153
50162
  }
50154
- }, [selectedYard]);
50163
+ }, [selectedYard, pathname]);
50155
50164
  React.useEffect(function () {
50156
50165
  var interval = setInterval(function () {
50157
50166
  if (listOfAllNotifications.length) {
@@ -50555,7 +50564,8 @@ var AppFrame = function AppFrame(props) {
50555
50564
  return location.reload();
50556
50565
  },
50557
50566
  showTitle: props.showTitle || true,
50558
- title: props.appTitle
50567
+ title: props.appTitle,
50568
+ pathname: props.location.pathname
50559
50569
  })), React__default["default"].createElement(Breadcrumbs, {
50560
50570
  history: props.history,
50561
50571
  pathname: window.location.pathname