@bjsdistribution/dms-client-return 0.0.90 → 0.0.91

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.
@@ -2016,17 +2016,6 @@ var DefectsData = [{
2016
2016
  date: '6/11/2024 11:26:05 AM',
2017
2017
  images: ''
2018
2018
  }];
2019
- var getCookie = function getCookie(name) {
2020
- var value = "; " + document.cookie;
2021
- var parts = value.split("; " + name + "=");
2022
- if (parts.length === 2) {
2023
- var lastPart = parts.pop();
2024
- if (lastPart !== undefined) {
2025
- return lastPart.split(';').shift() || null;
2026
- }
2027
- }
2028
- return null;
2029
- };
2030
2019
  var handleKeyDown = function handleKeyDown(e) {
2031
2020
  // Allowed keys: numbers (0-9), '.', '-', '+'
2032
2021
  var allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-', '+', 'ArrowLeft', 'ArrowRight'];
@@ -5495,7 +5484,6 @@ function AddNote() {
5495
5484
  var location = reactRouterDom.useLocation();
5496
5485
  var pathname = location.pathname;
5497
5486
  var orderIdLocaation = pathname.split('/')[1];
5498
- var ssoToken = getCookie('id_token');
5499
5487
  var _usemoduleIds = usemoduleIds(),
5500
5488
  moduleIds = _usemoduleIds[0];
5501
5489
  var _useGlobalStateHitAud = useGlobalStateHitAuditLog(),
@@ -5503,12 +5491,17 @@ function AddNote() {
5503
5491
  var _useSelectedData = useSelectedData(),
5504
5492
  selected = _useSelectedData[0];
5505
5493
  // Save New Note
5494
+ var _useAxios = dmsComponentLibrary.useAxios({
5495
+ endpoint: "/audit_logs/orders/",
5496
+ method: 'POST'
5497
+ }),
5498
+ callAuditLogs = _useAxios.fetchData;
5506
5499
  var _useState2 = React.useState(null),
5507
5500
  notificationData = _useState2[0],
5508
5501
  setNotificationData = _useState2[1];
5509
5502
  var saveNote = /*#__PURE__*/function () {
5510
5503
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
5511
- var endpoint, payload, response;
5504
+ var payload, response;
5512
5505
  return _regeneratorRuntime().wrap(function _callee$(_context) {
5513
5506
  while (1) switch (_context.prev = _context.next) {
5514
5507
  case 0:
@@ -5519,7 +5512,6 @@ function AddNote() {
5519
5512
  }
5520
5513
  return _context.abrupt("return");
5521
5514
  case 3:
5522
- endpoint = dmsComponentLibrary.getBaseEndpoint() + "/audit_logs/orders/";
5523
5515
  payload = {
5524
5516
  audit_logs: [{
5525
5517
  parent_object_id: orderId || orderIdLocaation,
@@ -5532,47 +5524,41 @@ function AddNote() {
5532
5524
  manual: 1,
5533
5525
  is_private: selected
5534
5526
  }]
5535
- }; //to change
5536
- _context.prev = 5;
5537
- _context.next = 8;
5538
- return fetch(endpoint, {
5539
- method: 'POST',
5540
- headers: {
5541
- 'Content-Type': 'application/json',
5542
- Authorization: "Bearer " + ssoToken
5543
- },
5544
- body: JSON.stringify(payload)
5527
+ };
5528
+ _context.prev = 4;
5529
+ _context.next = 7;
5530
+ return callAuditLogs({
5531
+ payload: payload
5545
5532
  });
5546
- case 8:
5533
+ case 7:
5547
5534
  response = _context.sent;
5548
- // setNoteLoadingStore(false);
5549
- if (response.ok) {
5535
+ if (response.code == 200 && response != null && response.data) {
5550
5536
  antd.notification.success({
5551
5537
  message: 'Success',
5552
- description: 'Note saved successfully.'
5538
+ description: "" + (response == null ? void 0 : response.message)
5553
5539
  });
5554
5540
  setNoteText('');
5555
5541
  setRecallAuditLog(true);
5556
5542
  } else {
5557
5543
  antd.notification.error({
5558
5544
  message: 'Error',
5559
- description: 'Failed to save note.'
5545
+ description: "" + (response == null ? void 0 : response.error)
5560
5546
  });
5561
5547
  }
5562
- _context.next = 15;
5548
+ _context.next = 14;
5563
5549
  break;
5564
- case 12:
5565
- _context.prev = 12;
5566
- _context.t0 = _context["catch"](5);
5550
+ case 11:
5551
+ _context.prev = 11;
5552
+ _context.t0 = _context["catch"](4);
5567
5553
  antd.notification.error({
5568
5554
  message: 'Error',
5569
5555
  description: 'Failed to save note due to an error.'
5570
5556
  });
5571
- case 15:
5557
+ case 14:
5572
5558
  case "end":
5573
5559
  return _context.stop();
5574
5560
  }
5575
- }, _callee, null, [[5, 12]]);
5561
+ }, _callee, null, [[4, 11]]);
5576
5562
  }));
5577
5563
  return function saveNote() {
5578
5564
  return _ref.apply(this, arguments);
@@ -6805,10 +6791,6 @@ var reminderData = /*#__PURE__*/jotai.atom([]);
6805
6791
  var resolvedModalPayload = /*#__PURE__*/jotai.atom(resolvedValue);
6806
6792
  var routeDetails = /*#__PURE__*/jotai.atom({});
6807
6793
  var orderNotifyCount = /*#__PURE__*/jotai.atom(0);
6808
- var taskLoading = /*#__PURE__*/jotai.atom(true);
6809
- function useTaskLoading() {
6810
- return jotai.useAtom(taskLoading);
6811
- }
6812
6794
  var initialConfirmOrderErrValues = {
6813
6795
  homeContactError: '',
6814
6796
  workContactError: '',
@@ -11598,7 +11580,7 @@ var NotifyFlag = function NotifyFlag() {
11598
11580
  }));
11599
11581
  };
11600
11582
 
11601
- var _templateObject$2e, _templateObject2$1D, _templateObject3$V, _templateObject4$w, _templateObject5$m, _templateObject6$c, _templateObject7$c, _templateObject8$a, _templateObject9$6, _templateObject10$4, _templateObject11$4, _templateObject12$2;
11583
+ var _templateObject$2e, _templateObject2$1D, _templateObject3$V, _templateObject4$w, _templateObject5$m, _templateObject6$c, _templateObject7$c, _templateObject8$a, _templateObject9$6;
11602
11584
  function Notification() {
11603
11585
  var _OrderData$order_rout;
11604
11586
  var _useTabType = useTabType(),
@@ -11611,8 +11593,7 @@ function Notification() {
11611
11593
  var _useNotificationData = useNotificationData(),
11612
11594
  notificationData = _useNotificationData[0],
11613
11595
  setNotififcationData = _useNotificationData[1];
11614
- var _useTaskLoading = useTaskLoading(),
11615
- flagLoading = _useTaskLoading[0];
11596
+ // const [flagLoading] = useTaskLoading();
11616
11597
  var _useReminderNotiData = useReminderNotiData(),
11617
11598
  reminderData = _useReminderNotiData[0],
11618
11599
  setReminderData = _useReminderNotiData[1];
@@ -11764,7 +11745,7 @@ function Notification() {
11764
11745
  onClick: function onClick() {
11765
11746
  return handleTabChange('closed');
11766
11747
  }
11767
- }, "Closed", React__default.createElement(ClosedCount, null, totalClosedCount)))), flagLoading ? React__default.createElement(Loader, null, React__default.createElement(Spinner, null), React__default.createElement(Text$9, null, "Fetching Notifications...")) : notificationData.length > 0 || reminderData.length > 0 || OrderData ? React__default.createElement(TabsWrapper, null, React__default.createElement(Tabs, {
11748
+ }, "Closed", React__default.createElement(ClosedCount, null, totalClosedCount)))), notificationData.length > 0 || reminderData.length > 0 || OrderData ? React__default.createElement(TabsWrapper, null, React__default.createElement(Tabs, {
11768
11749
  activeNotifications: activeNotifications,
11769
11750
  closedNotifications: closedNotifications,
11770
11751
  activeReminders: activeReminders,
@@ -11774,21 +11755,41 @@ function Notification() {
11774
11755
  })) : 'No Notifications Found'));
11775
11756
  }
11776
11757
  var Container$1a = /*#__PURE__*/styled__default.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n border-bottom: 1px solid #ccc;\n"])));
11777
- var Loader = /*#__PURE__*/styled__default.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 10px;\n"])));
11778
- var Spinner = /*#__PURE__*/styled__default.div(_templateObject3$V || (_templateObject3$V = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 4px solid rgba(0, 0, 0, 0.1);\n border-left-color: #3a3630;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
11779
- var FlagContainer = /*#__PURE__*/styled__default.div(_templateObject4$w || (_templateObject4$w = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 8px;\n background-color: #3a3630;\n border-radius: 10px;\n"])));
11780
- var TabsData = /*#__PURE__*/styled__default.div(_templateObject5$m || (_templateObject5$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n"])));
11781
- var ActiveCount = /*#__PURE__*/styled__default.div(_templateObject6$c || (_templateObject6$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #6396e5;\n border-radius: 6px;\n"])));
11782
- var ClosedCount = /*#__PURE__*/styled__default.div(_templateObject7$c || (_templateObject7$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #e95252;\n border-radius: 6px;\n"])));
11783
- var StyledTab = /*#__PURE__*/styled__default.div(_templateObject8$a || (_templateObject8$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 5px;\n cursor: pointer;\n color: ", ";\n border-bottom: ", ";\n transition: border-bottom 0.3s ease;\n font-family: 'Roboto', sans-serif;\n padding-bottom: 5px;\n align-items: center;\n"])), function (props) {
11758
+ // const Loader = styled.div`
11759
+ // align-items: center;
11760
+ // justify-content: center;
11761
+ // display: flex;
11762
+ // flex-direction: column;
11763
+ // gap: 10px;
11764
+ // `;
11765
+ // const Spinner = styled.div`
11766
+ // border: 4px solid rgba(0, 0, 0, 0.1);
11767
+ // border-left-color: #3a3630;
11768
+ // border-radius: 50%;
11769
+ // width: 40px;
11770
+ // height: 40px;
11771
+ // animation: spin 1s linear infinite;
11772
+ // @keyframes spin {
11773
+ // 0% {
11774
+ // transform: rotate(0deg);
11775
+ // }
11776
+ // 100% {
11777
+ // transform: rotate(360deg);
11778
+ // }
11779
+ // }
11780
+ // `;
11781
+ var FlagContainer = /*#__PURE__*/styled__default.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 8px;\n background-color: #3a3630;\n border-radius: 10px;\n"])));
11782
+ var TabsData = /*#__PURE__*/styled__default.div(_templateObject3$V || (_templateObject3$V = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n"])));
11783
+ var ActiveCount = /*#__PURE__*/styled__default.div(_templateObject4$w || (_templateObject4$w = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #6396e5;\n border-radius: 6px;\n"])));
11784
+ var ClosedCount = /*#__PURE__*/styled__default.div(_templateObject5$m || (_templateObject5$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #e95252;\n border-radius: 6px;\n"])));
11785
+ var StyledTab = /*#__PURE__*/styled__default.div(_templateObject6$c || (_templateObject6$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 5px;\n cursor: pointer;\n color: ", ";\n border-bottom: ", ";\n transition: border-bottom 0.3s ease;\n font-family: 'Roboto', sans-serif;\n padding-bottom: 5px;\n align-items: center;\n"])), function (props) {
11784
11786
  return props.active ? '#3a3630' : '#AEA9A1';
11785
11787
  }, function (props) {
11786
11788
  return props.active ? '2px solid #feba30' : '2px solid #eeeeee';
11787
11789
  });
11788
- var Section$1 = /*#__PURE__*/styled__default.div(_templateObject9$6 || (_templateObject9$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 14px;\n background: #ffffff;\n border-radius: 12px;\n padding: 10px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0;\n"])));
11789
- var Label$i = /*#__PURE__*/styled__default(dmsComponentLibrary.SectionHeader)(_templateObject10$4 || (_templateObject10$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #ccc;\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n text-transform: uppercase;\n"])));
11790
- var TabsWrapper = /*#__PURE__*/styled__default.div(_templateObject11$4 || (_templateObject11$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* min-height: 200px; */\n max-height: 250px;\n overflow-y: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &:hover {\n scrollbar-width: thin;\n }\n\n &::-webkit-scrollbar {\n width: 0;\n }\n\n &:hover::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.5);\n }\n"])));
11791
- var Text$9 = /*#__PURE__*/styled__default.div(_templateObject12$2 || (_templateObject12$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--tonal-brown-651, #6a7378);\n font-family: Lato;\n font-size: 13px;\n font-style: normal;\n font-weight: 600;\n"])));
11790
+ var Section$1 = /*#__PURE__*/styled__default.div(_templateObject7$c || (_templateObject7$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 14px;\n background: #ffffff;\n border-radius: 12px;\n padding: 10px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0;\n"])));
11791
+ var Label$i = /*#__PURE__*/styled__default(dmsComponentLibrary.SectionHeader)(_templateObject8$a || (_templateObject8$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #ccc;\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n text-transform: uppercase;\n"])));
11792
+ var TabsWrapper = /*#__PURE__*/styled__default.div(_templateObject9$6 || (_templateObject9$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* min-height: 200px; */\n max-height: 250px;\n overflow-y: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &:hover {\n scrollbar-width: thin;\n }\n\n &::-webkit-scrollbar {\n width: 0;\n }\n\n &:hover::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.5);\n }\n"])));
11792
11793
 
11793
11794
  var _templateObject$2f;
11794
11795
  function CollapsedContent$2() {