@bjsdistribution/dms-client-return 0.1.90-prod → 0.1.91-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/components/client-portal/OutstandingTable.js +1 -1
- package/dist/components/client-portal/OutstandingTable.js.map +1 -1
- package/dist/components/client-portal/ReturnAfterSearchBar.js +7 -5
- package/dist/components/client-portal/ReturnAfterSearchBar.js.map +1 -1
- package/dist/components/client-portal/ReturnOverview.js +34 -31
- package/dist/components/client-portal/ReturnOverview.js.map +1 -1
- package/dist/components/client-portal/ReturnSearchBar.js +14 -12
- package/dist/components/client-portal/ReturnSearchBar.js.map +1 -1
- package/dist/components/client-portal/return-confirm/ConfirmedMain.js +11 -10
- package/dist/components/client-portal/return-confirm/ConfirmedMain.js.map +1 -1
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.js +62 -62
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.js.map +1 -1
- package/dist/components/order-daily-overview/header/route-header/ClientRouterHeader.js +34 -30
- package/dist/components/order-daily-overview/header/route-header/ClientRouterHeader.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js +40 -29
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js.map +1 -1
- package/dist/components/order-view/notification/FlagTemplate.js +55 -36
- package/dist/components/order-view/notification/FlagTemplate.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { StyledFiter as
|
|
4
|
-
import
|
|
5
|
-
import { useCustomerData as
|
|
6
|
-
import { useParams as
|
|
7
|
-
import
|
|
8
|
-
import { useAxios as
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as e, Fragment as i, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as m } from "react";
|
|
3
|
+
import { StyledFiter as R, Text as b, StyledFIlterELements as A, StyledTableFilter as N } from "../../filters/FilterStyle.js";
|
|
4
|
+
import w from "./RightFilters.js";
|
|
5
|
+
import { useCustomerData as E, useClientPortal as L, useStatsCPCount as j, useSearchAfterText as v, useSearchText as B } from "../../../store.js";
|
|
6
|
+
import { useParams as D } from "react-router-dom";
|
|
7
|
+
import I from "../../../client-portal/ReturnRTFilters.js";
|
|
8
|
+
import { useAxios as O, GlobalElements as a } from "@bjsdistribution/dms-component-library";
|
|
9
|
+
import "@bjsdistribution/dms-component-library/style.css";
|
|
10
|
+
import { dateFilterCPReducer as q } from "../../../client-portal/DateFilterStore.js";
|
|
11
|
+
import { useAtom as G } from "jotai";
|
|
12
|
+
const Z = ({ data: d, payload: u }) => {
|
|
13
|
+
const [p] = E(), [o] = L(), { status: r } = D(), [f, h] = j(), [n] = v(), [g] = B(), [x] = G(q), { "x-filters": c } = x, S = c.filter((t) => t.field !== "order_status"), _ = new URLSearchParams(location.search).get("customerId"), C = p?.find(
|
|
14
|
+
(t) => t?.customer_id?.toString() === _
|
|
15
|
+
)?.customer_name, F = (t) => {
|
|
16
|
+
switch (t) {
|
|
16
17
|
case "outstanding_return":
|
|
17
18
|
return "Outstanding Return";
|
|
18
19
|
case "scheduled_for_return":
|
|
@@ -20,28 +21,38 @@ const X = ({ data: d, payload: m }) => {
|
|
|
20
21
|
case "return_completed":
|
|
21
22
|
return "Completed Return";
|
|
22
23
|
default:
|
|
23
|
-
return
|
|
24
|
+
return t.replace(/_/g, " ").replace(/\b\w/g, (P) => P.toUpperCase());
|
|
24
25
|
}
|
|
25
|
-
}, { data: s, loading:
|
|
26
|
+
}, { data: s, loading: T, fetchData: y } = O({
|
|
26
27
|
endpoint: "v1/portal/return/stats/",
|
|
27
28
|
method: "GET",
|
|
28
29
|
pagination: { is_pagination: !1 },
|
|
29
|
-
filters:
|
|
30
|
+
filters: S
|
|
30
31
|
});
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
}, [
|
|
32
|
+
return m(() => {
|
|
33
|
+
o && n === "" && r == "return_completed" && y();
|
|
34
|
+
}, [n, g, JSON.stringify(c)]), m(() => {
|
|
34
35
|
s?.data && typeof s?.data == "object" && h(s?.data);
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
}, [T]), /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(R, { children: o ? /* @__PURE__ */ l(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: a.managementBar,
|
|
40
|
+
style: {
|
|
41
|
+
width: "calc(100% + 32px)",
|
|
42
|
+
margin: "-40px -16px 15px"
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ e("h2", { className: a.managementBarTitle, children: r ? `${F(r)} (${f?.completed_count})` : "" }),
|
|
46
|
+
/* @__PURE__ */ e("div", { className: a.managementBarActions, children: /* @__PURE__ */ e(I, { data: d, payload: u }) })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
) : /* @__PURE__ */ l(i, { children: [
|
|
50
|
+
/* @__PURE__ */ e(b, { children: C }),
|
|
51
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(N, {}) }),
|
|
52
|
+
/* @__PURE__ */ e(w, {})
|
|
42
53
|
] }) }) });
|
|
43
54
|
};
|
|
44
55
|
export {
|
|
45
|
-
|
|
56
|
+
Z as default
|
|
46
57
|
};
|
|
47
58
|
//# sourceMappingURL=ReturnFilter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReturnFilter.js","sources":["../../../../../src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport {\n StyledFIlterELements,\n StyledFiter,\n StyledTableFilter,\n Text,\n} from '../../filters/FilterStyle';\nimport RightFilters from './RightFilters';\nimport {\n useAtom,\n useClientPortal,\n useCustomerData,\n useSearchAfterText,\n useSearchText,\n useStatsCPCount,\n} from '../../../store';\nimport { useParams } from 'react-router-dom';\nimport ReturnRTFilters from '../../../client-portal/ReturnRTFilters';\nimport { returnCountType } from '../../../client-portal/ReturnStatus';\nimport { useAxios } from '@bjsdistribution/dms-component-library';\nimport { dateFilterCPReducer } from '../../../client-portal/DateFilterStore';\n\nconst ReturnFilter = ({ data, payload }: { data?: any; payload?: any }) => {\n const [customers] = useCustomerData();\n const [clientPortal] = useClientPortal();\n const { status } = useParams();\n const [count, setCount] = useStatsCPCount();\n const [debouncedSearchAfterText] = useSearchAfterText();\n const [debouncedSearchText] = useSearchText();\n\n const [state] = useAtom(dateFilterCPReducer);\n const { 'x-filters': filters } = state;\n\n const cleanedFilters = filters.filter(f => f.field !== 'order_status');\n\n const queryParams = new URLSearchParams(location.search);\n const customerId = queryParams.get('customerId');\n\n const selectedCustomer = customers?.find(\n (customer: any) => customer?.customer_id?.toString() === customerId\n );\n\n const customerName = selectedCustomer?.customer_name;\n // const accountNumber = selectedCustomer?.account_number;\n\n const getStatusLabel = (status: string) => {\n switch (status) {\n case 'outstanding_return':\n return 'Outstanding Return';\n case 'scheduled_for_return':\n return 'All Scheduled Orders';\n case 'return_completed':\n // return 'View Return Order';\n return 'Completed Return';\n default:\n return status\n .replace(/_/g, ' ')\n .replace(/\\b\\w/g, char => char.toUpperCase());\n }\n };\n\n const { data: statsData, loading: statsApiLoading, fetchData } = useAxios<{\n data: returnCountType[];\n }>({\n endpoint: `v1/portal/return/stats/`,\n method: 'GET',\n pagination: { is_pagination: false },\n filters: cleanedFilters,\n });\n\n useEffect(() => {\n if (\n clientPortal &&\n debouncedSearchAfterText === '' &&\n status == 'return_completed'\n ) {\n fetchData();\n }\n }, [debouncedSearchAfterText, debouncedSearchText, JSON.stringify(filters)]);\n\n useEffect(() => {\n if (statsData?.data && typeof statsData?.data === 'object') {\n setCount(statsData?.data);\n }\n }, [statsApiLoading]);\n\n return (\n <>\n <StyledFiter>\n {!clientPortal ? (\n <>\n <Text>{customerName}</Text>\n <StyledFIlterELements>\n <StyledTableFilter />\n </StyledFIlterELements>\n <RightFilters />\n </>\n ) : (\n
|
|
1
|
+
{"version":3,"file":"ReturnFilter.js","sources":["../../../../../src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport {\n StyledFIlterELements,\n StyledFiter,\n StyledTableFilter,\n Text,\n} from '../../filters/FilterStyle';\nimport RightFilters from './RightFilters';\nimport {\n useAtom,\n useClientPortal,\n useCustomerData,\n useSearchAfterText,\n useSearchText,\n useStatsCPCount,\n} from '../../../store';\nimport { useParams } from 'react-router-dom';\nimport ReturnRTFilters from '../../../client-portal/ReturnRTFilters';\nimport { returnCountType } from '../../../client-portal/ReturnStatus';\nimport { GlobalElements, useAxios } from '@bjsdistribution/dms-component-library';\nimport '@bjsdistribution/dms-component-library/style.css';\nimport { dateFilterCPReducer } from '../../../client-portal/DateFilterStore';\n\nconst ReturnFilter = ({ data, payload }: { data?: any; payload?: any }) => {\n const [customers] = useCustomerData();\n const [clientPortal] = useClientPortal();\n const { status } = useParams();\n const [count, setCount] = useStatsCPCount();\n const [debouncedSearchAfterText] = useSearchAfterText();\n const [debouncedSearchText] = useSearchText();\n\n const [state] = useAtom(dateFilterCPReducer);\n const { 'x-filters': filters } = state;\n\n const cleanedFilters = filters.filter(f => f.field !== 'order_status');\n\n const queryParams = new URLSearchParams(location.search);\n const customerId = queryParams.get('customerId');\n\n const selectedCustomer = customers?.find(\n (customer: any) => customer?.customer_id?.toString() === customerId\n );\n\n const customerName = selectedCustomer?.customer_name;\n // const accountNumber = selectedCustomer?.account_number;\n\n const getStatusLabel = (status: string) => {\n switch (status) {\n case 'outstanding_return':\n return 'Outstanding Return';\n case 'scheduled_for_return':\n return 'All Scheduled Orders';\n case 'return_completed':\n // return 'View Return Order';\n return 'Completed Return';\n default:\n return status\n .replace(/_/g, ' ')\n .replace(/\\b\\w/g, char => char.toUpperCase());\n }\n };\n\n const { data: statsData, loading: statsApiLoading, fetchData } = useAxios<{\n data: returnCountType[];\n }>({\n endpoint: `v1/portal/return/stats/`,\n method: 'GET',\n pagination: { is_pagination: false },\n filters: cleanedFilters,\n });\n\n useEffect(() => {\n if (\n clientPortal &&\n debouncedSearchAfterText === '' &&\n status == 'return_completed'\n ) {\n fetchData();\n }\n }, [debouncedSearchAfterText, debouncedSearchText, JSON.stringify(filters)]);\n\n useEffect(() => {\n if (statsData?.data && typeof statsData?.data === 'object') {\n setCount(statsData?.data);\n }\n }, [statsApiLoading]);\n\n return (\n <>\n <StyledFiter>\n {!clientPortal ? (\n <>\n <Text>{customerName}</Text>\n <StyledFIlterELements>\n <StyledTableFilter />\n </StyledFIlterELements>\n <RightFilters />\n </>\n ) : (\n <div\n className={GlobalElements.managementBar}\n style={{\n width: 'calc(100% + 32px)',\n margin: '-40px -16px 15px',\n }}\n >\n <h2 className={GlobalElements.managementBarTitle}>\n {status\n ? `${getStatusLabel(status)} (${count?.completed_count})`\n : ''}\n </h2>\n <div className={GlobalElements.managementBarActions}>\n <ReturnRTFilters data={data} payload={payload} />\n </div>\n </div>\n )}\n </StyledFiter>\n </>\n );\n};\n\nexport default ReturnFilter;\n"],"names":["ReturnFilter","data","payload","customers","useCustomerData","clientPortal","useClientPortal","status","useParams","count","setCount","useStatsCPCount","debouncedSearchAfterText","useSearchAfterText","debouncedSearchText","useSearchText","state","useAtom","dateFilterCPReducer","filters","cleanedFilters","f","customerId","customerName","customer","getStatusLabel","char","statsData","statsApiLoading","fetchData","useAxios","useEffect","jsx","Fragment","StyledFiter","jsxs","GlobalElements","ReturnRTFilters","Text","StyledFIlterELements","StyledTableFilter","RightFilters"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,IAAe,CAAC,EAAE,MAAAC,GAAM,SAAAC,QAA6C;AACzE,QAAM,CAACC,CAAS,IAAIC,EAAA,GACd,CA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UAAC7B,IASA,gBAAA8B;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAe;AAAA,MAC1B,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,MAAA;AAAA,MAGV,UAAA;AAAA,QAAA,gBAAAJ,EAAC,MAAA,EAAG,WAAWI,EAAe,oBAC3B,UAAA7B,IACG,GAAGkB,EAAelB,CAAM,CAAC,KAAKE,GAAO,eAAe,MACpD,IACN;AAAA,QACA,gBAAAuB,EAAC,SAAI,WAAWI,EAAe,sBAC7B,UAAA,gBAAAJ,EAACK,GAAA,EAAgB,MAAApC,GAAY,SAAAC,EAAA,CAAkB,EAAA,CACjD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAtBF,gBAAAiC,EAAAF,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAD,EAACM,KAAM,UAAAf,EAAA,CAAa;AAAA,IACpB,gBAAAS,EAACO,GAAA,EACC,UAAA,gBAAAP,EAACQ,GAAA,CAAA,CAAkB,GACrB;AAAA,sBACCC,GAAA,CAAA,CAAa;AAAA,EAAA,EAAA,CAChB,GAmBJ,EAAA,CACF;AAEJ;"}
|
|
@@ -1,56 +1,75 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { FlagAlert as
|
|
3
|
-
import
|
|
4
|
-
import { useFlagRefId as
|
|
1
|
+
import { jsx as o, jsxs as t, Fragment as r } from "react/jsx-runtime";
|
|
2
|
+
import { FlagAlert as a, formatUtcToLocal as l } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import n from "styled-components";
|
|
4
|
+
import { useFlagRefId as y } from "../order-actions/store.js";
|
|
5
5
|
import { useCurrentAction as g } from "../store.js";
|
|
6
6
|
import { useClientPortal as h } from "../../store.js";
|
|
7
|
-
function w({ data:
|
|
8
|
-
const [, i] =
|
|
7
|
+
function w({ data: e, dismissFlags: s }) {
|
|
8
|
+
const [, i] = y(), [, c] = g(), [f] = h(), m = () => {
|
|
9
9
|
c("view-flag");
|
|
10
|
-
},
|
|
10
|
+
}, p = (d) => {
|
|
11
11
|
i(d), m();
|
|
12
|
-
},
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
12
|
+
}, u = e?.status === "SD" ? "#36A053" : "#3a3630";
|
|
13
|
+
return /* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(
|
|
14
|
+
a,
|
|
15
15
|
{
|
|
16
|
-
type:
|
|
17
|
-
title: /* @__PURE__ */ t(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
o?.status === "AD" ? "Unresolved" : "Resolved on",
|
|
29
|
-
" ",
|
|
30
|
-
o?.status == "SD" ? /* @__PURE__ */ e(n, { children: [
|
|
31
|
-
`${s(o?.resolved_at)?.date} ${s(o?.resolved_at)?.time}`,
|
|
16
|
+
type: e?.status === "AD" ? "info" : "success",
|
|
17
|
+
title: /* @__PURE__ */ t(r, { children: [
|
|
18
|
+
/* @__PURE__ */ t(_, { color: u, children: [
|
|
19
|
+
"Flag : ",
|
|
20
|
+
e?.is_private ? "Private" : "Public",
|
|
21
|
+
" ",
|
|
22
|
+
/* @__PURE__ */ t(C, { onClick: () => p(e.id), children: [
|
|
23
|
+
e?.id,
|
|
24
|
+
" - ",
|
|
25
|
+
e?.flag_type,
|
|
26
|
+
" "
|
|
27
|
+
] }),
|
|
32
28
|
" ",
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
e?.status === "AD" ? "Unresolved" : "Resolved on",
|
|
30
|
+
" ",
|
|
31
|
+
e?.status == "SD" ? /* @__PURE__ */ t(r, { children: [
|
|
32
|
+
`${l(e?.resolved_at)?.date} ${l(e?.resolved_at)?.time}`,
|
|
33
|
+
" ",
|
|
34
|
+
"by ",
|
|
35
|
+
e?.resolved_by,
|
|
36
|
+
" "
|
|
37
|
+
] }) : null
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ o("br", {}),
|
|
40
|
+
/* @__PURE__ */ t(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
style: {
|
|
44
|
+
color: "#363a30",
|
|
45
|
+
fontWeight: 400,
|
|
46
|
+
fontSize: "13px"
|
|
47
|
+
},
|
|
48
|
+
children: [
|
|
49
|
+
"Created: ",
|
|
50
|
+
l(e?.created_at)?.date,
|
|
51
|
+
" ",
|
|
52
|
+
l(e?.created_at)?.time
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }),
|
|
38
57
|
subtitle: "",
|
|
39
|
-
description: f ? /* @__PURE__ */
|
|
58
|
+
description: f ? /* @__PURE__ */ o("span", { dangerouslySetInnerHTML: { __html: e?.description } }) : `${e?.description}`,
|
|
40
59
|
showOkButton: !1,
|
|
41
|
-
onClose: () =>
|
|
60
|
+
onClose: () => s(e?.id)
|
|
42
61
|
}
|
|
43
62
|
) });
|
|
44
63
|
}
|
|
45
|
-
const v =
|
|
64
|
+
const v = n.div``, C = n.span`
|
|
46
65
|
color: var(--contextual-blue, #6396e5);
|
|
47
66
|
font-family: Roboto;
|
|
48
67
|
font-size: 14px;
|
|
49
68
|
font-style: normal;
|
|
50
69
|
font-weight: 600;
|
|
51
70
|
cursor: pointer;
|
|
52
|
-
`,
|
|
53
|
-
color: ${({ color:
|
|
71
|
+
`, _ = n.span`
|
|
72
|
+
color: ${({ color: e }) => e};
|
|
54
73
|
font-family: Roboto;
|
|
55
74
|
font-size: 14px;
|
|
56
75
|
font-style: normal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagTemplate.js","sources":["../../../../src/components/order-view/notification/FlagTemplate.tsx"],"sourcesContent":["import {\n FlagAlert,\n formatUtcToLocal,\n} from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useFlagRefId } from '../order-actions/store';\nimport { useCurrentAction } from '../store';\nimport { useClientPortal } from '../../store';\nfunction FlagTemplate({ data, dismissFlags }: any) {\n const [, setSelectedFlag] = useFlagRefId();\n const [, setCurrentAction] = useCurrentAction();\n const [isCustomerPortal] = useClientPortal();\n //\n const openModal = () => {\n setCurrentAction('view-flag');\n };\n const handleClick = (Id: number) => {\n setSelectedFlag(Id);\n openModal();\n };\n\n const titleColor = data?.status === 'SD' ? '#36A053' : '#3a3630';\n return (\n <StyledAlert>\n <FlagAlert\n type={data?.status === 'AD' ? 'info' : 'success'}\n title={\n <>\n <StyledTitle color={titleColor}>\n Flag : {data?.is_private ? 'Private' : 'Public'}{' '}\n <StyledLink onClick={() => handleClick(data.id)}>\n {data?.id} - {data?.flag_type}{' '}\n </StyledLink>{' '}\n {data?.status === 'AD' ? 'Unresolved' : 'Resolved on'}{' '}\n {data?.status == 'SD' ? (\n <>\n {`${formatUtcToLocal(data?.resolved_at)?.date} ${\n formatUtcToLocal(data?.resolved_at)?.time\n }`}{' '}\n by {data?.resolved_by}{' '}\n </>\n ) : null}\n </StyledTitle>\n </>\n }\n subtitle=\"\"\n description={\n isCustomerPortal ? (\n <span dangerouslySetInnerHTML={{ __html: data?.description }} />\n ) : (\n `${data?.description}`\n )\n }\n showOkButton={false}\n onClose={() => dismissFlags(data?.id)}\n />\n </StyledAlert>\n );\n}\n\nconst StyledAlert = styled.div``;\n\nconst StyledLink = styled.span`\n color: var(--contextual-blue, #6396e5);\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n cursor: pointer;\n`;\n\nconst StyledTitle = styled.span<{ color: string }>`\n color: ${({ color }) => color};\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n`;\n\nexport default FlagTemplate;\n"],"names":["FlagTemplate","data","dismissFlags","setSelectedFlag","useFlagRefId","setCurrentAction","useCurrentAction","isCustomerPortal","useClientPortal","openModal","handleClick","Id","titleColor","StyledAlert","jsx","FlagAlert","
|
|
1
|
+
{"version":3,"file":"FlagTemplate.js","sources":["../../../../src/components/order-view/notification/FlagTemplate.tsx"],"sourcesContent":["import {\n FlagAlert,\n formatUtcToLocal,\n} from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useFlagRefId } from '../order-actions/store';\nimport { useCurrentAction } from '../store';\nimport { useClientPortal } from '../../store';\nfunction FlagTemplate({ data, dismissFlags }: any) {\n const [, setSelectedFlag] = useFlagRefId();\n const [, setCurrentAction] = useCurrentAction();\n const [isCustomerPortal] = useClientPortal();\n //\n const openModal = () => {\n setCurrentAction('view-flag');\n };\n const handleClick = (Id: number) => {\n setSelectedFlag(Id);\n openModal();\n };\n\n const titleColor = data?.status === 'SD' ? '#36A053' : '#3a3630';\n return (\n <StyledAlert>\n <FlagAlert\n type={data?.status === 'AD' ? 'info' : 'success'}\n title={\n <>\n <StyledTitle color={titleColor}>\n Flag : {data?.is_private ? 'Private' : 'Public'}{' '}\n <StyledLink onClick={() => handleClick(data.id)}>\n {data?.id} - {data?.flag_type}{' '}\n </StyledLink>{' '}\n {data?.status === 'AD' ? 'Unresolved' : 'Resolved on'}{' '}\n {data?.status == 'SD' ? (\n <>\n {`${formatUtcToLocal(data?.resolved_at)?.date} ${\n formatUtcToLocal(data?.resolved_at)?.time\n }`}{' '}\n by {data?.resolved_by}{' '}\n </>\n ) : null}\n </StyledTitle>\n <br />\n <span\n style={{\n color: '#363a30',\n fontWeight: 400,\n fontSize: '13px',\n }}\n >\n Created: {formatUtcToLocal(data?.created_at)?.date}{' '}\n {formatUtcToLocal(data?.created_at)?.time}\n </span>\n </>\n }\n subtitle=\"\"\n description={\n isCustomerPortal ? (\n <span dangerouslySetInnerHTML={{ __html: data?.description }} />\n ) : (\n `${data?.description}`\n )\n }\n showOkButton={false}\n onClose={() => dismissFlags(data?.id)}\n />\n </StyledAlert>\n );\n}\n\nconst StyledAlert = styled.div``;\n\nconst StyledLink = styled.span`\n color: var(--contextual-blue, #6396e5);\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n cursor: pointer;\n`;\n\nconst StyledTitle = styled.span<{ color: string }>`\n color: ${({ color }) => color};\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n`;\n\nexport default FlagTemplate;\n"],"names":["FlagTemplate","data","dismissFlags","setSelectedFlag","useFlagRefId","setCurrentAction","useCurrentAction","isCustomerPortal","useClientPortal","openModal","handleClick","Id","titleColor","StyledAlert","jsx","FlagAlert","jsxs","Fragment","StyledTitle","StyledLink","formatUtcToLocal","styled","color"],"mappings":";;;;;;AASA,SAASA,EAAa,EAAE,MAAAC,GAAM,cAAAC,KAAqB;AACjD,QAAM,CAAA,EAAGC,CAAe,IAAIC,EAAA,GACtB,CAAA,EAAGC,CAAgB,IAAIC,EAAA,GACvB,CAACC,CAAgB,IAAIC,EAAA,GAErBC,IAAY,MAAM;AACtB,IAAAJ,EAAiB,WAAW;AAAA,EAC9B,GACMK,IAAc,CAACC,MAAe;AAClC,IAAAR,EAAgBQ,CAAE,GAClBF,EAAA;AAAA,EACF,GAEMG,IAAaX,GAAM,WAAW,OAAO,YAAY;AACvD,2BACGY,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMd,GAAM,WAAW,OAAO,SAAS;AAAA,MACvC,OACE,gBAAAe,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAD,EAACE,GAAA,EAAY,OAAON,GAAY,UAAA;AAAA,UAAA;AAAA,UACtBX,GAAM,aAAa,YAAY;AAAA,UAAU;AAAA,4BAChDkB,GAAA,EAAW,SAAS,MAAMT,EAAYT,EAAK,EAAE,GAC3C,UAAA;AAAA,YAAAA,GAAM;AAAA,YAAG;AAAA,YAAIA,GAAM;AAAA,YAAW;AAAA,UAAA,GACjC;AAAA,UAAc;AAAA,UACbA,GAAM,WAAW,OAAO,eAAe;AAAA,UAAe;AAAA,UACtDA,GAAM,UAAU,OACf,gBAAAe,EAAA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