@bjsdistribution/dms-client-return 0.0.83 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/order-daily-overview/common/interface.d.ts +0 -80
- package/dist/components/order-view/hooks/AddResources.d.ts +2 -0
- package/dist/components/order-view/notes/logs/helper.d.ts +1 -2
- package/dist/components/order-view/order-actions/actions/add-resources/DocFileUpload.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/create-task-reminder/TaskModal.d.ts +4 -0
- package/dist/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.d.ts +3 -0
- package/dist/components/order-view/order-actions/store.d.ts +15 -0
- package/dist/components/order-view/order-resources/columns/actions/index.d.ts +12 -2
- package/dist/components/order-view/order-resources/columns/index.d.ts +1 -0
- package/dist/components/order-view/order-resources/helper.d.ts +2 -2
- package/dist/components/order-view/store.d.ts +1 -1
- package/dist/components/order-view/types.d.ts +2 -1
- package/dist/components/store.d.ts +1 -0
- package/dist/dms-client-return.cjs.development.js +2644 -2227
- 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 +3062 -2645
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/order-daily-overview/common/interface.ts +0 -85
- package/src/components/order-daily-overview/filters/Filters.tsx +0 -56
- package/src/components/order-daily-overview/header/input/dropdown/index.tsx +0 -1
- package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +1 -35
- package/src/components/order-daily-overview/header/table-filter/TableFilter.tsx +3 -4
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +0 -65
- package/src/components/order-daily-overview/return-after-table/table-filters/TableFilters.tsx +1 -106
- package/src/components/order-daily-overview/store/store.ts +0 -13
- package/src/components/order-view/details-filters/left-side-filters/ActionsMenu.tsx +0 -2
- package/src/components/order-view/details-filters/left-side-filters/actions/Actions.tsx +0 -13
- package/src/components/order-view/fakedata.ts +14 -5
- package/src/components/order-view/hooks/AddResources.tsx +54 -0
- package/src/components/order-view/index.tsx +23 -1
- package/src/components/order-view/notification/FlagTemplate.tsx +1 -1
- package/src/components/order-view/notification/Tabs.tsx +0 -2
- package/src/components/order-view/order-actions/actions/add-resources/CategoryDropdown.tsx +24 -9
- package/src/components/order-view/order-actions/actions/add-resources/DocFileUpload.tsx +141 -49
- package/src/components/order-view/order-actions/actions/add-resources/DocumentTypeDropdown.tsx +28 -5
- package/src/components/order-view/order-actions/actions/add-resources/Visibility.tsx +31 -14
- package/src/components/order-view/order-actions/actions/add-resources/index.tsx +99 -11
- package/src/components/order-view/order-actions/actions/cancel-order/index.tsx +0 -4
- package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +113 -0
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +3 -3
- package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +149 -0
- package/src/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.tsx +91 -0
- package/src/components/order-view/order-actions/hooks/useCreateReminder.ts +0 -5
- package/src/components/order-view/order-actions/index.tsx +10 -9
- package/src/components/order-view/order-actions/store.ts +6 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +29 -10
- package/src/components/order-view/order-details/expanded-content/orders-section/index.tsx +0 -3
- package/src/components/order-view/order-resources/collapsed-content/index.tsx +2 -2
- package/src/components/order-view/order-resources/columns/Date.tsx +2 -1
- package/src/components/order-view/order-resources/columns/actions/index.tsx +133 -5
- package/src/components/order-view/order-resources/columns/index.tsx +1 -0
- package/src/components/order-view/order-resources/expanded-content/index.tsx +11 -11
- package/src/components/order-view/order-resources/helper.ts +7 -1
- package/src/components/order-view/store.ts +5 -10
- package/src/components/order-view/system-event-logs/columns/index.tsx +0 -1
- package/src/components/order-view/types.ts +6 -3
- package/src/components/order-view/utils.ts +17 -1
- package/src/components/store.ts +6 -0
- package/dist/assets/PostCodeIcon.d.ts +0 -3
- package/dist/assets/icons/ArrivalIcon.d.ts +0 -3
- package/dist/assets/icons/ArrowIcon.d.ts +0 -3
- package/dist/assets/icons/AssemblyIcons.d.ts +0 -3
- package/dist/assets/icons/BarCode.d.ts +0 -3
- package/dist/assets/icons/BoxIcon.d.ts +0 -3
- package/dist/assets/icons/BoxTickIcon.d.ts +0 -3
- package/dist/assets/icons/CallIcon.d.ts +0 -3
- package/dist/assets/icons/CarIcon.d.ts +0 -3
- package/dist/assets/icons/CardsIcon.d.ts +0 -3
- package/dist/assets/icons/CbmIcon.d.ts +0 -3
- package/dist/assets/icons/ClockIcon.d.ts +0 -3
- package/dist/assets/icons/Complete.d.ts +0 -3
- package/dist/assets/icons/CompleteIcon.d.ts +0 -3
- package/dist/assets/icons/CompletedIcon.d.ts +0 -3
- package/dist/assets/icons/DeleteIcon.d.ts +0 -3
- package/dist/assets/icons/DownArrowIcon.d.ts +0 -3
- package/dist/assets/icons/DownloadIcon.d.ts +0 -3
- package/dist/assets/icons/DriverIcon.d.ts +0 -3
- package/dist/assets/icons/DropDownLarge.d.ts +0 -3
- package/dist/assets/icons/EditIcon.d.ts +0 -3
- package/dist/assets/icons/ExportIcon.d.ts +0 -3
- package/dist/assets/icons/EyeIcon.d.ts +0 -3
- package/dist/assets/icons/FailedIcon.d.ts +0 -3
- package/dist/assets/icons/HeavyItemIcon.d.ts +0 -3
- package/dist/assets/icons/InComplete.d.ts +0 -3
- package/dist/assets/icons/LargeItemIcon.d.ts +0 -3
- package/dist/assets/icons/LateIcon.d.ts +0 -3
- package/dist/assets/icons/LineIcon.d.ts +0 -3
- package/dist/assets/icons/LockIcon.d.ts +0 -3
- package/dist/assets/icons/MapIcon.d.ts +0 -3
- package/dist/assets/icons/OctaIcon.d.ts +0 -3
- package/dist/assets/icons/OntimeTrackingIcons.d.ts +0 -3
- package/dist/assets/icons/PaperIcon.d.ts +0 -3
- package/dist/assets/icons/PendingIcon.d.ts +0 -3
- package/dist/assets/icons/PersonIcon.d.ts +0 -3
- package/dist/assets/icons/PointIcon.d.ts +0 -3
- package/dist/assets/icons/PrintIcon.d.ts +0 -3
- package/dist/assets/icons/PrivateIcon.d.ts +0 -3
- package/dist/assets/icons/RecipientIcon.d.ts +0 -3
- package/dist/assets/icons/ReminderIcon.d.ts +0 -3
- package/dist/assets/icons/RightArrowIcon.d.ts +0 -3
- package/dist/assets/icons/RoundCheckbox.d.ts +0 -3
- package/dist/assets/icons/StartIcon.d.ts +0 -3
- package/dist/assets/icons/TableIcon.d.ts +0 -3
- package/dist/assets/icons/TextIcon.d.ts +0 -3
- package/dist/assets/icons/ThreeIcon.d.ts +0 -3
- package/dist/assets/icons/TickIon.d.ts +0 -3
- package/dist/assets/icons/TomtomIcon.d.ts +0 -3
- package/dist/assets/icons/TotalOrderIcon.d.ts +0 -3
- package/dist/assets/icons/TrackIcon.d.ts +0 -3
- package/dist/assets/icons/TruckIcon.d.ts +0 -3
- package/dist/assets/icons/UnlockIcon.d.ts +0 -3
- package/dist/assets/icons/UserIcon.d.ts +0 -3
- package/dist/assets/icons/VehicleIcon.d.ts +0 -3
- package/dist/assets/icons/WeightIcon.d.ts +0 -3
- package/dist/assets/icons/ZigZagIcon.d.ts +0 -3
- package/dist/components/order-daily-overview/common/PrintDropDown.d.ts +0 -8
- package/dist/components/order-daily-overview/common/css/TableStyle.d.ts +0 -21
- package/dist/components/order-daily-overview/common/css/mediaQuery.d.ts +0 -4
- package/dist/components/order-daily-overview/store/filterStore.d.ts +0 -16
- package/dist/components/order-daily-overview/store/initialValues.d.ts +0 -16
- package/dist/components/order-daily-overview/table/table-data/Fakedata.d.ts +0 -144
- package/dist/components/order-view/ProductData.d.ts +0 -14
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDownItem.d.ts +0 -8
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDownMenu.d.ts +0 -10
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropdownStyles.d.ts +0 -3
- package/dist/components/order-view/general-information/LockOrder.d.ts +0 -4
- package/dist/components/order-view/general-information/dropdowns/BjsMenu.d.ts +0 -3
- package/dist/components/order-view/general-information/dropdowns/CreateTask.d.ts +0 -3
- package/dist/components/order-view/general-information/dropdowns/SendEmail.d.ts +0 -3
- package/dist/components/order-view/general-information/dropdowns/SendSms.d.ts +0 -3
- package/dist/components/order-view/general-information/dropdowns/Tasks.d.ts +0 -3
- package/dist/components/order-view/general-information/dropdowns/Videos.d.ts +0 -3
- package/dist/components/order-view/general-information/dropdowns/ViewEpod.d.ts +0 -3
- package/dist/components/order-view/general-information/dropdowns/helper.d.ts +0 -1
- package/dist/components/order-view/general-information/dropdowns/index.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/AddProduct.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/BulkUpdateProduct.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/DeleteProduct.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/ProductAction.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/RepackModal.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/UnReceiveProduct.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/UpdateProducts.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/qclogs/AddDefect.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/qclogs/DefetcDetails.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/qclogs/OtherDamage.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/qclogs/RepackDetails.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/qclogs/RepackProduct.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/qclogs/index.d.ts +0 -3
- package/dist/components/order-view/modalsPopup/qclogs/logsTable.d.ts +0 -3
- package/dist/components/order-view/notes/logs/columns/Details.d.ts +0 -3
- package/dist/components/order-view/notes/logs/columns/index.d.ts +0 -2
- package/dist/components/order-view/notification/OrderTemplate.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelationNote.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelationReason.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/charge-log/DeleteLogModal.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/charge-log/index.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/escalation/Dropdowns.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/escalation/EscalationModal.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/escalation/NewEscalation.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/escalation/Notes.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/escalation/index.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/escalation/upgrade/index.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/restore-products/RestoreProducts.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/update-product-type/UpdateProductType.d.ts +0 -7
- package/dist/components/order-view/order-actions/actions/update-product-type/UpdateProductTypeStyle.d.ts +0 -9
- package/dist/components/order-view/order-actions/hooks/useFetchSingleReminder.d.ts +0 -2
- package/dist/components/order-view/order-actions/hooks/useUpdateReminder.d.ts +0 -3
- package/dist/components/order-view/order-details/expanded-content/orders-section/ValueField.d.ts +0 -3
- package/dist/components/order-view/order-resources/columns/Id.d.ts +0 -3
- package/dist/components/order-view/products-info/expanded-content/productList.d.ts +0 -0
- package/dist/components/order-view/products-info/expanded-content/products/Badge.d.ts +0 -6
- package/dist/components/order-view/products-info/expanded-content/products/index.d.ts +0 -7
- package/dist/components/order-view/products-info/types.d.ts +0 -1
- package/dist/components/order-view/products-info/utils.d.ts +0 -2
- package/dist/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.d.ts +0 -3
- package/dist/components/order-view/toolbox-resources/collapsed-content/index.d.ts +0 -3
- package/dist/components/order-view/toolbox-resources/expanded-content/index.d.ts +0 -3
- package/dist/components/order-view/view-reminder/AssigneeDropdown.d.ts +0 -3
- package/dist/components/order-view/view-reminder/ViewReminder.d.ts +0 -3
- package/dist/components/order-view/view-reminder/reminder-styles.d.ts +0 -25
- package/src/assets/PostCodeIcon.tsx +0 -32
- package/src/assets/icons/ArrivalIcon.tsx +0 -11
- package/src/assets/icons/ArrowIcon.tsx +0 -11
- package/src/assets/icons/AssemblyIcons.tsx +0 -11
- package/src/assets/icons/BarCode.tsx +0 -11
- package/src/assets/icons/BoxIcon.tsx +0 -19
- package/src/assets/icons/BoxTickIcon.tsx +0 -19
- package/src/assets/icons/CallIcon.tsx +0 -9
- package/src/assets/icons/CarIcon.tsx +0 -10
- package/src/assets/icons/CardsIcon.tsx +0 -12
- package/src/assets/icons/CbmIcon.tsx +0 -11
- package/src/assets/icons/ClockIcon.tsx +0 -10
- package/src/assets/icons/Complete.tsx +0 -15
- package/src/assets/icons/CompleteIcon.tsx +0 -34
- package/src/assets/icons/CompletedIcon.tsx +0 -11
- package/src/assets/icons/DeleteIcon.tsx +0 -20
- package/src/assets/icons/DownArrowIcon.tsx +0 -18
- package/src/assets/icons/DownloadIcon.tsx +0 -26
- package/src/assets/icons/DriverIcon.tsx +0 -28
- package/src/assets/icons/DropDownLarge.tsx +0 -25
- package/src/assets/icons/EditIcon.tsx +0 -34
- package/src/assets/icons/ExportIcon.tsx +0 -14
- package/src/assets/icons/EyeIcon.tsx +0 -10
- package/src/assets/icons/FailedIcon.tsx +0 -44
- package/src/assets/icons/HeavyItemIcon.tsx +0 -36
- package/src/assets/icons/InComplete.tsx +0 -15
- package/src/assets/icons/LargeItemIcon.tsx +0 -60
- package/src/assets/icons/LateIcon.tsx +0 -12
- package/src/assets/icons/LineIcon.tsx +0 -10
- package/src/assets/icons/LockIcon.tsx +0 -35
- package/src/assets/icons/MapIcon.tsx +0 -11
- package/src/assets/icons/OctaIcon.tsx +0 -10
- package/src/assets/icons/OntimeTrackingIcons.tsx +0 -19
- package/src/assets/icons/PaperIcon.tsx +0 -10
- package/src/assets/icons/PendingIcon.tsx +0 -32
- package/src/assets/icons/PersonIcon.tsx +0 -27
- package/src/assets/icons/PointIcon.tsx +0 -10
- package/src/assets/icons/PrintIcon.tsx +0 -10
- package/src/assets/icons/PrivateIcon.tsx +0 -29
- package/src/assets/icons/RecipientIcon.tsx +0 -10
- package/src/assets/icons/ReminderIcon.tsx +0 -35
- package/src/assets/icons/RightArrowIcon.tsx +0 -15
- package/src/assets/icons/RoundCheckbox.tsx +0 -11
- package/src/assets/icons/StartIcon.tsx +0 -10
- package/src/assets/icons/TableIcon.tsx +0 -12
- package/src/assets/icons/TextIcon.tsx +0 -10
- package/src/assets/icons/ThreeIcon.tsx +0 -19
- package/src/assets/icons/TickIon.tsx +0 -10
- package/src/assets/icons/TomtomIcon.tsx +0 -23
- package/src/assets/icons/TotalOrderIcon.tsx +0 -12
- package/src/assets/icons/TrackIcon.tsx +0 -12
- package/src/assets/icons/TruckIcon.tsx +0 -20
- package/src/assets/icons/UnlockIcon.tsx +0 -35
- package/src/assets/icons/UserIcon.tsx +0 -10
- package/src/assets/icons/VehicleIcon.tsx +0 -11
- package/src/assets/icons/WeightIcon.tsx +0 -11
- package/src/assets/icons/ZigZagIcon.tsx +0 -10
- package/src/components/order-daily-overview/common/PrintDropDown.tsx +0 -100
- package/src/components/order-daily-overview/common/css/TableStyle.tsx +0 -202
- package/src/components/order-daily-overview/common/css/mediaQuery.ts +0 -13
- package/src/components/order-daily-overview/store/filterStore.ts +0 -100
- package/src/components/order-daily-overview/store/initialValues.ts +0 -16
- package/src/components/order-daily-overview/table/table-data/Fakedata.tsx +0 -432
- package/src/components/order-view/ProductData.tsx +0 -81
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDownItem.tsx +0 -33
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDownMenu.tsx +0 -42
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropdownStyles.tsx +0 -25
- package/src/components/order-view/general-information/LockOrder.tsx +0 -113
- package/src/components/order-view/general-information/dropdowns/BjsMenu.tsx +0 -66
- package/src/components/order-view/general-information/dropdowns/CreateTask.tsx +0 -34
- package/src/components/order-view/general-information/dropdowns/SendEmail.tsx +0 -14
- package/src/components/order-view/general-information/dropdowns/SendSms.tsx +0 -14
- package/src/components/order-view/general-information/dropdowns/Tasks.tsx +0 -8
- package/src/components/order-view/general-information/dropdowns/Videos.tsx +0 -8
- package/src/components/order-view/general-information/dropdowns/ViewEpod.tsx +0 -8
- package/src/components/order-view/general-information/dropdowns/helper.tsx +0 -17
- package/src/components/order-view/general-information/dropdowns/index.tsx +0 -46
- package/src/components/order-view/modalsPopup/AddProduct.tsx +0 -234
- package/src/components/order-view/modalsPopup/BulkUpdateProduct.tsx +0 -145
- package/src/components/order-view/modalsPopup/DeleteProduct.tsx +0 -117
- package/src/components/order-view/modalsPopup/ProductAction.tsx +0 -79
- package/src/components/order-view/modalsPopup/RepackModal.tsx +0 -42
- package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +0 -72
- package/src/components/order-view/modalsPopup/UpdateProducts.tsx +0 -145
- package/src/components/order-view/modalsPopup/qclogs/AddDefect.tsx +0 -135
- package/src/components/order-view/modalsPopup/qclogs/DefetcDetails.tsx +0 -97
- package/src/components/order-view/modalsPopup/qclogs/OtherDamage.tsx +0 -125
- package/src/components/order-view/modalsPopup/qclogs/RepackDetails.tsx +0 -118
- package/src/components/order-view/modalsPopup/qclogs/RepackProduct.tsx +0 -63
- package/src/components/order-view/modalsPopup/qclogs/index.tsx +0 -62
- package/src/components/order-view/modalsPopup/qclogs/logsTable.tsx +0 -74
- package/src/components/order-view/notes/logs/columns/Details.tsx +0 -56
- package/src/components/order-view/notes/logs/columns/index.tsx +0 -2
- package/src/components/order-view/notification/OrderTemplate.tsx +0 -108
- package/src/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.tsx +0 -95
- package/src/components/order-view/order-actions/actions/cancel-order/CancelationNote.tsx +0 -28
- package/src/components/order-view/order-actions/actions/cancel-order/CancelationReason.tsx +0 -18
- package/src/components/order-view/order-actions/actions/charge-log/DeleteLogModal.tsx +0 -39
- package/src/components/order-view/order-actions/actions/charge-log/index.tsx +0 -171
- package/src/components/order-view/order-actions/actions/escalation/Dropdowns.tsx +0 -95
- package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +0 -28
- package/src/components/order-view/order-actions/actions/escalation/NewEscalation.tsx +0 -139
- package/src/components/order-view/order-actions/actions/escalation/Notes.tsx +0 -36
- package/src/components/order-view/order-actions/actions/escalation/index.tsx +0 -31
- package/src/components/order-view/order-actions/actions/escalation/upgrade/index.tsx +0 -198
- package/src/components/order-view/order-actions/actions/restore-products/RestoreProducts.tsx +0 -139
- package/src/components/order-view/order-actions/actions/update-product-type/UpdateProductType.tsx +0 -365
- package/src/components/order-view/order-actions/actions/update-product-type/UpdateProductTypeStyle.tsx +0 -251
- package/src/components/order-view/order-actions/hooks/useFetchSingleReminder.ts +0 -60
- package/src/components/order-view/order-actions/hooks/useUpdateReminder.ts +0 -54
- package/src/components/order-view/order-details/expanded-content/orders-section/ValueField.tsx +0 -36
- package/src/components/order-view/order-resources/columns/Id.tsx +0 -17
- package/src/components/order-view/products-info/expanded-content/productList.tsx +0 -28
- package/src/components/order-view/products-info/expanded-content/products/Badge.tsx +0 -34
- package/src/components/order-view/products-info/expanded-content/products/index.tsx +0 -305
- package/src/components/order-view/products-info/types.ts +0 -1
- package/src/components/order-view/products-info/utils.ts +0 -14
- package/src/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.tsx +0 -37
- package/src/components/order-view/toolbox-resources/collapsed-content/index.tsx +0 -16
- package/src/components/order-view/toolbox-resources/expanded-content/index.tsx +0 -84
- package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +0 -34
- package/src/components/order-view/view-reminder/ViewReminder.tsx +0 -315
- package/src/components/order-view/view-reminder/reminder-styles.tsx +0 -174
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { useTabType } from '../store';
|
|
4
|
-
// import OrderTemplate from './OrderTemplate';
|
|
5
4
|
import FlagTemplate from './FlagTemplate';
|
|
6
5
|
import ReminderTemplate from './ReminderTemplate';
|
|
7
6
|
|
|
@@ -27,7 +26,6 @@ function Tabs({
|
|
|
27
26
|
<Container className="tab-content">
|
|
28
27
|
{activeTab === 'active' && (
|
|
29
28
|
<>
|
|
30
|
-
{/* <OrderTemplate /> */}
|
|
31
29
|
{initialReminders.map((item: any, index: any) => (
|
|
32
30
|
<ReminderTemplate
|
|
33
31
|
key={index}
|
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import OrderActionsDropdown from '../../Dropdown';
|
|
3
|
+
import { useOrderStaticData } from '../../../store';
|
|
4
|
+
import { useAtom } from 'jotai';
|
|
5
|
+
import { selectedCategoryIdAtom } from '../../store';
|
|
3
6
|
|
|
4
7
|
function CategoryDropdown() {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
8
|
+
const [staticOrderData] = useOrderStaticData();
|
|
9
|
+
const [, setSelectedCategoryId] = useAtom(selectedCategoryIdAtom);
|
|
7
10
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const categoryOptions = staticOrderData?.resource_category_type?.map(
|
|
12
|
+
(x: any) => ({
|
|
13
|
+
id: x?.id,
|
|
14
|
+
type: x?.type,
|
|
15
|
+
value: x?.value,
|
|
16
|
+
})
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const onSelect = (selectedValue: any) => {
|
|
20
|
+
const selectedOption = categoryOptions?.find(
|
|
21
|
+
(option: any) => option?.value === selectedValue
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (selectedOption) {
|
|
25
|
+
setSelectedCategoryId(selectedOption.value);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
13
28
|
|
|
14
29
|
return (
|
|
15
30
|
<OrderActionsDropdown
|
|
16
31
|
label="Category"
|
|
32
|
+
required
|
|
17
33
|
placeholder="Select Category"
|
|
18
|
-
options={
|
|
34
|
+
options={categoryOptions}
|
|
19
35
|
onSelect={onSelect}
|
|
20
|
-
onSearch={onSearch}
|
|
21
36
|
/>
|
|
22
37
|
);
|
|
23
38
|
}
|
|
@@ -1,65 +1,136 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { UploadProps } from 'antd';
|
|
3
|
-
import { message, Upload } from 'antd';
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
4
2
|
import styled from 'styled-components';
|
|
5
3
|
import { Button } from '@bjsdistribution/dms-component-library';
|
|
6
4
|
import UploadIcon from '../../../../../assets/icons/UploadIcon';
|
|
5
|
+
import { atom, useAtom } from 'jotai';
|
|
6
|
+
import { notification } from 'antd';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
export const uploadedFilesAtom = atom<File[]>([]);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
// Allowed photo and video file types
|
|
11
|
+
const fileTypes = ['image/jpeg', 'image/png', 'video/mp4'];
|
|
12
|
+
|
|
13
|
+
function DocFileUpload() {
|
|
14
|
+
const [uploadedFiles, setUploadedFiles] = useAtom(uploadedFilesAtom);
|
|
15
|
+
const [dragging, setDragging] = useState(false);
|
|
16
|
+
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
17
|
+
|
|
18
|
+
const handleFileUpload = (files: FileList | null) => {
|
|
19
|
+
if (files) {
|
|
20
|
+
const validFiles = Array.from(files).filter(file =>
|
|
21
|
+
fileTypes.includes(file.type)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (validFiles.length > 0) {
|
|
25
|
+
setUploadedFiles(prev => [...prev, ...validFiles]);
|
|
26
|
+
validFiles.forEach(file => {
|
|
27
|
+
notification.success({
|
|
28
|
+
message: 'Success',
|
|
29
|
+
description: `${file.name} added successfully.`,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
} else {
|
|
33
|
+
notification.error({
|
|
34
|
+
message: 'Error',
|
|
35
|
+
description: 'Only photos (JPEG, PNG) and videos (MP4) are allowed.',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
18
38
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const handleDragOver = (e: React.DragEvent) => {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
setDragging(true);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const handleDragLeave = () => {
|
|
47
|
+
setDragging(false);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const handleDrop = (e: React.DragEvent) => {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
setDragging(false);
|
|
53
|
+
handleFileUpload(e.dataTransfer.files);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
57
|
+
handleFileUpload(e.target.files);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const handleButtonClick = () => {
|
|
61
|
+
if (fileInputRef.current) {
|
|
62
|
+
fileInputRef.current.click();
|
|
23
63
|
}
|
|
24
|
-
}
|
|
25
|
-
onDrop(e) {
|
|
26
|
-
console.log('Dropped files', e.dataTransfer.files);
|
|
27
|
-
},
|
|
28
|
-
};
|
|
64
|
+
};
|
|
29
65
|
|
|
30
|
-
function DocFileUpload () {
|
|
31
66
|
return (
|
|
32
67
|
<MainContainer>
|
|
33
|
-
<
|
|
68
|
+
<DraggerContainer
|
|
69
|
+
onDragOver={handleDragOver}
|
|
70
|
+
onDragLeave={handleDragLeave}
|
|
71
|
+
onDrop={handleDrop}
|
|
72
|
+
dragging={dragging}
|
|
73
|
+
>
|
|
34
74
|
<Container>
|
|
35
|
-
<UploadButton
|
|
36
|
-
|
|
75
|
+
<UploadButton
|
|
76
|
+
colors="secondary"
|
|
77
|
+
shape="rounded"
|
|
78
|
+
onClick={handleButtonClick}
|
|
79
|
+
>
|
|
80
|
+
UPLOAD FILE
|
|
37
81
|
</UploadButton>
|
|
82
|
+
<FileInput
|
|
83
|
+
type="file"
|
|
84
|
+
required
|
|
85
|
+
multiple
|
|
86
|
+
onChange={handleInputChange}
|
|
87
|
+
accept="image/jpeg, image/png, video/mp4"
|
|
88
|
+
ref={fileInputRef}
|
|
89
|
+
/>
|
|
38
90
|
<IconContainer>
|
|
39
|
-
|
|
91
|
+
<UploadIcon />
|
|
40
92
|
</IconContainer>
|
|
41
93
|
<TextContainer>
|
|
42
94
|
<Text1>or drag and drop your file </Text1>
|
|
43
|
-
<Text2>
|
|
95
|
+
<Text2>Photos (JPEG, PNG) or Videos (MP4) Only</Text2>
|
|
44
96
|
</TextContainer>
|
|
45
97
|
</Container>
|
|
46
|
-
</
|
|
98
|
+
</DraggerContainer>
|
|
99
|
+
|
|
100
|
+
{/* Uploaded Files List */}
|
|
101
|
+
{uploadedFiles.length > 0 && (
|
|
102
|
+
<UploadedFilesContainer>
|
|
103
|
+
<FilesTitle>Uploaded Files:</FilesTitle>
|
|
104
|
+
<FilesList>
|
|
105
|
+
{uploadedFiles.map((file, index) => (
|
|
106
|
+
<FileItem key={index}>
|
|
107
|
+
{file.name} - {(file.size / 1024).toFixed(2)} KB
|
|
108
|
+
</FileItem>
|
|
109
|
+
))}
|
|
110
|
+
</FilesList>
|
|
111
|
+
</UploadedFilesContainer>
|
|
112
|
+
)}
|
|
47
113
|
</MainContainer>
|
|
48
|
-
)
|
|
114
|
+
);
|
|
49
115
|
}
|
|
116
|
+
|
|
50
117
|
const MainContainer = styled.div`
|
|
51
118
|
width: 100%;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
const DraggerContainer = styled.div<{ dragging: boolean }>`
|
|
122
|
+
width: 100%;
|
|
123
|
+
padding: 6px;
|
|
124
|
+
border-radius: 30px;
|
|
125
|
+
border: ${props =>
|
|
126
|
+
props.dragging ? '2px dashed #0465ac' : '1px solid #e0e2e7'};
|
|
127
|
+
background-color: #fff;
|
|
128
|
+
transition: border-color 0.3s ease;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
`;
|
|
60
131
|
|
|
61
132
|
const Text2 = styled.p`
|
|
62
|
-
color: #
|
|
133
|
+
color: #bcbab7;
|
|
63
134
|
text-align: center;
|
|
64
135
|
font-family: 'Roboto', sans-serif;
|
|
65
136
|
font-size: 13px;
|
|
@@ -68,14 +139,12 @@ const Text2 = styled.p`
|
|
|
68
139
|
text-transform: lowercase;
|
|
69
140
|
padding: 0;
|
|
70
141
|
margin: 0;
|
|
71
|
-
`
|
|
72
|
-
|
|
73
|
-
const TextContainer = styled.div`
|
|
74
|
-
|
|
75
142
|
`;
|
|
76
143
|
|
|
144
|
+
const TextContainer = styled.div``;
|
|
145
|
+
|
|
77
146
|
const Text1 = styled.p`
|
|
78
|
-
color: #
|
|
147
|
+
color: #aea9a1;
|
|
79
148
|
text-align: left;
|
|
80
149
|
font-family: 'Roboto', sans-serif;
|
|
81
150
|
font-size: 14px;
|
|
@@ -87,7 +156,7 @@ const Text1 = styled.p`
|
|
|
87
156
|
`;
|
|
88
157
|
|
|
89
158
|
const IconContainer = styled.div`
|
|
90
|
-
border: 1px dashed #
|
|
159
|
+
border: 1px dashed #0465ac;
|
|
91
160
|
padding: 5px;
|
|
92
161
|
display: flex;
|
|
93
162
|
align-items: center;
|
|
@@ -106,12 +175,35 @@ const Container = styled.div`
|
|
|
106
175
|
align-items: center;
|
|
107
176
|
align-self: stretch;
|
|
108
177
|
border-radius: 30px;
|
|
109
|
-
|
|
110
|
-
|
|
178
|
+
background: #fff;
|
|
179
|
+
`;
|
|
111
180
|
|
|
112
|
-
|
|
181
|
+
const FileInput = styled.input`
|
|
182
|
+
display: none;
|
|
113
183
|
`;
|
|
114
184
|
|
|
115
|
-
|
|
185
|
+
const UploadedFilesContainer = styled.div`
|
|
186
|
+
margin-top: 20px;
|
|
187
|
+
border-top: 1px solid #e0e2e7;
|
|
188
|
+
padding-top: 10px;
|
|
189
|
+
`;
|
|
190
|
+
|
|
191
|
+
const FilesTitle = styled.h4`
|
|
192
|
+
font-family: 'Roboto', sans-serif;
|
|
193
|
+
font-size: 16px;
|
|
194
|
+
color: #0465ac;
|
|
195
|
+
`;
|
|
196
|
+
|
|
197
|
+
const FilesList = styled.ul`
|
|
198
|
+
list-style-type: none;
|
|
199
|
+
padding: 0;
|
|
200
|
+
`;
|
|
201
|
+
|
|
202
|
+
const FileItem = styled.li`
|
|
203
|
+
font-family: 'Roboto', sans-serif;
|
|
204
|
+
font-size: 14px;
|
|
205
|
+
color: #333;
|
|
206
|
+
margin: 5px 0;
|
|
207
|
+
`;
|
|
116
208
|
|
|
117
|
-
export default DocFileUpload;
|
|
209
|
+
export default DocFileUpload;
|
package/src/components/order-view/order-actions/actions/add-resources/DocumentTypeDropdown.tsx
CHANGED
|
@@ -1,16 +1,39 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import OrderActionsDropdown from '../../Dropdown';
|
|
3
|
+
import { useAtom } from 'jotai';
|
|
4
|
+
import { useOrderStaticData } from '../../../store';
|
|
5
|
+
import { selectedDocumentTypeAtom } from '../../store';
|
|
3
6
|
|
|
4
7
|
function DocumentTypeDropdown() {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
8
|
+
const [hello, setSelectedDocumentType] = useAtom(selectedDocumentTypeAtom);
|
|
9
|
+
const [staticOrderData] = useOrderStaticData();
|
|
10
|
+
|
|
11
|
+
const documentOptions = staticOrderData?.resource_document_type?.map(
|
|
12
|
+
(x: any) => ({
|
|
13
|
+
id: x?.id,
|
|
14
|
+
type: x?.type,
|
|
15
|
+
value: x?.value,
|
|
16
|
+
})
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const onSelectCancelReason = (selectedValue: any) => {
|
|
20
|
+
const selectedOption = documentOptions?.find(
|
|
21
|
+
(option: any) => option?.value === selectedValue
|
|
22
|
+
);
|
|
23
|
+
if (selectedOption) {
|
|
24
|
+
setSelectedDocumentType(selectedOption.value);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
console.log(hello, 'hellohello');
|
|
29
|
+
|
|
7
30
|
return (
|
|
8
31
|
<OrderActionsDropdown
|
|
9
32
|
label="Document Type"
|
|
33
|
+
required
|
|
10
34
|
placeholder="Select Document Type"
|
|
11
|
-
options={
|
|
12
|
-
onSelect={
|
|
13
|
-
onSearch={onSearch}
|
|
35
|
+
options={documentOptions}
|
|
36
|
+
onSelect={onSelectCancelReason}
|
|
14
37
|
/>
|
|
15
38
|
);
|
|
16
39
|
}
|
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
import { RadioButtonGroup } from '@bjsdistribution/dms-component-library';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
label: 'Public',
|
|
7
|
-
value: 'public',
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
label: 'Private',
|
|
11
|
-
value: 'private',
|
|
12
|
-
},
|
|
13
|
-
];
|
|
3
|
+
import { useAtom, useOrderStaticData } from '../../../store';
|
|
4
|
+
import { capitalize } from '../../../utils';
|
|
5
|
+
import { selectedVisibilityAtom } from '../../store';
|
|
14
6
|
|
|
15
7
|
function VisibilityRadioButtons() {
|
|
16
|
-
const
|
|
8
|
+
const [staticOrderData] = useOrderStaticData();
|
|
9
|
+
const [selectedVisibility, setSelectedVisibility] = useAtom(
|
|
10
|
+
selectedVisibilityAtom
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const visibilityOptions = staticOrderData?.resource_visibility_type?.map(
|
|
14
|
+
(option: any) => ({
|
|
15
|
+
label: capitalize(option.type.replaceAll('_', ' ')),
|
|
16
|
+
value: option.value.toString(),
|
|
17
|
+
})
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const handleRadioButtonChange = (
|
|
21
|
+
event: React.ChangeEvent<HTMLInputElement>
|
|
22
|
+
) => {
|
|
23
|
+
const selectedValue = event.target.value;
|
|
24
|
+
|
|
25
|
+
const selectedOption = visibilityOptions?.find(
|
|
26
|
+
(option: any) => option.value === selectedValue
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
if (selectedOption) {
|
|
30
|
+
setSelectedVisibility(selectedOption.value);
|
|
31
|
+
console.log(selectedOption, 'selectedOption');
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
17
35
|
return (
|
|
18
|
-
// refer product information for implementation
|
|
19
36
|
<RadioButtonGroup
|
|
20
|
-
selectedValue={
|
|
37
|
+
selectedValue={selectedVisibility || []}
|
|
21
38
|
heading="Visibility"
|
|
22
39
|
options={visibilityOptions || []}
|
|
23
40
|
required={false}
|
|
@@ -1,43 +1,132 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
|
|
3
3
|
import DocumentTypeDropdown from './DocumentTypeDropdown';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import CategoryDropdown from './CategoryDropdown';
|
|
6
6
|
import VisibilityRadioButtons from './Visibility';
|
|
7
|
-
import DocFileUpload from './DocFileUpload';
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import DocFileUpload, { uploadedFilesAtom } from './DocFileUpload';
|
|
8
|
+
import {
|
|
9
|
+
useAtom,
|
|
10
|
+
useCurrentAction,
|
|
11
|
+
useCustomerInfo,
|
|
12
|
+
useOrderStaticData,
|
|
13
|
+
} from '../../../store';
|
|
14
|
+
import {
|
|
15
|
+
selectedCategoryIdAtom,
|
|
16
|
+
selectedDocumentTypeAtom,
|
|
17
|
+
selectedTypeAtom,
|
|
18
|
+
setResourcesCall,
|
|
19
|
+
} from '../../store';
|
|
20
|
+
import OrderActionsDropdown from '../../Dropdown';
|
|
21
|
+
import { notification } from 'antd';
|
|
22
|
+
import useUploadFiles from '../../../hooks/AddResources';
|
|
10
23
|
|
|
11
24
|
function AddResources() {
|
|
12
25
|
const [, setCurrentAction] = useCurrentAction();
|
|
26
|
+
const [staticOrderData] = useOrderStaticData();
|
|
27
|
+
const [, setSelectedType] = useAtom(selectedTypeAtom);
|
|
28
|
+
const [uploadedFiles, setUploadedFiles] = useAtom(uploadedFilesAtom);
|
|
29
|
+
const uploadFiles = useUploadFiles();
|
|
30
|
+
const [isFormValid, setIsFormValid] = useState(false);
|
|
31
|
+
const [selectedCategoryId] = useAtom(selectedCategoryIdAtom);
|
|
32
|
+
const [selectedDocumentType] = useAtom(selectedDocumentTypeAtom);
|
|
33
|
+
const [selectedType] = useAtom(selectedTypeAtom);
|
|
34
|
+
const [, setResources] = useAtom(setResourcesCall);
|
|
13
35
|
|
|
14
36
|
const onClose = () => {
|
|
15
37
|
setCurrentAction(undefined);
|
|
38
|
+
setUploadedFiles([]);
|
|
16
39
|
};
|
|
17
40
|
|
|
41
|
+
const [customerInfo] = useCustomerInfo();
|
|
42
|
+
const infoText = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;
|
|
43
|
+
const typeOptions = staticOrderData?.resource_type?.map((x: any) => ({
|
|
44
|
+
id: x?.id,
|
|
45
|
+
type: x?.type,
|
|
46
|
+
value: x?.value,
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
const onSelectCancelReason = (selectedValue: any) => {
|
|
50
|
+
const selectedOption = typeOptions?.find(
|
|
51
|
+
(option: any) => option?.value === selectedValue
|
|
52
|
+
);
|
|
53
|
+
if (selectedOption) {
|
|
54
|
+
setSelectedType(selectedOption.value);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const handleSubmit = async () => {
|
|
58
|
+
if (!uploadedFiles) {
|
|
59
|
+
notification.error({ message: 'No files selected' });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const formData = new FormData();
|
|
64
|
+
if (uploadedFiles) {
|
|
65
|
+
Array.from(uploadedFiles).forEach(uploadedFiles => {
|
|
66
|
+
formData.append('files', uploadedFiles); // Adjust the key as per your API requirement
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
const response = await uploadFiles(formData);
|
|
72
|
+
console.log('Upload successful:', response);
|
|
73
|
+
notification.success({ message: 'Files uploaded successfully' });
|
|
74
|
+
onClose(); // Close modal after successful upload
|
|
75
|
+
setResources(false);
|
|
76
|
+
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
setResources(true);
|
|
79
|
+
}, 1000);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.error('Upload failed:', error);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
setIsFormValid(
|
|
87
|
+
!!selectedType &&
|
|
88
|
+
!!selectedDocumentType &&
|
|
89
|
+
!!selectedCategoryId &&
|
|
90
|
+
uploadedFiles?.length > 0
|
|
91
|
+
);
|
|
92
|
+
}, [selectedDocumentType, selectedCategoryId, uploadedFiles]);
|
|
93
|
+
|
|
18
94
|
return (
|
|
19
95
|
<OrderActionModal
|
|
20
|
-
headerTitle="
|
|
96
|
+
headerTitle="ADD RESOURCE"
|
|
21
97
|
showAdditionalInfo
|
|
22
|
-
infoText=
|
|
98
|
+
infoText={infoText}
|
|
23
99
|
onCloseHeader={onClose}
|
|
24
|
-
onSubmit={
|
|
100
|
+
onSubmit={handleSubmit}
|
|
101
|
+
isSubmitDisabled={!isFormValid}
|
|
25
102
|
>
|
|
26
103
|
<ContentContainer>
|
|
27
104
|
<Top>
|
|
28
105
|
<DocumentTypeDropdown />
|
|
106
|
+
|
|
107
|
+
<OrderActionsDropdown
|
|
108
|
+
label="Type"
|
|
109
|
+
required
|
|
110
|
+
placeholder="Select Type"
|
|
111
|
+
options={typeOptions}
|
|
112
|
+
onSelect={onSelectCancelReason}
|
|
113
|
+
/>
|
|
114
|
+
|
|
29
115
|
<CategoryDropdown />
|
|
30
116
|
<VisibilityRadioButtons />
|
|
31
117
|
</Top>
|
|
32
118
|
<Bottom>
|
|
33
|
-
<Label>File</Label>
|
|
34
|
-
<DocFileUpload />
|
|
119
|
+
<Label>File</Label> <RequiredAsterisk>*</RequiredAsterisk>
|
|
120
|
+
<DocFileUpload />{' '}
|
|
35
121
|
</Bottom>
|
|
36
122
|
</ContentContainer>
|
|
37
123
|
</OrderActionModal>
|
|
38
124
|
);
|
|
39
125
|
}
|
|
40
|
-
|
|
126
|
+
const RequiredAsterisk = styled.span`
|
|
127
|
+
color: red;
|
|
128
|
+
margin-left: 2px;
|
|
129
|
+
`;
|
|
41
130
|
const Label = styled.label`
|
|
42
131
|
color: #6a7378;
|
|
43
132
|
font-family: 'Lato', sans-serif;
|
|
@@ -59,7 +148,6 @@ const Top = styled.div`
|
|
|
59
148
|
`;
|
|
60
149
|
|
|
61
150
|
const ContentContainer = styled.div`
|
|
62
|
-
/* display: flex; */
|
|
63
151
|
padding: 15px 12px;
|
|
64
152
|
flex: 1 0 0;
|
|
65
153
|
border-radius: 15px;
|
|
@@ -3,7 +3,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
3
3
|
import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
|
|
4
4
|
import ReturnAction from './ReturnAction';
|
|
5
5
|
import ReturnReason from './ReturnReason';
|
|
6
|
-
// import CancelOrderTable from './CancelOrderTable';
|
|
7
6
|
import {
|
|
8
7
|
useCurrentAction,
|
|
9
8
|
useCustomerInfo,
|
|
@@ -165,9 +164,6 @@ function CancelOrder() {
|
|
|
165
164
|
</Container>
|
|
166
165
|
</TopRight>
|
|
167
166
|
</Top>
|
|
168
|
-
{/* <Bottom>
|
|
169
|
-
<CancelOrderTable />
|
|
170
|
-
</Bottom> */}
|
|
171
167
|
</ContentContainer>
|
|
172
168
|
</OrderActionModal>
|
|
173
169
|
);
|
package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CancelAndCompleteAction,
|
|
3
|
+
CancelationModal,
|
|
4
|
+
useApiHook,
|
|
5
|
+
} from '@bjsdistribution/dms-component-library';
|
|
6
|
+
import React, { useEffect } from 'react';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import {
|
|
9
|
+
useCurrentAction,
|
|
10
|
+
useLiveRecalling,
|
|
11
|
+
useOrderDetails,
|
|
12
|
+
useOrderId,
|
|
13
|
+
usePrevOrderDetails,
|
|
14
|
+
} from '../../../store';
|
|
15
|
+
import { ApiResponse, OrdersType } from '../../../types';
|
|
16
|
+
import { useLoading } from '../../../../order-daily-overview/store/store';
|
|
17
|
+
import { notification } from 'antd';
|
|
18
|
+
|
|
19
|
+
const ClearBookingStatus = () => {
|
|
20
|
+
const [orderId] = useOrderId();
|
|
21
|
+
const [, setOrderDetails] = useOrderDetails();
|
|
22
|
+
const [, setPrevOrderDetails] = usePrevOrderDetails();
|
|
23
|
+
const [, setLoading] = useLoading();
|
|
24
|
+
const [, setCurrentAction] = useCurrentAction();
|
|
25
|
+
const [liveRecalling, setRecalling] = useLiveRecalling();
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
data: response,
|
|
29
|
+
setShouldPerformAction: setPerformAction,
|
|
30
|
+
} = useApiHook<{
|
|
31
|
+
data: ApiResponse[];
|
|
32
|
+
}>({
|
|
33
|
+
endpoint: `orders/${orderId}/clear-date/`,
|
|
34
|
+
method: 'POST',
|
|
35
|
+
performAction: false,
|
|
36
|
+
});
|
|
37
|
+
const { data: fetchedData, loading, setShouldPerformAction } = useApiHook<{
|
|
38
|
+
data: OrdersType[];
|
|
39
|
+
}>({
|
|
40
|
+
endpoint: `orders/${orderId}`,
|
|
41
|
+
method: 'GET',
|
|
42
|
+
performAction: false,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
setLoading(loading);
|
|
47
|
+
if (fetchedData && fetchedData.data) {
|
|
48
|
+
const requiredData = fetchedData?.data;
|
|
49
|
+
setOrderDetails(requiredData[0]);
|
|
50
|
+
setPrevOrderDetails(requiredData[0]);
|
|
51
|
+
setCurrentAction(undefined);
|
|
52
|
+
}
|
|
53
|
+
if (
|
|
54
|
+
(fetchedData && fetchedData?.data === null) ||
|
|
55
|
+
fetchedData?.data?.length === 0
|
|
56
|
+
) {
|
|
57
|
+
setCurrentAction(undefined);
|
|
58
|
+
}
|
|
59
|
+
}, [loading]);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (response) {
|
|
63
|
+
//@ts-ignore
|
|
64
|
+
if (response?.data && response?.code === 200) {
|
|
65
|
+
setShouldPerformAction(true);
|
|
66
|
+
setRecalling(true);
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
setRecalling(false);
|
|
69
|
+
}, 2000);
|
|
70
|
+
} else {
|
|
71
|
+
notification.error({
|
|
72
|
+
message: 'Error',
|
|
73
|
+
description:
|
|
74
|
+
//@ts-ignore
|
|
75
|
+
response?.error_traceback ||
|
|
76
|
+
'An error has occurred. Please try again later.',
|
|
77
|
+
});
|
|
78
|
+
setCurrentAction(undefined);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}, [response, liveRecalling]);
|
|
82
|
+
|
|
83
|
+
const saveButton = () => {
|
|
84
|
+
if (orderId) {
|
|
85
|
+
setRecalling(false);
|
|
86
|
+
setPerformAction(true);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const closeModal = () => {
|
|
91
|
+
setCurrentAction(undefined);
|
|
92
|
+
};
|
|
93
|
+
return (
|
|
94
|
+
<CancelationModal
|
|
95
|
+
title="Clear Booking Status"
|
|
96
|
+
description="Are you sure, you want to clear booking status of the Order?"
|
|
97
|
+
actions={
|
|
98
|
+
<CustomCancelAndCompleteAction
|
|
99
|
+
cancelLabel="Cancel"
|
|
100
|
+
onCancel={closeModal}
|
|
101
|
+
completeLabel="Confirm"
|
|
102
|
+
onComplete={saveButton}
|
|
103
|
+
/>
|
|
104
|
+
}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const CustomCancelAndCompleteAction = styled(CancelAndCompleteAction)`
|
|
110
|
+
justify-content: center;
|
|
111
|
+
`;
|
|
112
|
+
|
|
113
|
+
export default ClearBookingStatus;
|