@copart/ops-tool-kit 1.10.15 → 1.10.17

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__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.15";
36
+ const version$5 = "1.10.17";
37
37
  const main$1 = "dist/ops-tool-kit.js";
38
38
  const style = "dist/ops-tool-kit.css";
39
39
  const files = [
@@ -6494,7 +6494,8 @@ function () {
6494
6494
  return _ref.apply(this, arguments);
6495
6495
  };
6496
6496
  }();
6497
- var findAppData = function findAppData(tiles) {
6497
+
6498
+ var tileFilter = function tileFilter(tile) {
6498
6499
  var _window$toolkitEnv;
6499
6500
 
6500
6501
  var appName = ((_window$toolkitEnv = window.toolkitEnv) === null || _window$toolkitEnv === void 0 ? void 0 : _window$toolkitEnv.APP_NAME) ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
@@ -6503,13 +6504,19 @@ var findAppData = function findAppData(tiles) {
6503
6504
  appName = window.location.pathname;
6504
6505
  }
6505
6506
 
6506
- var matchingTiles = tiles.filter(function (tile) {
6507
- if (tile.appName) {
6508
- return tile.appName === 'embedded' ? tile.path === appName : tile.appName === appName;
6509
- } else {
6510
- return tile.path === "/".concat(appName);
6511
- }
6512
- });
6507
+ if (tile.appName) {
6508
+ return tile.appName === 'embedded' ? tile.path === appName : tile.appName === appName;
6509
+ } else {
6510
+ return tile.path === "/".concat(appName);
6511
+ }
6512
+ };
6513
+
6514
+ var findAppData = function findAppData() {
6515
+ var tiles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6516
+ var tileOverrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6517
+ var matchingTiles = [];
6518
+ matchingTiles.concat(tileOverrides.filter(tileFilter));
6519
+ matchingTiles.concat(tiles.filter(tileFilter));
6513
6520
 
6514
6521
  if (matchingTiles.length > 1) {
6515
6522
  var currentLocation = window.location.pathname;
@@ -6541,7 +6548,7 @@ function () {
6541
6548
  case 3:
6542
6549
  config = _context2.sent;
6543
6550
  storage.setLocalItem('opsportal-core:config', config);
6544
- return _context2.abrupt("return", findAppData(config.tiles || []));
6551
+ return _context2.abrupt("return", findAppData(config.tiles, config.tileOverrides));
6545
6552
 
6546
6553
  case 6:
6547
6554
  case "end":
@@ -6753,8 +6760,6 @@ exports.all = function () {
6753
6760
  };
6754
6761
  });
6755
6762
 
6756
- // import { appFunctions } from './mock_appFunctions'
6757
-
6758
6763
  var getDefaultYard = function getDefaultYard(country) {
6759
6764
  var _window$toolkitEnv;
6760
6765
 
@@ -11161,9 +11166,7 @@ function () {
11161
11166
 
11162
11167
  var getHierarchyDetails = function getHierarchyDetails(hierarchies, hierarchyId) {
11163
11168
  var hierarchy = hierarchies[hierarchyId];
11164
- console.log('hierarchy --> ', hierarchy, hierarchyId);
11165
11169
  var isHierarchyFromCurrentCountry = hierarchy && hierarchy.countryCode === storage.getSessionItem('dashboard', 'selectedCountryA3code');
11166
- console.log('isHierarchyFromCurrentCountry --> ', isHierarchyFromCurrentCountry);
11167
11170
  return isHierarchyFromCurrentCountry ? {
11168
11171
  id: hierarchy.hierarchyId,
11169
11172
  level: hierarchy.levelName,
@@ -11193,54 +11196,60 @@ function () {
11193
11196
 
11194
11197
  case 4:
11195
11198
  hierarchies = _context.sent;
11196
- console.log('Hierarchy Data --> ', hierarchies);
11197
11199
  storage.setLocalItem('hierarchies', hierarchies);
11198
- _context.next = 13;
11200
+ _context.next = 12;
11199
11201
  break;
11200
11202
 
11201
- case 9:
11202
- _context.prev = 9;
11203
+ case 8:
11204
+ _context.prev = 8;
11203
11205
  _context.t0 = _context["catch"](1);
11204
11206
  console.log(_context.t0);
11205
11207
  hierarchies = storage.getLocalItem('hierarchies');
11206
11208
 
11207
- case 13:
11209
+ case 12:
11208
11210
  scopeData = storage.getLocalItem('login', 'entity_auth_scope');
11209
11211
  scopeList = typeof scopeData === 'string' ? scopeData === null || scopeData === void 0 ? void 0 : scopeData.split(',') : [];
11212
+ scopeList = scopeList.filter(function (scope) {
11213
+ return typeof scope === 'string' && scope.trim() !== '';
11214
+ });
11210
11215
  filteredScopeList = [];
11211
11216
  scopeList.forEach(function (scope) {
11212
- var _scopeInfo$;
11217
+ var _storage$getLocalItem3;
11213
11218
 
11214
11219
  var scopeInfo = scope === null || scope === void 0 ? void 0 : scope.split('|');
11215
- var hierarchyList = (_scopeInfo$ = scopeInfo[2]) === null || _scopeInfo$ === void 0 ? void 0 : _scopeInfo$.split(':');
11216
- console.log('hierarchyList--> ', hierarchyList, hierarchies);
11217
- var hierarchiesWithDetails = [];
11218
- hierarchyList.forEach(function (hierarchy) {
11219
- var details = getHierarchyDetails(hierarchies, Number(hierarchy));
11220
-
11221
- if (details) {
11222
- hierarchiesWithDetails.push(details);
11223
- }
11224
- });
11225
- console.log('hierarchiesWithDetails--> ', hierarchiesWithDetails);
11220
+ var appScopeEnv = (_storage$getLocalItem3 = storage.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.appScopeEnv;
11221
+ var isScopeForCurrentEnv = scopeInfo[0] && scopeInfo[0] === appScopeEnv;
11222
+
11223
+ if (isScopeForCurrentEnv) {
11224
+ var _scopeInfo$;
11226
11225
 
11227
- if (hierarchiesWithDetails.length > 0) {
11228
- filteredScopeList.push({
11229
- appName: scopeInfo[0],
11230
- scopeName: scopeInfo[1],
11231
- hierarchies: hierarchiesWithDetails
11226
+ var hierarchyList = ((_scopeInfo$ = scopeInfo[3]) === null || _scopeInfo$ === void 0 ? void 0 : _scopeInfo$.split(':')) || [];
11227
+ var hierarchiesWithDetails = [];
11228
+ hierarchyList.forEach(function (hierarchy) {
11229
+ var details = getHierarchyDetails(hierarchies, Number(hierarchy));
11230
+
11231
+ if (details) {
11232
+ hierarchiesWithDetails.push(details);
11233
+ }
11232
11234
  });
11235
+
11236
+ if (hierarchiesWithDetails.length > 0) {
11237
+ filteredScopeList.push({
11238
+ appName: scopeInfo[1],
11239
+ scopeName: scopeInfo[2],
11240
+ hierarchies: hierarchiesWithDetails
11241
+ });
11242
+ }
11233
11243
  }
11234
11244
  });
11235
- console.log('filteredScopeList -->', filteredScopeList);
11236
11245
  return _context.abrupt("return", filteredScopeList);
11237
11246
 
11238
- case 19:
11247
+ case 18:
11239
11248
  case "end":
11240
11249
  return _context.stop();
11241
11250
  }
11242
11251
  }
11243
- }, _callee, null, [[1, 9]]);
11252
+ }, _callee, null, [[1, 8]]);
11244
11253
  }));
11245
11254
 
11246
11255
  return function getUserScopes() {
@@ -42199,7 +42208,8 @@ var AppBar = function AppBar(_ref) {
42199
42208
  showTitle = _ref.showTitle,
42200
42209
  title = _ref.title,
42201
42210
  pathname = _ref.pathname,
42202
- ActionComponent = _ref.ActionComponent;
42211
+ ActionComponent = _ref.ActionComponent,
42212
+ searchComponent = _ref.searchComponent;
42203
42213
  SETTINGS_ITEMS[0].name = storage$1.userName; // Escape hatch for forceUpdate function
42204
42214
 
42205
42215
  var _useReducer = React.useReducer(function (x) {
@@ -42234,7 +42244,7 @@ var AppBar = function AppBar(_ref) {
42234
42244
  showMihelpTooltip = _useState10[0],
42235
42245
  setShowMihelpTooltip = _useState10[1];
42236
42246
 
42237
- var tileData = findAppData(coreAppConfig.tiles || []) || {};
42247
+ var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
42238
42248
  var mihelpAppPath = isCoreRoute && !window.location.pathname.includes('embedded') ? null : tileData.mihelpAppPath;
42239
42249
  var isMihelpEnabled;
42240
42250
 
@@ -42449,7 +42459,7 @@ var AppBar = function AppBar(_ref) {
42449
42459
  var handleHelpClick = function handleHelpClick() {
42450
42460
  var country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
42451
42461
  var uri = mihelpAppPath ? "".concat(coreAppConfig.mihelpUri, "/applications/").concat(mihelpAppPath, "?re=").concat(country.toLowerCase()) : "".concat(coreAppConfig.mihelpUri, "?re=").concat(country.toLowerCase());
42452
- window.open(uri, "_blank");
42462
+ window.open(uri, '_blank');
42453
42463
  };
42454
42464
 
42455
42465
  var feedbackConfig = function feedbackConfig() {
@@ -42548,7 +42558,7 @@ var AppBar = function AppBar(_ref) {
42548
42558
 
42549
42559
  var newNotification = _objectSpread2({}, newNotifications[0]);
42550
42560
 
42551
- var startTime = newNotification.timeZoneType === "RPTZ" ? newNotification.startsAt : moment.utc(newNotification.startsAt).local().format("YYYY-MM-DD HH:mm:ss"); // const endTime = newNotification.timeZoneType === "RPTZ" && newNotification.endDateTimeZone !=='UTC' ? newNotification.endsAt : moment.utc(newNotification.endsAt).local().format("YYYY-MM-DD HH:mm:ss")
42561
+ var startTime = newNotification.timeZoneType === 'RPTZ' ? newNotification.startsAt : moment.utc(newNotification.startsAt).local().format('YYYY-MM-DD HH:mm:ss'); // const endTime = newNotification.timeZoneType === "RPTZ" && newNotification.endDateTimeZone !=='UTC' ? newNotification.endsAt : moment.utc(newNotification.endsAt).local().format("YYYY-MM-DD HH:mm:ss")
42552
42562
 
42553
42563
  var currentDate = new Date();
42554
42564
 
@@ -42576,7 +42586,7 @@ var AppBar = function AppBar(_ref) {
42576
42586
  var _notification$newsTar;
42577
42587
 
42578
42588
  if (notification === null || notification === void 0 ? void 0 : (_notification$newsTar = notification.newsTarget) === null || _notification$newsTar === void 0 ? void 0 : _notification$newsTar.audience_value) {
42579
- var startTime = moment.utc(notification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
42589
+ var startTime = moment.utc(notification.startsAt).local().format('YYYY-MM-DD HH:mm:ss');
42580
42590
  var currentDate = new Date();
42581
42591
 
42582
42592
  if (new Date(startTime) > currentDate) {
@@ -42704,12 +42714,15 @@ var AppBar = function AppBar(_ref) {
42704
42714
  if (history.location.pathname !== '/logout' && history.location.pathname !== '/login' && localStorage.getItem('login') && tileConfigAccess) {
42705
42715
  if (notificationsSource.includes('Nchan')) {
42706
42716
  fetchG2Notifications(updateNotifications, updateAllNotificationsList);
42707
- var client = startWebSocketConnection(updateNotifications, updateAllNotificationsList, reConnectSocket);
42708
- var pingIntervalInSec = coreAppConfig.nchanPingIntervalInSec || 30;
42709
- setPingInterval(setInterval(function () {
42710
- client.send('_ping_');
42711
- }, pingIntervalInSec * 1000));
42712
- setSocketClient(client);
42717
+
42718
+ if (!(window.navigator.userAgent.includes('Chrome') && window.location.href.includes('localhost'))) {
42719
+ var client = startWebSocketConnection(updateNotifications, updateAllNotificationsList, reConnectSocket);
42720
+ var pingIntervalInSec = coreAppConfig.nchanPingIntervalInSec || 30;
42721
+ setPingInterval(setInterval(function () {
42722
+ client.send('_ping_');
42723
+ }, pingIntervalInSec * 1000));
42724
+ setSocketClient(client);
42725
+ }
42713
42726
  }
42714
42727
 
42715
42728
  if (!firebaseInitialized && notificationsSource.includes('Firebase')) {
@@ -42793,6 +42806,7 @@ var AppBar = function AppBar(_ref) {
42793
42806
  onDismiss: dismissNotification,
42794
42807
  ActionComponent: ActionComponent,
42795
42808
  saveActionComponentState: saveActionComponentState,
42809
+ searchComponent: searchComponent,
42796
42810
  mihelpAppPath: mihelpAppPath,
42797
42811
  showMihelpDot: showMihelpDot,
42798
42812
  setShowMihelpTooltip: setShowMihelpTooltip,
@@ -46641,7 +46655,7 @@ function ContextualHelp(_ref) {
46641
46655
  setArticle = _useState2[1];
46642
46656
 
46643
46657
  var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
46644
- var tileData = findAppData(coreAppConfig.tiles || []) || {};
46658
+ var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
46645
46659
  var mihelpAppPath = !isCoreRoute ? tileData.mihelpAppPath : null;
46646
46660
  var isMihelpEnabled;
46647
46661
 
@@ -46733,13 +46747,12 @@ function ContextualHelp(_ref) {
46733
46747
  }, React__default["default"].createElement("span", {
46734
46748
  id: "helpSnippet1",
46735
46749
  ref: snippetRef
46736
- }, React__default["default"].createElement(coreComponents.Icon, {
46737
- name: "help",
46738
- variant: "material",
46750
+ }, React__default["default"].createElement(coreComponents.IconV2, {
46751
+ name: "question-circle",
46752
+ variant: "solid",
46739
46753
  style: {
46740
- fontSize: '30px',
46741
46754
  color: '#1d5ab9',
46742
- cursor: 'default'
46755
+ fontSize: '22px'
46743
46756
  }
46744
46757
  })), React__default["default"].createElement(H, {
46745
46758
  anchorSelect: "#helpSnippet1",