@bjsdistribution/dms-client-return 0.0.24 → 0.0.25

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.24",
2
+ "version": "0.0.25",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -7,6 +7,7 @@ import {
7
7
  useGroupedPayload,
8
8
  useLocationData,
9
9
  useNewReturnPayload,
10
+ usePostLoading,
10
11
  useReturnPayload,
11
12
  useSelectAll,
12
13
  useSelectedOrders,
@@ -26,6 +27,7 @@ import { filtersReducerAtom } from '../../header-filters/filterStore';
26
27
  import { displayValueOrNA } from '../../shared/utlis';
27
28
  import PrintDropDownReturn from '../../../order-view/details-filters/left-side-filters/dropdowns/PrintDropDownReturn';
28
29
  import { format } from 'date-fns';
30
+ import Loader from '../../header/loader/Loader';
29
31
  const ReturnOrderTable = () => {
30
32
  const [state] = useAtom(filtersReducerAtom);
31
33
 
@@ -34,6 +36,7 @@ const ReturnOrderTable = () => {
34
36
  const { 'x-filters': filters, 'x-pagination': pagination } = state;
35
37
  const [returnData, setReturnData] = useReturnData();
36
38
  const [load, setLoading] = useLoading();
39
+ const [postLoading] = usePostLoading();
37
40
  const dropdownRefParent = useRef<HTMLDivElement>(null);
38
41
  const dropdownRef = useRef<HTMLDivElement>(null);
39
42
  const [printToogle, setPrintToggle] = usePrintOptionTOggle();
@@ -256,6 +259,7 @@ const ReturnOrderTable = () => {
256
259
 
257
260
  return (
258
261
  <>
262
+ {postLoading && <Loader />}
259
263
  <StyledTableWrapper className="fortables">
260
264
  <StyledTable>
261
265
  <thead>
@@ -4,17 +4,14 @@ import styled from 'styled-components';
4
4
  import {
5
5
  useFinalPayload,
6
6
  useGroupedPayload,
7
- usePostLoading,
8
7
  useSelectedConfirmLoc,
9
8
  useSelectedOrders,
10
9
  } from '../../store';
11
10
  import { displayValueOrNA } from '../../order-daily-overview/shared/utlis';
12
- import Loader from '../../order-daily-overview/header/loader/Loader';
13
11
 
14
12
  const CreateReturnModal = () => {
15
13
  const [selectedlocation, setSelectedLocations] = useSelectedConfirmLoc();
16
14
  const [selectedReturnOrder] = useSelectedOrders();
17
- const [load] = usePostLoading();
18
15
  const [groupedPayload] = useGroupedPayload();
19
16
  const [, setNew] = useFinalPayload();
20
17
 
@@ -55,7 +52,6 @@ const CreateReturnModal = () => {
55
52
 
56
53
  return (
57
54
  <>
58
- {load && <Loader />}
59
55
  <Wrapper>
60
56
  <Alert
61
57
  onClose={() => {}}
@@ -47,7 +47,7 @@ const ModalManager = () => {
47
47
  const [selectedTab] = useAtom(selectedTabKeyAtom);
48
48
  const [, setIsFormValid] = useState(false);
49
49
  const [newGrouped] = useFinalPayload();
50
- const [, SetPostLoading] = usePostLoading();
50
+ const [postLoading, SetPostLoading] = usePostLoading();
51
51
  const [, setSelectedReturnOrder] = useSelectedOrders();
52
52
  const [forDisabledCheck, setCheck] = useSelectedConfirmLoc();
53
53
  const [, setNewPayload] = useNewReturnPayload();
@@ -155,6 +155,7 @@ const ModalManager = () => {
155
155
  if (newGrouped?.length > 0) {
156
156
  setShouldPerformAction(true);
157
157
  setCallForFetch(true);
158
+ SetPostLoading(confirmLoading);
158
159
  }
159
160
  dispatch({ type: 'close' });
160
161
  };
@@ -218,40 +219,39 @@ const ModalManager = () => {
218
219
  setShouldPerformAction(false);
219
220
  setSelectAll(false);
220
221
  setError(null);
221
- navigate('/order-return');
222
+ navigate('returnclient/order-return');
222
223
  }
223
- }, [response, apiError]);
224
-
225
- console.log(apiError, 'apiError apiError');
226
- console.log(response, 'response response ');
224
+ }, [response, apiError, postLoading]);
227
225
 
228
226
  return (
229
227
  <>
230
- {popupName?.state == 'create-return' && (
231
- <AntModal
232
- openStatus={popupName?.state == 'create-return' ? true : false}
233
- closeModal={() => closeModal()}
234
- PopupHeader={{
235
- heading: 'CONFIRM RETURN',
236
- subHeading: '',
237
- }}
238
- PopupFooter={{
239
- btns: [
240
- {
241
- name: 'Submit',
242
- btnStyle: 'rounded',
243
- onClick: handleConfirmReturn,
244
- type: 'button',
245
- disabled: forDisabledCheck.length === 0,
246
- },
247
- ],
228
+ {popupName?.state === 'create-return' && (
229
+ <>
230
+ <AntModal
231
+ openStatus={popupName?.state == 'create-return' ? true : false}
232
+ closeModal={() => closeModal()}
233
+ PopupHeader={{
234
+ heading: 'CONFIRM RETURN',
235
+ subHeading: '',
236
+ }}
237
+ PopupFooter={{
238
+ btns: [
239
+ {
240
+ name: 'Submit',
241
+ btnStyle: 'rounded',
242
+ onClick: handleConfirmReturn,
243
+ type: 'button',
244
+ disabled: forDisabledCheck.length === 0,
245
+ },
246
+ ],
248
247
 
249
- btnAlign: 'justifyEnd',
250
- }}
251
- BodyComponent={CreateReturnModal}
252
- width={800}
253
- classNameAdd={'globalPopup'}
254
- />
248
+ btnAlign: 'justifyEnd',
249
+ }}
250
+ BodyComponent={CreateReturnModal}
251
+ width={800}
252
+ classNameAdd={'globalPopup'}
253
+ />
254
+ </>
255
255
  )}
256
256
  {popupName?.state === 'qclog' && (
257
257
  <AntModal