@bjsdistribution/dms-client-return 0.0.38 → 0.0.40

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.38",
2
+ "version": "0.0.40",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "testEnvironment": "jest-environment-jsdom-sixteen"
60
60
  },
61
61
  "devDependencies": {
62
- "@bjsdistribution/dms-component-library": "0.1.10",
62
+ "@bjsdistribution/dms-component-library": "0.1.4",
63
63
  "@size-limit/preset-small-lib": "^11.0.1",
64
64
  "@tippyjs/react": "^4.2.6",
65
65
  "@types/react": "^18.2.47",
@@ -48,15 +48,19 @@ function SelectionFilter() {
48
48
  const [actionTypeOptions, setActionTypeOptions] = useActionTypeOptions();
49
49
  const [locationOptions, setLocationOptions] = useLocationOptions();
50
50
 
51
- const clientOptions = customers?.map((option: any) => ({
52
- label:
53
- option?.customer_name?.charAt(0)?.toUpperCase() +
54
- option?.customer_name?.slice(1),
55
- value: option?.customer_id,
56
- actions: option?.actions,
57
- return_locations: option?.return_locations,
58
- account_number: option?.account_number,
59
- }));
51
+ const clientOptions = customers
52
+ ?.filter(
53
+ (option: any) => 'customer_id' in option && option.customer_id != null
54
+ )
55
+ .map((option: any) => ({
56
+ label:
57
+ option?.customer_name?.charAt(0)?.toUpperCase() +
58
+ option?.customer_name?.slice(1),
59
+ value: option?.customer_id,
60
+ actions: option?.actions,
61
+ return_locations: option?.return_locations,
62
+ account_number: option?.account_number,
63
+ }));
60
64
 
61
65
  //client change
62
66
  const handleClientChange = (value: any, option: any) => {
@@ -306,7 +306,6 @@ const ReturnOrderTable = () => {
306
306
 
307
307
  const mergedPayload = Object.values(groupedPayload);
308
308
  setGrouped(mergedPayload);
309
- console.log(mergedPayload, 'mergedPayload');
310
309
  }, [newpayload]);
311
310
 
312
311
  return (
@@ -428,7 +427,10 @@ const ReturnOrderTable = () => {
428
427
  <div className="awaiting">Awaiting</div>
429
428
  )}
430
429
  </td>
431
- <td> {displayValueOrNA(item?.new_location)}</td>
430
+ <td>
431
+ {' '}
432
+ {displayValueOrNA(item?.return_locations?.location_name)}
433
+ </td>
432
434
  <td>
433
435
  <ul style={{ listStyleType: 'none', padding: 0 }}>
434
436
  <li
@@ -32,7 +32,7 @@ interface ApiResponse {
32
32
  const ReturnTable: React.FC = () => {
33
33
  const [clientData] = useClientData();
34
34
  const [updatedData, setUpdatedData] = useState<any>([]);
35
- const [statsLoading, setLoading] = useStatsLoading();
35
+ const [statsLoading] = useStatsLoading();
36
36
  const [, setOrderStaticData] = useOrderStaticData();
37
37
  const [, dispatch] = useAtom(filtersReducerAtom);
38
38
  const navigate = useNavigate();
@@ -93,7 +93,7 @@ const ReturnTable: React.FC = () => {
93
93
  });
94
94
 
95
95
  useEffect(() => {
96
- setLoading(staticDataLoading);
96
+ // setLoading(staticDataLoading);
97
97
  if (fetchedStaticData && fetchedStaticData.data) {
98
98
  const result = fetchedStaticData?.data;
99
99
  setOrderStaticData(result[0]);
@@ -141,12 +141,15 @@ const ReturnTable: React.FC = () => {
141
141
  payload: [],
142
142
  });
143
143
  }
144
- //navigate(`filter/${customerId}`);
144
+ //for dev
145
+ navigate(`filter/${customerId}`);
145
146
 
146
- //forlocal
147
- navigate(`/filter/${customerId}`);
147
+ //for local
148
+ // navigate(`/filter/${customerId}`);
148
149
  };
149
150
 
151
+ console.log(statsLoading, 'statsLoading');
152
+
150
153
  return (
151
154
  <>
152
155
  {statsLoading && <Loader />}
@@ -11,8 +11,6 @@ const PrintDropDownReturn = ({
11
11
  }: {
12
12
  legacyProductId: number;
13
13
  }) => {
14
- console.log(legacyProductId, 'legacyProductId');
15
-
16
14
  const downloadFiles = () => {
17
15
  const url = `https://us.toolbox.bjshomedelivery.com/offload/return_label?gsit_products_id=${legacyProductId}`;
18
16
  window.open(url, '_blank'); // Opens the URL in a new tab
@@ -76,7 +76,7 @@ const CreateReturnModal = () => {
76
76
  onChange={() => handleSelectLocations(returnLoc.id)}
77
77
  />
78
78
  <StyledText style={{ marginLeft: '8px' }}>
79
- {displayValueOrNA(returnLoc?.new_location)}
79
+ {displayValueOrNA(returnLoc?.return_locations?.location_name)}
80
80
  </StyledText>
81
81
  </li>
82
82
  ))}