@bjsdistribution/dms-client-return 0.1.77-prod → 0.1.78-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/utils.js +8 -7
- package/dist/common/utils.js.map +1 -1
- package/dist/components/client-portal/OutstandingTable.js +122 -116
- package/dist/components/client-portal/OutstandingTable.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/header-filters/overViewFilter.js +7 -11
- package/dist/components/order-daily-overview/header-filters/overViewFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +32 -30
- 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 +58 -54
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +157 -151
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.js.map +1 -1
- package/dist/components/order-view/fakedata.js.map +1 -1
- package/dist/components/order-view/general-information/dropdowns/Print.js +11 -11
- package/dist/components/order-view/general-information/dropdowns/Print.js.map +1 -1
- package/dist/components/order-view/index.js +154 -133
- package/dist/components/order-view/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 +47 -45
- 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 +36 -23
- package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/index.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +25 -23
- 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 +90 -88
- 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 +24 -22
- 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 +56 -51
- 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/CancellationReasonDropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +26 -24
- 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 +30 -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 +25 -23
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +37 -35
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +20 -18
- 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/ServiceType.js +27 -22
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
- package/dist/components/order-view/order-details/helper.js.map +1 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +179 -151
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
- package/dist/components/order-view/store.js +160 -144
- package/dist/components/order-view/store.js.map +1 -1
- package/dist/components/order-view/toolbox-resources/collapsed-content/index.js +16 -0
- package/dist/components/order-view/toolbox-resources/collapsed-content/index.js.map +1 -0
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js +534 -0
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -0
- package/dist/components/utils.js +5 -4
- package/dist/components/utils.js.map +1 -1
- package/dist/types/common/utils.d.ts +1 -0
- package/dist/types/components/order-view/order-actions/Dropdown.d.ts +1 -0
- package/dist/types/components/order-view/store.d.ts +6 -0
- package/dist/types/components/order-view/toolbox-resources/collapsed-content/index.d.ts +2 -0
- package/dist/types/components/order-view/toolbox-resources/expanded-content/index.d.ts +2 -0
- package/dist/types/components/utils.d.ts +1 -0
- package/package.json +2 -3
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Label as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import
|
|
5
|
-
import { useEscalationReason as
|
|
6
|
-
|
|
1
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Label as f, SelectDropdown as R, dropdownStyles as D } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import { useEffect as b } from "react";
|
|
4
|
+
import h from "styled-components";
|
|
5
|
+
import { useEscalationReason as g, useOrderStaticData as C, useEscalationCategory as S, useFailureReason as v, useIsFailureReasonChanged as y } from "../../../../store.js";
|
|
6
|
+
import { toReverseDeliveryLabel as E } from "../../../../../../common/utils.js";
|
|
7
|
+
import { useClientPortal as I } from "../../../../../store.js";
|
|
8
|
+
function $() {
|
|
7
9
|
const [
|
|
8
10
|
l,
|
|
9
11
|
s
|
|
10
|
-
] =
|
|
12
|
+
] = g(), [t] = C(), [p] = I(), [n] = S(), [c] = v(), [
|
|
11
13
|
r,
|
|
12
|
-
|
|
13
|
-
] =
|
|
14
|
-
(e) => e?.escalation_type_id ===
|
|
14
|
+
d
|
|
15
|
+
] = y(), x = n?.value, a = t?.escalation_reasons?.filter(
|
|
16
|
+
(e) => e?.escalation_type_id === x
|
|
15
17
|
)?.map((e) => {
|
|
16
|
-
const o =
|
|
17
|
-
(
|
|
18
|
+
const o = t?.order_escalation_reasons?.find(
|
|
19
|
+
(u) => u?.id === e?.order_reason_id
|
|
18
20
|
);
|
|
19
21
|
if (o !== void 0)
|
|
20
22
|
return {
|
|
21
|
-
label: o?.reason,
|
|
23
|
+
label: p ? o?.reason : E(o?.reason),
|
|
22
24
|
value: o?.id
|
|
23
25
|
};
|
|
24
26
|
})?.filter(
|
|
25
27
|
(e) => e !== void 0
|
|
26
28
|
);
|
|
27
|
-
return
|
|
29
|
+
return b(() => {
|
|
28
30
|
if (r && a?.length > 0) {
|
|
29
31
|
const e = a?.find(
|
|
30
|
-
(o) => o?.label ===
|
|
32
|
+
(o) => o?.label === c?.label
|
|
31
33
|
);
|
|
32
|
-
s(e),
|
|
34
|
+
s(e), d(!1);
|
|
33
35
|
}
|
|
34
36
|
!r && a?.length > 0 && s(a[0]);
|
|
35
|
-
}, [
|
|
36
|
-
/* @__PURE__ */ i(
|
|
37
|
+
}, [n]), /* @__PURE__ */ m(_, { children: [
|
|
38
|
+
/* @__PURE__ */ i(f, { label: "Escalation Reason" }),
|
|
37
39
|
/* @__PURE__ */ i(
|
|
38
|
-
|
|
40
|
+
R,
|
|
39
41
|
{
|
|
40
42
|
options: a || [],
|
|
41
43
|
styles: {
|
|
42
|
-
...
|
|
44
|
+
...D,
|
|
43
45
|
control: (e, o) => ({
|
|
44
46
|
...e,
|
|
45
47
|
border: "1px solid #D0D5DD",
|
|
@@ -74,13 +76,13 @@ function j() {
|
|
|
74
76
|
)
|
|
75
77
|
] });
|
|
76
78
|
}
|
|
77
|
-
const
|
|
79
|
+
const _ = h.div`
|
|
78
80
|
display: flex;
|
|
79
81
|
flex-direction: column;
|
|
80
82
|
gap: 8px;
|
|
81
83
|
flex: 1;
|
|
82
84
|
`;
|
|
83
85
|
export {
|
|
84
|
-
|
|
86
|
+
$ as default
|
|
85
87
|
};
|
|
86
88
|
//# 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} 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":"
|
|
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';\nimport { toReverseDeliveryLabel } from '../../../../../../common/utils';\nimport { useClientPortal } from '../../../../../store';\n\nfunction EscalationReason() {\n const [\n escalationReasonState,\n setEscalationReasonState,\n ] = useEscalationReason();\n const [orderStaticData] = useOrderStaticData();\n const [isClientPortal] = useClientPortal();\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: isClientPortal\n ? matchedItem?.reason\n : toReverseDeliveryLabel(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","isClientPortal","useClientPortal","escalationCategory","useEscalationCategory","failureReason","useFailureReason","isFailureReasonChanged","setIsFailureReasonChanged","useIsFailureReasonChanged","escalationTypeId","filteredEscReasonOptions","x","item","matchedItem","toReverseDeliveryLabel","option","useEffect","reason","Container","jsx","Label","SelectDropdown","dropdownStyles","styles","state","selectedOption","styled"],"mappings":";;;;;;;AAkBA,SAASA,IAAmB;AAC1B,QAAM;AAAA,IACJC;AAAA,IACAC;AAAA,EAAA,IACEC,EAAA,GACE,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,CAAc,IAAIC,EAAA,GACnB,CAACC,CAAkB,IAAIC,EAAA,GACvB,CAACC,CAAa,IAAIC,EAAA,GAClB;AAAA,IACJC;AAAA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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,OAAO7B;AAAA,QACP,UAAU,CAAA8B,MAAkB7B,EAAyB6B,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,98 +1,103 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as x, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { RadioButtonGroup as n } from "@bjsdistribution/dms-component-library";
|
|
3
|
-
import
|
|
4
|
-
import { useOrderStaticData as
|
|
3
|
+
import u from "styled-components";
|
|
4
|
+
import { useOrderStaticData as L, useOrderDetails as P } from "../../../../store.js";
|
|
5
5
|
import { capitalize as c } from "../../../../utils.js";
|
|
6
|
+
import { toReverseDeliveryLabel as _ } from "../../../../../../common/utils.js";
|
|
7
|
+
import { useClientPortal as A } from "../../../../../store.js";
|
|
6
8
|
const q = [
|
|
7
9
|
{ label: "Yes", value: "true" },
|
|
8
10
|
{ label: "No", value: "false" }
|
|
9
11
|
];
|
|
10
|
-
function
|
|
11
|
-
const [l] =
|
|
12
|
+
function z() {
|
|
13
|
+
const [l] = L(), [t, a] = P(), [p] = A(), y = l?.order_service_levels?.map(
|
|
12
14
|
(e) => ({
|
|
13
15
|
label: c(e.type.replaceAll("_", " ")),
|
|
14
16
|
value: e.id.toString()
|
|
15
17
|
})
|
|
16
|
-
),
|
|
18
|
+
), g = l?.order_delivery_point?.map(
|
|
17
19
|
(e) => ({
|
|
18
20
|
label: c(e.type.replaceAll("_", " ")),
|
|
19
21
|
value: e.id.toString()
|
|
20
22
|
})
|
|
21
|
-
),
|
|
22
|
-
(e) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
), f = l?.order_type?.map(
|
|
24
|
+
(e) => {
|
|
25
|
+
const r = c(e.type.replaceAll("_", " "));
|
|
26
|
+
return {
|
|
27
|
+
label: p ? r : _(r),
|
|
28
|
+
value: e.id.toString()
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
), v = l?.order_service_list, m = t?.order_services_detail?.order_delivery_point_id?.toString(), h = t?.order_services_detail?.order_service_level_id?.toString(), S = t?.order_type_id?.toString(), D = (e) => {
|
|
32
|
+
const r = {
|
|
33
|
+
...t?.order_services_detail,
|
|
29
34
|
order_delivery_point_id: +e.target.value
|
|
30
|
-
}, o = { ...
|
|
31
|
-
|
|
32
|
-
}, m = (e) => {
|
|
33
|
-
const t = {
|
|
34
|
-
...r?.order_services_detail,
|
|
35
|
-
order_service_level_id: +e.target.value
|
|
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);
|
|
35
|
+
}, o = { ...t, order_services_detail: r };
|
|
36
|
+
a(o);
|
|
41
37
|
}, b = (e) => {
|
|
42
|
-
const
|
|
38
|
+
const r = {
|
|
39
|
+
...t?.order_services_detail,
|
|
40
|
+
order_service_level_id: +e.target.value
|
|
41
|
+
}, o = { ...t, order_services_detail: r };
|
|
42
|
+
a(o);
|
|
43
|
+
}, C = (e) => {
|
|
44
|
+
const r = { ...t, order_type_id: +e.target.value };
|
|
45
|
+
a(r);
|
|
46
|
+
}, O = (e) => {
|
|
47
|
+
const o = v?.find(
|
|
43
48
|
(d) => d.id === e
|
|
44
|
-
)?.type,
|
|
45
|
-
|
|
49
|
+
)?.type, w = !t[o];
|
|
50
|
+
a((d) => ({
|
|
46
51
|
...d,
|
|
47
|
-
[o]:
|
|
52
|
+
[o]: w
|
|
48
53
|
}));
|
|
49
54
|
};
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */ i(
|
|
55
|
+
return /* @__PURE__ */ x(T, { children: [
|
|
56
|
+
/* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
|
|
52
57
|
n,
|
|
53
58
|
{
|
|
54
59
|
heading: "Service Type",
|
|
55
|
-
onChange:
|
|
56
|
-
options:
|
|
57
|
-
selectedValue:
|
|
60
|
+
onChange: C,
|
|
61
|
+
options: f || [],
|
|
62
|
+
selectedValue: S || "",
|
|
58
63
|
direction: "vertical",
|
|
59
64
|
required: !1,
|
|
60
65
|
isDisabled: !0
|
|
61
66
|
}
|
|
62
67
|
) }),
|
|
63
|
-
/* @__PURE__ */ i(
|
|
68
|
+
/* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
|
|
64
69
|
n,
|
|
65
70
|
{
|
|
66
71
|
heading: "Service Level ",
|
|
67
|
-
onChange:
|
|
68
|
-
options:
|
|
69
|
-
selectedValue:
|
|
72
|
+
onChange: b,
|
|
73
|
+
options: y || [],
|
|
74
|
+
selectedValue: h || "",
|
|
70
75
|
direction: "vertical",
|
|
71
76
|
required: !1,
|
|
72
77
|
isDisabled: !0
|
|
73
78
|
}
|
|
74
79
|
) }),
|
|
75
|
-
/* @__PURE__ */ i(
|
|
80
|
+
/* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
|
|
76
81
|
n,
|
|
77
82
|
{
|
|
78
83
|
heading: "Delivery Point",
|
|
79
|
-
onChange:
|
|
80
|
-
options:
|
|
81
|
-
selectedValue:
|
|
84
|
+
onChange: D,
|
|
85
|
+
options: g || [],
|
|
86
|
+
selectedValue: m || "",
|
|
82
87
|
direction: "vertical",
|
|
83
88
|
required: !1,
|
|
84
89
|
isDisabled: !0
|
|
85
90
|
}
|
|
86
91
|
) }),
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */ i(
|
|
92
|
+
v?.map((e) => {
|
|
93
|
+
const r = t[e?.type];
|
|
94
|
+
return /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
|
|
90
95
|
n,
|
|
91
96
|
{
|
|
92
|
-
heading: e?.type?.replaceAll("_", " "),
|
|
93
|
-
onChange: () =>
|
|
97
|
+
heading: p ? e?.type?.replaceAll("_", " ") : _(e?.type?.replaceAll("_", " ")),
|
|
98
|
+
onChange: () => O(e?.id),
|
|
94
99
|
options: q || [],
|
|
95
|
-
selectedValue:
|
|
100
|
+
selectedValue: r ? "true" : "false",
|
|
96
101
|
direction: "vertical",
|
|
97
102
|
required: !1,
|
|
98
103
|
isDisabled: !0
|
|
@@ -101,7 +106,7 @@ function G() {
|
|
|
101
106
|
})
|
|
102
107
|
] });
|
|
103
108
|
}
|
|
104
|
-
const
|
|
109
|
+
const T = u.div`
|
|
105
110
|
display: flex;
|
|
106
111
|
flex-wrap: wrap;
|
|
107
112
|
gap: 16px;
|
|
@@ -109,11 +114,11 @@ const A = v.div`
|
|
|
109
114
|
width: 100%;
|
|
110
115
|
align-items: flex-start;
|
|
111
116
|
pointer-events: none;
|
|
112
|
-
`,
|
|
117
|
+
`, s = u.div`
|
|
113
118
|
flex: 1;
|
|
114
119
|
`;
|
|
115
120
|
export {
|
|
116
|
-
|
|
121
|
+
z as default,
|
|
117
122
|
q as radioButtonFilterOptions
|
|
118
123
|
};
|
|
119
124
|
//# 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 } 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) =>
|
|
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';\nimport { toReverseDeliveryLabel } from '../../../../../../common/utils';\nimport { useClientPortal } from '../../../../../store';\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 const [isClientPortal] = useClientPortal();\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 const rawLabel = capitalize(option.type.replaceAll('_', ' '));\n return {\n label: isClientPortal ? rawLabel : toReverseDeliveryLabel(rawLabel),\n value: option.id.toString(),\n };\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={\n isClientPortal\n ? service?.type?.replaceAll('_', ' ')\n : toReverseDeliveryLabel(service?.type?.replaceAll('_', ' '))\n }\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","isClientPortal","useClientPortal","serviceLevelOptions","x","capitalize","deliveryPointOptions","serviceTypeOptions","option","rawLabel","toReverseDeliveryLabel","orderServicesOptions","deliveryPointId","serviceLevelId","orderTypeId","onChangeDeliveryPoint","event","updatedServices","newData","onChangeServiceLevel","onChangeServiceType","onChangeServices","id","key","item","value","prev","Container","jsx","Group","RadioButtonGroup","service","selected","styled"],"mappings":";;;;;;;AASO,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,GAClC,CAACC,CAAc,IAAIC,EAAA,GAEnBC,IAAsBP,GAAiB,sBAAsB;AAAA,IACjE,CAACQ,OAAY;AAAA,MACX,OAAOC,E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B,IACI8B,GAAS,MAAM,WAAW,KAAK,GAAG,IAClCrB,EAAuBqB,GAAS,MAAM,WAAW,KAAK,GAAG,CAAC;AAAA,UAEhE,UAAU,MAAMV,EAAiBU,GAAS,EAAE;AAAA,UAC5C,SAASrC,KAA4B,CAAA;AAAA,UACrC,eAAesC,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancellationReasonDropdown.js","sources":["../../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx"],"sourcesContent":["import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {
|
|
1
|
+
{"version":3,"file":"CancellationReasonDropdown.js","sources":["../../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx"],"sourcesContent":["import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n useOrderCancelReason,\n useOrderStaticData,\n} from '../../../../../store';\n\nfunction CancellationReasonDropdown() {\n const [cancelationReason, setCancelationReason] = useOrderCancelReason();\n const [orderStaticData] = useOrderStaticData();\n const cancellationReasonOptions =\n orderStaticData?.cancellation_reasons?.map((x: any) => ({\n label: x.reason,\n value: x.id,\n })) || [];\n return (\n <Container>\n <Label\n label=\"Cancellation Reason\"\n htmlFor=\"cancellationreasondropdown\"\n required\n />\n <SelectDropdown\n placeholder=\"Select Reason\"\n options={cancellationReasonOptions || []}\n inputId=\"cancellationreasondropdown\"\n openMenuOnFocus\n value={cancelationReason}\n onChange={selectedOption => setCancelationReason(selectedOption)}\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 CancellationReasonDropdown;\n"],"names":["CancellationReasonDropdown","cancelationReason","setCancelationReason","useOrderCancelReason","orderStaticData","useOrderStaticData","cancellationReasonOptions","x","Container","jsx","Label","SelectDropdown","selectedOption","styled"],"mappings":";;;;AAQA,SAASA,IAA6B;AACpC,QAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAA,GAC5C,CAACC,CAAe,IAAIC,EAAA,GACpBC,IACJF,GAAiB,sBAAsB,IAAI,CAACG,OAAY;AAAA,IACtD,OAAOA,EAAE;AAAA,IACT,OAAOA,EAAE;AAAA,EAAA,EACT,KAAK,CAAA;AACT,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,SAAQ;AAAA,QACR,UAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,IAEV,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,aAAY;AAAA,QACZ,SAASL,KAA6B,CAAA;AAAA,QACtC,SAAQ;AAAA,QACR,iBAAe;AAAA,QACf,OAAOL;AAAA,QACP,UAAU,CAAAW,MAAkBV,EAAqBU,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EACjE,GACF;AAEJ;AAEA,MAAMJ,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,65 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Label as I, SelectDropdown as O } from "@bjsdistribution/dms-component-library";
|
|
3
3
|
import x from "styled-components";
|
|
4
|
-
import { useOrderStaticData as
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { useOrderStaticData as v, useFailureReason as D, useIsFailureReasonChanged as S } from "../../../../../store.js";
|
|
5
|
+
import { toReverseDeliveryLabel as w } from "../../../../../../../common/utils.js";
|
|
6
|
+
import { useClientPortal as N } from "../../../../../../store.js";
|
|
7
|
+
function A() {
|
|
8
|
+
const [a] = v(), [i] = N(), [u, c] = D(), [, d] = S(), p = a?.failure_reasons, n = a?.escalation_category, s = a?.escalation_types, l = a?.fault_non_fault_reasons, f = n?.find(
|
|
7
9
|
(e) => e?.type === "Failure - Non Fault"
|
|
8
|
-
)?.id,
|
|
10
|
+
)?.id, F = n?.find(
|
|
9
11
|
(e) => e?.type === "Failure - Fault"
|
|
10
|
-
)?.id,
|
|
11
|
-
(e) => e?.escalation_category_id === p
|
|
12
|
-
)[0]?.id, R = s?.filter(
|
|
12
|
+
)?.id, m = s?.filter(
|
|
13
13
|
(e) => e?.escalation_category_id === f
|
|
14
|
-
)[0]?.id,
|
|
15
|
-
(e) => e?.
|
|
16
|
-
),
|
|
14
|
+
)[0]?.id, R = s?.filter(
|
|
15
|
+
(e) => e?.escalation_category_id === F
|
|
16
|
+
)[0]?.id, y = l?.filter(
|
|
17
|
+
(e) => e?.escalation_type_id === m
|
|
18
|
+
), _ = l?.filter(
|
|
17
19
|
(e) => e?.escalation_type_id === R
|
|
18
20
|
), r = (e) => {
|
|
19
21
|
const h = new Set(
|
|
20
22
|
e?.map((o) => o?.order_reason_id)
|
|
21
23
|
);
|
|
22
|
-
return
|
|
24
|
+
return p?.filter((o) => h?.has(o?.id))?.map((o) => ({
|
|
23
25
|
value: o?.reason,
|
|
24
|
-
label: o?.title,
|
|
26
|
+
label: i ? o?.title : w(o?.title),
|
|
25
27
|
id: o?.id
|
|
26
28
|
}));
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
29
|
+
}, g = r(_), b = r(y);
|
|
30
|
+
return /* @__PURE__ */ C(L, { children: [
|
|
31
|
+
/* @__PURE__ */ t(I, { label: "Failure Reason", htmlFor: "failurereasondropdown", required: !0 }),
|
|
32
|
+
/* @__PURE__ */ t(
|
|
31
33
|
O,
|
|
32
34
|
{
|
|
33
35
|
placeholder: "Select Reason",
|
|
34
36
|
options: [
|
|
35
37
|
{
|
|
36
38
|
label: "Fault Reasons",
|
|
37
|
-
options:
|
|
39
|
+
options: g
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
42
|
label: "Non-Fault Reasons",
|
|
41
|
-
options:
|
|
43
|
+
options: b
|
|
42
44
|
}
|
|
43
45
|
] || [],
|
|
44
46
|
inputId: "failurereasondropdown",
|
|
45
47
|
openMenuOnFocus: !0,
|
|
46
|
-
value:
|
|
48
|
+
value: u,
|
|
47
49
|
onChange: (e) => {
|
|
48
|
-
|
|
50
|
+
c(e), d(!0);
|
|
49
51
|
},
|
|
50
|
-
formatGroupLabel: (e) => /* @__PURE__ */
|
|
52
|
+
formatGroupLabel: (e) => /* @__PURE__ */ t("div", { style: { color: "rgba(0,0,0,0.8)" }, children: /* @__PURE__ */ t("span", { children: e?.label }) }),
|
|
51
53
|
isDisabled: !1
|
|
52
54
|
}
|
|
53
55
|
)
|
|
54
56
|
] });
|
|
55
57
|
}
|
|
56
|
-
const
|
|
58
|
+
const L = x.div`
|
|
57
59
|
display: flex;
|
|
58
60
|
flex-direction: column;
|
|
59
61
|
gap: 6px;
|
|
60
62
|
flex: 1;
|
|
61
63
|
`;
|
|
62
64
|
export {
|
|
63
|
-
|
|
65
|
+
A as default
|
|
64
66
|
};
|
|
65
67
|
//# 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 } 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":"
|
|
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';\nimport { toReverseDeliveryLabel } from '../../../../../../../common/utils';\nimport { useClientPortal } from '../../../../../../store';\n\nfunction FailureReasonDropdown() {\n const [orderStaticData] = useOrderStaticData();\n const [isClientPortal] = useClientPortal();\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: isClientPortal\n ? failure?.title\n : toReverseDeliveryLabel(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","isClientPortal","useClientPortal","failureReasonState","setFailureReason","useFailureReason","setIsFailureReasonChanged","useIsFailureReasonChanged","failureReasons","escalationCategory","escalationTypes","faultNonFaultReasons","failureNonFaultId","category","failureFaultId","failureNonFaultEscTypeId","type","failureFaultEscTypeId","nonFaultReasons","reason","faultReasons","mapReasonsToFailures","reasons","reasonIds","failure","toReverseDeliveryLabel","faultReasonOptions","nonFaultReasonOptions","Container","jsx","Label","SelectDropdown","option","data","styled"],"mappings":";;;;;;AAWA,SAASA,IAAwB;AAC/B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,CAAc,IAAIC,EAAA,GACnB,CAACC,GAAoBC,CAAgB,IAAIC,EAAA,GACzC,CAAA,EAAGC,CAAyB,IAAIC,EAAA,GAChCC,IAAiBT,GAAiB,iBAClCU,IAAqBV,GAAiB,qBACtCW,IAAkBX,GAAiB,kBACnCY,IAAuBZ,GAAiB,yBAGxCa,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,GAAG,IACAK,IAAwBP,GAA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AA,gBAAAA,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,43 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useAxios as
|
|
4
|
-
import { useOrderId as
|
|
2
|
+
import { useState as h, useEffect as y } from "react";
|
|
3
|
+
import { useAxios as T, Label as p, AntSelect as Y } from "@bjsdistribution/dms-component-library";
|
|
4
|
+
import { useOrderId as _, useCurrentAction as x, useOrderStaticData as R, useCustomerInfo as I } from "../../../store.js";
|
|
5
5
|
import P from "../../../../../common/modals/order-action-modal/OrderActionModal.js";
|
|
6
|
-
import { HoldContentContainer as k, SplitText as j, HoldRow as
|
|
7
|
-
import { notification as d, DatePicker as
|
|
8
|
-
import
|
|
9
|
-
import { useClientPortal as
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { HoldContentContainer as k, SplitText as j, HoldRow as S, HoldDatePickerWrap as B } from "../modalstyle.js";
|
|
7
|
+
import { notification as d, DatePicker as L } from "antd";
|
|
8
|
+
import D from "dayjs";
|
|
9
|
+
import { useClientPortal as U } from "../../../../store.js";
|
|
10
|
+
import { toReverseDeliveryLabel as W } from "../../../../../common/utils.js";
|
|
11
|
+
function ee(n) {
|
|
12
|
+
const [a] = _(), [, l] = x(), [H] = R(), [t, c] = h(null), [s, C] = h(void 0), [m] = I(), [u] = U(), b = `${m?.recipient_name}, ${m?.postcode}`, v = H?.onhold_reasons?.map(
|
|
12
13
|
(e) => ({
|
|
13
|
-
label: e?.reason,
|
|
14
|
+
label: u ? e?.reason : W(e?.reason),
|
|
14
15
|
value: e?.reason
|
|
15
16
|
})
|
|
16
|
-
),
|
|
17
|
-
`, { fetchData:
|
|
18
|
-
endpoint:
|
|
17
|
+
), w = t ? `orders/${a}/hold/?hold_reason=${s}&hold_until=${t}` : `orders/${a}/hold/?hold_reason=${s}
|
|
18
|
+
`, { fetchData: g, error: r } = T({
|
|
19
|
+
endpoint: w,
|
|
19
20
|
method: "POST"
|
|
20
21
|
}), A = () => {
|
|
21
22
|
l(void 0);
|
|
22
23
|
}, O = (e) => {
|
|
23
24
|
C(e);
|
|
24
|
-
}, $ = (e,
|
|
25
|
-
const
|
|
26
|
-
c(
|
|
25
|
+
}, $ = (e, q) => {
|
|
26
|
+
const f = e?.format("YYYY-MM-DDTHH:mm:ss");
|
|
27
|
+
c(f !== void 0 ? f : null);
|
|
27
28
|
}, M = async () => {
|
|
28
29
|
if (a) {
|
|
29
|
-
const e = await
|
|
30
|
+
const e = await g();
|
|
30
31
|
e?.code === 200 && (d.success({
|
|
31
32
|
message: "Success",
|
|
32
33
|
description: `${e.message}`
|
|
33
|
-
}),
|
|
34
|
+
}), u && await n?.callUnresolvedTaskApi(), await n?.callOrderAlertsApi(), await n?.callOrderStatusApi(), await n?.callOrdersApi()), e?.code !== 200 && (d.error({
|
|
34
35
|
message: "Error",
|
|
35
36
|
description: `${e.error}`
|
|
36
37
|
}), l(void 0));
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
|
-
return
|
|
40
|
+
return y(() => {
|
|
40
41
|
r !== null && r?.code !== 200 && (console.log("entered"), d.error({
|
|
41
42
|
//@ts-ignore
|
|
42
43
|
message: `${r?.error}`,
|
|
@@ -57,25 +58,25 @@ function X(n) {
|
|
|
57
58
|
submitBtnTitle: "Save Details",
|
|
58
59
|
isSubmitDisabled: !(s !== void 0),
|
|
59
60
|
children: /* @__PURE__ */ o(k, { children: /* @__PURE__ */ i(j, { children: [
|
|
60
|
-
/* @__PURE__ */ i(
|
|
61
|
-
/* @__PURE__ */ o(
|
|
61
|
+
/* @__PURE__ */ i(S, { children: [
|
|
62
|
+
/* @__PURE__ */ o(p, { label: "Hold Until (leave blank for indefinite)" }),
|
|
62
63
|
/* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(
|
|
63
|
-
|
|
64
|
+
L,
|
|
64
65
|
{
|
|
65
66
|
needConfirm: !0,
|
|
66
67
|
format: "MMMM D, YYYY",
|
|
67
68
|
onChange: $,
|
|
68
|
-
value: t === null ? t :
|
|
69
|
-
disabledDate: (e) => e && e <
|
|
69
|
+
value: t === null ? t : D(t),
|
|
70
|
+
disabledDate: (e) => e && e < D().startOf("day")
|
|
70
71
|
}
|
|
71
72
|
) })
|
|
72
73
|
] }),
|
|
73
|
-
/* @__PURE__ */ i(
|
|
74
|
-
/* @__PURE__ */ o(
|
|
74
|
+
/* @__PURE__ */ i(S, { children: [
|
|
75
|
+
/* @__PURE__ */ o(p, { label: "Hold Reason", required: !0 }),
|
|
75
76
|
/* @__PURE__ */ o(
|
|
76
|
-
|
|
77
|
+
Y,
|
|
77
78
|
{
|
|
78
|
-
options:
|
|
79
|
+
options: v || [],
|
|
79
80
|
placeholder: "Select Hold Reason",
|
|
80
81
|
onChange: O,
|
|
81
82
|
disabled: !1,
|
|
@@ -92,6 +93,6 @@ function X(n) {
|
|
|
92
93
|
);
|
|
93
94
|
}
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
+
ee as default
|
|
96
97
|
};
|
|
97
98
|
//# sourceMappingURL=HoldOrderModal.js.map
|