@bjsdistribution/dms-client-return 0.1.20-dev → 0.1.21-dev
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/client-portal/DateFilterStore.d.ts +15 -0
- package/dist/components/order-view/DynamicTable.d.ts +2 -1
- package/dist/components/order-view/general-information/Status.d.ts +1 -1
- package/dist/components/order-view/general-information/index.d.ts +1 -1
- package/dist/components/order-view/index.d.ts +1 -1
- package/dist/components/order-view/notes/AddNote.d.ts +1 -0
- package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.d.ts +4 -1
- package/dist/components/order-view/order-actions/actions/confirm-order/index.d.ts +4 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/Selector.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.d.ts +8 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/index.d.ts +4 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/styles.d.ts +8 -0
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +1 -0
- package/dist/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.d.ts +1 -1
- package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +1 -0
- package/dist/components/order-view/order-actions/types.d.ts +3 -3
- package/dist/components/order-view/order-details/expanded-content/index.d.ts +1 -1
- package/dist/components/order-view/order-details/index.d.ts +1 -1
- package/dist/components/order-view/order-resources/expanded-content/index.d.ts +1 -1
- package/dist/components/order-view/products-info/expanded-content/index.d.ts +6 -1
- package/dist/components/order-view/products-info/index.d.ts +1 -1
- package/dist/components/order-view/return-client-products/ProductTable.d.ts +6 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +6 -1
- package/dist/components/order-view/store.d.ts +15 -3
- package/dist/components/order-view/system-event-logs/expanded-content/index.d.ts +1 -1
- package/dist/components/order-view/types.d.ts +49 -1
- package/dist/components/order-view/utils.d.ts +3 -0
- package/dist/components/order-view/view-reminder/ViewReminder.d.ts +2 -0
- package/dist/dms-client-return.cjs.development.js +4364 -1614
- 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 +4429 -1679
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +6 -4
- package/src/assets/icons/ActionIcon.tsx +1 -1
- package/src/assets/icons/ArrowDownIcon.tsx +2 -2
- package/src/components/client-portal/DateFilterStore.ts +94 -0
- package/src/components/client-portal/OutstandingTable.tsx +15 -72
- package/src/components/client-portal/ReturnAfterSearchBar.tsx +41 -87
- package/src/components/client-portal/ReturnRTFilters.tsx +0 -2
- package/src/components/client-portal/ReturnSearchBar.tsx +41 -152
- package/src/components/client-portal/ReturnStatus.tsx +33 -84
- package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +12 -23
- package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +8 -85
- package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +11 -18
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +43 -15
- package/src/components/order-daily-overview/index.tsx +23 -4
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +6 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +3 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +36 -36
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +12 -2
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +16 -0
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +25 -11
- package/src/components/order-daily-overview/table/ReturnTable.tsx +8 -4
- package/src/components/order-view/DynamicTable.tsx +21 -8
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +1 -1
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +9 -0
- package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
- package/src/components/order-view/flags-action-modal/Dropdowns.tsx +2 -0
- package/src/components/order-view/general-information/Status.tsx +92 -18
- package/src/components/order-view/general-information/index.tsx +2 -2
- package/src/components/order-view/generic-table/AuditLogs.tsx +39 -12
- package/src/components/order-view/index.tsx +50 -8
- package/src/components/order-view/modalsPopup/ModalManager.tsx +1 -1
- package/src/components/order-view/notes/AddNote.tsx +95 -65
- package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
- package/src/components/order-view/notification/FlagTemplate.tsx +21 -10
- package/src/components/order-view/notification/OrderTemplate.tsx +192 -41
- package/src/components/order-view/notification/ReminderTemplate.tsx +28 -13
- package/src/components/order-view/notification/index.tsx +100 -55
- package/src/components/order-view/order-actions/actions/add-resources/DocFileUpload.tsx +92 -72
- package/src/components/order-view/order-actions/actions/add-resources/index.tsx +27 -10
- package/src/components/order-view/order-actions/actions/cancel-order/ReturnAction.tsx +25 -4
- package/src/components/order-view/order-actions/actions/cancel-order/ReturnReason.tsx +24 -4
- package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +9 -2
- package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +12 -6
- package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +1 -0
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +88 -30
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +5 -3
- package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +2 -2
- package/src/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.tsx +620 -0
- package/src/components/order-view/order-actions/actions/force-debrief/Selector.tsx +65 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx +106 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.tsx +78 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.tsx +124 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.tsx +92 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.tsx +90 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx +122 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/index.tsx +16 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.tsx +46 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.tsx +117 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.tsx +32 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/index.tsx +180 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx +201 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx +40 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx +108 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.tsx +37 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.tsx +48 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.tsx +27 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.tsx +187 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/index.tsx +55 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.tsx +221 -0
- package/src/components/order-view/order-actions/actions/force-debrief/styles.tsx +51 -0
- package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +2 -0
- package/src/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.tsx +7 -2
- package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +2 -0
- package/src/components/order-view/order-actions/index.tsx +18 -5
- package/src/components/order-view/order-actions/store.ts +1 -1
- package/src/components/order-view/order-actions/types.ts +3 -3
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +7 -1
- package/src/components/order-view/order-details/expanded-content/index.tsx +37 -16
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +3 -4
- package/src/components/order-view/order-details/index.tsx +5 -2
- package/src/components/order-view/order-resources/expanded-content/index.tsx +2 -2
- package/src/components/order-view/products-info/expanded-content/index.tsx +33 -11
- package/src/components/order-view/products-info/index.tsx +10 -6
- package/src/components/order-view/return-client-products/ProductTable.tsx +12 -2
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +73 -23
- package/src/components/order-view/store.ts +107 -1
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -2
- package/src/components/order-view/types.ts +54 -1
- package/src/components/order-view/utils.ts +37 -0
- package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +85 -26
- package/src/components/order-view/view-reminder/ViewReminder.tsx +33 -14
- package/src/components/store.ts +1 -1
- package/src/index.tsx +6 -3
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { FlagAlert } from '@bjsdistribution/dms-component-library';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { useOrderNotify } from '../order-actions/store';
|
|
5
5
|
import { useOrderStaticData } from '../store';
|
|
6
|
+
import { useClientPortal } from '../../store';
|
|
6
7
|
|
|
7
8
|
function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
8
9
|
const [, setOrderCount] = useOrderNotify();
|
|
9
|
-
const precall = false;
|
|
10
|
+
// const precall = false;
|
|
10
11
|
const [orderStaticData] = useOrderStaticData();
|
|
11
12
|
const statusVal = routeInfoData?.status_value;
|
|
12
|
-
|
|
13
|
+
const [isClientPortal] = useClientPortal();
|
|
13
14
|
const unholdReasons = orderStaticData?.cancellation_reasons?.map(
|
|
14
15
|
(x: any) => ({
|
|
15
16
|
id: x?.id,
|
|
@@ -38,13 +39,17 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
38
39
|
isPreCall: true,
|
|
39
40
|
isConfirmed: true,
|
|
40
41
|
isPostcode: true,
|
|
42
|
+
isSubcontracted: true,
|
|
43
|
+
isRouted: true,
|
|
44
|
+
isOnSite: true,
|
|
45
|
+
isFailed: true,
|
|
41
46
|
});
|
|
42
47
|
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, [precall]);
|
|
48
|
+
// useEffect(() => {
|
|
49
|
+
// if (precall) {
|
|
50
|
+
// setOrderCount(prevCount => prevCount + 1);
|
|
51
|
+
// }
|
|
52
|
+
// }, [precall]);
|
|
48
53
|
|
|
49
54
|
//on close alert functionality
|
|
50
55
|
const onCloseAlert = (alertType: string) => {
|
|
@@ -57,6 +62,28 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
57
62
|
|
|
58
63
|
return (
|
|
59
64
|
<>
|
|
65
|
+
{/* order_red_cross_alerts */}
|
|
66
|
+
{!isClientPortal && routeInfoData?.order_red_cross_alerts?.length > 0 && (
|
|
67
|
+
<FlagAlert
|
|
68
|
+
type="error"
|
|
69
|
+
title=""
|
|
70
|
+
description={
|
|
71
|
+
<FlagsStyle>
|
|
72
|
+
<div className="redCross">
|
|
73
|
+
<div
|
|
74
|
+
className="spanStyle"
|
|
75
|
+
dangerouslySetInnerHTML={{
|
|
76
|
+
__html: routeInfoData?.order_red_cross_alerts,
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</FlagsStyle>
|
|
81
|
+
}
|
|
82
|
+
showOkButton={false}
|
|
83
|
+
onClose={() => onCloseAlert('isPostcode')}
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
86
|
+
|
|
60
87
|
{statusVal == 'on hold' && alertVisibility?.isHoldVisible && (
|
|
61
88
|
<StyledAlert>
|
|
62
89
|
<FlagAlert
|
|
@@ -64,7 +91,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
64
91
|
title={
|
|
65
92
|
<div
|
|
66
93
|
dangerouslySetInnerHTML={{
|
|
67
|
-
__html: routeInfoData?.
|
|
94
|
+
__html: routeInfoData?.order_info_alerts,
|
|
68
95
|
}}
|
|
69
96
|
></div>
|
|
70
97
|
}
|
|
@@ -81,7 +108,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
81
108
|
title={
|
|
82
109
|
<div
|
|
83
110
|
dangerouslySetInnerHTML={{
|
|
84
|
-
__html: routeInfoData?.
|
|
111
|
+
__html: routeInfoData?.order_info_alerts,
|
|
85
112
|
}}
|
|
86
113
|
></div>
|
|
87
114
|
}
|
|
@@ -92,24 +119,6 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
92
119
|
</StyledAlert>
|
|
93
120
|
)}
|
|
94
121
|
|
|
95
|
-
{precall && alertVisibility.isPreCall && (
|
|
96
|
-
<StyledAlert>
|
|
97
|
-
<FlagAlert
|
|
98
|
-
type="success"
|
|
99
|
-
title={
|
|
100
|
-
<div
|
|
101
|
-
dangerouslySetInnerHTML={{
|
|
102
|
-
__html: routeInfoData?.order_alert,
|
|
103
|
-
}}
|
|
104
|
-
></div>
|
|
105
|
-
}
|
|
106
|
-
description={``}
|
|
107
|
-
showOkButton={false}
|
|
108
|
-
onClose={() => onCloseAlert('isPreCall')}
|
|
109
|
-
/>
|
|
110
|
-
</StyledAlert>
|
|
111
|
-
)}
|
|
112
|
-
|
|
113
122
|
{statusVal == 'outstanding' && alertVisibility.isOutstanding && (
|
|
114
123
|
<StyledAlert>
|
|
115
124
|
<FlagAlert
|
|
@@ -117,7 +126,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
117
126
|
title={
|
|
118
127
|
<div
|
|
119
128
|
dangerouslySetInnerHTML={{
|
|
120
|
-
__html: routeInfoData?.
|
|
129
|
+
__html: routeInfoData?.order_info_alerts,
|
|
121
130
|
}}
|
|
122
131
|
></div>
|
|
123
132
|
}
|
|
@@ -127,6 +136,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
127
136
|
/>
|
|
128
137
|
</StyledAlert>
|
|
129
138
|
)}
|
|
139
|
+
|
|
130
140
|
{statusVal == 'awaiting confirmation' &&
|
|
131
141
|
alertVisibility.isAwaitingConfirmation && (
|
|
132
142
|
<StyledAlert>
|
|
@@ -135,7 +145,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
135
145
|
title={
|
|
136
146
|
<div
|
|
137
147
|
dangerouslySetInnerHTML={{
|
|
138
|
-
__html: routeInfoData?.
|
|
148
|
+
__html: routeInfoData?.order_info_alerts,
|
|
139
149
|
}}
|
|
140
150
|
></div>
|
|
141
151
|
}
|
|
@@ -152,7 +162,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
152
162
|
title={
|
|
153
163
|
<div
|
|
154
164
|
dangerouslySetInnerHTML={{
|
|
155
|
-
__html: routeInfoData?.
|
|
165
|
+
__html: routeInfoData?.order_info_alerts,
|
|
156
166
|
}}
|
|
157
167
|
></div>
|
|
158
168
|
}
|
|
@@ -165,11 +175,11 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
165
175
|
{statusVal == 'cancelled' && alertVisibility.isCancelled && (
|
|
166
176
|
<StyledAlert>
|
|
167
177
|
<FlagAlert
|
|
168
|
-
type="
|
|
178
|
+
type="info"
|
|
169
179
|
title={
|
|
170
180
|
<div
|
|
171
181
|
dangerouslySetInnerHTML={{
|
|
172
|
-
__html: routeInfoData?.
|
|
182
|
+
__html: routeInfoData?.order_info_alerts,
|
|
173
183
|
}}
|
|
174
184
|
></div>
|
|
175
185
|
}
|
|
@@ -179,6 +189,43 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
179
189
|
/>
|
|
180
190
|
</StyledAlert>
|
|
181
191
|
)}
|
|
192
|
+
|
|
193
|
+
{statusVal == 'confirmed' && alertVisibility.isConfirmed && (
|
|
194
|
+
<StyledAlert>
|
|
195
|
+
<FlagAlert
|
|
196
|
+
type="info"
|
|
197
|
+
title={
|
|
198
|
+
<div
|
|
199
|
+
dangerouslySetInnerHTML={{
|
|
200
|
+
__html: routeInfoData?.order_info_alerts,
|
|
201
|
+
}}
|
|
202
|
+
></div>
|
|
203
|
+
}
|
|
204
|
+
description={``}
|
|
205
|
+
showOkButton={false}
|
|
206
|
+
onClose={() => onCloseAlert('isConfirmed')}
|
|
207
|
+
/>
|
|
208
|
+
</StyledAlert>
|
|
209
|
+
)}
|
|
210
|
+
|
|
211
|
+
{statusVal == 'subcontracted' && alertVisibility.isSubcontracted && (
|
|
212
|
+
<StyledAlert>
|
|
213
|
+
<FlagAlert
|
|
214
|
+
type="info"
|
|
215
|
+
title={
|
|
216
|
+
<div
|
|
217
|
+
dangerouslySetInnerHTML={{
|
|
218
|
+
__html: routeInfoData?.order_info_alerts,
|
|
219
|
+
}}
|
|
220
|
+
></div>
|
|
221
|
+
}
|
|
222
|
+
description={``}
|
|
223
|
+
showOkButton={false}
|
|
224
|
+
onClose={() => onCloseAlert('isRouted')}
|
|
225
|
+
/>
|
|
226
|
+
</StyledAlert>
|
|
227
|
+
)}
|
|
228
|
+
|
|
182
229
|
{statusVal == 'enroute' && alertVisibility.isEnroute && (
|
|
183
230
|
<StyledAlert>
|
|
184
231
|
<FlagAlert
|
|
@@ -186,7 +233,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
186
233
|
title={
|
|
187
234
|
<div
|
|
188
235
|
dangerouslySetInnerHTML={{
|
|
189
|
-
__html: routeInfoData?.
|
|
236
|
+
__html: routeInfoData?.order_info_alerts,
|
|
190
237
|
}}
|
|
191
238
|
></div>
|
|
192
239
|
}
|
|
@@ -197,34 +244,89 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
197
244
|
</StyledAlert>
|
|
198
245
|
)}
|
|
199
246
|
|
|
200
|
-
{statusVal == '
|
|
247
|
+
{statusVal == 'routed' && alertVisibility.isRouted && (
|
|
201
248
|
<StyledAlert>
|
|
202
249
|
<FlagAlert
|
|
203
250
|
type="info"
|
|
204
251
|
title={
|
|
205
252
|
<div
|
|
206
253
|
dangerouslySetInnerHTML={{
|
|
207
|
-
__html: routeInfoData?.
|
|
254
|
+
__html: routeInfoData?.order_info_alerts,
|
|
208
255
|
}}
|
|
209
256
|
></div>
|
|
210
257
|
}
|
|
211
258
|
description={``}
|
|
212
259
|
showOkButton={false}
|
|
213
|
-
onClose={() => onCloseAlert('
|
|
260
|
+
onClose={() => onCloseAlert('isRouted')}
|
|
214
261
|
/>
|
|
215
262
|
</StyledAlert>
|
|
216
263
|
)}
|
|
217
264
|
|
|
218
|
-
{
|
|
265
|
+
{statusVal == 'precalled' && alertVisibility.isPreCall && (
|
|
266
|
+
<StyledAlert>
|
|
267
|
+
<FlagAlert
|
|
268
|
+
type="info"
|
|
269
|
+
title={
|
|
270
|
+
<div
|
|
271
|
+
dangerouslySetInnerHTML={{
|
|
272
|
+
__html: routeInfoData?.order_info_alerts,
|
|
273
|
+
}}
|
|
274
|
+
></div>
|
|
275
|
+
}
|
|
276
|
+
description={``}
|
|
277
|
+
showOkButton={false}
|
|
278
|
+
onClose={() => onCloseAlert('isPreCall')}
|
|
279
|
+
/>
|
|
280
|
+
</StyledAlert>
|
|
281
|
+
)}
|
|
282
|
+
|
|
283
|
+
{statusVal == 'on site' && alertVisibility.isOnSite && (
|
|
284
|
+
<StyledAlert>
|
|
285
|
+
<FlagAlert
|
|
286
|
+
type="info"
|
|
287
|
+
title={
|
|
288
|
+
<div
|
|
289
|
+
dangerouslySetInnerHTML={{
|
|
290
|
+
__html: routeInfoData?.order_info_alerts,
|
|
291
|
+
}}
|
|
292
|
+
></div>
|
|
293
|
+
}
|
|
294
|
+
description={``}
|
|
295
|
+
showOkButton={false}
|
|
296
|
+
onClose={() => onCloseAlert('isOnSite')}
|
|
297
|
+
/>
|
|
298
|
+
</StyledAlert>
|
|
299
|
+
)}
|
|
300
|
+
|
|
301
|
+
{statusVal == 'failed' && alertVisibility.isFailed && (
|
|
302
|
+
<StyledAlert>
|
|
303
|
+
<FlagAlert
|
|
304
|
+
type="info"
|
|
305
|
+
title={
|
|
306
|
+
<div
|
|
307
|
+
dangerouslySetInnerHTML={{
|
|
308
|
+
__html: routeInfoData?.order_info_alerts,
|
|
309
|
+
}}
|
|
310
|
+
></div>
|
|
311
|
+
}
|
|
312
|
+
description={``}
|
|
313
|
+
showOkButton={false}
|
|
314
|
+
onClose={() => onCloseAlert('isFailed')}
|
|
315
|
+
/>
|
|
316
|
+
</StyledAlert>
|
|
317
|
+
)}
|
|
318
|
+
|
|
319
|
+
{/* order_warnings_alerts */}
|
|
320
|
+
{!isClientPortal && routeInfoData?.order_warnings_alerts?.length > 0 && (
|
|
219
321
|
<FlagAlert
|
|
220
|
-
type="
|
|
322
|
+
type="warn"
|
|
221
323
|
title=""
|
|
222
324
|
description={
|
|
223
325
|
<FlagsStyle>
|
|
224
|
-
<div className="
|
|
326
|
+
<div className="">
|
|
225
327
|
<div
|
|
226
328
|
dangerouslySetInnerHTML={{
|
|
227
|
-
__html: routeInfoData
|
|
329
|
+
__html: routeInfoData?.order_warnings_alerts,
|
|
228
330
|
}}
|
|
229
331
|
/>
|
|
230
332
|
</div>
|
|
@@ -234,11 +336,58 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
234
336
|
onClose={() => onCloseAlert('isPostcode')}
|
|
235
337
|
/>
|
|
236
338
|
)}
|
|
339
|
+
|
|
340
|
+
{/* order_green_check_alerts */}
|
|
341
|
+
{!isClientPortal && routeInfoData?.order_green_check_alerts?.length > 0 && (
|
|
342
|
+
<FlagAlert
|
|
343
|
+
type="success"
|
|
344
|
+
title=""
|
|
345
|
+
description={
|
|
346
|
+
<FlagsStyle>
|
|
347
|
+
<div className="">
|
|
348
|
+
<div
|
|
349
|
+
dangerouslySetInnerHTML={{
|
|
350
|
+
__html: routeInfoData?.order_green_check_alerts,
|
|
351
|
+
}}
|
|
352
|
+
/>
|
|
353
|
+
</div>
|
|
354
|
+
</FlagsStyle>
|
|
355
|
+
}
|
|
356
|
+
showOkButton={false}
|
|
357
|
+
onClose={() => onCloseAlert('isPostcode')}
|
|
358
|
+
/>
|
|
359
|
+
)}
|
|
360
|
+
|
|
361
|
+
{!isClientPortal &&
|
|
362
|
+
routeInfoData?.same_postcode_orders &&
|
|
363
|
+
alertVisibility.isPostcode && (
|
|
364
|
+
<FlagAlert
|
|
365
|
+
type="info"
|
|
366
|
+
title=""
|
|
367
|
+
description={
|
|
368
|
+
<FlagsStyle>
|
|
369
|
+
<div className="postcode-alert-content">
|
|
370
|
+
<div
|
|
371
|
+
dangerouslySetInnerHTML={{
|
|
372
|
+
__html: routeInfoData?.same_postcode_orders,
|
|
373
|
+
}}
|
|
374
|
+
/>
|
|
375
|
+
</div>
|
|
376
|
+
</FlagsStyle>
|
|
377
|
+
}
|
|
378
|
+
showOkButton={false}
|
|
379
|
+
onClose={() => onCloseAlert('isPostcode')}
|
|
380
|
+
/>
|
|
381
|
+
)}
|
|
237
382
|
</>
|
|
238
383
|
);
|
|
239
384
|
}
|
|
240
385
|
|
|
241
386
|
const FlagsStyle = styled.div`
|
|
387
|
+
.redCross {
|
|
388
|
+
font-size: 13px;
|
|
389
|
+
margin-top: 4px;
|
|
390
|
+
}
|
|
242
391
|
.postcode-alert-content {
|
|
243
392
|
> div {
|
|
244
393
|
> h4 {
|
|
@@ -251,6 +400,7 @@ const FlagsStyle = styled.div`
|
|
|
251
400
|
}
|
|
252
401
|
}
|
|
253
402
|
ul {
|
|
403
|
+
margin-bottom: 0;
|
|
254
404
|
}
|
|
255
405
|
|
|
256
406
|
li {
|
|
@@ -268,6 +418,7 @@ const FlagsStyle = styled.div`
|
|
|
268
418
|
> strong {
|
|
269
419
|
> a {
|
|
270
420
|
color: #6396e5;
|
|
421
|
+
|
|
271
422
|
font-family: Roboto;
|
|
272
423
|
font-size: 14px;
|
|
273
424
|
font-style: normal;
|
|
@@ -6,11 +6,12 @@ import {
|
|
|
6
6
|
} from '@bjsdistribution/dms-component-library';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { useReminderRefId } from '../order-actions/store';
|
|
9
|
-
import {
|
|
9
|
+
import { useClientPortal } from '../../store';
|
|
10
10
|
|
|
11
11
|
function ReminderTemplate({ data, dismissReminder }: any) {
|
|
12
12
|
const [, setCurrentAction] = useCurrentAction();
|
|
13
13
|
const [, setReminderRefId] = useReminderRefId();
|
|
14
|
+
const [isClientPortal] = useClientPortal();
|
|
14
15
|
const openModal = () => {
|
|
15
16
|
setCurrentAction('view-reminder');
|
|
16
17
|
};
|
|
@@ -44,18 +45,30 @@ function ReminderTemplate({ data, dismissReminder }: any) {
|
|
|
44
45
|
<>
|
|
45
46
|
<StyledTitle color={titleColor}>
|
|
46
47
|
Reminder:
|
|
47
|
-
<StyledLink
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
<StyledLink
|
|
49
|
+
onClick={() => handleClick(data.id)}
|
|
50
|
+
$disable={isClientPortal || false}
|
|
51
|
+
>
|
|
52
|
+
{' '}
|
|
53
|
+
{data?.reference || 'NA'}{' '}
|
|
54
|
+
</StyledLink>
|
|
55
|
+
(Due -{' '}
|
|
56
|
+
{`${formatUtcToLocal(data?.due_datetime)?.date} ${
|
|
57
|
+
formatUtcToLocal(data?.due_datetime)?.time
|
|
53
58
|
}`}
|
|
54
|
-
)
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
)
|
|
60
|
+
{data?.assigned_to && (
|
|
61
|
+
<div>Assigned to: {data.assigned_to}</div>
|
|
62
|
+
)}
|
|
63
|
+
{data?.completed_at && (
|
|
64
|
+
<div>
|
|
65
|
+
Completed On:{' '}
|
|
66
|
+
{`${formatUtcToLocal(data.completed_at)?.date} ${
|
|
67
|
+
formatUtcToLocal(data.completed_at)?.time
|
|
68
|
+
}`}
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
{data?.completed_by && <div>By: {data.completed_by}</div>}
|
|
59
72
|
</StyledTitle>
|
|
60
73
|
</>
|
|
61
74
|
}
|
|
@@ -79,12 +92,14 @@ const StyledTitle = styled.span<{ color: string }>`
|
|
|
79
92
|
font-weight: 600;
|
|
80
93
|
`;
|
|
81
94
|
|
|
82
|
-
const StyledLink = styled.span
|
|
95
|
+
const StyledLink = styled.span<{ $disable: boolean }>`
|
|
83
96
|
color: var(--contextual-blue, #6396e5);
|
|
84
97
|
font-family: Roboto;
|
|
85
98
|
font-size: 14px;
|
|
86
99
|
font-style: normal;
|
|
87
100
|
font-weight: 600;
|
|
101
|
+
cursor: ${props => (props?.$disable ? 'auto' : 'pointer')};
|
|
102
|
+
${props => props?.$disable && `pointer-events: none;`};
|
|
88
103
|
`;
|
|
89
104
|
|
|
90
105
|
export default ReminderTemplate;
|
|
@@ -22,7 +22,15 @@ import {
|
|
|
22
22
|
useAllOrderStatus,
|
|
23
23
|
} from '../order-actions/store';
|
|
24
24
|
import { useParams, useSearchParams } from 'react-router-dom';
|
|
25
|
-
|
|
25
|
+
import { useClientPortal } from '../../store';
|
|
26
|
+
import { Skeleton } from 'antd';
|
|
27
|
+
type ReminderResponse = {
|
|
28
|
+
data: ApiResponse[];
|
|
29
|
+
stats_count: {
|
|
30
|
+
pending: number;
|
|
31
|
+
overdue: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
26
34
|
interface ApiResponse {
|
|
27
35
|
message: string;
|
|
28
36
|
code: number;
|
|
@@ -44,7 +52,7 @@ function Notification() {
|
|
|
44
52
|
const [closedReminders, setCloseReminders] = useState([]);
|
|
45
53
|
const [activeTasks, setActiveTasks] = useState([]);
|
|
46
54
|
const [closedTasks, setCloseTasks] = useState([]);
|
|
47
|
-
const [idOfRoute
|
|
55
|
+
const [idOfRoute] = useRouteId();
|
|
48
56
|
const [, setStatusVal] = useAllOrderStatus();
|
|
49
57
|
const [searchParams] = useSearchParams();
|
|
50
58
|
const [orderAlertsData, setOrderAlertsData] = useOrderAlertsData();
|
|
@@ -52,6 +60,7 @@ function Notification() {
|
|
|
52
60
|
const { id } = useParams();
|
|
53
61
|
const [orderId, setOrderId] = useOrderId();
|
|
54
62
|
const routeId = orderData?.order_routes?.route_id;
|
|
63
|
+
const [isClientPortal] = useClientPortal();
|
|
55
64
|
|
|
56
65
|
useEffect(() => {
|
|
57
66
|
if (orderIdParams) {
|
|
@@ -73,7 +82,12 @@ function Notification() {
|
|
|
73
82
|
endpoint: `/v1/task/`,
|
|
74
83
|
method: 'GET',
|
|
75
84
|
pagination: { is_pagination: false },
|
|
76
|
-
filters:
|
|
85
|
+
filters: isClientPortal
|
|
86
|
+
? [
|
|
87
|
+
{ field: 'is_private', op: '=', value: 'false' },
|
|
88
|
+
{ field: 'order_id', op: '=', value: orderId },
|
|
89
|
+
]
|
|
90
|
+
: [{ field: 'order_id', op: '=', value: orderId }],
|
|
77
91
|
});
|
|
78
92
|
|
|
79
93
|
//reminder get
|
|
@@ -81,15 +95,20 @@ function Notification() {
|
|
|
81
95
|
data: fetchedReminderData,
|
|
82
96
|
loading: reminderLoading,
|
|
83
97
|
fetchData: callReminderApi,
|
|
84
|
-
} = useAxios<{
|
|
85
|
-
data: ApiResponse[];
|
|
86
|
-
}>({
|
|
98
|
+
} = useAxios<ReminderResponse>({
|
|
87
99
|
endpoint: `/v1/task/reminder/get/`,
|
|
88
100
|
method: 'GET',
|
|
89
101
|
pagination: { is_pagination: false },
|
|
90
102
|
filters: [{ field: 'order_id', op: '=', value: orderId }],
|
|
91
103
|
});
|
|
92
104
|
|
|
105
|
+
//reminder data set
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (fetchedReminderData && fetchedReminderData?.data) {
|
|
108
|
+
setReminderNotifyData(fetchedReminderData?.data);
|
|
109
|
+
}
|
|
110
|
+
}, [fetchedReminderData]);
|
|
111
|
+
|
|
93
112
|
useEffect(() => {
|
|
94
113
|
setStatusVal(orderData?.status_value);
|
|
95
114
|
}, [orderData?.status_value]);
|
|
@@ -107,13 +126,6 @@ function Notification() {
|
|
|
107
126
|
}
|
|
108
127
|
}, [unresolvedLoading, fetchedUnresolvedData]);
|
|
109
128
|
|
|
110
|
-
//reminder data set
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
if (fetchedReminderData && fetchedReminderData?.data) {
|
|
113
|
-
setReminderNotifyData(fetchedReminderData?.data);
|
|
114
|
-
}
|
|
115
|
-
}, [reminderLoading]);
|
|
116
|
-
|
|
117
129
|
// Route API calling...
|
|
118
130
|
const { data: fetchedData, fetchData: fetchRoute } = useAxios<{
|
|
119
131
|
data: ApiResponse[];
|
|
@@ -126,9 +138,6 @@ function Notification() {
|
|
|
126
138
|
if (idOfRoute !== null && idOfRoute !== undefined) {
|
|
127
139
|
fetchRoute();
|
|
128
140
|
}
|
|
129
|
-
return () => {
|
|
130
|
-
setRouteId(null);
|
|
131
|
-
};
|
|
132
141
|
}, [idOfRoute]);
|
|
133
142
|
|
|
134
143
|
const {
|
|
@@ -153,7 +162,7 @@ function Notification() {
|
|
|
153
162
|
if (orderId == null) return;
|
|
154
163
|
|
|
155
164
|
try {
|
|
156
|
-
await callReminderApi();
|
|
165
|
+
!isClientPortal && (await callReminderApi());
|
|
157
166
|
await callUnresolvedTaskApi();
|
|
158
167
|
await callOrderAlertsApi();
|
|
159
168
|
} catch (error) {
|
|
@@ -245,11 +254,80 @@ function Notification() {
|
|
|
245
254
|
</StyledTab>
|
|
246
255
|
</TabsData>
|
|
247
256
|
</Container>
|
|
248
|
-
{unresolvedLoading || reminderLoading ? (
|
|
249
|
-
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
257
|
+
{unresolvedLoading || reminderLoading || alertsApiLoading ? (
|
|
258
|
+
<>
|
|
259
|
+
<div
|
|
260
|
+
style={{
|
|
261
|
+
display: 'flex',
|
|
262
|
+
alignItems: 'center',
|
|
263
|
+
gap: 12,
|
|
264
|
+
}}
|
|
265
|
+
>
|
|
266
|
+
<Skeleton.Avatar active size="small" shape="circle" />
|
|
267
|
+
<Skeleton.Input
|
|
268
|
+
active
|
|
269
|
+
style={{
|
|
270
|
+
width: '100%',
|
|
271
|
+
height: 12,
|
|
272
|
+
borderRadius: 4,
|
|
273
|
+
}}
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
<div
|
|
278
|
+
style={{
|
|
279
|
+
display: 'flex',
|
|
280
|
+
alignItems: 'center',
|
|
281
|
+
gap: 12,
|
|
282
|
+
}}
|
|
283
|
+
>
|
|
284
|
+
<Skeleton.Avatar active size="small" shape="circle" />
|
|
285
|
+
<Skeleton.Input
|
|
286
|
+
active
|
|
287
|
+
style={{
|
|
288
|
+
width: '100%',
|
|
289
|
+
height: 12,
|
|
290
|
+
borderRadius: 4,
|
|
291
|
+
}}
|
|
292
|
+
/>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
<div
|
|
296
|
+
style={{
|
|
297
|
+
display: 'flex',
|
|
298
|
+
alignItems: 'center',
|
|
299
|
+
gap: 12,
|
|
300
|
+
}}
|
|
301
|
+
>
|
|
302
|
+
<Skeleton.Avatar active size="small" shape="circle" />
|
|
303
|
+
<Skeleton.Input
|
|
304
|
+
active
|
|
305
|
+
style={{
|
|
306
|
+
width: '100%',
|
|
307
|
+
height: 12,
|
|
308
|
+
borderRadius: 4,
|
|
309
|
+
}}
|
|
310
|
+
/>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<div
|
|
314
|
+
style={{
|
|
315
|
+
display: 'flex',
|
|
316
|
+
alignItems: 'center',
|
|
317
|
+
gap: 12,
|
|
318
|
+
}}
|
|
319
|
+
>
|
|
320
|
+
<Skeleton.Avatar active size="small" shape="circle" />
|
|
321
|
+
<Skeleton.Input
|
|
322
|
+
active
|
|
323
|
+
style={{
|
|
324
|
+
width: '100%',
|
|
325
|
+
height: 12,
|
|
326
|
+
borderRadius: 4,
|
|
327
|
+
}}
|
|
328
|
+
/>
|
|
329
|
+
</div>
|
|
330
|
+
</>
|
|
253
331
|
) : taskData?.length > 0 ||
|
|
254
332
|
reminderNotifyData?.length > 0 ||
|
|
255
333
|
orderData ? (
|
|
@@ -280,32 +358,6 @@ const Container = styled.div`
|
|
|
280
358
|
border-bottom: 1px solid #ccc;
|
|
281
359
|
`;
|
|
282
360
|
|
|
283
|
-
const Loader = styled.div`
|
|
284
|
-
align-items: center;
|
|
285
|
-
justify-content: center;
|
|
286
|
-
display: flex;
|
|
287
|
-
flex-direction: column;
|
|
288
|
-
gap: 10px;
|
|
289
|
-
`;
|
|
290
|
-
|
|
291
|
-
const Spinner = styled.div`
|
|
292
|
-
border: 4px solid rgba(0, 0, 0, 0.1);
|
|
293
|
-
border-left-color: #3a3630;
|
|
294
|
-
border-radius: 50%;
|
|
295
|
-
width: 40px;
|
|
296
|
-
height: 40px;
|
|
297
|
-
animation: spin 1s linear infinite;
|
|
298
|
-
|
|
299
|
-
@keyframes spin {
|
|
300
|
-
0% {
|
|
301
|
-
transform: rotate(0deg);
|
|
302
|
-
}
|
|
303
|
-
100% {
|
|
304
|
-
transform: rotate(360deg);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
`;
|
|
308
|
-
|
|
309
361
|
const FlagContainer = styled.div`
|
|
310
362
|
padding: 8px;
|
|
311
363
|
background-color: #3a3630;
|
|
@@ -391,11 +443,4 @@ const TabsWrapper = styled.div`
|
|
|
391
443
|
}
|
|
392
444
|
`;
|
|
393
445
|
|
|
394
|
-
const Text = styled.div`
|
|
395
|
-
color: var(--tonal-brown-651, #6a7378);
|
|
396
|
-
font-family: Lato;
|
|
397
|
-
font-size: 13px;
|
|
398
|
-
font-style: normal;
|
|
399
|
-
font-weight: 600;
|
|
400
|
-
`;
|
|
401
446
|
export default Notification;
|