@bjsdistribution/dms-client-return 0.0.89 → 0.0.91
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/flags-action-modal/Actions.d.ts +1 -1
- package/dist/components/order-view/flags-action-modal/Header.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +1166 -1927
- 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 +1168 -1929
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +0 -3
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +1 -4
- package/src/components/order-daily-overview/table/ReturnTable.tsx +0 -2
- package/src/components/order-view/flags-action-modal/Actions.tsx +33 -17
- package/src/components/order-view/flags-action-modal/Header.tsx +34 -9
- package/src/components/order-view/flags-action-modal/index.tsx +44 -27
- package/src/components/order-view/index.tsx +28 -16
- package/src/components/order-view/notes/AddNote.tsx +18 -22
- package/src/components/order-view/notification/index.tsx +76 -56
- package/src/components/order-view/order-actions/actions/add-resources/index.tsx +40 -11
- package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +17 -5
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +0 -4
- package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +54 -14
- package/src/components/order-view/order-actions/actions/create-task-reminder/index.tsx +57 -22
- package/src/components/order-view/order-actions/actions/order-lock/index.tsx +34 -9
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +22 -5
- package/src/components/order-view/order-resources/columns/actions/index.tsx +1 -1
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +1 -7
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +23 -26
- package/src/components/order-view/view-reminder/ViewReminder.tsx +157 -118
- package/dist/components/order-view/hooks/AddResources.d.ts +0 -2
- package/dist/components/order-view/hooks/useGetEventNotes.d.ts +0 -2
- package/dist/components/order-view/hooks/useGetSystemLogs.d.ts +0 -2
- package/dist/components/order-view/hooks/useUpdateOrder.d.ts +0 -2
- package/dist/components/order-view/order-actions/hooks/useAllReminderData.d.ts +0 -2
- package/dist/components/order-view/order-actions/hooks/useAllTaskData.d.ts +0 -2
- package/dist/components/order-view/order-actions/hooks/useCreateReminder.d.ts +0 -3
- package/dist/components/order-view/order-actions/hooks/useCreateTask.d.ts +0 -3
- package/dist/components/order-view/order-actions/hooks/useFetchSingleFlagData.d.ts +0 -2
- package/dist/components/order-view/order-actions/hooks/useFetchSingleReminder.d.ts +0 -2
- package/dist/components/order-view/order-actions/hooks/useUpdateFlag.d.ts +0 -3
- package/dist/components/order-view/order-actions/hooks/useUpdateReminder.d.ts +0 -3
- package/src/components/order-view/hooks/AddResources.tsx +0 -54
- package/src/components/order-view/hooks/useGetEventNotes.tsx +0 -60
- package/src/components/order-view/hooks/useGetSystemLogs.tsx +0 -71
- package/src/components/order-view/hooks/useUpdateOrder.ts +0 -62
- package/src/components/order-view/order-actions/hooks/useAllReminderData.ts +0 -70
- package/src/components/order-view/order-actions/hooks/useAllTaskData.ts +0 -72
- package/src/components/order-view/order-actions/hooks/useCreateReminder.ts +0 -58
- package/src/components/order-view/order-actions/hooks/useCreateTask.ts +0 -58
- package/src/components/order-view/order-actions/hooks/useFetchSingleFlagData.ts +0 -58
- package/src/components/order-view/order-actions/hooks/useFetchSingleReminder.ts +0 -56
- package/src/components/order-view/order-actions/hooks/useUpdateFlag.ts +0 -54
- package/src/components/order-view/order-actions/hooks/useUpdateReminder.ts +0 -52
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CancelAndCompleteAction,
|
|
3
3
|
CancelationModal,
|
|
4
|
+
useAxios,
|
|
4
5
|
} from '@bjsdistribution/dms-component-library';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import styled from 'styled-components';
|
|
@@ -10,15 +11,23 @@ import {
|
|
|
10
11
|
useGlobalStateHitOrder,
|
|
11
12
|
useOrderDetails,
|
|
12
13
|
} from '../../../store';
|
|
13
|
-
import
|
|
14
|
+
import { notification } from 'antd';
|
|
15
|
+
import { ApiResponse } from '../../../types';
|
|
14
16
|
|
|
15
17
|
function OrderLock() {
|
|
16
18
|
const [, setCurrentAction] = useCurrentAction();
|
|
17
19
|
const [orderDetails, setOrderdetails] = useOrderDetails();
|
|
18
|
-
const lockOrder = useUpdateOrder();
|
|
19
20
|
const [, setRecallOrders] = useGlobalStateHitOrder();
|
|
20
21
|
const [, setRecallAuditLog] = useGlobalStateHitAuditLog();
|
|
21
22
|
|
|
23
|
+
//update order
|
|
24
|
+
const { fetchData: callUpdateOrderAPI } = useAxios<{
|
|
25
|
+
data: ApiResponse[];
|
|
26
|
+
}>({
|
|
27
|
+
endpoint: `/orders/update/`,
|
|
28
|
+
method: 'PUT',
|
|
29
|
+
});
|
|
30
|
+
|
|
22
31
|
const title =
|
|
23
32
|
orderDetails?.order_locked === true ? 'Unlocking Order' : 'Locking Order';
|
|
24
33
|
const action = orderDetails?.order_locked === true ? 'Unlock' : 'Lock';
|
|
@@ -32,13 +41,29 @@ function OrderLock() {
|
|
|
32
41
|
const isLocked =
|
|
33
42
|
orderDetails?.order_locked === null ? false : orderDetails?.order_locked;
|
|
34
43
|
const payload = [{ id: orderDetails?.id, order_locked: !isLocked }];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
try {
|
|
45
|
+
let response = (await callUpdateOrderAPI({
|
|
46
|
+
payload: payload,
|
|
47
|
+
})) as {
|
|
48
|
+
code: number | null;
|
|
49
|
+
error?: string | null | undefined;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
};
|
|
52
|
+
if (response.code == 200 && response?.data?.length > 0) {
|
|
53
|
+
notification.success({
|
|
54
|
+
message: 'Success',
|
|
55
|
+
description: `${response?.message}`,
|
|
56
|
+
});
|
|
57
|
+
setOrderdetails(response?.data[0]);
|
|
58
|
+
setRecallAuditLog(true);
|
|
59
|
+
setRecallOrders(true);
|
|
60
|
+
} else {
|
|
61
|
+
notification.error({
|
|
62
|
+
message: 'Error',
|
|
63
|
+
description: `${response?.error}`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {}
|
|
42
67
|
onClose();
|
|
43
68
|
};
|
|
44
69
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import AllowTracking from './AllowTracking';
|
|
4
|
-
import { Button } from '@bjsdistribution/dms-component-library';
|
|
4
|
+
import { Button, useAxios } from '@bjsdistribution/dms-component-library';
|
|
5
5
|
import {
|
|
6
6
|
useAtom,
|
|
7
7
|
useOrderDetails,
|
|
@@ -13,21 +13,28 @@ import {
|
|
|
13
13
|
useGlobalStateHitAuditLog,
|
|
14
14
|
useGlobalStateHitOrder,
|
|
15
15
|
} from '../../../store';
|
|
16
|
-
import useUpdateOrder from '../../../hooks/useUpdateOrder';
|
|
17
16
|
import { compareOrderDetailsStates, filterObject } from '../../../utils';
|
|
18
|
-
import { OrderServiceType } from '../../../types';
|
|
17
|
+
import { ApiResponse, OrderServiceType } from '../../../types';
|
|
18
|
+
import { notification } from 'antd';
|
|
19
19
|
|
|
20
20
|
function OrderDetailsFooter() {
|
|
21
21
|
const [orderDetails, setOrderDetails] = useOrderDetails();
|
|
22
22
|
const [prevOrderDetails, setPrevOrderDetails] = usePrevOrderDetails();
|
|
23
23
|
const [, setCustomerInfo] = useCustomerInfo();
|
|
24
|
-
const updateOrder = useUpdateOrder();
|
|
25
24
|
const [errorState] = useAtom(errorAtom);
|
|
26
25
|
const [, setCallApi] = useUpdateApiCall(); //single detail
|
|
27
26
|
const [, setRecalling] = useLiveRecalling();
|
|
28
27
|
const [, setRecallAuditLog] = useGlobalStateHitAuditLog();
|
|
29
28
|
const [, setRecallOrders] = useGlobalStateHitOrder();
|
|
30
29
|
|
|
30
|
+
//update order
|
|
31
|
+
const { fetchData: callUpdateOrderAPI } = useAxios<{
|
|
32
|
+
data: ApiResponse[];
|
|
33
|
+
}>({
|
|
34
|
+
endpoint: `/orders/update/`,
|
|
35
|
+
method: 'PUT',
|
|
36
|
+
});
|
|
37
|
+
|
|
31
38
|
const errorFound = () => {
|
|
32
39
|
const isError =
|
|
33
40
|
errorState?.w3wError.length > 0 ||
|
|
@@ -83,11 +90,21 @@ function OrderDetailsFooter() {
|
|
|
83
90
|
setRecallAuditLog(false);
|
|
84
91
|
setRecallOrders(false);
|
|
85
92
|
const payload = compareOrderDetailsStates(prevOrderDetails, orderDetails);
|
|
86
|
-
|
|
93
|
+
let response = (await callUpdateOrderAPI({
|
|
94
|
+
payload: [payload],
|
|
95
|
+
})) as {
|
|
96
|
+
code: number | null;
|
|
97
|
+
error?: string | null | undefined;
|
|
98
|
+
[key: string]: any;
|
|
99
|
+
};
|
|
87
100
|
setCallApi(false);
|
|
88
101
|
setRecallOrders(true);
|
|
89
102
|
// setLogsCallAPi(prev => !prev);
|
|
90
103
|
if (response && response?.data?.length > 0) {
|
|
104
|
+
notification.success({
|
|
105
|
+
message: 'Success',
|
|
106
|
+
description: `${response?.message}`,
|
|
107
|
+
});
|
|
91
108
|
setOrderDetails(response?.data[0]);
|
|
92
109
|
setPrevOrderDetails(response?.data[0]);
|
|
93
110
|
setCustomerInfo({
|
package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx
CHANGED
|
@@ -8,7 +8,6 @@ import ActionIcon from '../../../../assets/icons/ActionIcon';
|
|
|
8
8
|
// import { useSelectedOrders } from '../../../store';
|
|
9
9
|
import { useOrderId, useOrderStaticData, useProductDetails } from '../../store';
|
|
10
10
|
import { ApiResponse } from '../../types';
|
|
11
|
-
import Loader from '../../../order-daily-overview/header/loader/Loader';
|
|
12
11
|
import { notification } from 'antd';
|
|
13
12
|
import { useNewReturnOrderData, useSelectedProducts } from '../../../store';
|
|
14
13
|
import styled from 'styled-components';
|
|
@@ -25,11 +24,7 @@ const ReturnProductTable = () => {
|
|
|
25
24
|
setSelectedRowId(id);
|
|
26
25
|
};
|
|
27
26
|
|
|
28
|
-
const {
|
|
29
|
-
data: isresponse,
|
|
30
|
-
setShouldPerformAction: setAction,
|
|
31
|
-
loading,
|
|
32
|
-
} = useApiHook<{
|
|
27
|
+
const { data: isresponse, setShouldPerformAction: setAction } = useApiHook<{
|
|
33
28
|
data: ApiResponse[];
|
|
34
29
|
}>({
|
|
35
30
|
endpoint: `order/order_products/delete/`,
|
|
@@ -100,7 +95,6 @@ const ReturnProductTable = () => {
|
|
|
100
95
|
|
|
101
96
|
return (
|
|
102
97
|
<div>
|
|
103
|
-
{loading && <Loader title="Deleting" />}
|
|
104
98
|
<StyledTableWrapper id="tableScrolling" className="orderProductTable">
|
|
105
99
|
<StyledTable>
|
|
106
100
|
<thead>
|
|
@@ -3,40 +3,37 @@ import CollapsedContent from '../collapsed-content';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import CollapsableForm from '../../../../common/expand-collapse';
|
|
5
5
|
import DynamicTable from '../../DynamicTable';
|
|
6
|
-
import {
|
|
7
|
-
useEventNotesData,
|
|
8
|
-
// useOrderDetails,
|
|
9
|
-
useOrderProductSystemLogs,
|
|
10
|
-
} from '../../store';
|
|
6
|
+
import { useEventNotesData, useOrderProductSystemLogs } from '../../store';
|
|
11
7
|
import { tableColumns } from '../helper';
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
8
|
+
import { useAxios } from '@bjsdistribution/dms-component-library';
|
|
9
|
+
import { ApiResponse } from '../../types';
|
|
14
10
|
|
|
15
11
|
function SystemLogs() {
|
|
16
12
|
const [systemLogs] = useOrderProductSystemLogs();
|
|
17
|
-
|
|
18
|
-
// const [orderDetails] = useOrderDetails();
|
|
19
|
-
const systemLogsData = useGetEventNotes();
|
|
20
13
|
const [, setNotesData] = useEventNotesData();
|
|
21
|
-
// const gsitId = orderDetails?.gsit_order_id;
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
15
|
+
//event API
|
|
16
|
+
const {
|
|
17
|
+
data: systemLogsData,
|
|
18
|
+
fetchData: callSystemLogAPI,
|
|
19
|
+
loading,
|
|
20
|
+
} = useAxios<{
|
|
21
|
+
data: ApiResponse[];
|
|
22
|
+
}>({
|
|
23
|
+
endpoint: `/events/get/event_information/`,
|
|
24
|
+
method: 'GET',
|
|
25
|
+
pagination: { is_pagination: false },
|
|
26
|
+
});
|
|
36
27
|
|
|
37
28
|
useEffect(() => {
|
|
38
|
-
|
|
39
|
-
}, [
|
|
29
|
+
callSystemLogAPI();
|
|
30
|
+
}, []);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (systemLogsData && systemLogsData?.data) {
|
|
34
|
+
setNotesData(systemLogsData?.data);
|
|
35
|
+
}
|
|
36
|
+
}, [loading]);
|
|
40
37
|
|
|
41
38
|
return (
|
|
42
39
|
<Table>
|
|
@@ -3,17 +3,14 @@ import OrderActionModal from '../../../common/modals/order-action-modal/OrderAct
|
|
|
3
3
|
import { useCurrentAction } from '../store';
|
|
4
4
|
import { DatePickerWrap, Label } from '../order-actions/actions/modalstyle';
|
|
5
5
|
import {
|
|
6
|
-
useFlagsLoading,
|
|
7
6
|
useReminderRefId,
|
|
8
7
|
useSingleReminderData,
|
|
9
8
|
useUpdateReminderData,
|
|
10
9
|
} from '../order-actions/store';
|
|
11
|
-
import Loader from '../../order-daily-overview/header/loader/Loader';
|
|
12
10
|
import StatusIndicator from '../flags-action-modal/StatusIndicator';
|
|
13
11
|
import styled from 'styled-components';
|
|
14
12
|
import { format, isValid } from 'date-fns';
|
|
15
|
-
import
|
|
16
|
-
import { DatePicker } from 'antd';
|
|
13
|
+
import { DatePicker, notification } from 'antd';
|
|
17
14
|
import dayjs from 'dayjs';
|
|
18
15
|
import {
|
|
19
16
|
ReferenceContainer,
|
|
@@ -29,35 +26,53 @@ import {
|
|
|
29
26
|
MiniContainer,
|
|
30
27
|
TimeWrapper,
|
|
31
28
|
} from './reminder-styles';
|
|
32
|
-
import useFetchSingleReminderData from '../order-actions/hooks/useFetchSingleReminder';
|
|
33
|
-
import useUpdateReminder from '../order-actions/hooks/useUpdateReminder';
|
|
34
29
|
import AssigneeDropdown from './AssigneeDropdown';
|
|
30
|
+
import { useAxios } from '@bjsdistribution/dms-component-library';
|
|
31
|
+
import { ApiResponse } from '../types';
|
|
35
32
|
|
|
36
33
|
const ViewReminderModal = () => {
|
|
37
34
|
const [, setCurrentAction] = useCurrentAction();
|
|
38
|
-
const fetchData = useFetchSingleReminderData();
|
|
39
|
-
const fetchRemindersData = useFetchReminders();
|
|
40
|
-
|
|
41
|
-
const updateReminder = useUpdateReminder();
|
|
42
35
|
const [, setDueDate] = useState<any | null>(null);
|
|
43
36
|
const [reminderData, setReminderData] = useSingleReminderData();
|
|
44
37
|
const [reminderRefId] = useReminderRefId();
|
|
45
|
-
const [loading, setLoading] = useFlagsLoading();
|
|
46
38
|
const [reminderPayload, setPayload] = useUpdateReminderData();
|
|
47
39
|
|
|
40
|
+
//reminder get
|
|
41
|
+
const {
|
|
42
|
+
data: fetchedReminderData,
|
|
43
|
+
loading: reminderLoading,
|
|
44
|
+
fetchData: callReminderApi,
|
|
45
|
+
} = useAxios<{
|
|
46
|
+
data: ApiResponse[];
|
|
47
|
+
}>({
|
|
48
|
+
endpoint: `/tasks/reminder/${reminderRefId}`,
|
|
49
|
+
method: 'GET',
|
|
50
|
+
pagination: { is_pagination: false },
|
|
51
|
+
filters: [{ field: 'order_id', op: '=', value: reminderRefId }],
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//use Axios Reminder
|
|
55
|
+
const { fetchData: callReminderEditAPI } = useAxios<{
|
|
56
|
+
data: ApiResponse[];
|
|
57
|
+
}>({
|
|
58
|
+
endpoint: `/tasks/reminder/update/`,
|
|
59
|
+
method: 'PUT',
|
|
60
|
+
});
|
|
61
|
+
|
|
48
62
|
const closeModal = () => {
|
|
49
63
|
setCurrentAction(undefined);
|
|
50
64
|
};
|
|
51
65
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (fetchedReminderData && fetchedReminderData?.data) {
|
|
68
|
+
setReminderData(fetchedReminderData?.data);
|
|
69
|
+
}
|
|
70
|
+
}, [reminderLoading]);
|
|
58
71
|
|
|
59
72
|
useEffect(() => {
|
|
60
|
-
|
|
73
|
+
if (reminderRefId) {
|
|
74
|
+
callReminderApi();
|
|
75
|
+
}
|
|
61
76
|
}, [reminderRefId]);
|
|
62
77
|
|
|
63
78
|
useEffect(() => {
|
|
@@ -116,10 +131,33 @@ const ViewReminderModal = () => {
|
|
|
116
131
|
};
|
|
117
132
|
|
|
118
133
|
const handleEditReminder = async () => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
134
|
+
try {
|
|
135
|
+
const apiResponse = (await callReminderEditAPI({
|
|
136
|
+
payload: [reminderPayload],
|
|
137
|
+
})) as {
|
|
138
|
+
code: number | null;
|
|
139
|
+
error?: string | null | undefined;
|
|
140
|
+
[key: string]: any;
|
|
141
|
+
};
|
|
142
|
+
if (apiResponse?.code === 200 && apiResponse?.data) {
|
|
143
|
+
notification.success({
|
|
144
|
+
message: 'Success',
|
|
145
|
+
description: apiResponse.message,
|
|
146
|
+
});
|
|
147
|
+
callReminderApi();
|
|
148
|
+
closeModal();
|
|
149
|
+
} else {
|
|
150
|
+
notification.error({
|
|
151
|
+
message: 'Failure',
|
|
152
|
+
description: apiResponse?.error || 'An error occurred.',
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
} catch (error) {
|
|
156
|
+
notification.error({
|
|
157
|
+
message: 'Error',
|
|
158
|
+
description: 'Failed to update the reminder. Please try again later.',
|
|
159
|
+
});
|
|
160
|
+
}
|
|
123
161
|
};
|
|
124
162
|
|
|
125
163
|
const isDisabled = reminderData?.reminder_status?.name_alias === 'resolved';
|
|
@@ -131,104 +169,105 @@ const ViewReminderModal = () => {
|
|
|
131
169
|
|
|
132
170
|
return (
|
|
133
171
|
<>
|
|
134
|
-
{reminderData &&
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
/>
|
|
184
|
-
)}
|
|
185
|
-
</LabelText>
|
|
186
|
-
</MiniContainer>
|
|
187
|
-
</InnerContainer>
|
|
188
|
-
</ReferenceContainer>
|
|
189
|
-
<ContentsContainer>
|
|
190
|
-
<Left>
|
|
191
|
-
<AssigneeDropdown />
|
|
192
|
-
<DateTimeContainer>
|
|
193
|
-
<Label>Due </Label>
|
|
194
|
-
<Row>
|
|
195
|
-
<StyleContainer>
|
|
196
|
-
<DatePickerWrap>
|
|
197
|
-
<DatePicker
|
|
198
|
-
format="DD/MM/YYYY"
|
|
199
|
-
value={
|
|
200
|
-
reminderPayload?.due_date
|
|
201
|
-
? dayjs(reminderPayload?.due_date)
|
|
202
|
-
: null
|
|
203
|
-
}
|
|
204
|
-
onChange={handleDateChange}
|
|
172
|
+
{reminderData && (
|
|
173
|
+
<OrderActionModal
|
|
174
|
+
headerTitle="View Reminder"
|
|
175
|
+
onCloseHeader={closeModal}
|
|
176
|
+
onSubmit={handleEditReminder}
|
|
177
|
+
submitBtnTitle="Save Details"
|
|
178
|
+
isSubmitDisabled={isDisabled}
|
|
179
|
+
showAdditionalInfo
|
|
180
|
+
infoText={additional || 'NA'}
|
|
181
|
+
headerActions={
|
|
182
|
+
<OuterDiv>
|
|
183
|
+
{reminderData?.reminder_status?.name_alias === 'pending' ||
|
|
184
|
+
reminderData?.reminder_status?.name_alias === 'unresolved' ? (
|
|
185
|
+
<>
|
|
186
|
+
<StyledWrapper>
|
|
187
|
+
<StyledLabel>
|
|
188
|
+
<StyledCheckbox>
|
|
189
|
+
<input
|
|
190
|
+
type="checkbox"
|
|
191
|
+
onChange={() => handleResolved(2)}
|
|
192
|
+
/>
|
|
193
|
+
<RoundCheckbox />
|
|
194
|
+
</StyledCheckbox>
|
|
195
|
+
<StyledSpan>Mark As Complete</StyledSpan>
|
|
196
|
+
</StyledLabel>
|
|
197
|
+
</StyledWrapper>
|
|
198
|
+
</>
|
|
199
|
+
) : null}
|
|
200
|
+
</OuterDiv>
|
|
201
|
+
}
|
|
202
|
+
>
|
|
203
|
+
<ReferenceContainer style={{ marginTop: '20px' }}>
|
|
204
|
+
<InnerContainer>
|
|
205
|
+
<MiniContainer>
|
|
206
|
+
{' '}
|
|
207
|
+
<Label>Reference {} </Label>
|
|
208
|
+
<LabelText>{reminderData?.reference || 'N/A'}</LabelText>
|
|
209
|
+
</MiniContainer>
|
|
210
|
+
<MiniContainer>
|
|
211
|
+
{' '}
|
|
212
|
+
<Label>Status </Label>
|
|
213
|
+
<LabelText>
|
|
214
|
+
{reminderData?.reminder_status?.name_alias === 'pending' ||
|
|
215
|
+
reminderData?.reminder_status?.name_alias === 'unresolved' ? (
|
|
216
|
+
<StatusIndicator text="Incomplete" status="AD" />
|
|
217
|
+
) : (
|
|
218
|
+
<StatusIndicator
|
|
219
|
+
text={`Completed on ${reminderData?.completed} by ${reminderData?.completed_by}`}
|
|
220
|
+
status="SD"
|
|
205
221
|
/>
|
|
206
|
-
|
|
207
|
-
</
|
|
222
|
+
)}
|
|
223
|
+
</LabelText>
|
|
224
|
+
</MiniContainer>
|
|
225
|
+
</InnerContainer>
|
|
226
|
+
</ReferenceContainer>
|
|
227
|
+
<ContentsContainer>
|
|
228
|
+
<Left>
|
|
229
|
+
<AssigneeDropdown />
|
|
230
|
+
<DateTimeContainer>
|
|
231
|
+
<Label>Due </Label>
|
|
232
|
+
<Row>
|
|
233
|
+
<StyleContainer>
|
|
234
|
+
<DatePickerWrap>
|
|
235
|
+
<DatePicker
|
|
236
|
+
format="DD/MM/YYYY"
|
|
237
|
+
value={
|
|
238
|
+
reminderPayload?.due_date
|
|
239
|
+
? dayjs(reminderPayload?.due_date)
|
|
240
|
+
: null
|
|
241
|
+
}
|
|
242
|
+
onChange={handleDateChange}
|
|
243
|
+
/>
|
|
244
|
+
</DatePickerWrap>
|
|
245
|
+
</StyleContainer>
|
|
208
246
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
247
|
+
<TimeWrapper>
|
|
248
|
+
<StyledTime
|
|
249
|
+
onChange={handleTime}
|
|
250
|
+
value={reminderPayload?.due_time}
|
|
251
|
+
type="time"
|
|
252
|
+
/>
|
|
253
|
+
</TimeWrapper>
|
|
254
|
+
</Row>
|
|
255
|
+
</DateTimeContainer>
|
|
256
|
+
</Left>
|
|
257
|
+
<Right>
|
|
258
|
+
<DetailedContainer>
|
|
259
|
+
<Label>Details</Label>
|
|
260
|
+
<StyledText
|
|
261
|
+
name="text"
|
|
262
|
+
required
|
|
263
|
+
value={reminderPayload?.details}
|
|
264
|
+
onChange={onChangeDetails}
|
|
265
|
+
/>
|
|
266
|
+
</DetailedContainer>
|
|
267
|
+
</Right>
|
|
268
|
+
</ContentsContainer>
|
|
269
|
+
</OrderActionModal>
|
|
270
|
+
)}
|
|
232
271
|
</>
|
|
233
272
|
);
|
|
234
273
|
};
|