@bjsdistribution/dms-client-return 0.2.2-prod → 0.2.3-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/common/expand-collapse/index.js +44 -26
- package/dist/common/expand-collapse/index.js.map +1 -1
- package/dist/common/modals/order-action-modal/OrderActionModal.js.map +1 -1
- package/dist/common/modals/order-action-modal/footer/OrderActionFooter.js.map +1 -1
- package/dist/components/client-portal/ClientPortalResponsive.js +148 -0
- package/dist/components/client-portal/ClientPortalResponsive.js.map +1 -0
- package/dist/components/client-portal/OutstandingTable.js +112 -118
- package/dist/components/client-portal/OutstandingTable.js.map +1 -1
- package/dist/components/client-portal/ReturnOverview.js +38 -37
- package/dist/components/client-portal/ReturnOverview.js.map +1 -1
- package/dist/components/client-portal/return-confirm/ConfirmedMain.js +4 -4
- package/dist/components/client-portal/return-confirm/ConfirmedMain.js.map +1 -1
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.js +445 -185
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.js.map +1 -1
- package/dist/components/fakeData.js.map +1 -1
- package/dist/components/order-daily-overview/common/fakedata.js.map +1 -1
- package/dist/components/order-daily-overview/common/mediaQuery.js +17 -0
- package/dist/components/order-daily-overview/common/mediaQuery.js.map +1 -0
- package/dist/components/order-daily-overview/filters/FilterStyle.js +174 -11
- package/dist/components/order-daily-overview/filters/FilterStyle.js.map +1 -1
- package/dist/components/order-daily-overview/header/route-header/RouterHeaderStyle.js +9 -4
- package/dist/components/order-daily-overview/header/route-header/RouterHeaderStyle.js.map +1 -1
- package/dist/components/order-daily-overview/header/route-header/title/HeaderTitle.js +11 -1
- package/dist/components/order-daily-overview/header/route-header/title/HeaderTitle.js.map +1 -1
- package/dist/components/order-daily-overview/header-filters/Styledfilters.js +46 -17
- package/dist/components/order-daily-overview/header-filters/Styledfilters.js.map +1 -1
- package/dist/components/order-daily-overview/index.js +76 -53
- package/dist/components/order-daily-overview/index.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +101 -103
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js +135 -134
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table-filters/TableFilters.js +17 -11
- package/dist/components/order-daily-overview/return-after-table/table-filters/TableFilters.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js +5 -5
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +129 -135
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.js +346 -27
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.js.map +1 -1
- package/dist/components/order-daily-overview/table/ReturnTable.js +199 -183
- package/dist/components/order-daily-overview/table/ReturnTable.js.map +1 -1
- package/dist/components/order-daily-overview/table/table-data/styles.js +159 -38
- package/dist/components/order-daily-overview/table/table-data/styles.js.map +1 -1
- package/dist/components/order-daily-overview/table-view/PaginationStyle.js +21 -6
- package/dist/components/order-daily-overview/table-view/PaginationStyle.js.map +1 -1
- package/dist/components/order-view/DynamicTable.js +136 -35
- package/dist/components/order-view/DynamicTable.js.map +1 -1
- package/dist/components/order-view/details-filters/DetailsFilters.js +33 -8
- package/dist/components/order-view/details-filters/DetailsFilters.js.map +1 -1
- package/dist/components/order-view/details-filters/left-side-filters/ActionsMenu.js +23 -5
- package/dist/components/order-view/details-filters/left-side-filters/ActionsMenu.js.map +1 -1
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.js +39 -22
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.js.map +1 -1
- package/dist/components/order-view/details-filters/right-side-filters/Details.js +25 -12
- package/dist/components/order-view/details-filters/right-side-filters/Details.js.map +1 -1
- package/dist/components/order-view/general-information/Status.js +58 -28
- package/dist/components/order-view/general-information/Status.js.map +1 -1
- package/dist/components/order-view/generic-table/AuditLogs.js +129 -24
- package/dist/components/order-view/generic-table/AuditLogs.js.map +1 -1
- package/dist/components/order-view/notes/logs/index.js +15 -7
- package/dist/components/order-view/notes/logs/index.js.map +1 -1
- package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.js +7 -7
- package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.js.map +1 -1
- package/dist/components/order-view/notification/index.js +68 -55
- package/dist/components/order-view/notification/index.js.map +1 -1
- package/dist/components/order-view/order-actions/Dropdown.js +3 -3
- package/dist/components/order-view/order-actions/Dropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js +45 -47
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js +23 -36
- package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +23 -25
- package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js +88 -89
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js +16 -16
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js +22 -23
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js +52 -56
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +26 -27
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js +29 -29
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js +54 -222
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/split-order/index.js +37 -50
- package/dist/components/order-view/order-actions/actions/split-order/index.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +35 -37
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.js +85 -85
- package/dist/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.js +12 -8
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.js +22 -18
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/index.js +14 -8
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/index.js +19 -13
- package/dist/components/order-view/order-details/expanded-content/customer-section/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Address.js +11 -6
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Address.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.js +23 -21
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.js +23 -21
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/index.js +39 -21
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/footer/index.js +28 -14
- package/dist/components/order-view/order-details/expanded-content/footer/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/orders-section/index.js +44 -28
- package/dist/components/order-view/order-details/expanded-content/orders-section/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +28 -20
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceLevel.js +17 -18
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceLevel.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +22 -26
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/index.js +79 -25
- package/dist/components/order-view/order-details/expanded-content/services-section/index.js.map +1 -1
- package/dist/components/order-view/order-details/helper.js.map +1 -1
- package/dist/components/order-view/products-info/collapsed-content/index.js +21 -15
- package/dist/components/order-view/products-info/collapsed-content/index.js.map +1 -1
- package/dist/components/order-view/products-info/index.js +36 -36
- package/dist/components/order-view/products-info/index.js.map +1 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +265 -334
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
- package/dist/components/order-view/store.js +155 -162
- package/dist/components/order-view/store.js.map +1 -1
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js +281 -173
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -1
- package/dist/components/utils.js +5 -4
- package/dist/components/utils.js.map +1 -1
- package/dist/types/common/modals/order-action-modal/OrderActionModal.d.ts +1 -2
- package/dist/types/common/modals/order-action-modal/footer/OrderActionFooter.d.ts +1 -1
- package/dist/types/components/client-portal/ClientPortalResponsive.d.ts +15 -0
- package/dist/types/components/order-daily-overview/common/mediaQuery.d.ts +4 -0
- package/dist/types/components/order-daily-overview/filters/FilterStyle.d.ts +1 -0
- package/dist/types/components/order-view/order-actions/Dropdown.d.ts +0 -1
- package/dist/types/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +1 -0
- package/dist/types/components/order-view/store.d.ts +0 -1
- package/dist/types/components/order-view/types.d.ts +1 -1
- package/dist/types/components/utils.d.ts +1 -0
- package/package.json +2 -2
- package/dist/assets/icons/ChevronDownIcon.js +0 -26
- package/dist/assets/icons/ChevronDownIcon.js.map +0 -1
- package/dist/components/order-view/return-client-products/product-table/palletGrouping.js +0 -47
- package/dist/components/order-view/return-client-products/product-table/palletGrouping.js.map +0 -1
- package/dist/types/components/order-view/return-client-products/product-table/palletGrouping.d.ts +0 -23
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import
|
|
5
|
-
import { useEscalationReason as
|
|
6
|
-
|
|
7
|
-
function T() {
|
|
1
|
+
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Label as m, SelectDropdown as f, dropdownStyles as R } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import { useEffect as D } from "react";
|
|
4
|
+
import b from "styled-components";
|
|
5
|
+
import { useEscalationReason as h, useOrderStaticData as g, useEscalationCategory as S, useFailureReason as y, useIsFailureReasonChanged as C } from "../../../../store.js";
|
|
6
|
+
function j() {
|
|
8
7
|
const [
|
|
9
8
|
l,
|
|
10
9
|
s
|
|
11
|
-
] =
|
|
10
|
+
] = h(), [n] = g(), [t] = S(), [p] = y(), [
|
|
12
11
|
r,
|
|
13
|
-
|
|
14
|
-
] =
|
|
15
|
-
(e) => e?.escalation_type_id ===
|
|
12
|
+
c
|
|
13
|
+
] = C(), d = t?.value, a = n?.escalation_reasons?.filter(
|
|
14
|
+
(e) => e?.escalation_type_id === d
|
|
16
15
|
)?.map((e) => {
|
|
17
|
-
const o =
|
|
18
|
-
(
|
|
16
|
+
const o = n?.order_escalation_reasons?.find(
|
|
17
|
+
(x) => x?.id === e?.order_reason_id
|
|
19
18
|
);
|
|
20
19
|
if (o !== void 0)
|
|
21
20
|
return {
|
|
22
|
-
label:
|
|
21
|
+
label: o?.reason,
|
|
23
22
|
value: o?.id
|
|
24
23
|
};
|
|
25
24
|
})?.filter(
|
|
26
25
|
(e) => e !== void 0
|
|
27
26
|
);
|
|
28
|
-
return
|
|
27
|
+
return D(() => {
|
|
29
28
|
if (r && a?.length > 0) {
|
|
30
29
|
const e = a?.find(
|
|
31
|
-
(o) => o?.label ===
|
|
30
|
+
(o) => o?.label === p?.label
|
|
32
31
|
);
|
|
33
|
-
s(e),
|
|
32
|
+
s(e), c(!1);
|
|
34
33
|
}
|
|
35
34
|
!r && a?.length > 0 && s(a[0]);
|
|
36
|
-
}, [
|
|
37
|
-
/* @__PURE__ */ i(
|
|
35
|
+
}, [t]), /* @__PURE__ */ u(v, { children: [
|
|
36
|
+
/* @__PURE__ */ i(m, { label: "Escalation Reason" }),
|
|
38
37
|
/* @__PURE__ */ i(
|
|
39
|
-
|
|
38
|
+
f,
|
|
40
39
|
{
|
|
41
40
|
options: a || [],
|
|
42
41
|
styles: {
|
|
43
|
-
...
|
|
42
|
+
...R,
|
|
44
43
|
control: (e, o) => ({
|
|
45
44
|
...e,
|
|
46
45
|
border: "1px solid #D0D5DD",
|
|
@@ -75,13 +74,13 @@ function T() {
|
|
|
75
74
|
)
|
|
76
75
|
] });
|
|
77
76
|
}
|
|
78
|
-
const
|
|
77
|
+
const v = b.div`
|
|
79
78
|
display: flex;
|
|
80
79
|
flex-direction: column;
|
|
81
80
|
gap: 8px;
|
|
82
81
|
flex: 1;
|
|
83
82
|
`;
|
|
84
83
|
export {
|
|
85
|
-
|
|
84
|
+
j as default
|
|
86
85
|
};
|
|
87
86
|
//# sourceMappingURL=EscalationReason.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EscalationReason.js","sources":["../../../../../../../src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx"],"sourcesContent":["import {\n Label,\n SelectDropdown,\n dropdownStyles,\n
|
|
1
|
+
{"version":3,"file":"EscalationReason.js","sources":["../../../../../../../src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx"],"sourcesContent":["import {\n Label,\n SelectDropdown,\n dropdownStyles,\n} from '@bjsdistribution/dms-component-library';\nimport React, { useEffect } from 'react';\nimport styled from 'styled-components';\n\nimport {\n useEscalationCategory,\n useEscalationReason,\n useFailureReason,\n useIsFailureReasonChanged,\n useOrderStaticData,\n} from '../../../../store';\n\nfunction EscalationReason() {\n const [\n escalationReasonState,\n setEscalationReasonState,\n ] = useEscalationReason();\n const [orderStaticData] = useOrderStaticData();\n const [escalationCategory] = useEscalationCategory();\n const [failureReason] = useFailureReason();\n const [\n isFailureReasonChanged,\n setIsFailureReasonChanged,\n ] = useIsFailureReasonChanged();\n\n // escalationCategory.value is now escalation_type.id directly (same as orders force-debrief)\n const escalationTypeId = escalationCategory?.value;\n\n const escalationReasons = orderStaticData?.escalation_reasons?.filter(\n (x: any) => x?.escalation_type_id === escalationTypeId\n );\n\n const escalationReasonsOptions = escalationReasons?.map((item: any) => {\n const matchedItem = orderStaticData?.order_escalation_reasons?.find(\n (x: any) => x?.id === item?.order_reason_id\n );\n if (matchedItem !== undefined) {\n return {\n label: matchedItem?.reason,\n value: matchedItem?.id,\n };\n } else {\n return;\n }\n });\n const filteredEscReasonOptions = escalationReasonsOptions?.filter(\n (option: any) => option !== undefined\n );\n\n useEffect(() => {\n if (isFailureReasonChanged && filteredEscReasonOptions?.length > 0) {\n // ids of both esc reason options and failure reason not matched but their labels matched\n const reason = filteredEscReasonOptions?.find(\n (option: any) => option?.label === failureReason?.label\n );\n setEscalationReasonState(reason);\n setIsFailureReasonChanged(false);\n }\n if (!isFailureReasonChanged && filteredEscReasonOptions?.length > 0) {\n setEscalationReasonState(filteredEscReasonOptions[0]);\n }\n }, [escalationCategory]);\n\n return (\n <Container>\n <Label label=\"Escalation Reason\" />\n <SelectDropdown\n options={filteredEscReasonOptions || []}\n styles={{\n ...dropdownStyles,\n control: (styles, state) => ({\n ...styles,\n border: '1px solid #D0D5DD',\n cursor: 'pointer',\n borderRadius: `${\n state.selectProps.menuIsOpen ? '0px 0px 6px 6px' : '6px'\n }`,\n boxShadow: '0px 3px 22px #00000014',\n minHeight: '40px',\n '&:hover': {\n borderColor: '#D0D5DD',\n boxShadow: '0px 3px 22px #00000014',\n },\n }),\n menu: styles => ({\n ...styles,\n marginBottom: '0px',\n borderRadius: '6px 6px 0px 0px',\n boxShadow: '0px 3px 22px #00000014',\n border: '1px solid #D0D5DD',\n borderBottom: '0px',\n }),\n dropdownIndicator: (styles, state) => ({\n ...styles,\n transition: 'all 0.3s ease-in-out',\n transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'null',\n }),\n }}\n placeholder=\"Select Reason\"\n menuPlacement=\"top\"\n value={escalationReasonState}\n onChange={selectedOption => setEscalationReasonState(selectedOption)}\n />\n </Container>\n );\n}\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 8px;\n flex: 1;\n`;\n\nexport default EscalationReason;\n"],"names":["EscalationReason","escalationReasonState","setEscalationReasonState","useEscalationReason","orderStaticData","useOrderStaticData","escalationCategory","useEscalationCategory","failureReason","useFailureReason","isFailureReasonChanged","setIsFailureReasonChanged","useIsFailureReasonChanged","escalationTypeId","filteredEscReasonOptions","x","item","matchedItem","option","useEffect","reason","Container","jsx","Label","SelectDropdown","dropdownStyles","styles","state","selectedOption","styled"],"mappings":";;;;;AAgBA,SAASA,IAAmB;AAC1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c,GACZC,EAAM,YAAY,aAAa,oBAAoB,KACrD;AAAA,YACA,WAAW;AAAA,YACX,WAAW;AAAA,YACX,WAAW;AAAA,cACT,aAAa;AAAA,cACb,WAAW;AAAA,YAAA;AAAA,UACb;AAAA,UAEF,MAAM,CAAAD,OAAW;AAAA,YACf,GAAGA;AAAA,YACH,cAAc;AAAA,YACd,cAAc;AAAA,YACd,WAAW;AAAA,YACX,QAAQ;AAAA,YACR,cAAc;AAAA,UAAA;AAAA,UAEhB,mBAAmB,CAACA,GAAQC,OAAW;AAAA,YACrC,GAAGD;AAAA,YACH,YAAY;AAAA,YACZ,WAAWC,EAAM,YAAY,aAAa,mBAAmB;AAAA,UAAA;AAAA,QAC/D;AAAA,QAEF,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,OAAO1B;AAAA,QACP,UAAU,CAAA2B,MAAkB1B,EAAyB0B,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EACrE,GACF;AAEJ;AAEA,MAAMP,IAAYQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js
CHANGED
|
@@ -1,102 +1,98 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useOrderStaticData as
|
|
1
|
+
import { jsxs as O, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { RadioButtonGroup as n } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import v from "styled-components";
|
|
4
|
+
import { useOrderStaticData as x, useOrderDetails as w } from "../../../../store.js";
|
|
5
5
|
import { capitalize as c } from "../../../../utils.js";
|
|
6
|
-
import { useClientPortal as A } from "../../../../../store.js";
|
|
7
6
|
const q = [
|
|
8
7
|
{ label: "Yes", value: "true" },
|
|
9
8
|
{ label: "No", value: "false" }
|
|
10
9
|
];
|
|
11
|
-
function
|
|
12
|
-
const [l] =
|
|
10
|
+
function G() {
|
|
11
|
+
const [l] = x(), [r, s] = w(), _ = l?.order_service_levels?.map(
|
|
13
12
|
(e) => ({
|
|
14
13
|
label: c(e.type.replaceAll("_", " ")),
|
|
15
14
|
value: e.id.toString()
|
|
16
15
|
})
|
|
17
|
-
),
|
|
16
|
+
), u = l?.order_delivery_point?.map(
|
|
18
17
|
(e) => ({
|
|
19
18
|
label: c(e.type.replaceAll("_", " ")),
|
|
20
19
|
value: e.id.toString()
|
|
21
20
|
})
|
|
22
|
-
),
|
|
23
|
-
(e) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
), v = l?.order_service_list, h = t?.order_services_detail?.order_delivery_point_id?.toString(), S = t?.order_services_detail?.order_service_level_id?.toString(), m = t?.order_type_id?.toString(), D = (e) => {
|
|
31
|
-
const r = {
|
|
32
|
-
...t?.order_services_detail,
|
|
21
|
+
), g = l?.order_type?.map(
|
|
22
|
+
(e) => ({
|
|
23
|
+
label: c(e.type.replaceAll("_", " ")),
|
|
24
|
+
value: e.id.toString()
|
|
25
|
+
})
|
|
26
|
+
), p = l?.order_service_list, y = r?.order_services_detail?.order_delivery_point_id?.toString(), f = r?.order_services_detail?.order_service_level_id?.toString(), h = r?.order_type_id?.toString(), S = (e) => {
|
|
27
|
+
const t = {
|
|
28
|
+
...r?.order_services_detail,
|
|
33
29
|
order_delivery_point_id: +e.target.value
|
|
34
|
-
}, o = { ...
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
const
|
|
38
|
-
...
|
|
30
|
+
}, o = { ...r, order_services_detail: t };
|
|
31
|
+
s(o);
|
|
32
|
+
}, m = (e) => {
|
|
33
|
+
const t = {
|
|
34
|
+
...r?.order_services_detail,
|
|
39
35
|
order_service_level_id: +e.target.value
|
|
40
|
-
}, o = { ...
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
const o =
|
|
36
|
+
}, o = { ...r, order_services_detail: t };
|
|
37
|
+
s(o);
|
|
38
|
+
}, D = (e) => {
|
|
39
|
+
const t = { ...r, order_type_id: +e.target.value };
|
|
40
|
+
s(t);
|
|
41
|
+
}, b = (e) => {
|
|
42
|
+
const o = p?.find(
|
|
47
43
|
(d) => d.id === e
|
|
48
|
-
)?.type,
|
|
49
|
-
|
|
44
|
+
)?.type, C = !r[o];
|
|
45
|
+
s((d) => ({
|
|
50
46
|
...d,
|
|
51
|
-
[o]:
|
|
47
|
+
[o]: C
|
|
52
48
|
}));
|
|
53
49
|
};
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ i(
|
|
50
|
+
return /* @__PURE__ */ O(A, { children: [
|
|
51
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(
|
|
56
52
|
n,
|
|
57
53
|
{
|
|
58
54
|
heading: "Service Type",
|
|
59
|
-
onChange:
|
|
60
|
-
options:
|
|
61
|
-
selectedValue:
|
|
55
|
+
onChange: D,
|
|
56
|
+
options: g || [],
|
|
57
|
+
selectedValue: h || "",
|
|
62
58
|
direction: "vertical",
|
|
63
59
|
required: !1,
|
|
64
60
|
isDisabled: !0
|
|
65
61
|
}
|
|
66
62
|
) }),
|
|
67
|
-
/* @__PURE__ */ i(
|
|
63
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(
|
|
68
64
|
n,
|
|
69
65
|
{
|
|
70
66
|
heading: "Service Level ",
|
|
71
|
-
onChange:
|
|
72
|
-
options:
|
|
73
|
-
selectedValue:
|
|
67
|
+
onChange: m,
|
|
68
|
+
options: _ || [],
|
|
69
|
+
selectedValue: f || "",
|
|
74
70
|
direction: "vertical",
|
|
75
71
|
required: !1,
|
|
76
72
|
isDisabled: !0
|
|
77
73
|
}
|
|
78
74
|
) }),
|
|
79
|
-
/* @__PURE__ */ i(
|
|
75
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(
|
|
80
76
|
n,
|
|
81
77
|
{
|
|
82
78
|
heading: "Delivery Point",
|
|
83
|
-
onChange:
|
|
84
|
-
options:
|
|
85
|
-
selectedValue:
|
|
79
|
+
onChange: S,
|
|
80
|
+
options: u || [],
|
|
81
|
+
selectedValue: y || "",
|
|
86
82
|
direction: "vertical",
|
|
87
83
|
required: !1,
|
|
88
84
|
isDisabled: !0
|
|
89
85
|
}
|
|
90
86
|
) }),
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
return /* @__PURE__ */ i(
|
|
87
|
+
p?.map((e) => {
|
|
88
|
+
const t = r[e?.type];
|
|
89
|
+
return /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(
|
|
94
90
|
n,
|
|
95
91
|
{
|
|
96
|
-
heading:
|
|
97
|
-
onChange: () =>
|
|
92
|
+
heading: e?.type?.replaceAll("_", " "),
|
|
93
|
+
onChange: () => b(e?.id),
|
|
98
94
|
options: q || [],
|
|
99
|
-
selectedValue:
|
|
95
|
+
selectedValue: t ? "true" : "false",
|
|
100
96
|
direction: "vertical",
|
|
101
97
|
required: !1,
|
|
102
98
|
isDisabled: !0
|
|
@@ -105,7 +101,7 @@ function k() {
|
|
|
105
101
|
})
|
|
106
102
|
] });
|
|
107
103
|
}
|
|
108
|
-
const
|
|
104
|
+
const A = v.div`
|
|
109
105
|
display: flex;
|
|
110
106
|
flex-wrap: wrap;
|
|
111
107
|
gap: 16px;
|
|
@@ -113,11 +109,11 @@ const T = u.div`
|
|
|
113
109
|
width: 100%;
|
|
114
110
|
align-items: flex-start;
|
|
115
111
|
pointer-events: none;
|
|
116
|
-
`,
|
|
112
|
+
`, a = v.div`
|
|
117
113
|
flex: 1;
|
|
118
114
|
`;
|
|
119
115
|
export {
|
|
120
|
-
|
|
116
|
+
G as default,
|
|
121
117
|
q as radioButtonFilterOptions
|
|
122
118
|
};
|
|
123
119
|
//# sourceMappingURL=RadioButtons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtons.js","sources":["../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx"],"sourcesContent":["import { RadioButtonGroup
|
|
1
|
+
{"version":3,"file":"RadioButtons.js","sources":["../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx"],"sourcesContent":["import { RadioButtonGroup } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useOrderDetails, useOrderStaticData } from '../../../../store';\nimport { OrdersType } from '../../../../types';\nimport { capitalize } from '../../../../utils';\n\nexport const radioButtonFilterOptions = [\n { label: 'Yes', value: 'true' },\n { label: 'No', value: 'false' },\n];\n\nfunction RadioButtonGroups() {\n const [orderStaticData] = useOrderStaticData();\n const [orderDetails, setOrderDetails] = useOrderDetails();\n\n const serviceLevelOptions = orderStaticData?.order_service_levels?.map(\n (x: any) => ({\n label: capitalize(x.type.replaceAll('_', ' ')),\n value: x.id.toString(),\n })\n );\n\n const deliveryPointOptions = orderStaticData?.order_delivery_point?.map(\n (x: any) => ({\n label: capitalize(x.type.replaceAll('_', ' ')),\n value: x.id.toString(),\n })\n );\n\n const serviceTypeOptions = orderStaticData?.order_type?.map(\n (option: any) => ({\n label: capitalize(option.type.replaceAll('_', ' ')),\n value: option.id.toString(),\n })\n );\n\n const orderServicesOptions = orderStaticData?.order_service_list;\n const deliveryPointId = orderDetails?.order_services_detail?.order_delivery_point_id?.toString();\n const serviceLevelId = orderDetails?.order_services_detail?.order_service_level_id?.toString();\n const orderTypeId = orderDetails?.order_type_id?.toString();\n\n // ON CHANGE HANDLERS\n const onChangeDeliveryPoint = (\n event: React.ChangeEvent<HTMLInputElement>\n ) => {\n const updatedServices = {\n ...orderDetails?.order_services_detail!,\n order_delivery_point_id: +event.target.value,\n };\n const newData = { ...orderDetails, order_services_detail: updatedServices };\n setOrderDetails(newData);\n };\n\n const onChangeServiceLevel = (event: React.ChangeEvent<HTMLInputElement>) => {\n const updatedServices = {\n ...orderDetails?.order_services_detail!,\n order_service_level_id: +event.target.value,\n };\n const newData = { ...orderDetails, order_services_detail: updatedServices };\n setOrderDetails(newData);\n };\n\n const onChangeServiceType = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newData = { ...orderDetails, order_type_id: +event.target.value };\n setOrderDetails(newData);\n };\n\n const onChangeServices = (id: number) => {\n const selectedService = orderServicesOptions?.find(\n (item: any) => item.id === id\n );\n const key = selectedService?.type;\n const value = !orderDetails[key as keyof OrdersType];\n setOrderDetails(prev => ({\n ...prev,\n [key]: value,\n }));\n };\n\n return (\n <Container>\n <Group>\n <RadioButtonGroup\n heading=\"Service Type\"\n onChange={onChangeServiceType}\n options={serviceTypeOptions || []}\n selectedValue={orderTypeId || ''}\n direction=\"vertical\"\n required={false}\n isDisabled\n />\n </Group>\n <Group>\n <RadioButtonGroup\n heading=\"Service Level \"\n onChange={onChangeServiceLevel}\n options={serviceLevelOptions || []}\n selectedValue={serviceLevelId || ''}\n direction=\"vertical\"\n required={false}\n isDisabled\n />\n </Group>\n <Group>\n <RadioButtonGroup\n heading=\"Delivery Point\"\n onChange={onChangeDeliveryPoint}\n options={deliveryPointOptions || []}\n selectedValue={deliveryPointId || ''}\n direction=\"vertical\"\n required={false}\n isDisabled\n />\n </Group>\n\n {orderServicesOptions?.map((service: any) => {\n const selected = orderDetails[service?.type as keyof OrdersType];\n return (\n <Group>\n <RadioButtonGroup\n heading={service?.type?.replaceAll('_', ' ')}\n onChange={() => onChangeServices(service?.id)}\n options={radioButtonFilterOptions || []}\n selectedValue={selected ? 'true' : 'false'}\n direction=\"vertical\"\n required={false}\n isDisabled\n />\n </Group>\n );\n })}\n </Container>\n );\n}\nconst Container = styled.div`\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n padding: 8px;\n width: 100%;\n align-items: flex-start;\n pointer-events: none;\n`;\n\nconst Group = styled.div`\n flex: 1;\n`;\n\nexport default RadioButtonGroups;\n"],"names":["radioButtonFilterOptions","RadioButtonGroups","orderStaticData","useOrderStaticData","orderDetails","setOrderDetails","useOrderDetails","serviceLevelOptions","x","capitalize","deliveryPointOptions","serviceTypeOptions","option","orderServicesOptions","deliveryPointId","serviceLevelId","orderTypeId","onChangeDeliveryPoint","event","updatedServices","newData","onChangeServiceLevel","onChangeServiceType","onChangeServices","id","key","item","value","prev","Container","jsx","Group","RadioButtonGroup","service","selected","styled"],"mappings":";;;;;AAOO,MAAMA,IAA2B;AAAA,EACtC,EAAE,OAAO,OAAO,OAAO,OAAA;AAAA,EACvB,EAAE,OAAO,MAAM,OAAO,QAAA;AACxB;AAEA,SAASC,IAAoB;AAC3B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAElCC,IAAsBL,GAAiB,sBAAsB;AAAA,IACjE,CAACM,OAAY;AAAA,MACX,OAAOC,EAAWD,EAAE,KAAK,WAAW,KAAK,GAAG,CAAC;AAAA,MAC7C,OAAOA,EAAE,GAAG,SAAA;AAAA,IAAS;AAAA,EACvB,GAGIE,IAAuBR,GAAiB,sBAAsB;AAAA,IAClE,CAACM,OAAY;AAAA,MACX,OAAOC,EAAWD,EAAE,KAAK,WAAW,KAAK,GAAG,CAAC;AAAA,MAC7C,OAAOA,EAAE,GAAG,SAAA;AAAA,IAAS;AAAA,EACvB,GAGIG,IAAqBT,GAAiB,YAAY;AAAA,IACtD,CAACU,OAAiB;AAAA,MAChB,OAAOH,EAAWG,EAAO,KAAK,WAAW,KAAK,GAAG,CAAC;AAAA,MAClD,OAAOA,EAAO,GAAG,SAAA;AAAA,IAAS;AAAA,EAC5B,GAGIC,IAAuBX,GAAiB,oBACxCY,IAAkBV,GAAc,uBAAuB,yBAAyB,SAAA,GAChFW,IAAiBX,GAAc,uBAAuB,wBAAwB,SAAA,GAC9EY,IAAcZ,GAAc,eAAe,SAAA,GAG3Ca,IAAwB,CAC5BC,MACG;AACH,UAAMC,IAAkB;AAAA,MACtB,GAAGf,GAAc;AAAA,MACjB,yBAAyB,CAACc,EAAM,OAAO;AAAA,IAAA,GAEnCE,IAAU,EAAE,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C,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAUf;AAAA,QACV,SAASP,KAAwB,CAAA;AAAA,QACjC,eAAeI,KAAmB;AAAA,QAClC,WAAU;AAAA,QACV,UAAU;AAAA,QACV,YAAU;AAAA,MAAA;AAAA,IAAA,GAEd;AAAA,IAECD,GAAsB,IAAI,CAACoB,MAAiB;AAC3C,YAAMC,IAAW9B,EAAa6B,GAAS,IAAwB;AAC/D,+BACGF,GAAA,EACC,UAAA,gBAAAD;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,SAASC,GAAS,MAAM,WAAW,KAAK,GAAG;AAAA,UAC3C,UAAU,MAAMV,EAAiBU,GAAS,EAAE;AAAA,UAC5C,SAASjC,KAA4B,CAAA;AAAA,UACrC,eAAekC,IAAW,SAAS;AAAA,UACnC,WAAU;AAAA,UACV,UAAU;AAAA,UACV,YAAU;AAAA,QAAA;AAAA,MAAA,GAEd;AAAA,IAEJ,CAAC;AAAA,EAAA,GACH;AAEJ;AACA,MAAML,IAAYM,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUnBJ,IAAQI,EAAO;AAAA;AAAA;"}
|
|
@@ -1,66 +1,65 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Label as I, SelectDropdown as O
|
|
3
|
-
import
|
|
4
|
-
import { useOrderStaticData as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const [a] = D(), [i] = N(), [u, c] = S(), [, d] = w(), p = a?.failure_reasons, n = a?.escalation_category, s = a?.escalation_types, l = a?.fault_non_fault_reasons, f = n?.find(
|
|
1
|
+
import { jsxs as b, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Label as I, SelectDropdown as O } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import x from "styled-components";
|
|
4
|
+
import { useOrderStaticData as C, useFailureReason as S, useIsFailureReasonChanged as w } from "../../../../../store.js";
|
|
5
|
+
function q() {
|
|
6
|
+
const [a] = C(), [i, u] = S(), [, c] = w(), d = a?.failure_reasons, t = a?.escalation_category, s = a?.escalation_types, l = a?.fault_non_fault_reasons, p = t?.find(
|
|
8
7
|
(e) => e?.type === "Failure - Non Fault"
|
|
9
|
-
)?.id,
|
|
8
|
+
)?.id, f = t?.find(
|
|
10
9
|
(e) => e?.type === "Failure - Fault"
|
|
11
|
-
)?.id,
|
|
10
|
+
)?.id, F = s?.filter(
|
|
11
|
+
(e) => e?.escalation_category_id === p
|
|
12
|
+
)[0]?.id, R = s?.filter(
|
|
12
13
|
(e) => e?.escalation_category_id === f
|
|
13
|
-
)[0]?.id,
|
|
14
|
-
(e) => e?.
|
|
15
|
-
)
|
|
14
|
+
)[0]?.id, _ = l?.filter(
|
|
15
|
+
(e) => e?.escalation_type_id === F
|
|
16
|
+
), m = l?.filter(
|
|
16
17
|
(e) => e?.escalation_type_id === R
|
|
17
|
-
), _ = l?.filter(
|
|
18
|
-
(e) => e?.escalation_type_id === m
|
|
19
18
|
), r = (e) => {
|
|
20
19
|
const h = new Set(
|
|
21
20
|
e?.map((o) => o?.order_reason_id)
|
|
22
21
|
);
|
|
23
|
-
return
|
|
22
|
+
return d?.filter((o) => h?.has(o?.id))?.map((o) => ({
|
|
24
23
|
value: o?.reason,
|
|
25
|
-
label:
|
|
24
|
+
label: o?.title,
|
|
26
25
|
id: o?.id
|
|
27
26
|
}));
|
|
28
|
-
},
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
27
|
+
}, y = r(m), g = r(_);
|
|
28
|
+
return /* @__PURE__ */ b(D, { children: [
|
|
29
|
+
/* @__PURE__ */ n(I, { label: "Failure Reason", htmlFor: "failurereasondropdown", required: !0 }),
|
|
30
|
+
/* @__PURE__ */ n(
|
|
32
31
|
O,
|
|
33
32
|
{
|
|
34
33
|
placeholder: "Select Reason",
|
|
35
34
|
options: [
|
|
36
35
|
{
|
|
37
36
|
label: "Fault Reasons",
|
|
38
|
-
options:
|
|
37
|
+
options: y
|
|
39
38
|
},
|
|
40
39
|
{
|
|
41
40
|
label: "Non-Fault Reasons",
|
|
42
|
-
options:
|
|
41
|
+
options: g
|
|
43
42
|
}
|
|
44
43
|
] || [],
|
|
45
44
|
inputId: "failurereasondropdown",
|
|
46
45
|
openMenuOnFocus: !0,
|
|
47
|
-
value:
|
|
46
|
+
value: i,
|
|
48
47
|
onChange: (e) => {
|
|
49
|
-
|
|
48
|
+
u(e), c(!0);
|
|
50
49
|
},
|
|
51
|
-
formatGroupLabel: (e) => /* @__PURE__ */
|
|
50
|
+
formatGroupLabel: (e) => /* @__PURE__ */ n("div", { style: { color: "rgba(0,0,0,0.8)" }, children: /* @__PURE__ */ n("span", { children: e?.label }) }),
|
|
52
51
|
isDisabled: !1
|
|
53
52
|
}
|
|
54
53
|
)
|
|
55
54
|
] });
|
|
56
55
|
}
|
|
57
|
-
const
|
|
56
|
+
const D = x.div`
|
|
58
57
|
display: flex;
|
|
59
58
|
flex-direction: column;
|
|
60
59
|
gap: 6px;
|
|
61
60
|
flex: 1;
|
|
62
61
|
`;
|
|
63
62
|
export {
|
|
64
|
-
|
|
63
|
+
q as default
|
|
65
64
|
};
|
|
66
65
|
//# sourceMappingURL=FailureReasonDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FailureReasonDropdown.js","sources":["../../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx"],"sourcesContent":["import { Label, SelectDropdown
|
|
1
|
+
{"version":3,"file":"FailureReasonDropdown.js","sources":["../../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx"],"sourcesContent":["import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n useFailureReason,\n useIsFailureReasonChanged,\n useOrderStaticData,\n} from '../../../../../store';\n\nfunction FailureReasonDropdown() {\n const [orderStaticData] = useOrderStaticData();\n const [failureReasonState, setFailureReason] = useFailureReason();\n const [, setIsFailureReasonChanged] = useIsFailureReasonChanged(); // to map esc reason properly\n const failureReasons = orderStaticData?.failure_reasons;\n const escalationCategory = orderStaticData?.escalation_category;\n const escalationTypes = orderStaticData?.escalation_types;\n const faultNonFaultReasons = orderStaticData?.fault_non_fault_reasons;\n\n // Step 1: Get IDs of \"Failure-Non_Fault\" and \"Failure-Fault\"\n const failureNonFaultId = escalationCategory?.find(\n (category: any) => category?.type === 'Failure - Non Fault'\n )?.id;\n const failureFaultId = escalationCategory?.find(\n (category: any) => category?.type === 'Failure - Fault'\n )?.id;\n\n // Step 2: Map to get escalation type IDs\n\n const failureNonFaultEscTypeId = escalationTypes?.filter(\n (type: any) => type?.escalation_category_id === failureNonFaultId\n )[0]?.id;\n const failureFaultEscTypeId = escalationTypes?.filter(\n (type: any) => type?.escalation_category_id === failureFaultId\n )[0]?.id;\n\n // Step 3: Separate fault and non-fault reasons\n const nonFaultReasons = faultNonFaultReasons?.filter(\n (reason: any) => reason?.escalation_type_id === failureNonFaultEscTypeId\n );\n const faultReasons = faultNonFaultReasons?.filter(\n (reason: any) => reason?.escalation_type_id === failureFaultEscTypeId\n );\n\n // Step 4: Simplified mapping to failureReasons\n const mapReasonsToFailures = (reasons: any) => {\n const reasonIds = new Set(\n reasons?.map((reason: any) => reason?.order_reason_id)\n );\n return failureReasons\n ?.filter((failure: any) => reasonIds?.has(failure?.id))\n ?.map((failure: any) => ({\n value: failure?.reason,\n label: failure?.title,\n id: failure?.id,\n }));\n };\n\n const faultReasonOptions = mapReasonsToFailures(faultReasons);\n const nonFaultReasonOptions = mapReasonsToFailures(nonFaultReasons);\n\n const groupedOptions: any = [\n {\n label: 'Fault Reasons',\n options: faultReasonOptions,\n },\n {\n label: 'Non-Fault Reasons',\n options: nonFaultReasonOptions,\n },\n ];\n\n const onChangeOption = (option: any) => {\n setFailureReason(option);\n setIsFailureReasonChanged(true);\n };\n\n const formatGroupLabel = (data: any) => (\n <div style={{ color: 'rgba(0,0,0,0.8)' }}>\n <span>{data?.label}</span>\n {/* <span>{data?.options?.length}</span> */}\n </div>\n );\n\n return (\n <Container>\n <Label label=\"Failure Reason\" htmlFor=\"failurereasondropdown\" required />\n <SelectDropdown\n placeholder=\"Select Reason\"\n options={groupedOptions || []}\n inputId=\"failurereasondropdown\"\n openMenuOnFocus\n value={failureReasonState}\n onChange={onChangeOption}\n formatGroupLabel={formatGroupLabel}\n isDisabled={false}\n />\n </Container>\n );\n}\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nexport default FailureReasonDropdown;\n"],"names":["FailureReasonDropdown","orderStaticData","useOrderStaticData","failureReasonState","setFailureReason","useFailureReason","setIsFailureReasonChanged","useIsFailureReasonChanged","failureReasons","escalationCategory","escalationTypes","faultNonFaultReasons","failureNonFaultId","category","failureFaultId","failureNonFaultEscTypeId","type","failureFaultEscTypeId","nonFaultReasons","reason","faultReasons","mapReasonsToFailures","reasons","reasonIds","failure","faultReasonOptions","nonFaultReasonOptions","Container","jsx","Label","SelectDropdown","option","data","styled"],"mappings":";;;;AASA,SAASA,IAAwB;AAC/B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAoBC,CAAgB,IAAIC,EAAA,GACzC,CAAA,EAAGC,CAAyB,IAAIC,EAAA,GAChCC,IAAiBP,GAAiB,iBAClCQ,IAAqBR,GAAiB,qBACtCS,IAAkBT,GAAiB,kBACnCU,IAAuBV,GAAiB,yBAGxCW,IAAoBH,GAAoB;AAAA,IAC5C,CAACI,MAAkBA,GAAU,SAAS;AAAA,EAAA,GACrC,IACGC,IAAiBL,GAAoB;AAAA,IACzC,CAACI,MAAkBA,GAAU,SAAS;AAAA,EAAA,GACrC,IAIGE,IAA2BL,GAAiB;AAAA,IAChD,CAACM,MAAcA,GAAM,2BAA2BJ;AAAA,EAAA,EAChD,CAAC,GAA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EAAC,QAAA,EAAM,UAAAI,GAAM,OAAM,GAErB;AAAA,QAcI,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACd,GACF;AAEJ;AAEA,MAAML,IAAYM,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import { useOrderId as x, useCurrentAction as
|
|
5
|
-
import
|
|
6
|
-
import { HoldContentContainer as
|
|
2
|
+
import { useState as f, useEffect as T } from "react";
|
|
3
|
+
import { useAxios as Y, Label as h, AntSelect as _ } from "@bjsdistribution/dms-component-library";
|
|
4
|
+
import { useOrderId as x, useCurrentAction as y, useOrderStaticData as I, useCustomerInfo as R } from "../../../store.js";
|
|
5
|
+
import P from "../../../../../common/modals/order-action-modal/OrderActionModal.js";
|
|
6
|
+
import { HoldContentContainer as k, SplitText as j, HoldRow as p, HoldDatePickerWrap as B } from "../modalstyle.js";
|
|
7
7
|
import { notification as d, DatePicker as U } from "antd";
|
|
8
|
-
import
|
|
8
|
+
import S from "dayjs";
|
|
9
9
|
import { useClientPortal as W } from "../../../../store.js";
|
|
10
|
-
function
|
|
11
|
-
const [a] = x(), [, l] =
|
|
10
|
+
function X(n) {
|
|
11
|
+
const [a] = x(), [, l] = y(), [H] = I(), [t, c] = f(null), [s, C] = f(void 0), [m] = R(), [D] = W(), b = `${m?.recipient_name}, ${m?.postcode}`, w = H?.onhold_reasons?.map(
|
|
12
12
|
(e) => ({
|
|
13
|
-
label:
|
|
13
|
+
label: e?.reason,
|
|
14
14
|
value: e?.reason
|
|
15
15
|
})
|
|
16
|
-
),
|
|
17
|
-
`, { fetchData:
|
|
18
|
-
endpoint:
|
|
16
|
+
), g = t ? `orders/${a}/hold/?hold_reason=${s}&hold_until=${t}` : `orders/${a}/hold/?hold_reason=${s}
|
|
17
|
+
`, { fetchData: v, error: r } = Y({
|
|
18
|
+
endpoint: g,
|
|
19
19
|
method: "POST"
|
|
20
20
|
}), A = () => {
|
|
21
21
|
l(void 0);
|
|
22
22
|
}, O = (e) => {
|
|
23
23
|
C(e);
|
|
24
|
-
}, $ = (e,
|
|
25
|
-
const
|
|
26
|
-
c(
|
|
24
|
+
}, $ = (e, L) => {
|
|
25
|
+
const u = e?.format("YYYY-MM-DDTHH:mm:ss");
|
|
26
|
+
c(u !== void 0 ? u : null);
|
|
27
27
|
}, M = async () => {
|
|
28
28
|
if (a) {
|
|
29
|
-
const e = await
|
|
29
|
+
const e = await v();
|
|
30
30
|
e?.code === 200 && (d.success({
|
|
31
31
|
message: "Success",
|
|
32
32
|
description: `${e.message}`
|
|
33
|
-
}),
|
|
33
|
+
}), D && await n?.callUnresolvedTaskApi(), await n?.callOrderAlertsApi(), await n?.callOrderStatusApi(), await n?.callOrdersApi()), e?.code !== 200 && (d.error({
|
|
34
34
|
message: "Error",
|
|
35
35
|
description: `${e.error}`
|
|
36
36
|
}), l(void 0));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
return
|
|
39
|
+
return T(() => {
|
|
40
40
|
r !== null && r?.code !== 200 && (console.log("entered"), d.error({
|
|
41
41
|
//@ts-ignore
|
|
42
42
|
message: `${r?.error}`,
|
|
@@ -46,7 +46,7 @@ function Z(n) {
|
|
|
46
46
|
)
|
|
47
47
|
}), l(void 0));
|
|
48
48
|
}, [r]), /* @__PURE__ */ o(
|
|
49
|
-
|
|
49
|
+
P,
|
|
50
50
|
{
|
|
51
51
|
minWidth: "24vw",
|
|
52
52
|
headerTitle: "Hold order",
|
|
@@ -56,26 +56,26 @@ function Z(n) {
|
|
|
56
56
|
infoText: b,
|
|
57
57
|
submitBtnTitle: "Save Details",
|
|
58
58
|
isSubmitDisabled: !(s !== void 0),
|
|
59
|
-
children: /* @__PURE__ */ o(
|
|
60
|
-
/* @__PURE__ */ i(
|
|
61
|
-
/* @__PURE__ */ o(
|
|
62
|
-
/* @__PURE__ */ o(
|
|
59
|
+
children: /* @__PURE__ */ o(k, { children: /* @__PURE__ */ i(j, { children: [
|
|
60
|
+
/* @__PURE__ */ i(p, { children: [
|
|
61
|
+
/* @__PURE__ */ o(h, { label: "Hold Until (leave blank for indefinite)" }),
|
|
62
|
+
/* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(
|
|
63
63
|
U,
|
|
64
64
|
{
|
|
65
65
|
needConfirm: !0,
|
|
66
66
|
format: "MMMM D, YYYY",
|
|
67
67
|
onChange: $,
|
|
68
|
-
value: t === null ? t :
|
|
69
|
-
disabledDate: (e) => e && e <
|
|
68
|
+
value: t === null ? t : S(t),
|
|
69
|
+
disabledDate: (e) => e && e < S().startOf("day")
|
|
70
70
|
}
|
|
71
71
|
) })
|
|
72
72
|
] }),
|
|
73
|
-
/* @__PURE__ */ i(
|
|
74
|
-
/* @__PURE__ */ o(
|
|
73
|
+
/* @__PURE__ */ i(p, { children: [
|
|
74
|
+
/* @__PURE__ */ o(h, { label: "Hold Reason", required: !0 }),
|
|
75
75
|
/* @__PURE__ */ o(
|
|
76
76
|
_,
|
|
77
77
|
{
|
|
78
|
-
options:
|
|
78
|
+
options: w || [],
|
|
79
79
|
placeholder: "Select Hold Reason",
|
|
80
80
|
onChange: O,
|
|
81
81
|
disabled: !1,
|
|
@@ -92,6 +92,6 @@ function Z(n) {
|
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
export {
|
|
95
|
-
|
|
95
|
+
X as default
|
|
96
96
|
};
|
|
97
97
|
//# sourceMappingURL=HoldOrderModal.js.map
|