@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.
- package/dist/assets/icons/ArrowDownIcon.d.ts +6 -0
- package/dist/assets/icons/DeliverProductIcon.d.ts +3 -0
- package/dist/assets/icons/ReturnProductIcon.d.ts +3 -0
- package/dist/common/checkbox/index.d.ts +2 -0
- package/dist/common/modals/order-action-modal/OrderActionModal.d.ts +3 -1
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.d.ts +1 -0
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/MenuDropDown.d.ts +2 -2
- package/dist/components/order-view/flags-action-modal/Actions.d.ts +6 -2
- package/dist/components/order-view/flags-action-modal/Dropdowns.d.ts +1 -0
- package/dist/components/order-view/flags-action-modal/Header.d.ts +1 -1
- package/dist/components/order-view/notification/FlagTemplate.d.ts +1 -1
- package/dist/components/order-view/notification/OrderTemplate.d.ts +1 -1
- package/dist/components/order-view/notification/Tabs.d.ts +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.d.ts +5 -0
- package/dist/components/order-view/order-actions/actions/cancel-order/index.d.ts +7 -1
- package/dist/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.d.ts +4 -1
- package/dist/components/order-view/order-actions/actions/charge-log/index.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.d.ts +1 -13
- package/dist/components/order-view/order-actions/actions/create-task-reminder/TaskModal.d.ts +5 -1
- package/dist/components/order-view/order-actions/actions/create-task-reminder/index.d.ts +6 -2
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +6 -1
- package/dist/components/order-view/order-actions/actions/log-service-refusal/DeliveryPoint.d.ts +5 -1
- package/dist/components/order-view/order-actions/actions/log-service-refusal/Notes.d.ts +5 -3
- package/dist/components/order-view/order-actions/actions/log-service-refusal/OrderServices.d.ts +5 -1
- package/dist/components/order-view/order-actions/actions/log-service-refusal/index.d.ts +1 -1
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrder.d.ts +7 -1
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.d.ts +5 -0
- package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +6 -1
- package/dist/components/order-view/order-actions/store.d.ts +10 -8
- package/dist/components/order-view/order-actions/types.d.ts +38 -60
- package/dist/components/order-view/order-actions/utils.d.ts +2 -1
- package/dist/components/order-view/store.d.ts +48 -3
- package/dist/components/order-view/types.d.ts +11 -0
- package/dist/components/order-view/utils.d.ts +1 -0
- package/dist/components/order-view/view-reminder/ViewReminder.d.ts +5 -1
- package/dist/components/order-view/view-reminder/reminder-styles.d.ts +3 -1
- package/dist/components/store.d.ts +2 -1
- package/dist/dms-client-return.cjs.development.js +4812 -3095
- 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 +4815 -3098
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/assets/icons/ArrowDownIcon.tsx +28 -0
- package/src/assets/icons/DeliverProductIcon.tsx +42 -0
- package/src/assets/icons/ReturnProductIcon.tsx +23 -0
- package/src/common/checkbox/index.tsx +60 -17
- package/src/common/modals/order-action-modal/OrderActionModal.tsx +13 -7
- package/src/common/radio-group/RadioButtonGroup.tsx +3 -4
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +29 -26
- package/src/components/order-daily-overview/header-filters/filterStore.ts +6 -8
- package/src/components/order-daily-overview/index.tsx +20 -7
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +2 -2
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +19 -19
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +11 -9
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +19 -4
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +41 -59
- package/src/components/order-daily-overview/table/ReturnTable.tsx +1 -30
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +52 -2
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/MenuDropDown.tsx +37 -43
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +75 -44
- package/src/components/order-view/fakedata.ts +7 -6
- package/src/components/order-view/flags-action-modal/Actions.tsx +51 -25
- package/src/components/order-view/flags-action-modal/DetailSection.tsx +5 -5
- package/src/components/order-view/flags-action-modal/Dropdowns.tsx +75 -89
- package/src/components/order-view/flags-action-modal/Header.tsx +32 -23
- package/src/components/order-view/flags-action-modal/TextSection.tsx +9 -6
- package/src/components/order-view/flags-action-modal/index.tsx +54 -67
- package/src/components/order-view/general-information/dropdowns/Print.tsx +136 -70
- package/src/components/order-view/generic-table/AuditLogs.tsx +5 -4
- package/src/components/order-view/index.tsx +9 -42
- package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +20 -18
- package/src/components/order-view/modalsPopup/ModalManager.tsx +4 -10
- package/src/components/order-view/notes/logs/index.tsx +1 -1
- package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +5 -7
- package/src/components/order-view/notification/FlagTemplate.tsx +8 -8
- package/src/components/order-view/notification/OrderTemplate.tsx +169 -175
- package/src/components/order-view/notification/ReminderTemplate.tsx +23 -14
- package/src/components/order-view/notification/Tabs.tsx +15 -14
- package/src/components/order-view/notification/index.tsx +164 -92
- package/src/components/order-view/order-actions/actions/add-resources/index.tsx +19 -29
- package/src/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.tsx +345 -0
- package/src/components/order-view/order-actions/actions/cancel-order/index.tsx +146 -71
- package/src/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.tsx +95 -32
- package/src/components/order-view/order-actions/actions/charge-log/index.tsx +395 -0
- package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +1 -1
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ActionDropdown.tsx +34 -17
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactMobile.tsx +2 -3
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactPhone.tsx +2 -3
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactWork.tsx +2 -3
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/DeliveryDate.tsx +39 -25
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/EmailAddress.tsx +1 -1
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/TimedServiceDropdown.tsx +4 -2
- package/src/components/order-view/order-actions/actions/confirm-order/customer-info/index.tsx +1 -1
- package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +254 -66
- package/src/components/order-view/order-actions/actions/confirm-order/slot-and-instructions/index.tsx +1 -1
- package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +13 -9
- package/src/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.tsx +1 -1
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +213 -117
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +97 -152
- package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +30 -87
- package/src/components/order-view/order-actions/actions/create-task-reminder/index.tsx +77 -83
- package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +57 -65
- package/src/components/order-view/order-actions/actions/log-service-refusal/DeliveryPoint.tsx +10 -16
- package/src/components/order-view/order-actions/actions/log-service-refusal/Notes.tsx +21 -4
- package/src/components/order-view/order-actions/actions/log-service-refusal/OrderServices.tsx +39 -11
- package/src/components/order-view/order-actions/actions/log-service-refusal/index.tsx +79 -8
- package/src/components/order-view/order-actions/actions/send-email/SendEmailModal.tsx +114 -17
- package/src/components/order-view/order-actions/actions/send-sms/SendSmsModal.tsx +115 -7
- package/src/components/order-view/order-actions/actions/split-order/index.tsx +14 -4
- package/src/components/order-view/order-actions/actions/uncancel-order/UncancelOrder.tsx +176 -87
- package/src/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.tsx +352 -0
- package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +35 -59
- package/src/components/order-view/order-actions/index.tsx +237 -22
- package/src/components/order-view/order-actions/store.ts +50 -48
- package/src/components/order-view/order-actions/types.ts +40 -65
- package/src/components/order-view/order-actions/utils.ts +15 -8
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +80 -39
- package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +10 -14
- package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +10 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +2 -1
- package/src/components/order-view/products-info/expanded-content/index.tsx +3 -2
- package/src/components/order-view/products-info/index.tsx +14 -11
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +26 -24
- package/src/components/order-view/store.ts +59 -2
- package/src/components/order-view/system-event-logs/columns/Date.tsx +4 -2
- package/src/components/order-view/system-event-logs/columns/Event.tsx +9 -9
- package/src/components/order-view/system-event-logs/columns/Note.tsx +1 -1
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +25 -25
- package/src/components/order-view/types.ts +13 -0
- package/src/components/order-view/utils.ts +4 -0
- package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +183 -12
- package/src/components/order-view/view-reminder/ViewReminder.tsx +234 -143
- package/src/components/order-view/view-reminder/reminder-styles.tsx +14 -8
- package/src/components/store.ts +6 -0
- package/src/index.tsx +28 -18
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.95-prod",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"testEnvironment": "jest-environment-jsdom-sixteen"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@bjsdistribution/dms-component-library": "0.
|
|
62
|
+
"@bjsdistribution/dms-component-library": "0.3.14-prod",
|
|
63
63
|
"@size-limit/preset-small-lib": "^11.0.1",
|
|
64
64
|
"@tippyjs/react": "^4.2.6",
|
|
65
65
|
"@types/react": "^18.2.47",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ArrowDownIconProps {
|
|
4
|
+
fill?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const ArrowDownIcon: React.FC<ArrowDownIconProps> = ({ fill = '#3A3630' }) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
width="24"
|
|
11
|
+
height="24"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<rect width="24" height="24" fill={fill} />
|
|
17
|
+
<path
|
|
18
|
+
opacity="0.4"
|
|
19
|
+
fill-rule="evenodd"
|
|
20
|
+
clip-rule="evenodd"
|
|
21
|
+
d="M6.69104 9.8912C6.82604 9.75637 7.00903 9.68063 7.19984 9.68063C7.39064 9.68063 7.57363 9.75637 7.70864 9.8912L11.9998 14.1824L16.291 9.8912C16.4275 9.76402 16.608 9.69478 16.7946 9.69807C16.9811 9.70136 17.1591 9.77693 17.291 9.90884C17.4229 10.0408 17.4985 10.2187 17.5018 10.4053C17.5051 10.5918 17.4358 10.7723 17.3086 10.9088L12.5086 15.7088C12.3736 15.8436 12.1906 15.9194 11.9998 15.9194C11.809 15.9194 11.626 15.8436 11.491 15.7088L6.69104 10.9088C6.5562 10.7738 6.48047 10.5908 6.48047 10.4C6.48047 10.2092 6.5562 10.0262 6.69104 9.8912Z"
|
|
22
|
+
fill="#3A3630"
|
|
23
|
+
/>
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default ArrowDownIcon;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const DeliverProductIcon = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
width="18"
|
|
7
|
+
height="20"
|
|
8
|
+
viewBox="0 0 18 20"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<g clip-path="url(#clip0_2123_194397)">
|
|
13
|
+
<path
|
|
14
|
+
d="M16.1579 5.78943V9.99996M1 5.78943V14.3461C1 15.5107 2.63874 16.2029 5.91537 17.5865C7.23158 18.1431 7.89011 18.421 8.57895 18.421V9.4568M11.1053 15.8947C11.1053 15.8947 11.8421 15.8947 12.5789 17.5789C12.5789 17.5789 14.92 13.3684 17 12.5263"
|
|
15
|
+
stroke="#36A053"
|
|
16
|
+
stroke-width="1.5"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
d="M3.52632 9.99997L5.21053 10.8421M12.7895 3.26313L4.36842 7.47366M5.48505 8.05555L3.02526 6.86566C1.67537 6.21218 1 5.88544 1 5.36839C1 4.85134 1.67537 4.5246 3.02526 3.87113L5.48421 2.68123C7.00421 1.94608 7.76211 1.57892 8.57895 1.57892C9.39579 1.57892 10.1545 1.94608 11.6728 2.68123L14.1326 3.87113C15.4825 4.5246 16.1579 4.85134 16.1579 5.36839C16.1579 5.88544 15.4825 6.21218 14.1326 6.86566L11.6737 8.05555C10.1537 8.79071 9.39579 9.15787 8.57895 9.15787C7.76211 9.15787 7.00337 8.79071 5.48505 8.05555Z"
|
|
22
|
+
stroke="#36A053"
|
|
23
|
+
stroke-width="1.5"
|
|
24
|
+
stroke-linecap="round"
|
|
25
|
+
stroke-linejoin="round"
|
|
26
|
+
/>
|
|
27
|
+
</g>
|
|
28
|
+
<defs>
|
|
29
|
+
<clipPath id="clip0_2123_194397">
|
|
30
|
+
<rect
|
|
31
|
+
width="18"
|
|
32
|
+
height="18.8421"
|
|
33
|
+
fill="white"
|
|
34
|
+
transform="translate(0 0.578918)"
|
|
35
|
+
/>
|
|
36
|
+
</clipPath>
|
|
37
|
+
</defs>
|
|
38
|
+
</svg>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default DeliverProductIcon;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const ReturnProductIcon = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="18"
|
|
8
|
+
height="16"
|
|
9
|
+
viewBox="0 0 18 16"
|
|
10
|
+
fill="none"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M7.39996 7.20159H10.5999M11.0311 11.1824L13.2127 11.14C14.0815 11.124 15.8023 11.3376 15.8023 13.1424C15.8023 15.0143 14.0031 15.1983 13.1927 15.1983H5.83997C4.13758 15.1983 1.8016 14.8207 1.8016 11.608V4.79761M11.0311 11.1824C11.0339 11.02 11.0998 10.8654 11.2159 10.752L12.5871 9.58878M11.0311 11.1824C11.0283 11.2684 11.0426 11.354 11.0749 11.4338C11.1071 11.5136 11.1557 11.5857 11.2175 11.6456L12.5871 12.7768M16.1831 4.79761V8.81998M15.5583 0.801636H2.4416C1.8416 0.801636 1.5408 0.801636 1.3328 0.943235C1.23031 1.01294 1.14541 1.1055 1.0848 1.21363C0.962405 1.43203 0.992005 1.72563 1.052 2.31443C1.152 3.29682 1.2016 3.78802 1.4624 4.13841C1.5928 4.31441 1.7576 4.46081 1.9472 4.57041C2.328 4.79201 2.82879 4.79201 3.83119 4.79201H14.1687C15.1711 4.79201 15.6719 4.79201 16.0527 4.57041C16.2423 4.46081 16.4071 4.31441 16.5375 4.13841C16.7983 3.78802 16.8479 3.29682 16.9479 2.31443C17.0079 1.72563 17.0375 1.43203 16.9159 1.21363C16.8551 1.10542 16.7699 1.01284 16.6671 0.943235C16.4591 0.801636 16.1583 0.801636 15.5583 0.801636Z"
|
|
14
|
+
stroke="#E95252"
|
|
15
|
+
stroke-width="1.5"
|
|
16
|
+
stroke-linecap="round"
|
|
17
|
+
stroke-linejoin="round"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default ReturnProductIcon;
|
|
@@ -6,37 +6,58 @@ interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
imageSrc: string;
|
|
8
8
|
label: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
onClickCheckbox: (service: string) => void;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
function Checkbox(props: CheckboxProps) {
|
|
12
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
imageSrc,
|
|
16
|
+
label,
|
|
17
|
+
checked,
|
|
18
|
+
enabled = false,
|
|
19
|
+
onClickCheckbox,
|
|
20
|
+
...rest
|
|
21
|
+
} = props;
|
|
13
22
|
return (
|
|
14
|
-
<MainContainer
|
|
23
|
+
<MainContainer
|
|
24
|
+
$enabled={enabled}
|
|
25
|
+
$checked={checked}
|
|
26
|
+
onClick={() => onClickCheckbox(label)}
|
|
27
|
+
>
|
|
15
28
|
{/* Custom Checkbox */}
|
|
16
29
|
<CheckboxContainer>
|
|
17
|
-
<HiddenCheckbox type="checkbox" {...rest} />
|
|
18
|
-
<CircleContainer>
|
|
30
|
+
<HiddenCheckbox type="checkbox" $enabled={enabled} {...rest} />
|
|
31
|
+
<CircleContainer $checked={checked} $enabled={enabled}>
|
|
19
32
|
<Circle $checked={checked} />
|
|
20
33
|
</CircleContainer>
|
|
21
34
|
</CheckboxContainer>
|
|
22
35
|
<InformationContainer>
|
|
23
|
-
<Image
|
|
24
|
-
|
|
36
|
+
<Image
|
|
37
|
+
src={imageSrc}
|
|
38
|
+
$checked={checked}
|
|
39
|
+
$enabled={enabled}
|
|
40
|
+
className="checkbox-img"
|
|
41
|
+
/>
|
|
42
|
+
<Text $checked={checked} className="label">
|
|
43
|
+
{label?.replaceAll('_', ' ')}
|
|
44
|
+
</Text>
|
|
25
45
|
</InformationContainer>
|
|
26
46
|
</MainContainer>
|
|
27
47
|
);
|
|
28
48
|
}
|
|
29
49
|
|
|
30
|
-
const Image = styled.img<{ $checked: boolean }>`
|
|
50
|
+
const Image = styled.img<{ $checked: boolean; $enabled: boolean }>`
|
|
31
51
|
height: 28px;
|
|
32
52
|
width: 20px;
|
|
33
53
|
filter: ${props => (props.$checked ? 'grayscale(0)' : 'grayscale(1)')};
|
|
54
|
+
cursor: ${props => (props.$enabled ? 'pointer' : 'not-allowed')};
|
|
34
55
|
`;
|
|
35
56
|
|
|
36
|
-
const CircleContainer = styled.span
|
|
57
|
+
const CircleContainer = styled.span<{ $checked: boolean; $enabled: boolean }>`
|
|
37
58
|
height: 20px;
|
|
38
59
|
width: 20px;
|
|
39
|
-
border: 1px solid #e0e2e7;
|
|
60
|
+
border: 1px solid ${props => (props.$checked ? '#feba30' : '#e0e2e7')};
|
|
40
61
|
border-radius: 50%;
|
|
41
62
|
display: flex;
|
|
42
63
|
align-items: center;
|
|
@@ -44,12 +65,13 @@ const CircleContainer = styled.span`
|
|
|
44
65
|
position: absolute;
|
|
45
66
|
top: 8px;
|
|
46
67
|
left: 8px;
|
|
68
|
+
cursor: ${props => (props.$enabled ? 'pointer' : 'not-allowed')};
|
|
47
69
|
`;
|
|
48
70
|
|
|
49
71
|
const Circle = styled.span<{ $checked: boolean }>`
|
|
50
72
|
height: 14px;
|
|
51
73
|
width: 14px;
|
|
52
|
-
background: ${props => (props.$checked ? '#feba30' : '
|
|
74
|
+
background: ${props => (props.$checked ? '#feba30' : '#ffffff')};
|
|
53
75
|
border-radius: 50%;
|
|
54
76
|
display: inline-block;
|
|
55
77
|
transition: 0.2s ease all;
|
|
@@ -61,6 +83,7 @@ const Text = styled.span<{ $checked: boolean }>`
|
|
|
61
83
|
font-size: 12px;
|
|
62
84
|
font-style: normal;
|
|
63
85
|
font-weight: 600;
|
|
86
|
+
text-transform: capitalize;
|
|
64
87
|
`;
|
|
65
88
|
|
|
66
89
|
const InformationContainer = styled.div`
|
|
@@ -74,7 +97,7 @@ const CheckboxContainer = styled.div`
|
|
|
74
97
|
display: flex;
|
|
75
98
|
`;
|
|
76
99
|
|
|
77
|
-
const HiddenCheckbox = styled.input
|
|
100
|
+
const HiddenCheckbox = styled.input<{ $enabled: boolean }>`
|
|
78
101
|
border: 0;
|
|
79
102
|
height: 100%;
|
|
80
103
|
margin: -1px;
|
|
@@ -84,12 +107,13 @@ const HiddenCheckbox = styled.input`
|
|
|
84
107
|
white-space: nowrap;
|
|
85
108
|
width: 100%;
|
|
86
109
|
opacity: 0;
|
|
87
|
-
cursor: pointer;
|
|
110
|
+
/* cursor: pointer; */
|
|
111
|
+
cursor: ${props => (props.$enabled ? 'pointer' : 'not-allowed')};
|
|
88
112
|
top: 0;
|
|
89
113
|
left: 0;
|
|
90
114
|
`;
|
|
91
115
|
|
|
92
|
-
const MainContainer = styled.div<{ $checked: boolean }>`
|
|
116
|
+
const MainContainer = styled.div<{ $enabled: boolean; $checked: boolean }>`
|
|
93
117
|
display: flex;
|
|
94
118
|
width: 130px;
|
|
95
119
|
height: 93px;
|
|
@@ -99,13 +123,32 @@ const MainContainer = styled.div<{ $checked: boolean }>`
|
|
|
99
123
|
align-items: center;
|
|
100
124
|
justify-content: center;
|
|
101
125
|
position: relative;
|
|
126
|
+
background: ${props => (props.$checked ? '#ffffff' : '#f8fafc')};
|
|
127
|
+
box-shadow: ${props =>
|
|
128
|
+
props.$checked ? '0px 4px 8px -2px rgba(16, 24, 40, 0.1)' : 'none'};
|
|
129
|
+
pointer-events: ${props => (props.$enabled ? 'visible' : 'none')};
|
|
102
130
|
|
|
103
|
-
&:hover {
|
|
104
|
-
border: 1px solid #cbc8c2;
|
|
131
|
+
/* &:hover {
|
|
132
|
+
border: 1px solid ${props => (props.$enabled ? '#cbc8c2' : '#e0e2e7')};
|
|
105
133
|
.checkbox-img {
|
|
106
|
-
filter: grayscale(0);
|
|
134
|
+
filter: ${props => (props.$enabled ? 'grayscale(0)' : 'grayscale(1)')};
|
|
107
135
|
}
|
|
108
|
-
}
|
|
136
|
+
} */
|
|
137
|
+
|
|
138
|
+
${props =>
|
|
139
|
+
props.$enabled &&
|
|
140
|
+
`&:hover {
|
|
141
|
+
border: 1px solid #cbc8c2;
|
|
142
|
+
|
|
143
|
+
.checkbox-img {
|
|
144
|
+
filter: grayscale(0);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.label {
|
|
148
|
+
color: #3a3630;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`}
|
|
109
152
|
`;
|
|
110
153
|
|
|
111
154
|
export default Checkbox;
|
|
@@ -15,12 +15,18 @@ interface ActionModalProps {
|
|
|
15
15
|
onCloseHeader: () => void;
|
|
16
16
|
onSubmit: () => void;
|
|
17
17
|
isSubmitDisabled?: boolean;
|
|
18
|
+
minWidth?: string; // New optional prop for min-width
|
|
19
|
+
maxWidth?: string; // New optional prop for min-width
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
function OrderActionModal(
|
|
22
|
+
function OrderActionModal({
|
|
23
|
+
minWidth = '30vw',
|
|
24
|
+
maxWidth = '75vw',
|
|
25
|
+
...props
|
|
26
|
+
}: ActionModalProps) {
|
|
21
27
|
return (
|
|
22
28
|
<BackgroundModal>
|
|
23
|
-
<MainContainer>
|
|
29
|
+
<MainContainer minWidth={minWidth} maxWidth={maxWidth}>
|
|
24
30
|
<OrderActionHeader
|
|
25
31
|
title={props.headerTitle}
|
|
26
32
|
onClose={props.onCloseHeader}
|
|
@@ -39,21 +45,21 @@ function OrderActionModal(props: ActionModalProps) {
|
|
|
39
45
|
</BackgroundModal>
|
|
40
46
|
);
|
|
41
47
|
}
|
|
42
|
-
|
|
48
|
+
|
|
49
|
+
// Styled component with dynamic min-width
|
|
50
|
+
const MainContainer = styled.div<{ minWidth: string; maxWidth: string }>`
|
|
43
51
|
min-height: 30vh;
|
|
44
52
|
max-height: 80vh;
|
|
45
|
-
/* overflow: auto; */
|
|
46
53
|
border-radius: 12px;
|
|
47
54
|
background: #fff;
|
|
48
55
|
box-shadow: 0px 20px 24px -4px #10182814;
|
|
49
56
|
display: flex;
|
|
50
57
|
flex-direction: column;
|
|
51
|
-
/* gap: 15px; */
|
|
52
58
|
align-items: center;
|
|
53
59
|
justify-content: space-between;
|
|
54
60
|
overflow-x: hidden;
|
|
55
|
-
max-width:
|
|
56
|
-
min-width:
|
|
61
|
+
max-width: ${({ maxWidth }) => maxWidth}; // Dynamic max-width
|
|
62
|
+
min-width: ${({ minWidth }) => minWidth}; // Dynamic min-width
|
|
57
63
|
`;
|
|
58
64
|
|
|
59
65
|
export default OrderActionModal;
|
|
@@ -25,9 +25,9 @@ function RadioButtonGroup(props: RadioButtonGroupProps) {
|
|
|
25
25
|
} = props;
|
|
26
26
|
|
|
27
27
|
function renderOptions() {
|
|
28
|
-
return options
|
|
28
|
+
return options?.map((option: StandardOptionsType, index: number) => {
|
|
29
29
|
const { label, value, color } = option;
|
|
30
|
-
const shortenedOptionLabel = label
|
|
30
|
+
const shortenedOptionLabel = label?.replace(/\s+/g, '');
|
|
31
31
|
const optionId = `radio-option-${shortenedOptionLabel}`;
|
|
32
32
|
|
|
33
33
|
return (
|
|
@@ -82,7 +82,6 @@ const RequiredText = styled.span<RequiredTextProps>`
|
|
|
82
82
|
|
|
83
83
|
const LegendContainer = styled.div`
|
|
84
84
|
display: flex;
|
|
85
|
-
margin-bottom: 7px;
|
|
86
85
|
`;
|
|
87
86
|
|
|
88
87
|
const Legend = styled.legend`
|
|
@@ -102,7 +101,7 @@ const Wrapper = styled.div<{ $direction: DirectionType }>`
|
|
|
102
101
|
display: flex;
|
|
103
102
|
flex-direction: ${props =>
|
|
104
103
|
props.$direction === 'horizontal' ? 'row' : 'column'};
|
|
105
|
-
gap:
|
|
104
|
+
gap: 20px;
|
|
106
105
|
padding: 0px 10px;
|
|
107
106
|
border-radius: 15px;
|
|
108
107
|
border: 1px solid #e0e2e7;
|
|
@@ -339,32 +339,35 @@ function SelectionFilter() {
|
|
|
339
339
|
showSearch
|
|
340
340
|
/>
|
|
341
341
|
</FilterColumn>
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
342
|
+
{selectedClient && (
|
|
343
|
+
<>
|
|
344
|
+
<FilterColumn>
|
|
345
|
+
<Label>Action Type</Label>
|
|
346
|
+
<StyledAntSelect
|
|
347
|
+
options={actionTypeOptions}
|
|
348
|
+
placeholder="Select Action Type"
|
|
349
|
+
value={selectedFilterValue}
|
|
350
|
+
onChange={handleActionClick}
|
|
351
|
+
style={{ minWidth: '150px' }}
|
|
352
|
+
allowClear
|
|
353
|
+
onClear={handleClearAction}
|
|
354
|
+
/>
|
|
355
|
+
</FilterColumn>
|
|
356
|
+
|
|
357
|
+
<FilterColumn>
|
|
358
|
+
<Label>Location </Label>
|
|
359
|
+
<StyledAntSelect
|
|
360
|
+
options={locationOptions}
|
|
361
|
+
value={selectedLocationValue}
|
|
362
|
+
placeholder="Select Location"
|
|
363
|
+
onChange={handleLocationChange}
|
|
364
|
+
style={{ minWidth: '150px' }}
|
|
365
|
+
allowClear
|
|
366
|
+
mode="multiple"
|
|
367
|
+
/>
|
|
368
|
+
</FilterColumn>
|
|
369
|
+
</>
|
|
370
|
+
)}
|
|
368
371
|
</LeftColumn>
|
|
369
372
|
<RightColumn>
|
|
370
373
|
<ApplyButton onClick={applyFilters} disabled={!isButtonEnabled}>
|
|
@@ -61,9 +61,9 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
61
61
|
return {
|
|
62
62
|
...state,
|
|
63
63
|
'x-filters': [
|
|
64
|
-
...state['x-filters'].filter(f => f.field !== '
|
|
64
|
+
...state['x-filters'].filter(f => f.field !== 'customer_id'),
|
|
65
65
|
{
|
|
66
|
-
field: '
|
|
66
|
+
field: 'customer_id',
|
|
67
67
|
op: '=',
|
|
68
68
|
value: action.payload,
|
|
69
69
|
},
|
|
@@ -75,10 +75,10 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
75
75
|
...state,
|
|
76
76
|
'x-filters': [
|
|
77
77
|
...state['x-filters'].filter(
|
|
78
|
-
f => f.field !== '
|
|
78
|
+
f => f.field !== 'product_return_action_id'
|
|
79
79
|
),
|
|
80
80
|
{
|
|
81
|
-
field: '
|
|
81
|
+
field: 'product_return_action_id',
|
|
82
82
|
op: '=',
|
|
83
83
|
value: action.payload,
|
|
84
84
|
},
|
|
@@ -101,16 +101,14 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
101
101
|
case 'CLEAR_CLIENT':
|
|
102
102
|
return {
|
|
103
103
|
...state,
|
|
104
|
-
'x-filters': state['x-filters'].filter(
|
|
105
|
-
f => f.field !== 'order.customer_id'
|
|
106
|
-
),
|
|
104
|
+
'x-filters': state['x-filters'].filter(f => f.field !== 'customer_id'),
|
|
107
105
|
};
|
|
108
106
|
|
|
109
107
|
case 'CLEAR_ACTION':
|
|
110
108
|
return {
|
|
111
109
|
...state,
|
|
112
110
|
'x-filters': state['x-filters'].filter(
|
|
113
|
-
f => f.field !== '
|
|
111
|
+
f => f.field !== 'product_return_action_id'
|
|
114
112
|
),
|
|
115
113
|
};
|
|
116
114
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from './store/store';
|
|
7
7
|
import Filters from './filters/Filters';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
|
-
import { useStickyStatus } from '../store';
|
|
9
|
+
import { useCustomerData, useStickyStatus } from '../store';
|
|
10
10
|
import HeaderFilter from './header-filters/HeaderFilter';
|
|
11
11
|
import { useApiHook } from '@bjsdistribution/dms-component-library';
|
|
12
12
|
import { useAtom, useClientData } from '../order-view/store';
|
|
@@ -17,6 +17,7 @@ import ReturnTable from './table/ReturnTable';
|
|
|
17
17
|
import { overviewfiltersReducerAtom } from './header-filters/overViewFilter';
|
|
18
18
|
import Pagination from './table-view/Pagination';
|
|
19
19
|
import { notification } from 'antd';
|
|
20
|
+
import { ApiResponse } from '../types';
|
|
20
21
|
|
|
21
22
|
function ReturnMainTable() {
|
|
22
23
|
const [state] = useAtom(overviewfiltersReducerAtom);
|
|
@@ -29,6 +30,7 @@ function ReturnMainTable() {
|
|
|
29
30
|
const [isScrolled] = useStickyStatus();
|
|
30
31
|
const [, setLoading] = useStatsLoading();
|
|
31
32
|
const [, setClientData] = useClientData();
|
|
33
|
+
const [, setCustomers] = useCustomerData();
|
|
32
34
|
// const [tableName] = useTableName();
|
|
33
35
|
const queryParams = new URLSearchParams(location.search);
|
|
34
36
|
|
|
@@ -41,6 +43,22 @@ function ReturnMainTable() {
|
|
|
41
43
|
setItemsPerPage(itemsPerPage);
|
|
42
44
|
};
|
|
43
45
|
|
|
46
|
+
//API for client data
|
|
47
|
+
const { data: fetchedCustomerData, loading: loading } = useApiHook<
|
|
48
|
+
ApiResponse
|
|
49
|
+
>({
|
|
50
|
+
endpoint: `/v1/return/product/customers/`,
|
|
51
|
+
method: 'GET',
|
|
52
|
+
//@ts-ignore
|
|
53
|
+
pagination: { is_pagination: false },
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (fetchedCustomerData && fetchedCustomerData?.data) {
|
|
58
|
+
setCustomers(fetchedCustomerData?.data);
|
|
59
|
+
}
|
|
60
|
+
}, [loading]);
|
|
61
|
+
|
|
44
62
|
const {
|
|
45
63
|
data: fetchedClientData,
|
|
46
64
|
loading: statsDataLoading,
|
|
@@ -48,7 +66,7 @@ function ReturnMainTable() {
|
|
|
48
66
|
} = useApiHook<{
|
|
49
67
|
data: ClientData[];
|
|
50
68
|
}>({
|
|
51
|
-
endpoint: `/
|
|
69
|
+
endpoint: `/v1/return/product/stats/`,
|
|
52
70
|
method: 'GET',
|
|
53
71
|
//@ts-ignore
|
|
54
72
|
pagination: pagination,
|
|
@@ -71,11 +89,6 @@ function ReturnMainTable() {
|
|
|
71
89
|
description: 'Failed to parse pagination data',
|
|
72
90
|
});
|
|
73
91
|
}
|
|
74
|
-
} else {
|
|
75
|
-
notification.error({
|
|
76
|
-
message: 'Error',
|
|
77
|
-
description: 'Pagination data is null or undefined',
|
|
78
|
-
});
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
94
|
}, [statsDataLoading]);
|
|
@@ -42,9 +42,9 @@ const ReturnAfterTable = () => {
|
|
|
42
42
|
setShouldPerformAction,
|
|
43
43
|
paginationData,
|
|
44
44
|
} = useApiHook<ApiResponse>({
|
|
45
|
-
endpoint: '/
|
|
45
|
+
endpoint: '/v1/return/orders/',
|
|
46
46
|
method: 'GET',
|
|
47
|
-
filters: filters,
|
|
47
|
+
filters: filters && filters?.length > 0 ? filters : undefined,
|
|
48
48
|
pagination: pagination,
|
|
49
49
|
performAction: false,
|
|
50
50
|
});
|
|
@@ -148,7 +148,10 @@ const OrderTable = () => {
|
|
|
148
148
|
case 'Awaiting':
|
|
149
149
|
return { color: '#845ADF', background: 'rgba(132, 90, 223, 0.15)' };
|
|
150
150
|
case 'Completed':
|
|
151
|
-
return {
|
|
151
|
+
return {
|
|
152
|
+
color: '#1F9254',
|
|
153
|
+
background: 'rgba(41, 204, 106, 0.15)',
|
|
154
|
+
};
|
|
152
155
|
case 'Outstanding':
|
|
153
156
|
return { color: '#FF9900', background: 'rgba(255, 153, 0, 0.15)' };
|
|
154
157
|
case 'Routed':
|
|
@@ -222,16 +225,15 @@ const OrderTable = () => {
|
|
|
222
225
|
Created {renderSortIcon('created_at')}
|
|
223
226
|
</div>
|
|
224
227
|
</th>
|
|
225
|
-
<th onClick={() => handleSort('
|
|
228
|
+
<th onClick={() => handleSort('return_location_name')}>
|
|
226
229
|
<div className="sortIconClass">
|
|
227
|
-
Return Location{'
|
|
228
|
-
{renderSortIcon('return_locations.location_name')}
|
|
230
|
+
Return Location {renderSortIcon('return_location_name')}
|
|
229
231
|
</div>
|
|
230
232
|
</th>
|
|
231
233
|
<th>Pick Up Location</th>
|
|
232
|
-
<th onClick={() => handleSort('
|
|
234
|
+
<th onClick={() => handleSort('recipient_name')}>
|
|
233
235
|
<div className="sortIconClass">
|
|
234
|
-
Recipient {renderSortIcon('
|
|
236
|
+
Recipient {renderSortIcon('recipient_name')}
|
|
235
237
|
</div>
|
|
236
238
|
</th>
|
|
237
239
|
<th> Client</th>
|
|
@@ -273,15 +275,15 @@ const OrderTable = () => {
|
|
|
273
275
|
sortedData?.map((item: any, index: any) => {
|
|
274
276
|
const statusMapping: any = {
|
|
275
277
|
cancelled: 'Cancelled',
|
|
276
|
-
|
|
278
|
+
'on hold': 'On Hold',
|
|
277
279
|
SC: 'Sub-Contracted',
|
|
278
280
|
'awaiting route': 'Awaiting',
|
|
279
281
|
'awaiting confirmation': 'Awaiting',
|
|
280
|
-
|
|
282
|
+
complete: 'Completed',
|
|
281
283
|
outstanding: 'Outstanding',
|
|
282
284
|
routed: 'Routed',
|
|
285
|
+
failed: 'Failed',
|
|
283
286
|
};
|
|
284
|
-
|
|
285
287
|
const status = statusMapping[item?.status_value] || 'Unknown';
|
|
286
288
|
const statusClass = getStatusClass(status);
|
|
287
289
|
return (
|
|
@@ -293,10 +295,12 @@ const OrderTable = () => {
|
|
|
293
295
|
/>
|
|
294
296
|
</td> */}
|
|
295
297
|
<td>{formatDate(new Date(item?.created_at))}</td>
|
|
298
|
+
<td>{displayValueOrNA(item?.return_location_name)}</td>
|
|
296
299
|
<td>
|
|
297
|
-
{
|
|
300
|
+
{item?.locations?.length
|
|
301
|
+
? item?.locations.join(', ')
|
|
302
|
+
: 'N/A'}
|
|
298
303
|
</td>
|
|
299
|
-
<td>{displayValueOrNA(item?.pick_up_location)}</td>
|
|
300
304
|
|
|
301
305
|
<td onClick={() => setOrderId(item.id)}>
|
|
302
306
|
<ul style={{ listStyleType: 'none', padding: 0 }}>
|
|
@@ -308,25 +312,21 @@ const OrderTable = () => {
|
|
|
308
312
|
}}
|
|
309
313
|
>
|
|
310
314
|
<NavLink to={`../${item.id}`}>
|
|
311
|
-
{displayValueOrNA(
|
|
312
|
-
item?.order_recipient?.recipient_name
|
|
313
|
-
)}
|
|
315
|
+
{displayValueOrNA(item?.recipient_name)}
|
|
314
316
|
</NavLink>
|
|
315
317
|
</li>
|
|
316
318
|
<li style={{ color: '#888075' }}>
|
|
317
|
-
{displayValueOrNA(item?.
|
|
319
|
+
{displayValueOrNA(item?.postcode)}
|
|
318
320
|
</li>
|
|
319
321
|
</ul>
|
|
320
322
|
</td>
|
|
321
323
|
|
|
322
|
-
<td>
|
|
323
|
-
{displayValueOrNA(item?.customer_data?.customer_name)}
|
|
324
|
-
</td>
|
|
324
|
+
<td>{displayValueOrNA(item?.customer_name)}</td>
|
|
325
325
|
|
|
326
326
|
<td>{displayValueOrNA(item?.consignment)}</td>
|
|
327
327
|
<td>{displayValueOrNA(item?.order_number)}</td>
|
|
328
328
|
|
|
329
|
-
<td>{displayValueOrNA(item?.
|
|
329
|
+
<td>{displayValueOrNA(item?.total_products)}</td>
|
|
330
330
|
<td>
|
|
331
331
|
{displayValueOrNA(item?.weight)}{' '}
|
|
332
332
|
{item?.weight && item?.weight > 0 ? 'KG' : ''}
|
package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts
CHANGED
|
@@ -86,9 +86,9 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
86
86
|
return {
|
|
87
87
|
...state,
|
|
88
88
|
'x-filters': [
|
|
89
|
-
...state['x-filters'].filter(f => f.field !== '
|
|
89
|
+
...state['x-filters'].filter(f => f.field !== 'order_status'),
|
|
90
90
|
{
|
|
91
|
-
field: '
|
|
91
|
+
field: 'order_status',
|
|
92
92
|
op: '=',
|
|
93
93
|
value: action.payload,
|
|
94
94
|
},
|
|
@@ -97,14 +97,17 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
97
97
|
} else {
|
|
98
98
|
return {
|
|
99
99
|
...state,
|
|
100
|
-
'x-filters': state['x-filters'].filter(
|
|
100
|
+
'x-filters': state['x-filters'].filter(
|
|
101
|
+
f => f.field !== 'order_status'
|
|
102
|
+
),
|
|
101
103
|
};
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
case 'SET_ASSIGNEE_FILTER':
|
|
107
|
+
return {
|
|
108
|
+
...state,
|
|
109
|
+
'x-filters':
|
|
110
|
+
action.payload !== null
|
|
108
111
|
? [
|
|
109
112
|
...state['x-filters'].filter(f => f.field !== 'bjs_delivery'),
|
|
110
113
|
{
|
|
@@ -114,8 +117,7 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
114
117
|
},
|
|
115
118
|
]
|
|
116
119
|
: state['x-filters'].filter(f => f.field !== 'bjs_delivery'),
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
};
|
|
119
121
|
|
|
120
122
|
case 'CLEAR_STATUS_ORDER_FILTER':
|
|
121
123
|
return {
|