@bjsdistribution/dms-client-return 0.0.9 → 0.0.11
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-daily-overview/return-after-table/table-filters/ReturnFilterStore.d.ts +16 -0
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.d.ts +1 -0
- package/dist/components/store.d.ts +12 -2
- package/dist/components/types.d.ts +7 -0
- package/dist/dms-client-return.cjs.development.js +657 -478
- 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 +663 -484
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/common/custom-switch/index.tsx +12 -4
- package/src/components/order-daily-overview/filters/FilterStyle.tsx +2 -13
- package/src/components/order-daily-overview/filters/Filters.tsx +7 -1
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +1 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +46 -1
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +6 -5
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +130 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +152 -69
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +3 -2
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +131 -23
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +15 -1
- package/src/components/order-daily-overview/shared/utlis.ts +7 -1
- package/src/components/order-daily-overview/table/ReturnTable.tsx +12 -0
- package/src/components/order-view/hooks/useGetEventNotes.tsx +15 -2
- package/src/components/order-view/hooks/useGetSystemLogs.tsx +14 -2
- package/src/components/order-view/hooks/useUpdateOrder.ts +13 -2
- package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +14 -17
- package/src/components/order-view/modalsPopup/ModalManager.tsx +90 -62
- package/src/components/order-view/notes/AddNote.tsx +7 -2
- package/src/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.tsx +6 -2
- package/src/components/order-view/order-actions/actions/escalation/Dropdowns.tsx +5 -0
- package/src/components/order-view/order-actions/actions/escalation/upgrade/index.tsx +7 -1
- package/src/components/order-view/order-actions/hooks/useAllReminderData.ts +13 -2
- package/src/components/order-view/order-actions/hooks/useAllTaskData.ts +15 -5
- package/src/components/order-view/order-actions/hooks/useCreateReminder.ts +20 -4
- package/src/components/order-view/order-actions/hooks/useCreateTask.ts +14 -3
- package/src/components/order-view/order-actions/hooks/useFetchSingleFlagData.ts +15 -3
- package/src/components/order-view/order-actions/hooks/useFetchSingleReminder.ts +13 -2
- package/src/components/order-view/order-actions/hooks/useUpdateFlag.ts +12 -2
- package/src/components/order-view/order-actions/hooks/useUpdateReminder.ts +12 -2
- package/src/components/order-view/products-info/expanded-content/index.tsx +6 -1
- package/src/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.tsx +6 -1
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +7 -1
- package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +6 -1
- package/src/components/store.ts +30 -1
- package/src/components/types.ts +8 -0
- package/src/index.tsx +8 -4
|
@@ -92,8 +92,13 @@ function AddNote() {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
} catch (error) {
|
|
95
|
-
console.error('Error saving note:', error);
|
|
96
|
-
alert('Failed to save note');
|
|
95
|
+
// console.error('Error saving note:', error);
|
|
96
|
+
// alert('Failed to save note');
|
|
97
|
+
notification.error({
|
|
98
|
+
message: 'Error',
|
|
99
|
+
description:
|
|
100
|
+
`${error}` || 'An error has occurred. Please try again later.',
|
|
101
|
+
});
|
|
97
102
|
}
|
|
98
103
|
};
|
|
99
104
|
|
|
@@ -4,9 +4,9 @@ import OrderActionModal from '../../../../../common/modals/order-action-modal/Or
|
|
|
4
4
|
import { ContentContainer, Label, Row, SplitLayout } from '../modalstyle';
|
|
5
5
|
import { OptionsMenu } from '../../../fakedata';
|
|
6
6
|
import { useCurrentAction } from '../../../store';
|
|
7
|
+
import { notification } from 'antd';
|
|
7
8
|
|
|
8
9
|
function ChangeCustomerAccModal() {
|
|
9
|
-
|
|
10
10
|
const [, setCurrentAction] = useCurrentAction();
|
|
11
11
|
|
|
12
12
|
const closeModal = () => {
|
|
@@ -14,7 +14,11 @@ function ChangeCustomerAccModal() {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const handleSelectChange = () => {
|
|
17
|
-
alert('hello');
|
|
17
|
+
// alert('hello');
|
|
18
|
+
notification.success({
|
|
19
|
+
message: 'Success',
|
|
20
|
+
description: 'Saved successfully.',
|
|
21
|
+
});
|
|
18
22
|
};
|
|
19
23
|
return (
|
|
20
24
|
<OrderActionModal
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AntSelect, Label } from '@bjsdistribution/dms-component-library';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import { notification } from 'antd';
|
|
4
5
|
// import {
|
|
5
6
|
// EscalationCategory,
|
|
6
7
|
// EscalationLevel,
|
|
@@ -29,6 +30,10 @@ const StyledAntSelect = styled(AntSelect)`
|
|
|
29
30
|
const Dropdowns = () => {
|
|
30
31
|
const handleSelectChange = () => {
|
|
31
32
|
// alert('hello');
|
|
33
|
+
notification.success({
|
|
34
|
+
message: 'Success',
|
|
35
|
+
description: 'Saved successfully.',
|
|
36
|
+
});
|
|
32
37
|
};
|
|
33
38
|
return (
|
|
34
39
|
<FlexContainer>
|
|
@@ -5,10 +5,16 @@ import {
|
|
|
5
5
|
Switch,
|
|
6
6
|
} from '@bjsdistribution/dms-component-library';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
+
import { notification } from 'antd';
|
|
8
9
|
|
|
9
10
|
const Upgrade = () => {
|
|
10
11
|
const handleSelectChange = () => {
|
|
11
|
-
alert('hello');
|
|
12
|
+
// alert('hello');
|
|
13
|
+
|
|
14
|
+
notification.success({
|
|
15
|
+
message: 'Success',
|
|
16
|
+
description: 'Upgrade successfully.',
|
|
17
|
+
});
|
|
12
18
|
};
|
|
13
19
|
|
|
14
20
|
return (
|
|
@@ -2,6 +2,7 @@ import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
|
2
2
|
import { useOrderDetails } from '../../store';
|
|
3
3
|
import { getCookie } from '../../utils';
|
|
4
4
|
import { useReminderNotiData } from '../store';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function useFetchReminders() {
|
|
7
8
|
const ssoToken = getCookie('id_token');
|
|
@@ -35,7 +36,12 @@ function useFetchReminders() {
|
|
|
35
36
|
const json = await response.json();
|
|
36
37
|
const detail = json?.detail;
|
|
37
38
|
const msg = detail[0]?.msg;
|
|
38
|
-
console.error('Error response:', msg);
|
|
39
|
+
// console.error('Error response:', msg);
|
|
40
|
+
notification.error({
|
|
41
|
+
message: 'Error',
|
|
42
|
+
description:
|
|
43
|
+
`${msg}` || 'An error has occurred. Please try again later.',
|
|
44
|
+
});
|
|
39
45
|
// setLoading(false);
|
|
40
46
|
return [];
|
|
41
47
|
}
|
|
@@ -47,7 +53,12 @@ function useFetchReminders() {
|
|
|
47
53
|
}
|
|
48
54
|
return [];
|
|
49
55
|
} catch (err) {
|
|
50
|
-
console.error('Error fetching data:', err);
|
|
56
|
+
// console.error('Error fetching data:', err);
|
|
57
|
+
notification.error({
|
|
58
|
+
message: 'Error',
|
|
59
|
+
description:
|
|
60
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
61
|
+
});
|
|
51
62
|
return [];
|
|
52
63
|
} finally {
|
|
53
64
|
// setLoading(false);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
2
|
-
import {
|
|
2
|
+
import { useNotificationData, useTaskLoading } from '../store';
|
|
3
3
|
import { useOrderDetails } from '../../store';
|
|
4
4
|
import { getCookie } from '../../utils';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function useFetchUnresolvedTasks() {
|
|
7
8
|
const ssoToken = getCookie('id_token');
|
|
@@ -36,7 +37,12 @@ function useFetchUnresolvedTasks() {
|
|
|
36
37
|
const json = await response.json();
|
|
37
38
|
const detail = json?.detail;
|
|
38
39
|
const msg = detail[0]?.msg;
|
|
39
|
-
console.error('Error response:', msg);
|
|
40
|
+
// console.error('Error response:', msg);
|
|
41
|
+
notification.error({
|
|
42
|
+
message: 'Error',
|
|
43
|
+
description:
|
|
44
|
+
`${msg}` || 'An error has occurred. Please try again later.',
|
|
45
|
+
});
|
|
40
46
|
setLoading(false);
|
|
41
47
|
return [];
|
|
42
48
|
}
|
|
@@ -48,11 +54,15 @@ function useFetchUnresolvedTasks() {
|
|
|
48
54
|
}
|
|
49
55
|
return [];
|
|
50
56
|
} catch (err) {
|
|
51
|
-
console.error('Error fetching data:', err);
|
|
57
|
+
// console.error('Error fetching data:', err);
|
|
58
|
+
notification.error({
|
|
59
|
+
message: 'Error',
|
|
60
|
+
description:
|
|
61
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
62
|
+
});
|
|
52
63
|
setLoading(false);
|
|
53
64
|
return [];
|
|
54
|
-
}
|
|
55
|
-
finally{
|
|
65
|
+
} finally {
|
|
56
66
|
setLoading(false);
|
|
57
67
|
}
|
|
58
68
|
};
|
|
@@ -2,6 +2,7 @@ import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
|
2
2
|
import { useFlagsLoading } from '../store';
|
|
3
3
|
import { CreateReminderPayload } from '../types';
|
|
4
4
|
import { getCookie } from '../../utils';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function useCreateReminder() {
|
|
7
8
|
const ssoToken = getCookie('id_token');
|
|
@@ -25,16 +26,31 @@ function useCreateReminder() {
|
|
|
25
26
|
|
|
26
27
|
if (!response.ok) {
|
|
27
28
|
setLoading(false);
|
|
28
|
-
alert('response is not ok');
|
|
29
|
+
// alert('response is not ok');
|
|
30
|
+
notification.error({
|
|
31
|
+
message: 'Error',
|
|
32
|
+
description: 'response is not ok',
|
|
33
|
+
});
|
|
29
34
|
}
|
|
30
|
-
alert('Reminder Created Successfully');
|
|
35
|
+
// alert('Reminder Created Successfully');
|
|
36
|
+
|
|
37
|
+
notification.success({
|
|
38
|
+
message: 'Success',
|
|
39
|
+
description: 'Reminder Created Successfully',
|
|
40
|
+
});
|
|
31
41
|
|
|
32
42
|
const json = await response.json();
|
|
33
43
|
return json;
|
|
34
44
|
} catch (err) {
|
|
35
45
|
setLoading(false);
|
|
36
|
-
alert(err);
|
|
37
|
-
console.error('Error:', err);
|
|
46
|
+
// alert(err);
|
|
47
|
+
// console.error('Error:', err);
|
|
48
|
+
|
|
49
|
+
notification.error({
|
|
50
|
+
message: 'Error',
|
|
51
|
+
description:
|
|
52
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
53
|
+
});
|
|
38
54
|
} finally {
|
|
39
55
|
setLoading(false);
|
|
40
56
|
}
|
|
@@ -2,6 +2,7 @@ import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
|
2
2
|
import { useFlagsLoading } from '../store';
|
|
3
3
|
import { CreateTaskPayload } from '../types';
|
|
4
4
|
import { getCookie } from '../../utils';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function useCreateTask() {
|
|
7
8
|
const ssoToken = getCookie('id_token');
|
|
@@ -27,14 +28,24 @@ function useCreateTask() {
|
|
|
27
28
|
setLoading(false);
|
|
28
29
|
throw new Error('response is not ok');
|
|
29
30
|
}
|
|
30
|
-
alert('Task Created Successfully');
|
|
31
|
+
// alert('Task Created Successfully');
|
|
32
|
+
|
|
33
|
+
notification.success({
|
|
34
|
+
message: 'Success',
|
|
35
|
+
description: 'Task Created Successfully',
|
|
36
|
+
});
|
|
31
37
|
|
|
32
38
|
const json = await response.json();
|
|
33
39
|
return json;
|
|
34
40
|
} catch (err) {
|
|
35
41
|
setLoading(false);
|
|
36
|
-
alert(err);
|
|
37
|
-
console.error('Error:', err);
|
|
42
|
+
// alert(err);
|
|
43
|
+
// console.error('Error:', err);
|
|
44
|
+
notification.error({
|
|
45
|
+
message: 'Error',
|
|
46
|
+
description:
|
|
47
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
48
|
+
});
|
|
38
49
|
} finally {
|
|
39
50
|
setLoading(false);
|
|
40
51
|
}
|
|
@@ -2,12 +2,13 @@ import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
|
2
2
|
|
|
3
3
|
import { useFlagRefId, useFlagsLoading } from '../store';
|
|
4
4
|
import { getCookie } from '../../utils';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function useFetchSingleFlagsData() {
|
|
7
8
|
const [selectedFlagId] = useFlagRefId();
|
|
8
9
|
const [loading, setLoading] = useFlagsLoading();
|
|
9
10
|
const ssoToken = getCookie('id_token');
|
|
10
|
-
console.log(loading,
|
|
11
|
+
console.log(loading, 'loading loading');
|
|
11
12
|
const res = async () => {
|
|
12
13
|
const endpoint = `${getBaseEndpoint()}/tasks/${selectedFlagId}`;
|
|
13
14
|
try {
|
|
@@ -24,7 +25,12 @@ function useFetchSingleFlagsData() {
|
|
|
24
25
|
const json = await response.json();
|
|
25
26
|
const detail = json?.detail;
|
|
26
27
|
const msg = detail[0]?.msg;
|
|
27
|
-
alert(`${msg}`);
|
|
28
|
+
// alert(`${msg}`);
|
|
29
|
+
notification.error({
|
|
30
|
+
message: 'Error',
|
|
31
|
+
description:
|
|
32
|
+
`${msg}` || 'An error has occurred. Please try again later.',
|
|
33
|
+
});
|
|
28
34
|
setLoading(false);
|
|
29
35
|
return [];
|
|
30
36
|
}
|
|
@@ -36,7 +42,13 @@ function useFetchSingleFlagsData() {
|
|
|
36
42
|
return [];
|
|
37
43
|
} catch (err) {
|
|
38
44
|
setLoading(false);
|
|
39
|
-
console.error('Error fetching data:', err);
|
|
45
|
+
// console.error('Error fetching data:', err);
|
|
46
|
+
|
|
47
|
+
notification.error({
|
|
48
|
+
message: 'Error',
|
|
49
|
+
description:
|
|
50
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
51
|
+
});
|
|
40
52
|
return [];
|
|
41
53
|
}
|
|
42
54
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
2
2
|
import { useFlagsLoading, useReminderRefId } from '../store';
|
|
3
3
|
import { getCookie } from '../../utils';
|
|
4
|
+
import { notification } from 'antd';
|
|
4
5
|
|
|
5
6
|
function useFetchSingleReminderData() {
|
|
6
7
|
const [reminderRefId] = useReminderRefId();
|
|
@@ -25,7 +26,12 @@ function useFetchSingleReminderData() {
|
|
|
25
26
|
const json = await response.json();
|
|
26
27
|
const detail = json?.detail;
|
|
27
28
|
const msg = detail[0]?.msg;
|
|
28
|
-
alert(`${msg}`);
|
|
29
|
+
// alert(`${msg}`);
|
|
30
|
+
notification.error({
|
|
31
|
+
message: 'Error',
|
|
32
|
+
description:
|
|
33
|
+
`${msg}` || 'An error has occurred. Please try again later.',
|
|
34
|
+
});
|
|
29
35
|
setLoading(false);
|
|
30
36
|
return [];
|
|
31
37
|
}
|
|
@@ -39,7 +45,12 @@ function useFetchSingleReminderData() {
|
|
|
39
45
|
} catch (err) {
|
|
40
46
|
//setloading(false);
|
|
41
47
|
|
|
42
|
-
console.error('Error fetching data:', err);
|
|
48
|
+
// console.error('Error fetching data:', err);
|
|
49
|
+
notification.error({
|
|
50
|
+
message: 'Error',
|
|
51
|
+
description:
|
|
52
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
53
|
+
});
|
|
43
54
|
return [];
|
|
44
55
|
}
|
|
45
56
|
};
|
|
@@ -2,6 +2,7 @@ import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
|
2
2
|
import { useFlagsLoading } from '../store';
|
|
3
3
|
import { SingleFlagPayload } from '../types';
|
|
4
4
|
import { getCookie } from '../../utils';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function useUpdateFlag() {
|
|
7
8
|
const ssoToken = getCookie('id_token');
|
|
@@ -28,10 +29,19 @@ function useUpdateFlag() {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
const json = await response.json();
|
|
31
|
-
alert('Flag has been updated');
|
|
32
|
+
// alert('Flag has been updated');
|
|
33
|
+
notification.success({
|
|
34
|
+
message: 'Success',
|
|
35
|
+
description: 'Flag has been updated',
|
|
36
|
+
});
|
|
32
37
|
return json;
|
|
33
38
|
} catch (err) {
|
|
34
|
-
console.error('Error:', err);
|
|
39
|
+
// console.error('Error:', err);
|
|
40
|
+
notification.error({
|
|
41
|
+
message: 'Error',
|
|
42
|
+
description:
|
|
43
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
44
|
+
});
|
|
35
45
|
} finally {
|
|
36
46
|
setLoading(false);
|
|
37
47
|
}
|
|
@@ -2,6 +2,7 @@ import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
|
|
|
2
2
|
import { useFlagsLoading } from '../store';
|
|
3
3
|
import { UpdateReminderPayload } from '../types';
|
|
4
4
|
import { getCookie } from '../../utils';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function useUpdateReminder() {
|
|
7
8
|
const ssoToken = getCookie('id_token');
|
|
@@ -28,10 +29,19 @@ function useUpdateReminder() {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
const json = await response.json();
|
|
31
|
-
alert('Reminder has been updated');
|
|
32
|
+
// alert('Reminder has been updated');
|
|
33
|
+
notification.success({
|
|
34
|
+
message: 'Success',
|
|
35
|
+
description: 'Reminder has been updated',
|
|
36
|
+
});
|
|
32
37
|
return json;
|
|
33
38
|
} catch (err) {
|
|
34
|
-
console.error('Error:', err);
|
|
39
|
+
// console.error('Error:', err);
|
|
40
|
+
notification.error({
|
|
41
|
+
message: 'Error',
|
|
42
|
+
description:
|
|
43
|
+
`${err}` || 'An error has occurred. Please try again later.',
|
|
44
|
+
});
|
|
35
45
|
} finally {
|
|
36
46
|
setLoading(false);
|
|
37
47
|
}
|
|
@@ -4,10 +4,15 @@ import ProductTable from '../../return-client-products/ProductTable';
|
|
|
4
4
|
// import OrderDetailsFooter from '../../order-details/expanded-content/footer';
|
|
5
5
|
// import NewReturnDropdown from '../../notes/order-dropdown/NewReturnDropdown';
|
|
6
6
|
import { Button } from '@bjsdistribution/dms-component-library';
|
|
7
|
+
import { notification } from 'antd';
|
|
7
8
|
|
|
8
9
|
function ExpandedContent() {
|
|
9
10
|
const SaveNote = () => {
|
|
10
|
-
alert('saved');
|
|
11
|
+
// alert('saved');
|
|
12
|
+
notification.success({
|
|
13
|
+
message: 'Success',
|
|
14
|
+
description: ' Saved successfully.',
|
|
15
|
+
});
|
|
11
16
|
};
|
|
12
17
|
return (
|
|
13
18
|
<Container>
|
|
@@ -2,10 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Button } from '@bjsdistribution/dms-component-library';
|
|
4
4
|
import NewReturnDropdown from '../../notes/order-dropdown/NewReturnDropdown';
|
|
5
|
+
import { notification } from 'antd';
|
|
5
6
|
|
|
6
7
|
function OrderDetailsFooter() {
|
|
7
8
|
const onSave = () => {
|
|
8
|
-
alert('saved');
|
|
9
|
+
// alert('saved');
|
|
10
|
+
notification.success({
|
|
11
|
+
message: 'Success',
|
|
12
|
+
description: ' Saved successfully.',
|
|
13
|
+
});
|
|
9
14
|
};
|
|
10
15
|
|
|
11
16
|
return (
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from '../../store';
|
|
11
11
|
import { tableColumns } from '../helper';
|
|
12
12
|
import useGetEventNotes from '../../hooks/useGetEventNotes';
|
|
13
|
+
import { notification } from 'antd';
|
|
13
14
|
|
|
14
15
|
function SystemLogs() {
|
|
15
16
|
const [systemLogs] = useOrderProductSystemLogs();
|
|
@@ -26,7 +27,12 @@ function SystemLogs() {
|
|
|
26
27
|
setNotesData(result);
|
|
27
28
|
}
|
|
28
29
|
} catch (error) {
|
|
29
|
-
console.error('Error fetching event notes:', error);
|
|
30
|
+
// console.error('Error fetching event notes:', error);
|
|
31
|
+
notification.error({
|
|
32
|
+
message: 'Error',
|
|
33
|
+
description:
|
|
34
|
+
`${error}` || 'An error has occurred. Please try again later.',
|
|
35
|
+
});
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Label, AntSelect } from '@bjsdistribution/dms-component-library';
|
|
2
|
+
import { notification } from 'antd';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
|
|
5
6
|
function AssigneeDropdown() {
|
|
6
7
|
const handleSelectChange = () => {
|
|
7
|
-
alert('hello');
|
|
8
|
+
// alert('hello');
|
|
9
|
+
notification.success({
|
|
10
|
+
message: 'Success',
|
|
11
|
+
description: 'Order has been saved successfully.',
|
|
12
|
+
});
|
|
8
13
|
};
|
|
9
14
|
return (
|
|
10
15
|
<FormContainer>
|
package/src/components/store.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { atom, useAtom } from 'jotai';
|
|
2
|
-
import { SelectDateType } from './types';
|
|
2
|
+
import { CreateReturnPayload, SelectDateType } from './types';
|
|
3
3
|
|
|
4
4
|
export const filtersInitialValue = {
|
|
5
5
|
date: {
|
|
@@ -8,6 +8,14 @@ export const filtersInitialValue = {
|
|
|
8
8
|
},
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
export const CreateReturnInitial = {
|
|
12
|
+
customer_id: 0,
|
|
13
|
+
account_number: '',
|
|
14
|
+
return_location_token: '',
|
|
15
|
+
products: [],
|
|
16
|
+
return_action: [],
|
|
17
|
+
};
|
|
18
|
+
|
|
11
19
|
export const triggerApiCallAtom = atom(false);
|
|
12
20
|
|
|
13
21
|
const staticData = atom<any>({});
|
|
@@ -27,6 +35,12 @@ const actionTypeData = atom<any>([]);
|
|
|
27
35
|
|
|
28
36
|
const locationData = atom<any>([]);
|
|
29
37
|
|
|
38
|
+
const createReturnPayload = atom<CreateReturnPayload>(CreateReturnInitial);
|
|
39
|
+
|
|
40
|
+
const newPayload = atom<any>([]);
|
|
41
|
+
|
|
42
|
+
const grpPayload = atom<any>([]);
|
|
43
|
+
|
|
30
44
|
function useReminderData() {
|
|
31
45
|
return useAtom(reminderTableData);
|
|
32
46
|
}
|
|
@@ -79,6 +93,18 @@ function useLocationData() {
|
|
|
79
93
|
return useAtom(locationData);
|
|
80
94
|
}
|
|
81
95
|
|
|
96
|
+
function useReturnPayload() {
|
|
97
|
+
return useAtom(createReturnPayload);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function useNewReturnPayload() {
|
|
101
|
+
return useAtom(newPayload);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function useGroupedPayload() {
|
|
105
|
+
return useAtom(grpPayload);
|
|
106
|
+
}
|
|
107
|
+
|
|
82
108
|
export {
|
|
83
109
|
useAtom,
|
|
84
110
|
useFilter,
|
|
@@ -93,4 +119,7 @@ export {
|
|
|
93
119
|
useActionType,
|
|
94
120
|
useLocationData,
|
|
95
121
|
useSelectedOrders,
|
|
122
|
+
useReturnPayload,
|
|
123
|
+
useNewReturnPayload,
|
|
124
|
+
useGroupedPayload,
|
|
96
125
|
};
|
package/src/components/types.ts
CHANGED
|
@@ -219,3 +219,11 @@ export type InvoiceOverviewType = {
|
|
|
219
219
|
total_orders: number;
|
|
220
220
|
vat_rate: number;
|
|
221
221
|
};
|
|
222
|
+
|
|
223
|
+
export type CreateReturnPayload = {
|
|
224
|
+
customer_id: number;
|
|
225
|
+
account_number: string;
|
|
226
|
+
return_location_token: string;
|
|
227
|
+
products: number[];
|
|
228
|
+
return_action: string[];
|
|
229
|
+
};
|
package/src/index.tsx
CHANGED
|
@@ -8,8 +8,12 @@ import ReturnAfterTable from './components/order-daily-overview/return-after-tab
|
|
|
8
8
|
import { useTableName } from './components/order-daily-overview/store/store';
|
|
9
9
|
// import ReturnOrderTable from './components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable';
|
|
10
10
|
import ReturnMainTable from './components/order-daily-overview';
|
|
11
|
+
import { notification } from 'antd';
|
|
11
12
|
|
|
12
13
|
function ReturnClient() {
|
|
14
|
+
notification.config({
|
|
15
|
+
top: 80,
|
|
16
|
+
});
|
|
13
17
|
const LoadingMessage = () => <div>Loading...</div>;
|
|
14
18
|
const [selectedClient] = useTableName();
|
|
15
19
|
const navigate = useNavigate();
|
|
@@ -17,10 +21,10 @@ function ReturnClient() {
|
|
|
17
21
|
selectedClientString = selectedClientString?.toLowerCase();
|
|
18
22
|
|
|
19
23
|
console.log(selectedClientString, 'selectedClient');
|
|
20
|
-
console.log(`../
|
|
24
|
+
console.log(`../filter/:${selectedClientString}`);
|
|
21
25
|
|
|
22
26
|
useEffect(() => {
|
|
23
|
-
if (!location.pathname.includes('/
|
|
27
|
+
if (!location.pathname.includes('/filter')) {
|
|
24
28
|
localStorage.removeItem('clientName');
|
|
25
29
|
localStorage.removeItem('clientId');
|
|
26
30
|
}
|
|
@@ -29,7 +33,7 @@ function ReturnClient() {
|
|
|
29
33
|
useEffect(() => {
|
|
30
34
|
if (selectedClient) {
|
|
31
35
|
const selectedClientString = selectedClient.replace(/\s+/g, '-');
|
|
32
|
-
navigate(`
|
|
36
|
+
navigate(`filter/${selectedClientString}`);
|
|
33
37
|
}
|
|
34
38
|
}, [selectedClient]);
|
|
35
39
|
|
|
@@ -39,7 +43,7 @@ function ReturnClient() {
|
|
|
39
43
|
<Route path="" element={<ReturnMainTable />} />
|
|
40
44
|
<Route path="order-return" element={<ReturnAfterTable />} />
|
|
41
45
|
<Route path="order-return/:id" element={<OrderView />} />
|
|
42
|
-
<Route path="
|
|
46
|
+
<Route path="filter/:clientName" element={<ReturnTable />} />
|
|
43
47
|
|
|
44
48
|
{/* <Route
|
|
45
49
|
path=""
|