@bjsdistribution/dms-client-return 0.0.94-prod → 0.0.95-prod

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.
Files changed (138) hide show
  1. package/dist/assets/icons/ArrowDownIcon.d.ts +6 -0
  2. package/dist/assets/icons/DeliverProductIcon.d.ts +3 -0
  3. package/dist/assets/icons/ReturnProductIcon.d.ts +3 -0
  4. package/dist/common/checkbox/index.d.ts +2 -0
  5. package/dist/common/modals/order-action-modal/OrderActionModal.d.ts +3 -1
  6. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.d.ts +1 -0
  7. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/MenuDropDown.d.ts +2 -2
  8. package/dist/components/order-view/flags-action-modal/Actions.d.ts +6 -2
  9. package/dist/components/order-view/flags-action-modal/Dropdowns.d.ts +1 -0
  10. package/dist/components/order-view/flags-action-modal/Header.d.ts +1 -1
  11. package/dist/components/order-view/notification/FlagTemplate.d.ts +1 -1
  12. package/dist/components/order-view/notification/OrderTemplate.d.ts +1 -1
  13. package/dist/components/order-view/notification/Tabs.d.ts +1 -1
  14. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.d.ts +5 -0
  15. package/dist/components/order-view/order-actions/actions/cancel-order/index.d.ts +7 -1
  16. package/dist/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.d.ts +4 -1
  17. package/dist/components/order-view/order-actions/actions/charge-log/index.d.ts +11 -0
  18. package/dist/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.d.ts +1 -13
  19. package/dist/components/order-view/order-actions/actions/create-task-reminder/TaskModal.d.ts +5 -1
  20. package/dist/components/order-view/order-actions/actions/create-task-reminder/index.d.ts +6 -2
  21. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +6 -1
  22. package/dist/components/order-view/order-actions/actions/log-service-refusal/DeliveryPoint.d.ts +5 -1
  23. package/dist/components/order-view/order-actions/actions/log-service-refusal/Notes.d.ts +5 -3
  24. package/dist/components/order-view/order-actions/actions/log-service-refusal/OrderServices.d.ts +5 -1
  25. package/dist/components/order-view/order-actions/actions/log-service-refusal/index.d.ts +1 -1
  26. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrder.d.ts +7 -1
  27. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.d.ts +5 -0
  28. package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +6 -1
  29. package/dist/components/order-view/order-actions/store.d.ts +10 -8
  30. package/dist/components/order-view/order-actions/types.d.ts +38 -60
  31. package/dist/components/order-view/order-actions/utils.d.ts +2 -1
  32. package/dist/components/order-view/store.d.ts +48 -3
  33. package/dist/components/order-view/types.d.ts +11 -0
  34. package/dist/components/order-view/utils.d.ts +1 -0
  35. package/dist/components/order-view/view-reminder/ViewReminder.d.ts +5 -1
  36. package/dist/components/order-view/view-reminder/reminder-styles.d.ts +3 -1
  37. package/dist/components/store.d.ts +2 -1
  38. package/dist/dms-client-return.cjs.development.js +4812 -3095
  39. package/dist/dms-client-return.cjs.development.js.map +1 -1
  40. package/dist/dms-client-return.cjs.production.min.js +1 -1
  41. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  42. package/dist/dms-client-return.esm.js +4815 -3098
  43. package/dist/dms-client-return.esm.js.map +1 -1
  44. package/package.json +2 -2
  45. package/src/assets/icons/ArrowDownIcon.tsx +28 -0
  46. package/src/assets/icons/DeliverProductIcon.tsx +42 -0
  47. package/src/assets/icons/ReturnProductIcon.tsx +23 -0
  48. package/src/common/checkbox/index.tsx +60 -17
  49. package/src/common/modals/order-action-modal/OrderActionModal.tsx +13 -7
  50. package/src/common/radio-group/RadioButtonGroup.tsx +3 -4
  51. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +29 -26
  52. package/src/components/order-daily-overview/header-filters/filterStore.ts +6 -8
  53. package/src/components/order-daily-overview/index.tsx +20 -7
  54. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +2 -2
  55. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +19 -19
  56. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +11 -9
  57. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +19 -4
  58. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +41 -59
  59. package/src/components/order-daily-overview/table/ReturnTable.tsx +1 -30
  60. package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +52 -2
  61. package/src/components/order-view/details-filters/left-side-filters/dropdowns/MenuDropDown.tsx +37 -43
  62. package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +75 -44
  63. package/src/components/order-view/fakedata.ts +7 -6
  64. package/src/components/order-view/flags-action-modal/Actions.tsx +51 -25
  65. package/src/components/order-view/flags-action-modal/DetailSection.tsx +5 -5
  66. package/src/components/order-view/flags-action-modal/Dropdowns.tsx +75 -89
  67. package/src/components/order-view/flags-action-modal/Header.tsx +32 -23
  68. package/src/components/order-view/flags-action-modal/TextSection.tsx +9 -6
  69. package/src/components/order-view/flags-action-modal/index.tsx +54 -67
  70. package/src/components/order-view/general-information/dropdowns/Print.tsx +136 -70
  71. package/src/components/order-view/generic-table/AuditLogs.tsx +5 -4
  72. package/src/components/order-view/index.tsx +9 -42
  73. package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +20 -18
  74. package/src/components/order-view/modalsPopup/ModalManager.tsx +4 -10
  75. package/src/components/order-view/notes/logs/index.tsx +1 -1
  76. package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +5 -7
  77. package/src/components/order-view/notification/FlagTemplate.tsx +8 -8
  78. package/src/components/order-view/notification/OrderTemplate.tsx +169 -175
  79. package/src/components/order-view/notification/ReminderTemplate.tsx +23 -14
  80. package/src/components/order-view/notification/Tabs.tsx +15 -14
  81. package/src/components/order-view/notification/index.tsx +164 -92
  82. package/src/components/order-view/order-actions/actions/add-resources/index.tsx +19 -29
  83. package/src/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.tsx +345 -0
  84. package/src/components/order-view/order-actions/actions/cancel-order/index.tsx +146 -71
  85. package/src/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.tsx +95 -32
  86. package/src/components/order-view/order-actions/actions/charge-log/index.tsx +395 -0
  87. package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +1 -1
  88. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ActionDropdown.tsx +34 -17
  89. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactMobile.tsx +2 -3
  90. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactPhone.tsx +2 -3
  91. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactWork.tsx +2 -3
  92. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/DeliveryDate.tsx +39 -25
  93. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/EmailAddress.tsx +1 -1
  94. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/TimedServiceDropdown.tsx +4 -2
  95. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/index.tsx +1 -1
  96. package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +254 -66
  97. package/src/components/order-view/order-actions/actions/confirm-order/slot-and-instructions/index.tsx +1 -1
  98. package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +13 -9
  99. package/src/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.tsx +1 -1
  100. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +213 -117
  101. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +97 -152
  102. package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +30 -87
  103. package/src/components/order-view/order-actions/actions/create-task-reminder/index.tsx +77 -83
  104. package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +57 -65
  105. package/src/components/order-view/order-actions/actions/log-service-refusal/DeliveryPoint.tsx +10 -16
  106. package/src/components/order-view/order-actions/actions/log-service-refusal/Notes.tsx +21 -4
  107. package/src/components/order-view/order-actions/actions/log-service-refusal/OrderServices.tsx +39 -11
  108. package/src/components/order-view/order-actions/actions/log-service-refusal/index.tsx +79 -8
  109. package/src/components/order-view/order-actions/actions/send-email/SendEmailModal.tsx +114 -17
  110. package/src/components/order-view/order-actions/actions/send-sms/SendSmsModal.tsx +115 -7
  111. package/src/components/order-view/order-actions/actions/split-order/index.tsx +14 -4
  112. package/src/components/order-view/order-actions/actions/uncancel-order/UncancelOrder.tsx +176 -87
  113. package/src/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.tsx +352 -0
  114. package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +35 -59
  115. package/src/components/order-view/order-actions/index.tsx +237 -22
  116. package/src/components/order-view/order-actions/store.ts +50 -48
  117. package/src/components/order-view/order-actions/types.ts +40 -65
  118. package/src/components/order-view/order-actions/utils.ts +15 -8
  119. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +2 -1
  120. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +80 -39
  121. package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +10 -14
  122. package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +10 -1
  123. package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +2 -1
  124. package/src/components/order-view/products-info/expanded-content/index.tsx +3 -2
  125. package/src/components/order-view/products-info/index.tsx +14 -11
  126. package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +26 -24
  127. package/src/components/order-view/store.ts +59 -2
  128. package/src/components/order-view/system-event-logs/columns/Date.tsx +4 -2
  129. package/src/components/order-view/system-event-logs/columns/Event.tsx +9 -9
  130. package/src/components/order-view/system-event-logs/columns/Note.tsx +1 -1
  131. package/src/components/order-view/system-event-logs/expanded-content/index.tsx +25 -25
  132. package/src/components/order-view/types.ts +13 -0
  133. package/src/components/order-view/utils.ts +4 -0
  134. package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +183 -12
  135. package/src/components/order-view/view-reminder/ViewReminder.tsx +234 -143
  136. package/src/components/order-view/view-reminder/reminder-styles.tsx +14 -8
  137. package/src/components/store.ts +6 -0
  138. package/src/index.tsx +28 -18
@@ -1,32 +1,100 @@
1
- import React from 'react';
2
- import { AntSelect } from '@bjsdistribution/dms-component-library';
1
+ import React, { useState } from 'react';
2
+ import { AntSelect, useAxios } from '@bjsdistribution/dms-component-library';
3
3
  import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
4
4
  import { ContentContainer, Label, Row, SplitLayout } from '../modalstyle';
5
- import { useCurrentAction } from '../../../store';
6
- import { notification } from 'antd';
7
- import { optionsMenu } from '../../../fakedata';
5
+ import {
6
+ useCurrentAction,
7
+ useCustomerData,
8
+ useOrderDetails,
9
+ useOrderId,
10
+ } from '../../../store';
11
+ import { Input, notification } from 'antd';
12
+ import { ApiResponse } from '../../../types';
13
+ interface IProps {
14
+ callOrdersApi?: any;
15
+ }
8
16
 
9
- function ChangeCustomerAccModal() {
17
+ function ChangeCustomerAccModal(props: IProps) {
18
+ const [orderId] = useOrderId();
19
+ const [customerData] = useCustomerData();
10
20
  const [, setCurrentAction] = useCurrentAction();
21
+ const [orderDetails] = useOrderDetails();
22
+ const [selectedCustomerId, setSelectedCustomerId] = useState<any>(
23
+ orderDetails?.customer_id ?? null
24
+ );
25
+ const [tradingName, setTradingName] = useState<string>(
26
+ orderDetails?.trading_name || ''
27
+ );
28
+ const orderRecipient = orderDetails?.order_recipient;
29
+ const infoText = `${orderRecipient?.recipient_name}, ${orderRecipient?.postcode}`;
30
+ const closeModal = () => setCurrentAction(undefined);
31
+
32
+ const customerMappedData = customerData?.map((customer: any) => ({
33
+ label: customer?.customer_name,
34
+ value: customer?.id,
35
+ }));
36
+
37
+ const { fetchData } = useAxios<{
38
+ data: ApiResponse[];
39
+ }>({
40
+ endpoint: `/orders/change_customer_account`,
41
+ method: 'PUT',
42
+ });
43
+
44
+ const handleChangeAcc = async () => {
45
+ if (selectedCustomerId == null || !tradingName?.trim()) {
46
+ notification.warning({
47
+ message: 'Validation Error',
48
+ description: 'Please select a customer and enter a trading name.',
49
+ });
50
+ return;
51
+ }
11
52
 
12
- const closeModal = () => {
13
- setCurrentAction(undefined);
53
+ try {
54
+ const payload = [
55
+ {
56
+ order_id: +orderId,
57
+ customer_id: +selectedCustomerId,
58
+ trading_name: tradingName,
59
+ },
60
+ ];
61
+ const response = (await fetchData({ payload })) as {
62
+ code: number | null;
63
+ error?: string | null | undefined;
64
+ [key: string]: any;
65
+ };
66
+
67
+ if (response?.code === 200) {
68
+ notification.success({
69
+ message: 'Success',
70
+ description: `${response.message}`,
71
+ });
72
+ await props?.callOrdersApi();
73
+ closeModal();
74
+ }
75
+ } catch {
76
+ notification.error({
77
+ message: 'Error',
78
+ description: 'Something went wrong while saving.',
79
+ });
80
+ }
14
81
  };
15
82
 
16
- const handleSelectChange = () => {
17
- // alert('hello');
18
- notification.success({
19
- message: 'Success',
20
- description: 'Saved successfully.',
21
- });
83
+ const handleSelectChange = (value: string) => {
84
+ setSelectedCustomerId(+value);
85
+ const selected = customerMappedData?.find(c => c?.value === +value);
86
+ if (selected) {
87
+ setSelectedCustomerId(selected?.value);
88
+ }
22
89
  };
90
+
23
91
  return (
24
92
  <OrderActionModal
25
93
  headerTitle="Change customer account"
26
94
  onCloseHeader={closeModal}
27
- onSubmit={() => {}}
95
+ onSubmit={handleChangeAcc}
28
96
  showAdditionalInfo
29
- infoText="632801 (OFS)"
97
+ infoText={infoText}
30
98
  submitBtnTitle="Save Details"
31
99
  >
32
100
  <ContentContainer>
@@ -34,29 +102,24 @@ function ChangeCustomerAccModal() {
34
102
  <Row>
35
103
  <Label>New Customer</Label>
36
104
  <AntSelect
37
- options={optionsMenu}
105
+ options={customerMappedData}
38
106
  placeholder="Select Customer"
39
107
  onChange={handleSelectChange}
40
- disabled={false}
41
108
  style={{ width: '22vw', height: 40 }}
42
- showSearch={true}
43
- popupClassName={'dropDownStyle'}
44
- selectWrapperClass={'rounded'}
45
- ></AntSelect>
109
+ showSearch
110
+ popupClassName="dropDownStyle"
111
+ selectWrapperClass="rounded"
112
+ defaultValue={selectedCustomerId}
113
+ />
46
114
  </Row>
47
115
 
48
116
  <Row>
49
117
  <Label>New Trading Name</Label>
50
- <AntSelect
51
- options={optionsMenu}
52
- placeholder="Select Trading Name"
53
- onChange={handleSelectChange}
54
- disabled={false}
55
- style={{ width: '22vw', height: 40 }}
56
- showSearch={true}
57
- popupClassName={'dropDownStyle'}
58
- selectWrapperClass={'rounded'}
59
- ></AntSelect>
118
+ <Input
119
+ style={{ borderRadius: '15px', minWidth: '22vw' }}
120
+ value={tradingName}
121
+ onChange={e => setTradingName(e.target.value)}
122
+ />
60
123
  </Row>
61
124
  </SplitLayout>
62
125
  </ContentContainer>
@@ -0,0 +1,395 @@
1
+ import React, { useEffect } from 'react';
2
+ import { useAxios } from '@bjsdistribution/dms-component-library';
3
+ import {
4
+ useCurrentAction,
5
+ useCustomerInfo,
6
+ useOrderDetails,
7
+ } from '../../../store';
8
+ import { ApiResponse } from '../../../types';
9
+ import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
10
+ import { Empty, Skeleton } from 'antd';
11
+
12
+ import styled from 'styled-components';
13
+
14
+ function ChargeLog() {
15
+ const [, setCurrentAction] = useCurrentAction();
16
+ const [customerInfo] = useCustomerInfo();
17
+ const infoText = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;
18
+ const [orderDetails] = useOrderDetails();
19
+
20
+ const closeModal = () => {
21
+ setCurrentAction(undefined);
22
+ };
23
+
24
+ const { data: fetchedData, loading, fetchData } = useAxios<{
25
+ data: ApiResponse[];
26
+ }>({
27
+ endpoint: `/invoices/charge-logs/?order_id=${orderDetails?.id}`,
28
+ method: 'GET',
29
+ });
30
+
31
+ useEffect(() => {
32
+ fetchData();
33
+ }, []);
34
+
35
+ return (
36
+ <OrderActionModal
37
+ headerTitle="Charges For"
38
+ onCloseHeader={closeModal}
39
+ onSubmit={closeModal}
40
+ submitBtnTitle="Close"
41
+ showAdditionalInfo
42
+ infoText={infoText}
43
+ >
44
+ <StyledTableWrapper>
45
+ <StyledTable className="scrollClass">
46
+ <thead>
47
+ <tr>
48
+ <th>Date</th>
49
+ <th>Description</th>
50
+ <th>Amount</th>
51
+ <th>Status</th>
52
+ </tr>
53
+ </thead>
54
+ <tbody>
55
+ {loading ? (
56
+ <tr>
57
+ <td colSpan={6}>
58
+ <Skeleton active />
59
+ </td>
60
+ <td colSpan={6}></td>
61
+ </tr>
62
+ ) : fetchedData?.data?.length === 0 ? (
63
+ <tr>
64
+ <td className="emptyTd" colSpan={7}>
65
+ <EmptyDataContainer>
66
+ <Empty />
67
+ </EmptyDataContainer>
68
+ </td>
69
+ </tr>
70
+ ) : (
71
+ fetchedData?.data?.map((order: any) => {
72
+ const label = order?.status?.split(':')[0];
73
+ const val = order?.status?.split(':')[1];
74
+ return (
75
+ <tr>
76
+ <td>{order?.date}</td>
77
+ <td>{order?.description}</td>
78
+ <td>{order?.amount}</td>
79
+ <td>
80
+ <div
81
+ style={{
82
+ display: 'flex',
83
+ alignItems: 'center',
84
+ gap: '5px',
85
+ }}
86
+ >
87
+ {label}: <Value>{val}</Value>
88
+ </div>
89
+ </td>
90
+ </tr>
91
+ );
92
+ })
93
+ )}
94
+ </tbody>
95
+ </StyledTable>
96
+ </StyledTableWrapper>
97
+ </OrderActionModal>
98
+ );
99
+ }
100
+ // Styled components
101
+ export const StyledTableWrapper = styled.div`
102
+ overflow-x: auto;
103
+ max-height: calc(100vh - 290px);
104
+ scrollbar-width: none;
105
+ width: 100%;
106
+ /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */
107
+ &::-webkit-scrollbar {
108
+ width: 5px;
109
+ border-radius: 100px;
110
+ height: 5px;
111
+ }
112
+
113
+ &::-webkit-scrollbar-track {
114
+ background: #777;
115
+ border-radius: 100px;
116
+ }
117
+
118
+ &::-webkit-scrollbar-thumb {
119
+ background: #7b61ff;
120
+ border-radius: 100px;
121
+ }
122
+
123
+ &::-webkit-scrollbar-thumb:hover {
124
+ background: #7b61ff;
125
+ }
126
+ `;
127
+
128
+ export const StyledTable = styled.table`
129
+ border-spacing: 0 10px;
130
+ width: 100%;
131
+ padding: 10px;
132
+ thead {
133
+ tr {
134
+ border-radius: 40px;
135
+ border-spacing: 0 10px;
136
+ th {
137
+ color: #3a3630;
138
+ font-size: 14px;
139
+ font-style: normal;
140
+ font-weight: 600;
141
+ line-height: normal;
142
+ padding: 5px 15px;
143
+ background: #f0f2f2;
144
+ border-right: none;
145
+ border-left: none;
146
+ text-align: left;
147
+ border: 1px solid rgba(0, 0, 0, 0.08);
148
+ border-width: 1px 0;
149
+ text-transform: capitalize;
150
+ &:first-child {
151
+ border-radius: 100px 0 0 100px;
152
+ border-left: 1px solid rgba(0, 0, 0, 0.08);
153
+ }
154
+ &:last-child {
155
+ border-radius: 0px 100px 100px 0;
156
+ border-right: 1px solid rgba(0, 0, 0, 0.08);
157
+ }
158
+ }
159
+ }
160
+ }
161
+ tbody {
162
+ tr {
163
+ td {
164
+ color: #3a3630;
165
+ font-size: 13px;
166
+ font-style: normal;
167
+ font-weight: 400;
168
+ line-height: normal;
169
+ padding: 12px 15px;
170
+ background: #fff;
171
+ border: 1px solid rgba(0, 0, 0, 0.08);
172
+ border-right: none;
173
+ border-left: none;
174
+ }
175
+ .link {
176
+ color: #09f;
177
+ font-family: Roboto;
178
+ font-weight: 400;
179
+ .linkHover {
180
+ cursor: pointer;
181
+ }
182
+ }
183
+ td {
184
+ .flex {
185
+ display: flex;
186
+ gap: 4px;
187
+ align-items: center;
188
+ }
189
+ .overDue {
190
+ border-radius: 20px;
191
+ border: 1px solid #edebe8;
192
+ background: #fff;
193
+ padding: 4px 8px;
194
+ color: #e95252;
195
+ font-size: 12px;
196
+ font-style: normal;
197
+ font-weight: 600;
198
+ line-height: 16px;
199
+ }
200
+ }
201
+ &:nth-child(even) td {
202
+ background: #f6fbff;
203
+ }
204
+ td:first-child {
205
+ border-radius: 100px 0 0 100px;
206
+ border-left: 1px solid rgba(0, 0, 0, 0.08);
207
+ }
208
+ td:last-child {
209
+ border-radius: 0px 100px 100px 0;
210
+ border-right: 1px solid rgba(0, 0, 0, 0.08);
211
+ }
212
+ .emptyTd {
213
+ border-radius: 100px !important;
214
+ }
215
+ .flex {
216
+ display: flex;
217
+ flex-direction: row;
218
+ gap: 5px;
219
+ height: 29px;
220
+ align-items: center;
221
+ }
222
+
223
+ &.insideTable {
224
+ td {
225
+ border-radius: 0;
226
+ border: none;
227
+ &:last-child {
228
+ border-radius: 0;
229
+ border-right: none;
230
+ }
231
+ }
232
+ table {
233
+ border-spacing: 0;
234
+ width: 100%;
235
+ border-radius: 5px;
236
+ border: 1px solid rgba(0, 0, 0, 0.08);
237
+ overflow: hidden;
238
+ border-top-left-radius: 15px;
239
+ border-top-right-radius: 15px;
240
+ thead {
241
+ tr {
242
+ border-bottom: none;
243
+ th {
244
+ padding: 14px 20px;
245
+ text-align: left;
246
+ border-top: 0;
247
+ border-right: 0;
248
+ border-left: 0;
249
+ background: #f8fafc;
250
+ &:first-child {
251
+ border-radius: 0;
252
+ border-left: 1px solid rgba(0, 0, 0, 0.08);
253
+ border-top-left-radius: 15px;
254
+ }
255
+ &:last-child {
256
+ border-radius: 0;
257
+ }
258
+ }
259
+ }
260
+ }
261
+ tbody {
262
+ tr {
263
+ td {
264
+ padding: 14px 20px;
265
+ text-align: left;
266
+ border-bottom: 1px solid rgba(58, 54, 48, 0.15);
267
+ background: #fff;
268
+ > svg {
269
+ transform: scale(1.5);
270
+ background-color: #edebe8;
271
+ border-radius: 20px;
272
+ padding: 5px;
273
+ }
274
+ &:last-child {
275
+ border-radius: 0;
276
+ border-right: none;
277
+ }
278
+ }
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+ .actions {
286
+ display: flex;
287
+ align-items: center;
288
+ gap: 20px;
289
+ > svg {
290
+ transform: scale(1.5);
291
+ background-color: #edebe8;
292
+ border-radius: 20px;
293
+ padding: 5px;
294
+ }
295
+
296
+ .close-icon {
297
+ transform: scale(1.3);
298
+ background-color: transparent;
299
+ border-radius: 0;
300
+ padding: 0;
301
+ }
302
+ }
303
+ `;
304
+
305
+ export const EmptyDataContainer = styled.div`
306
+ display: flex;
307
+ justify-content: center;
308
+ `;
309
+
310
+ export const Badge = styled.div`
311
+ div {
312
+ display: flex;
313
+ min-width: 85px;
314
+ padding: 6px 10px;
315
+ justify-content: center;
316
+ align-items: center;
317
+ gap: 5px;
318
+ border-radius: 22px;
319
+ font-family: 'Open Sans';
320
+ font-size: 12px;
321
+ font-style: normal;
322
+ font-weight: 600;
323
+ line-height: normal;
324
+ }
325
+ `;
326
+
327
+ export const BadgeStatus = styled.div`
328
+ &.pending {
329
+ background: #fff1d6;
330
+ color: #f4a503;
331
+ }
332
+
333
+ &.resolved {
334
+ background: rgba(41, 204, 106, 0.15);
335
+ color: #1f9254;
336
+ }
337
+
338
+ &.overdue {
339
+ background: rgba(233, 82, 82, 0.15);
340
+ color: var(--contextual-red, #e95252);
341
+ }
342
+ `;
343
+
344
+ export const ClearAll = styled.div`
345
+ border-radius: 20px;
346
+ border: 1px solid #edebe8;
347
+ background: #fff;
348
+ display: flex;
349
+ padding: 6px 6px;
350
+ justify-content: center;
351
+ align-items: center;
352
+ gap: 8px;
353
+ cursor: pointer;
354
+
355
+ &.active {
356
+ background: #313130;
357
+ & > div {
358
+ color: #fff;
359
+ }
360
+ }
361
+ `;
362
+ export const StyledFilterBtnIcon = styled.div`
363
+ display: flex;
364
+ width: 24px;
365
+ height: 24px;
366
+ justify-content: center;
367
+ align-items: center;
368
+ border-radius: 20px;
369
+ border: 1px solid #e2e0db;
370
+ background: #f1f5f6;
371
+ .cross {
372
+ position: relative;
373
+ &:after {
374
+ display: inline-block;
375
+ content: 'X';
376
+ font-style: normal;
377
+ font-size: 14px;
378
+ color: #000;
379
+ }
380
+ }
381
+ `;
382
+ export const StyledFilterBtnLabel = styled.div`
383
+ color: #6a7378;
384
+ font-size: 13px;
385
+ font-style: normal;
386
+ font-weight: 400;
387
+ line-height: 16px;
388
+ white-space: nowrap;
389
+ `;
390
+
391
+ export default ChargeLog;
392
+
393
+ const Value = styled.span`
394
+ color: #29cc6a;
395
+ `;
@@ -44,7 +44,7 @@ const ClearBookingStatus = () => {
44
44
 
45
45
  useEffect(() => {
46
46
  setLoading(loading);
47
- if (fetchedData && fetchedData.data) {
47
+ if (fetchedData && fetchedData?.data) {
48
48
  const requiredData = fetchedData?.data;
49
49
  setOrderDetails(requiredData[0]);
50
50
  setPrevOrderDetails(requiredData[0]);
@@ -1,38 +1,55 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import OrderActionsDropdown from '../../../Dropdown';
3
- import { useOrderStaticData } from '../../../../store';
2
+ import { useOrderStaticData, useSelectionAction } from '../../../../store';
4
3
  import { capitalize } from '../../../../utils';
4
+ import { Select } from 'antd';
5
+ import { Label } from '@bjsdistribution/dms-component-library';
6
+ import styled from 'styled-components';
5
7
 
6
8
  function ActionDropdown() {
7
9
  const [orderStaticData] = useOrderStaticData();
8
- const [actionTypeOptions, setActionTypeOptions] = useState<any[]>([]);
10
+ const [actionTypeOptions, setActionTypeOptions] = useState<any>([]);
11
+ const [selectedAction, setSelectedAction] = useSelectionAction();
9
12
 
10
13
  useEffect(() => {
11
14
  if (orderStaticData) {
12
15
  const options = orderStaticData?.order_contact_action_type?.map(
13
16
  (option: any) => ({
14
- label: capitalize(option.type.replaceAll('_', ' ')),
15
- value: option.id,
17
+ label: capitalize(option?.type?.replaceAll('_', ' ')), // Display text
18
+ value: option?.type,
16
19
  })
17
20
  );
18
21
  setActionTypeOptions(options);
22
+
23
+ if (options?.length > 0 && !selectedAction) {
24
+ setSelectedAction(options[0]?.value);
25
+ }
19
26
  }
20
27
  }, [orderStaticData]);
21
-
22
- const onSelect = () => {};
23
- const onSearch = () => {};
28
+ const onSelect = (value: any) => {
29
+ setSelectedAction(value);
30
+ };
24
31
 
25
32
  return (
26
- <OrderActionsDropdown
27
- label="Action"
28
- placeholder="Select Action"
29
- options={actionTypeOptions}
30
- value={actionTypeOptions?.find(option => option.value === 7)}
31
- onSelect={onSelect}
32
- onSearch={onSearch}
33
- className="action-dropdown"
34
- />
33
+ <Container>
34
+ <Label label="Action" />
35
+ <Select
36
+ style={{ minWidth: '260px' }}
37
+ placeholder="Select Action"
38
+ options={actionTypeOptions}
39
+ value={selectedAction || undefined}
40
+ onChange={onSelect}
41
+ className="action-dropdown"
42
+ />
43
+ </Container>
35
44
  );
36
45
  }
37
46
 
47
+ const Container = styled.div`
48
+ display: flex;
49
+ flex-direction: column;
50
+ .ant-select-selector {
51
+ border-radius: 25px;
52
+ }
53
+ `;
54
+
38
55
  export default ActionDropdown;
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { Input } from 'antd';
4
-
5
- import { handleKeyDown } from '../../../../utils';
6
4
  import {
7
5
  useErrorConfirmOrder,
8
6
  useOrderDetailsConfirmOrder,
9
- } from '../../../store';
7
+ } from '../../../../store';
8
+ import { handleKeyDown } from '../../../../utils';
10
9
 
11
10
  function ContactMobile() {
12
11
  const [orderDetails, setOrderDetails] = useOrderDetailsConfirmOrder();
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { Input } from 'antd';
4
-
5
- import { handleKeyDown } from '../../../../utils';
6
4
  import {
7
5
  useErrorConfirmOrder,
8
6
  useOrderDetailsConfirmOrder,
9
- } from '../../../store';
7
+ } from '../../../../store';
8
+ import { handleKeyDown } from '../../../../utils';
10
9
 
11
10
  function ContactPhone() {
12
11
  const [orderDetails, setOrderDetails] = useOrderDetailsConfirmOrder();
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { Input } from 'antd';
4
-
5
- import { handleKeyDown } from '../../../../utils';
6
4
  import {
7
5
  useErrorConfirmOrder,
8
6
  useOrderDetailsConfirmOrder,
9
- } from '../../../store';
7
+ } from '../../../../store';
8
+ import { handleKeyDown } from '../../../../utils';
10
9
 
11
10
  function ContactWork() {
12
11
  const [orderDetails, setOrderDetails] = useOrderDetailsConfirmOrder();