@copart/ops-tool-kit 1.12.1-alpha.32 → 1.12.1-alpha.33

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.
@@ -32,7 +32,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
32
32
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
33
33
 
34
34
  const name$r = "@copart/ops-tool-kit";
35
- const version$7 = "1.12.1-alpha.32";
35
+ const version$7 = "1.12.1-alpha.33";
36
36
  const main$1 = "dist/ops-tool-kit.js";
37
37
  const style = "dist/ops-tool-kit.css";
38
38
  const files = [
@@ -47259,7 +47259,8 @@ var NavigationBar = function NavigationBar(_ref2) {
47259
47259
  setActiveSubmenu = _ref2.setActiveSubmenu,
47260
47260
  allowMultipleNavItemsOpen = _ref2.allowMultipleNavItemsOpen,
47261
47261
  setShowNavigationCounts = _ref2.setShowNavigationCounts,
47262
- countsRef = _ref2.countsRef;
47262
+ countsRef = _ref2.countsRef,
47263
+ countAutoReloadDisabled = _ref2.countAutoReloadDisabled;
47263
47264
  // const withCounts = getCounts && typeof getCounts === 'function'
47264
47265
  var navigateFunction = navigateTo || (history === null || history === void 0 ? void 0 : history.push) || defaultRedirect;
47265
47266
  var _useState = React.useState(null),
@@ -47336,7 +47337,8 @@ var NavigationBar = function NavigationBar(_ref2) {
47336
47337
  getCounts: getCounts,
47337
47338
  setWithCounts: setWithCounts,
47338
47339
  withCounts: withCounts,
47339
- countsRef: countsRef
47340
+ countsRef: countsRef,
47341
+ countAutoReloadDisabled: countAutoReloadDisabled
47340
47342
  }) : null, isConfigValid === false ? /*#__PURE__*/React__default["default"].createElement("div", null, "Please check your navigation config") : null);
47341
47343
  };
47342
47344
  var NavigationMenu = function NavigationMenu(_ref3) {
@@ -47352,8 +47354,14 @@ var NavigationMenu = function NavigationMenu(_ref3) {
47352
47354
  getCounts = _ref3.getCounts,
47353
47355
  setWithCounts = _ref3.setWithCounts,
47354
47356
  withCounts = _ref3.withCounts,
47355
- countsRef = _ref3.countsRef;
47357
+ countsRef = _ref3.countsRef,
47358
+ countAutoReloadDisabled = _ref3.countAutoReloadDisabled;
47356
47359
  var redirectUrl = window.location.pathname;
47360
+ var _useState13 = React.useState(null),
47361
+ _useState14 = _slicedToArray(_useState13, 2),
47362
+ counts = _useState14[0],
47363
+ setCounts = _useState14[1];
47364
+ var countLoadAttemptsRef = React.useRef(0);
47357
47365
  React.useEffect(function () {
47358
47366
  if (redirectUrl != '/') {
47359
47367
  var splitUrl = redirectUrl.split('/');
@@ -47412,7 +47420,11 @@ var NavigationMenu = function NavigationMenu(_ref3) {
47412
47420
  getCounts: getCounts,
47413
47421
  setWithCounts: setWithCounts,
47414
47422
  withCounts: withCounts,
47415
- countsRef: countsRef
47423
+ countsRef: countsRef,
47424
+ countAutoReloadDisabled: countAutoReloadDisabled,
47425
+ counts: counts,
47426
+ setCounts: setCounts,
47427
+ countLoadAttemptsRef: countLoadAttemptsRef
47416
47428
  });
47417
47429
  }));
47418
47430
  };
@@ -47429,7 +47441,11 @@ var NavigationMenuLevel1 = function NavigationMenuLevel1(_ref4) {
47429
47441
  getCounts = _ref4.getCounts,
47430
47442
  setWithCounts = _ref4.setWithCounts,
47431
47443
  withCounts = _ref4.withCounts,
47432
- countsRef = _ref4.countsRef;
47444
+ countsRef = _ref4.countsRef,
47445
+ countAutoReloadDisabled = _ref4.countAutoReloadDisabled,
47446
+ counts = _ref4.counts,
47447
+ setCounts = _ref4.setCounts,
47448
+ countLoadAttemptsRef = _ref4.countLoadAttemptsRef;
47433
47449
  var hasSubMenuItems = navItem.subMenuItems && navItem.subMenuItems.length > 0;
47434
47450
  var shortName = navItem.shortName ? navItem.shortName.toUpperCase() : dotIcon;
47435
47451
  var nameText = isHover ? (_navItem$name = navItem.name) === null || _navItem$name === void 0 ? void 0 : _navItem$name.toUpperCase() : shortName;
@@ -47461,7 +47477,11 @@ var NavigationMenuLevel1 = function NavigationMenuLevel1(_ref4) {
47461
47477
  getCounts: getCounts,
47462
47478
  setWithCounts: setWithCounts,
47463
47479
  withCounts: withCounts,
47464
- countsRef: countsRef
47480
+ countsRef: countsRef,
47481
+ countAutoReloadDisabled: countAutoReloadDisabled,
47482
+ counts: counts,
47483
+ setCounts: setCounts,
47484
+ countLoadAttemptsRef: countLoadAttemptsRef
47465
47485
  });
47466
47486
  }) : null));
47467
47487
  };
@@ -47477,14 +47497,14 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
47477
47497
  getCounts = _ref5.getCounts,
47478
47498
  setWithCounts = _ref5.setWithCounts,
47479
47499
  withCounts = _ref5.withCounts,
47480
- countsRef = _ref5.countsRef;
47500
+ countsRef = _ref5.countsRef,
47501
+ countAutoReloadDisabled = _ref5.countAutoReloadDisabled,
47502
+ counts = _ref5.counts,
47503
+ setCounts = _ref5.setCounts,
47504
+ countLoadAttemptsRef = _ref5.countLoadAttemptsRef;
47481
47505
  // const isMenuExpanded = activeSubmenu === navItem.fullRoute
47482
47506
  var isMenuExpanded = activeSubmenu.includes(navItem.fullRoute);
47483
47507
  var showCounts = isMenuExpanded && getCounts && typeof getCounts === 'function';
47484
- var _useState13 = React.useState(null),
47485
- _useState14 = _slicedToArray(_useState13, 2),
47486
- counts = _useState14[0],
47487
- setCounts = _useState14[1];
47488
47508
  var _useState15 = React.useState(false),
47489
47509
  _useState16 = _slicedToArray(_useState15, 2),
47490
47510
  countsLoading = _useState16[0],
@@ -47495,8 +47515,11 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
47495
47515
 
47496
47516
  React.useEffect(function () {
47497
47517
  if (showCounts) {
47498
- setCountsLoading(true);
47499
- reloadCounts(navItem.route);
47518
+ if (!countAutoReloadDisabled || (countLoadAttemptsRef === null || countLoadAttemptsRef === void 0 ? void 0 : countLoadAttemptsRef.current) === 0) {
47519
+ countLoadAttemptsRef.current++;
47520
+ setCountsLoading(true);
47521
+ reloadCounts(navItem.route);
47522
+ }
47500
47523
  if (countsRef && _typeof(countsRef) === 'object') {
47501
47524
  countsRef.current = {
47502
47525
  refreshCounts: function refreshCounts() {
@@ -47534,7 +47557,7 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
47534
47557
  });
47535
47558
  }
47536
47559
  // setActiveSubmenu(isMenuExpanded ? null : navItem.fullRoute)
47537
- if (!isMenuExpanded && showCounts) {
47560
+ if (!isMenuExpanded && showCounts && !countAutoReloadDisabled) {
47538
47561
  reloadCounts();
47539
47562
  }
47540
47563
  } else {
@@ -47804,7 +47827,8 @@ var AppFrame = function AppFrame(props) {
47804
47827
  setActiveSubmenu: setActiveSubmenu,
47805
47828
  allowMultipleNavItemsOpen: props.allowMultipleNavItemsOpen,
47806
47829
  setShowNavigationCounts: setShowNavigationCounts,
47807
- countsRef: props.countsRef
47830
+ countsRef: props.countsRef,
47831
+ countAutoReloadDisabled: props.countAutoReloadDisabled
47808
47832
  }) : null, /*#__PURE__*/React__default["default"].createElement("div", {
47809
47833
  style: {
47810
47834
  marginLeft: props.showNavigation ? navigationWidth : '0px',