@bjsdistribution/dms-client-return 0.0.32 → 0.0.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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.32",
2
+ "version": "0.0.33",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -515,15 +515,16 @@ export const StyledTable = styled.table`
515
515
 
516
516
  // Styled components
517
517
  export const StyledTableWrapper = styled.div`
518
- overflow-x: auto;
519
518
  max-height: 60vh;
519
+ overflow-x: auto;
520
520
  scrollbar-width: none;
521
+ min-height: 50vh;
521
522
 
522
523
  .fortables {
523
- overflow-x: auto;
524
524
  max-height: 60vh;
525
+ overflow-x: auto;
525
526
  scrollbar-width: none;
526
- min-height: 60vh;
527
+ min-height: 50vh;
527
528
  }
528
529
  /* height: 600px; */
529
530
  /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */
@@ -59,7 +59,7 @@ export const StyledTable = styled.table`
59
59
  }
60
60
  }
61
61
  .emailInvoiceNo {
62
- padding-left: 0px;
62
+ padding-left: 12px;
63
63
  }
64
64
  .emailInvoiceShare {
65
65
  width: 100px;
@@ -1,29 +1,25 @@
1
1
  import React, { useState, useEffect, useRef } from 'react';
2
- import { useAtom } from 'jotai';
3
- import { countReducerAtom } from '../../../store';
2
+ import { useCurrentAction } from '../../../store';
4
3
  import DropDownItem from './DropDownItem';
5
4
  import DropDownMenu from './DropDownMenu';
6
5
  import { DropDownContainer } from './DropdownStyles';
7
6
  import DropDownLarge from '../../../../../assets/icons/DropDownLarge';
8
- // import { countReducerAtom } from '../../../store/store';
9
7
 
10
8
  const Options = [
11
- { label: 'Add Order Resource ', value: 'add-order-resources' },
9
+ // { label: 'Add Order Resource ', value: 'add-order-resources' },
12
10
  { label: 'Split Order ', value: 'split-order' },
13
11
  ];
14
12
 
15
13
  const MenuDropDown: React.FC = () => {
16
14
  const [isOpen, setIsOpen] = useState(false);
17
- const [, dispatch] = useAtom(countReducerAtom);
18
15
  const dropdownRef = useRef<HTMLDivElement>(null);
19
-
16
+ const [, setCurrentAction] = useCurrentAction();
20
17
  const handleClick = () => {
21
18
  setIsOpen(prev => !prev);
22
19
  };
23
20
 
24
- const handleSelect = (value: string) => {
25
- console.log(`Selected: ${value}`);
26
- dispatch({ type: value });
21
+ const handleSelect = (selectedOption: any) => {
22
+ setCurrentAction(selectedOption);
27
23
  setIsOpen(false);
28
24
  };
29
25
 
@@ -63,7 +63,7 @@ const renderIcon = (value: any, orderStatus: any) => {
63
63
  } else if (status.delivered === true && status.completed === true) {
64
64
  return <SuccessIcon />;
65
65
  } else if (status.delivered === true && status.completed === false) {
66
- return <RouteIcon />;
66
+ return <RouteIcon />; //orange
67
67
  } else {
68
68
  return <ConfirmedIcon />;
69
69
  }
@@ -3,24 +3,13 @@ import { AntModal, useApiHook } from '@bjsdistribution/dms-component-library';
3
3
  import { useAtom } from 'jotai';
4
4
  import {
5
5
  countReducerAtom,
6
- letselectedProductIdAtom,
7
- selectedTabKeyAtom,
8
6
  useCreateOrderProducts,
9
7
  useDeleteProdsID,
10
8
  usefetchAgain,
11
- // usefetchAgain,
12
- useOrderId,
13
9
  useProductDetails,
14
- useRecieveOrderProducts,
15
- useUpdateOrderProducts,
16
10
  } from '../store';
17
11
 
18
- import ProductAction from './ProductAction';
19
- // import DeleteProduct from './DeleteProduct';
20
- // import AddProduct from './AddProduct';
21
- import logsTable from './qclogs/logsTable';
22
12
  import DefectsModal from './DefectsModal';
23
- import repackModal from './RepackModal';
24
13
  import { ApiResponse } from '../types';
25
14
  import CreateReturnModal from './CreateReturnModal';
26
15
  import {
@@ -39,12 +28,7 @@ const ModalManager = () => {
39
28
  const [popupName, dispatch] = useAtom(countReducerAtom);
40
29
  const [,] = useProductDetails();
41
30
  const [orderProduct] = useCreateOrderProducts();
42
- const [orderId] = useOrderId();
43
31
  const [selectedRows] = useDeleteProdsID();
44
- const [unRecieve, setUnRecieve] = useRecieveOrderProducts();
45
- const [updateOrderProduct, setUpdateOrderProduct] = useUpdateOrderProducts();
46
- const [selectedProductId] = useAtom(letselectedProductIdAtom);
47
- const [selectedTab] = useAtom(selectedTabKeyAtom);
48
32
  const [, setIsFormValid] = useState(false);
49
33
  const [newGrouped] = useFinalPayload();
50
34
  const [postLoading, SetPostLoading] = usePostLoading();
@@ -71,66 +55,6 @@ const ModalManager = () => {
71
55
  setIsFormValid(validateForm());
72
56
  }, [selectedRows]);
73
57
 
74
- // api block for the create product order
75
- const {
76
- data: actionResponse,
77
- setShouldPerformAction: setUnrecieveaction,
78
- } = useApiHook<{
79
- data: ApiResponse[];
80
- }>({
81
- endpoint: `order/order_products/unrecieve/`,
82
- method: 'POST',
83
- body: [unRecieve],
84
- performAction: false,
85
- });
86
-
87
- useEffect(() => {
88
- if (actionResponse && actionResponse?.data) {
89
- dispatch({ type: 'close' });
90
- }
91
- }, [actionResponse]);
92
-
93
- // api block for the update product order
94
- const {
95
- data: updateResponse,
96
- setShouldPerformAction: setUpdateSction,
97
- } = useApiHook<{
98
- data: ApiResponse[];
99
- }>({
100
- endpoint: `order/order_products/type/update/`,
101
- method: 'PUT',
102
- body: [updateOrderProduct],
103
- performAction: false,
104
- });
105
-
106
- const onSubmit = () => {
107
- if (selectedTab === '1') {
108
- setUpdateOrderProduct((prev: any) => ({
109
- ...prev,
110
- order_id: orderId,
111
- id: selectedProductId,
112
- }));
113
- setUpdateSction(true);
114
- console.log('Tab 1 selected');
115
- } else if (selectedTab === '2') {
116
- console.log('Tab 2 selected');
117
- } else if (selectedTab === '3') {
118
- setUnRecieve((prev: any) => ({
119
- ...prev,
120
- order_id: orderId,
121
- id: selectedProductId,
122
- }));
123
- setUnrecieveaction(true);
124
- console.log('Tab 3 selected');
125
- }
126
- };
127
-
128
- useEffect(() => {
129
- if (updateResponse && updateResponse?.data) {
130
- dispatch({ type: 'close' });
131
- }
132
- }, [updateResponse]);
133
-
134
58
  // Confirm return popup
135
59
  const {
136
60
  data: response,
@@ -258,49 +182,7 @@ const ModalManager = () => {
258
182
  />
259
183
  </>
260
184
  )}
261
- {popupName?.state === 'qclog' && (
262
- <AntModal
263
- openStatus={popupName?.state === 'qclog'}
264
- closeModal={closeModal}
265
- PopupHeader={{
266
- heading: 'Deliver - STOHOP011GRY-UK - 006064438012831476',
267
- subHeading: '[Hopkins Highboard, Walnut Effect Grey]',
268
- }}
269
- PopupFooter={{
270
- btns: [
271
- {
272
- name: 'Submit',
273
- btnStyle: 'rounded',
274
- onClick: onSubmit,
275
- },
276
- ],
277
- }}
278
- BodyComponent={ProductAction}
279
- width={1104}
280
- classNameAdd={'globalPopup'}
281
- />
282
- )}
283
- {popupName?.state == 'qclogtable' && (
284
- <AntModal
285
- openStatus={popupName?.state == 'qclogtable' ? true : false}
286
- closeModal={closeModal}
287
- PopupHeader={{
288
- heading: 'Deliver-AI-00030345784968148412',
289
- subHeading: '[Centralized regional adpated] ',
290
- }}
291
- PopupFooter={{
292
- btns: [
293
- {
294
- name: 'Submit',
295
- btnStyle: 'rounded',
296
- },
297
- ],
298
- }}
299
- BodyComponent={logsTable}
300
- width={1104}
301
- classNameAdd={'globalPopup'}
302
- />
303
- )}
185
+
304
186
  {popupName?.state == 'defectsModal' && (
305
187
  <AntModal
306
188
  openStatus={popupName?.state == 'defectsModal' ? true : false}
@@ -324,29 +206,6 @@ const ModalManager = () => {
324
206
  classNameAdd={'globalPopup'}
325
207
  />
326
208
  )}
327
- {popupName?.state == 'repackModal' && (
328
- <AntModal
329
- openStatus={popupName?.state == 'repackModal' ? true : false}
330
- closeModal={closeModal}
331
- PopupHeader={{
332
- heading: 'DEliver - DWLK1006 - 00605',
333
- subHeading: 'ALtair TV stand for TVs up to 60',
334
- }}
335
- PopupFooter={{
336
- btns: [
337
- {
338
- name: '',
339
- btnStyle: '',
340
- type: '',
341
- },
342
- ],
343
- btnAlign: '',
344
- }}
345
- BodyComponent={repackModal}
346
- width={1504}
347
- classNameAdd={'globalPopup'}
348
- />
349
- )}
350
209
  </>
351
210
  );
352
211
  };
@@ -7,9 +7,9 @@ import { Checkbox } from '@bjsdistribution/dms-component-library';
7
7
  import { useSelectedSplit, useSplitOrderPayload } from '../../store';
8
8
  import {
9
9
  EmptyDataContainer,
10
+ StyledTable,
10
11
  StyledTableWrapper,
11
12
  } from '../confirm-order/tables/ReminderStyles';
12
- import { StyledTable } from '../modalstyle';
13
13
 
14
14
  function SplitOrderTable() {
15
15
  const [orderProductDetails] = useProductDetails();
@@ -48,7 +48,7 @@ function SplitOrderTable() {
48
48
  useEffect(() => {
49
49
  setPayload({
50
50
  ...payload,
51
- return_order: 0,
51
+ return_order: 1, // FOR SPLIT ORDER WE ARE ASKED TO SET THIS AS 1
52
52
  products: selectedSplits?.map(order => order.id),
53
53
  force: true,
54
54
  });
@@ -5,17 +5,14 @@ import { useCurrentAction } from '../store';
5
5
  import SplitOrder from './actions/split-order';
6
6
  import LogServiceRefusal from './actions/log-service-refusal';
7
7
  import CancelOrder from './actions/cancel-order';
8
- import UpdateProductType from './actions/update-product-type/UpdateProductType';
9
8
  import ConfirmOrder from './actions/confirm-order';
10
9
  import SendSmsModal from './actions/send-sms/SendSmsModal';
11
10
  import SendEmailModal from './actions/send-email/SendEmailModal';
12
11
  import ChangeCustomerAccModal from './actions/change-customer-account/ChangeCustomerAccModal';
13
12
  import HoldOrderModal from './actions/hold-order/HoldOrderModal';
14
- import EscalationModal from './actions/escalation/EscalationModal';
15
13
  import LogFeedback from './actions/log-feedback/LogFeedback';
16
14
  import ChargeLog from './actions/charge-log';
17
15
  import UnholdOrder from './actions/unhold-order/UnholdOrder';
18
- import RestoreProducts from './actions/restore-products/RestoreProducts';
19
16
  import ViewReminderModal from '../view-reminder/ViewReminder';
20
17
  import TaskReminderModal from './actions/create-task-reminder';
21
18
  import OrderLock from './actions/order-lock';
@@ -29,8 +26,6 @@ function OrderActions() {
29
26
  switch (currentAction) {
30
27
  case 'add-resources':
31
28
  return <AddResources />;
32
- case 'bulk-update':
33
- return <UpdateProductType />;
34
29
  case 'split-order':
35
30
  return <SplitOrder />;
36
31
  case 'release-order':
@@ -53,8 +48,6 @@ function OrderActions() {
53
48
  return <ChangeCustomerAccModal />;
54
49
  case 'hold-order':
55
50
  return <HoldOrderModal />;
56
- case 'escalations':
57
- return <EscalationModal />;
58
51
  case 'create-task':
59
52
  return <TaskReminderModal />;
60
53
  case 'log-feedback':
@@ -63,8 +56,6 @@ function OrderActions() {
63
56
  return <ChargeLog />;
64
57
  case 'unhold-order':
65
58
  return <UnholdOrder />;
66
- case 'restore-products':
67
- return <RestoreProducts />;
68
59
  case 'view-reminder':
69
60
  return <ViewReminderModal />;
70
61
  case 'order-lock':
@@ -122,6 +122,7 @@ const Container = styled.div`
122
122
  background: #f8fafc;
123
123
  margin: 0px;
124
124
  border-radius: 0px 0px 8px 8px;
125
+ align-items: center;
125
126
  `;
126
127
 
127
128
  export default OrderDetailsFooter;
@@ -475,7 +475,12 @@ const popupReducer = (state: any, action: any) => {
475
475
  } else if (action.type === 'addProduct') {
476
476
  state = 'addProduct';
477
477
  return { state };
478
- } else if (action.type === 'deleteProduct') {
478
+ }
479
+ else if (action.type === 'split-order') {
480
+ state = 'split-order';
481
+ return { state };
482
+ }
483
+ else if (action.type === 'deleteProduct') {
479
484
  state = 'deleteProduct';
480
485
  return { state };
481
486
  } else if (action.type === 'defectsModal') {