@bjsdistribution/dms-client-return 0.0.23 → 0.0.24
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/common/services-slider/ServiceSlider.d.ts +1 -0
- package/dist/dms-client-return.cjs.development.js +436 -381
- 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 +437 -382
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/common/services-slider/ServiceSlider.tsx +9 -8
- package/src/components/order-daily-overview/header-filters/filterStore.ts +7 -7
- package/src/components/order-daily-overview/index.tsx +2 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +25 -11
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +1 -1
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +7 -1
- package/src/components/order-view/order-details/expanded-content/services-section/AssemblyType.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/services-section/OrderServices.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +1 -0
- package/src/components/order-view/products-info/expanded-content/index.tsx +16 -13
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +7 -1
- package/src/index.tsx +0 -10
package/package.json
CHANGED
|
@@ -8,25 +8,26 @@ interface SliderProps {
|
|
|
8
8
|
serviceId: number;
|
|
9
9
|
isSelected: boolean;
|
|
10
10
|
toggle: (id: number) => void;
|
|
11
|
+
disabled: boolean;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
function ServiceSlider(props: SliderProps) {
|
|
15
|
+
// const onClick = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
16
|
+
// event.preventDefault();
|
|
17
|
+
// props.toggle(props.serviceId);
|
|
18
|
+
// };
|
|
14
19
|
|
|
15
|
-
const onClick = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
16
|
-
event.preventDefault();
|
|
17
|
-
props.toggle(props.serviceId);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
20
|
return (
|
|
21
|
-
<Container
|
|
21
|
+
<Container>
|
|
22
22
|
<ServiceIcon src={getIcon(props.serviceId)} />
|
|
23
23
|
<ServiceName>{props.serviceName}</ServiceName>
|
|
24
24
|
{/* to stop event propagation */}
|
|
25
|
-
<div
|
|
25
|
+
<div className="hidden">
|
|
26
26
|
<Switch
|
|
27
27
|
checked={props.isSelected}
|
|
28
28
|
name={props.serviceName}
|
|
29
29
|
onChange={() => {}}
|
|
30
|
+
disabled={props?.disabled}
|
|
30
31
|
/>
|
|
31
32
|
</div>
|
|
32
33
|
</Container>
|
|
@@ -51,7 +52,7 @@ const Container = styled.div`
|
|
|
51
52
|
display: flex;
|
|
52
53
|
gap: 10px;
|
|
53
54
|
align-items: center;
|
|
54
|
-
cursor:
|
|
55
|
+
cursor: not-allowed;
|
|
55
56
|
flex: 1;
|
|
56
57
|
`;
|
|
57
58
|
|
|
@@ -98,13 +98,13 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
98
98
|
],
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
case 'CLEAR_CLIENT':
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
// case 'CLEAR_CLIENT':
|
|
102
|
+
// return {
|
|
103
|
+
// ...state,
|
|
104
|
+
// 'x-filters': state['x-filters'].filter(
|
|
105
|
+
// f => f.field !== 'order.customer_id'
|
|
106
|
+
// ),
|
|
107
|
+
// };
|
|
108
108
|
|
|
109
109
|
case 'CLEAR_ACTION':
|
|
110
110
|
return {
|
|
@@ -46,7 +46,8 @@ function ReturnMainTable() {
|
|
|
46
46
|
}>({
|
|
47
47
|
endpoint: `/return_orders/get/client-returns/`,
|
|
48
48
|
method: 'GET',
|
|
49
|
-
|
|
49
|
+
//@ts-ignore
|
|
50
|
+
pagination: { page: 1, per_page: 200, is_pagination: false },
|
|
50
51
|
});
|
|
51
52
|
|
|
52
53
|
useEffect(() => {
|
|
@@ -90,16 +90,22 @@ const OrderTable = ({ loadingskeleton }: any) => {
|
|
|
90
90
|
},
|
|
91
91
|
];
|
|
92
92
|
|
|
93
|
-
const getStatusClass = (status:
|
|
93
|
+
const getStatusClass = (status: string) => {
|
|
94
94
|
switch (status) {
|
|
95
95
|
case 'Cancelled':
|
|
96
96
|
return { color: '#E95252', background: 'rgba(233, 82, 82, 0.15)' };
|
|
97
|
-
case '
|
|
97
|
+
case 'On Hold':
|
|
98
98
|
return { color: '#F4A503', background: '#FFF1D6' };
|
|
99
|
-
case '
|
|
99
|
+
case 'Sub-Contracted':
|
|
100
|
+
return { color: '#F4A503', background: '#FFF1D6' };
|
|
101
|
+
case 'Awaiting route':
|
|
100
102
|
return { color: '#845ADF', background: 'rgba(132, 90, 223, 0.15)' };
|
|
101
103
|
case 'Completed':
|
|
102
104
|
return { color: '#1F9254', background: 'rgba(41, 204, 106, 0.15)' };
|
|
105
|
+
case 'Outstanding':
|
|
106
|
+
return { color: '#FF9900', background: 'rgba(255, 153, 0, 0.15)' };
|
|
107
|
+
case 'Routed':
|
|
108
|
+
return { color: '#6396E5', background: 'rgba(99, 150, 229, 0.15)' };
|
|
103
109
|
default:
|
|
104
110
|
return { color: '#000', background: '#fff' };
|
|
105
111
|
}
|
|
@@ -109,7 +115,7 @@ const OrderTable = ({ loadingskeleton }: any) => {
|
|
|
109
115
|
// console.log(id, 'idid');
|
|
110
116
|
return (
|
|
111
117
|
<>
|
|
112
|
-
<StyledTableWrapper>
|
|
118
|
+
<StyledTableWrapper className="fortables">
|
|
113
119
|
<StyledTable>
|
|
114
120
|
<thead>
|
|
115
121
|
<tr>
|
|
@@ -150,14 +156,16 @@ const OrderTable = ({ loadingskeleton }: any) => {
|
|
|
150
156
|
) : (
|
|
151
157
|
returnAfterOrder?.map((item: any, index: any) => {
|
|
152
158
|
const statusMapping: any = {
|
|
153
|
-
|
|
159
|
+
cancelled: 'Cancelled',
|
|
154
160
|
OO: 'On Hold',
|
|
155
161
|
SC: 'Sub-Contracted',
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
162
|
+
'awaiting route': 'Awaiting route',
|
|
163
|
+
completed: 'completed',
|
|
164
|
+
outstanding: 'Outstanding',
|
|
165
|
+
routed: 'Routed',
|
|
159
166
|
};
|
|
160
|
-
|
|
167
|
+
|
|
168
|
+
const status = statusMapping[item?.status_value] || 'Unknown';
|
|
161
169
|
const statusClass = getStatusClass(status);
|
|
162
170
|
return (
|
|
163
171
|
<tr key={item.id}>
|
|
@@ -223,9 +231,15 @@ const OrderTable = ({ loadingskeleton }: any) => {
|
|
|
223
231
|
<td>
|
|
224
232
|
<ul
|
|
225
233
|
className="statuscontainer"
|
|
226
|
-
style={{
|
|
234
|
+
style={{
|
|
235
|
+
listStyleType: 'none',
|
|
236
|
+
background: statusClass.background,
|
|
237
|
+
}}
|
|
227
238
|
>
|
|
228
|
-
<li
|
|
239
|
+
<li
|
|
240
|
+
className="statustext"
|
|
241
|
+
style={{ color: statusClass.color }}
|
|
242
|
+
>
|
|
229
243
|
{status}
|
|
230
244
|
</li>
|
|
231
245
|
</ul>
|
package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts
CHANGED
|
@@ -517,7 +517,13 @@ export const StyledTableWrapper = styled.div`
|
|
|
517
517
|
overflow-x: auto;
|
|
518
518
|
max-height: 60vh;
|
|
519
519
|
scrollbar-width: none;
|
|
520
|
-
|
|
520
|
+
|
|
521
|
+
.fortables {
|
|
522
|
+
overflow-x: auto;
|
|
523
|
+
max-height: 60vh;
|
|
524
|
+
scrollbar-width: none;
|
|
525
|
+
min-height: 60vh;
|
|
526
|
+
}
|
|
521
527
|
/* height: 600px; */
|
|
522
528
|
/* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */
|
|
523
529
|
&::-webkit-scrollbar {
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import ProductTable from '../../return-client-products/ProductTable';
|
|
4
|
-
|
|
5
|
-
// import NewReturnDropdown from '../../notes/order-dropdown/NewReturnDropdown';
|
|
4
|
+
import NewReturnDropdown from '../../notes/order-dropdown/NewReturnDropdown';
|
|
6
5
|
import { Button } from '@bjsdistribution/dms-component-library';
|
|
7
|
-
import { notification } from 'antd';
|
|
6
|
+
// import { notification } from 'antd';
|
|
8
7
|
|
|
9
8
|
function ExpandedContent() {
|
|
10
|
-
const SaveNote = () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
9
|
+
// const SaveNote = () => {
|
|
10
|
+
// // alert('saved');
|
|
11
|
+
// notification.success({
|
|
12
|
+
// message: 'Success',
|
|
13
|
+
// description: ' Saved successfully.',
|
|
14
|
+
// });
|
|
15
|
+
// };
|
|
17
16
|
return (
|
|
18
17
|
<Container>
|
|
19
18
|
<ProductTable />
|
|
20
19
|
<MidConatiner>
|
|
21
20
|
<SaveNoteContainer>
|
|
22
|
-
<Button
|
|
23
|
-
|
|
21
|
+
<Button
|
|
22
|
+
style={{ borderRadius: '20px' }}
|
|
23
|
+
onClick={() => {}}
|
|
24
|
+
disabled={true}
|
|
25
|
+
>
|
|
26
|
+
Move Products
|
|
24
27
|
</Button>
|
|
25
|
-
|
|
28
|
+
<NewReturnDropdown />
|
|
26
29
|
</SaveNoteContainer>
|
|
27
30
|
</MidConatiner>
|
|
28
31
|
</Container>
|
package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx
CHANGED
|
@@ -76,7 +76,12 @@ const ReturnProductTable = () => {
|
|
|
76
76
|
<thead>
|
|
77
77
|
<tr>
|
|
78
78
|
<th className="emailInvoiceCheckbox">
|
|
79
|
-
<Checkbox
|
|
79
|
+
<Checkbox
|
|
80
|
+
checked={selectAll}
|
|
81
|
+
onChange={handleSelectAll}
|
|
82
|
+
disabled={true}
|
|
83
|
+
style={{ cursor: 'not-allowed' }}
|
|
84
|
+
/>
|
|
80
85
|
</th>
|
|
81
86
|
<th>Location</th>
|
|
82
87
|
<th>Sender</th>
|
|
@@ -96,6 +101,7 @@ const ReturnProductTable = () => {
|
|
|
96
101
|
checked={selectedInvoices.some(
|
|
97
102
|
selectedInvoice => selectedInvoice.id === invoice.id
|
|
98
103
|
)}
|
|
104
|
+
style={{ cursor: 'not-allowed' }}
|
|
99
105
|
/>
|
|
100
106
|
</td>
|
|
101
107
|
<td>{'N/A'}</td>
|
package/src/index.tsx
CHANGED
|
@@ -35,28 +35,18 @@ function ReturnClient() {
|
|
|
35
35
|
const [, setActionType] = useActionType();
|
|
36
36
|
const [, setLocationData] = useLocationData();
|
|
37
37
|
const [, setStatusOfOrders] = useStatusOrderData();
|
|
38
|
-
// const [, dispatch] = useAtom(filtersReducerAtom);
|
|
39
|
-
|
|
40
|
-
console.log(selectedClientString, 'selectedClient');
|
|
41
|
-
console.log(`../filter/:${selectedClientString}`);
|
|
42
38
|
|
|
43
39
|
const splitPath = (str: any) => {
|
|
44
40
|
const parts = str?.split('/')?.filter((part: any) => part !== ''); // Filter out empty parts
|
|
45
41
|
return parts;
|
|
46
42
|
};
|
|
47
43
|
const paths = splitPath(location.pathname);
|
|
48
|
-
console.log(paths, 'pathssssssssssssssssssssssssssss');
|
|
49
44
|
|
|
50
45
|
useEffect(() => {
|
|
51
|
-
console.log(
|
|
52
|
-
paths[paths.length - 1],
|
|
53
|
-
'paths[paths.length] paths[paths.length]'
|
|
54
|
-
);
|
|
55
46
|
if (paths[paths.length - 1] === 'returnclient') {
|
|
56
47
|
localStorage.removeItem('clientName');
|
|
57
48
|
localStorage.removeItem('clientId');
|
|
58
49
|
localStorage.removeItem('uuid');
|
|
59
|
-
// dispatch({ type: 'CLEAR_CLIENT', payload: [] });
|
|
60
50
|
}
|
|
61
51
|
}, [location.pathname]);
|
|
62
52
|
|