@bjsdistribution/dms-client-return 0.0.59 → 0.0.60
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/dist/components/order-view/store.d.ts +2 -1
- package/dist/dms-client-return.cjs.development.js +32 -24
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +32 -24
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +3 -2
- package/src/components/order-daily-overview/store/store.ts +1 -1
- package/src/components/order-daily-overview/table/ReturnTable.tsx +5 -3
- package/src/components/order-view/hooks/useUpdateOrder.ts +3 -0
- package/src/components/order-view/index.tsx +0 -1
- package/src/components/order-view/modalsPopup/DeleteProduct.tsx +2 -2
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -5
- package/src/components/order-view/products-info/expanded-content/index.tsx +2 -1
- package/src/components/order-view/store.ts +13 -7
- package/src/index.tsx +5 -2
package/package.json
CHANGED
|
@@ -168,7 +168,8 @@ function SelectionFilter() {
|
|
|
168
168
|
if (!currentSearch.includes('filter')) {
|
|
169
169
|
console.log('inside include');
|
|
170
170
|
// for dev
|
|
171
|
-
navigate(`filter?${queryParams.toString()}`);
|
|
171
|
+
//navigate(`filter?${queryParams.toString()}`);
|
|
172
|
+
navigate(`/orders/view/return/filter?${queryParams.toString()}`);
|
|
172
173
|
|
|
173
174
|
// for local
|
|
174
175
|
//navigate(`/filter?${queryParams.toString()}`);
|
|
@@ -272,7 +273,7 @@ function SelectionFilter() {
|
|
|
272
273
|
useEffect(() => {
|
|
273
274
|
if (clearState) {
|
|
274
275
|
dispatch({ type: 'CLEAR_CLIENT' });
|
|
275
|
-
window.location.href = '/
|
|
276
|
+
window.location.href = '/orders/view/return/';
|
|
276
277
|
}
|
|
277
278
|
}, [clearState]);
|
|
278
279
|
|
|
@@ -138,7 +138,8 @@ const ReturnTable: React.FC = () => {
|
|
|
138
138
|
customerId: customerId?.toString(),
|
|
139
139
|
});
|
|
140
140
|
//for dev
|
|
141
|
-
navigate(`filter?${queryParams.toString()}`);
|
|
141
|
+
//navigate(`filter?${queryParams.toString()}`);
|
|
142
|
+
navigate(`/orders/view/return/filter?${queryParams.toString()}`);
|
|
142
143
|
|
|
143
144
|
//for local
|
|
144
145
|
//navigate(`/filter?${queryParams.toString()}`);
|
|
@@ -167,7 +168,8 @@ const ReturnTable: React.FC = () => {
|
|
|
167
168
|
type: RTS,
|
|
168
169
|
});
|
|
169
170
|
//for dev
|
|
170
|
-
navigate(`filter?${queryParams.toString()}`);
|
|
171
|
+
//navigate(`filter?${queryParams.toString()}`);
|
|
172
|
+
navigate(`/orders/view/return/filter?${queryParams.toString()}`);
|
|
171
173
|
|
|
172
174
|
//for local
|
|
173
175
|
//navigate(`/filter?${queryParams.toString()}`);
|
|
@@ -176,7 +178,7 @@ const ReturnTable: React.FC = () => {
|
|
|
176
178
|
return (
|
|
177
179
|
<>
|
|
178
180
|
{statsLoading && <Loader />}
|
|
179
|
-
<StyledTableWrapper
|
|
181
|
+
<StyledTableWrapper>
|
|
180
182
|
<StyledTable>
|
|
181
183
|
<thead>
|
|
182
184
|
<tr>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
2
2
|
import { getCookie } from '../utils';
|
|
3
3
|
import { notification } from 'antd';
|
|
4
|
+
import { useUpdateApiCall } from '../store';
|
|
4
5
|
|
|
5
6
|
function useUpdateOrder() {
|
|
6
7
|
let controller: AbortController;
|
|
7
8
|
const ssoToken = getCookie('id_token');
|
|
9
|
+
const [, setCallApi] = useUpdateApiCall(); //single detail
|
|
8
10
|
|
|
9
11
|
const update = async (data: any) => {
|
|
10
12
|
const endpoint = `${getBaseEndpoint()}/orders/update/`;
|
|
@@ -38,6 +40,7 @@ function useUpdateOrder() {
|
|
|
38
40
|
message: 'Success',
|
|
39
41
|
description: 'Order has been updated.',
|
|
40
42
|
});
|
|
43
|
+
setCallApi(true);
|
|
41
44
|
return json;
|
|
42
45
|
} catch (err) {
|
|
43
46
|
// setLoading(false);
|
|
@@ -58,7 +58,6 @@ function OrderView() {
|
|
|
58
58
|
const [, setDepotOptions] = useDepotOptions();
|
|
59
59
|
const [, setCustomerInfo] = useCustomerInfo();
|
|
60
60
|
const [, setLocationOptions] = useLocationOptions();
|
|
61
|
-
|
|
62
61
|
const [orderResources, setOrderResources] = useOrderProductsResources();
|
|
63
62
|
const [orderToolbox, setOrderToolbox] = useOrderProductsToolbox();
|
|
64
63
|
const [GsitCUstomerId, setGsitCUstomerId] = useGsitCUstomerId();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useDeleteProdsID, useProductDetails } from '../store';
|
|
3
|
+
import { Empty, Skeleton } from 'antd';
|
|
3
4
|
import {
|
|
4
5
|
EmptyDataContainer,
|
|
5
6
|
StyledTable,
|
|
6
7
|
StyledTableWrapper,
|
|
7
|
-
} from '../
|
|
8
|
-
import { Empty, Skeleton } from 'antd';
|
|
8
|
+
} from '../order-actions/actions/confirm-order/tables/ReminderStyles';
|
|
9
9
|
|
|
10
10
|
const DeleteProduct = () => {
|
|
11
11
|
const [productdata] = useProductDetails();
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
errorAtom,
|
|
10
10
|
useCustomerInfo,
|
|
11
11
|
// useLogsCallAPi,
|
|
12
|
-
|
|
12
|
+
useUpdateApiCall,
|
|
13
13
|
// UseNotesLoading,
|
|
14
14
|
} from '../../../store';
|
|
15
15
|
import useUpdateOrder from '../../../hooks/useUpdateOrder';
|
|
@@ -23,7 +23,7 @@ function OrderDetailsFooter() {
|
|
|
23
23
|
const updateOrder = useUpdateOrder();
|
|
24
24
|
const [errorState] = useAtom(errorAtom);
|
|
25
25
|
// const [, setLogsCallAPi] = useLogsCallAPi();
|
|
26
|
-
const [, setCallApi] =
|
|
26
|
+
const [, setCallApi] = useUpdateApiCall(); //single detail
|
|
27
27
|
// const [, setNoteLoadingStore] = UseNotesLoading();
|
|
28
28
|
|
|
29
29
|
const errorFound = () => {
|
|
@@ -78,12 +78,10 @@ function OrderDetailsFooter() {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
const onSave = async () => {
|
|
81
|
-
setCallApi(true);
|
|
82
81
|
const payload = compareOrderDetailsStates(prevOrderDetails, orderDetails);
|
|
83
82
|
const response = await updateOrder([payload]);
|
|
84
|
-
|
|
83
|
+
setCallApi(false);
|
|
85
84
|
// setLogsCallAPi(prev => !prev);
|
|
86
|
-
|
|
87
85
|
if (response && response?.data?.length > 0) {
|
|
88
86
|
setOrderDetails(response?.data[0]);
|
|
89
87
|
setPrevOrderDetails(response?.data[0]);
|
|
@@ -81,7 +81,8 @@ function ExpandedContent() {
|
|
|
81
81
|
|
|
82
82
|
//@ts-ignore
|
|
83
83
|
if (response?.code === 200 && newId) {
|
|
84
|
-
|
|
84
|
+
// suggested by rahul
|
|
85
|
+
navigate(`${newId}`);
|
|
85
86
|
setSelectedProducts([]);
|
|
86
87
|
}
|
|
87
88
|
}, [response, newId, navigate, setSelectedProducts]);
|
|
@@ -433,10 +433,10 @@ const returnDataAtom = atom<any[]>([]);
|
|
|
433
433
|
export function useReturnData() {
|
|
434
434
|
return useAtom(returnDataAtom);
|
|
435
435
|
}
|
|
436
|
-
const
|
|
436
|
+
const apiUpdateCalling = atom<boolean>(false);
|
|
437
437
|
|
|
438
|
-
export function
|
|
439
|
-
return useAtom(
|
|
438
|
+
export function useUpdateApiCall() {
|
|
439
|
+
return useAtom(apiUpdateCalling);
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
|
|
@@ -446,6 +446,14 @@ const liveRecalling = atom<boolean>(false);
|
|
|
446
446
|
export function useLiveRecalling() {
|
|
447
447
|
return useAtom(liveRecalling);
|
|
448
448
|
}
|
|
449
|
+
|
|
450
|
+
//delete products
|
|
451
|
+
const onDeleteProduct = atom<boolean>(false);
|
|
452
|
+
|
|
453
|
+
export function useDeleteRecall() {
|
|
454
|
+
return useAtom(onDeleteProduct);
|
|
455
|
+
}
|
|
456
|
+
|
|
449
457
|
export const selectedTabKeyAtom = atom<string>('1');
|
|
450
458
|
export const letselectedProductIdAtom = atom<number | null>(null);
|
|
451
459
|
|
|
@@ -482,12 +490,10 @@ const popupReducer = (state: any, action: any) => {
|
|
|
482
490
|
} else if (action.type === 'addProduct') {
|
|
483
491
|
state = 'addProduct';
|
|
484
492
|
return { state };
|
|
485
|
-
}
|
|
486
|
-
else if (action.type === 'split-order') {
|
|
493
|
+
} else if (action.type === 'split-order') {
|
|
487
494
|
state = 'split-order';
|
|
488
495
|
return { state };
|
|
489
|
-
}
|
|
490
|
-
else if (action.type === 'deleteProduct') {
|
|
496
|
+
} else if (action.type === 'deleteProduct') {
|
|
491
497
|
state = 'deleteProduct';
|
|
492
498
|
return { state };
|
|
493
499
|
} else if (action.type === 'defectsModal') {
|
package/src/index.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import ReturnAfterTable from './components/order-daily-overview/return-after-tab
|
|
|
5
5
|
import {
|
|
6
6
|
useSelectedAction,
|
|
7
7
|
useSelectedClient,
|
|
8
|
+
useSelectedLocation,
|
|
8
9
|
} from './components/order-daily-overview/store/store';
|
|
9
10
|
import { notification } from 'antd';
|
|
10
11
|
import RouterHeader from './components/order-daily-overview/header/route-header/RouterHeader';
|
|
@@ -36,6 +37,7 @@ function ReturnClient() {
|
|
|
36
37
|
const [, setSelectedFilterValue] = useSelectedAction();
|
|
37
38
|
const [, setSelectedClient] = useSelectedClient();
|
|
38
39
|
const [searchParams] = useSearchParams();
|
|
40
|
+
const [, setSelectedLocationValue] = useSelectedLocation();
|
|
39
41
|
const splitPath = (str: any) => {
|
|
40
42
|
const parts = str?.split('/')?.filter((part: any) => part !== ''); // Filter out empty parts
|
|
41
43
|
return parts;
|
|
@@ -47,6 +49,7 @@ function ReturnClient() {
|
|
|
47
49
|
setLocationOptions([]);
|
|
48
50
|
setSelectedClient(null);
|
|
49
51
|
setSelectedFilterValue(null);
|
|
52
|
+
setSelectedLocationValue(null);
|
|
50
53
|
}
|
|
51
54
|
}, [location.pathname, searchParams]);
|
|
52
55
|
// useEffect(() => {
|
|
@@ -114,7 +117,7 @@ function ReturnClient() {
|
|
|
114
117
|
<Route path="" element={<OrderViewQueryHandler />} />
|
|
115
118
|
<Route path="overview" element={<ReturnAfterTable />} />
|
|
116
119
|
<Route path="/:id" element={<OrderView />} />
|
|
117
|
-
|
|
120
|
+
|
|
118
121
|
<Route path="filter" element={<ReturnTable />} />
|
|
119
122
|
{/* <Route
|
|
120
123
|
path=""
|
|
@@ -131,4 +134,4 @@ function ReturnClient() {
|
|
|
131
134
|
</>
|
|
132
135
|
);
|
|
133
136
|
}
|
|
134
|
-
export default ReturnClient;
|
|
137
|
+
export default ReturnClient;
|