@bigbinary/neeto-payments-frontend 6.1.25 → 6.1.26
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/ConfirmCashPaymentButton.js +5 -4
- package/dist/ConfirmCashPaymentButton.js.map +1 -1
- package/dist/ManualUpiPaymentConfirmButton.js +5 -4
- package/dist/ManualUpiPaymentConfirmButton.js.map +1 -1
- package/dist/cjs/ConfirmCashPaymentButton.js +5 -4
- package/dist/cjs/ConfirmCashPaymentButton.js.map +1 -1
- package/dist/cjs/ManualUpiPaymentConfirmButton.js +5 -4
- package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +1 -1
- package/package.json +6 -7
|
@@ -17,7 +17,8 @@ import 'ramda';
|
|
|
17
17
|
const ConfirmCashPaymentButton = ({
|
|
18
18
|
paymentId,
|
|
19
19
|
payableId,
|
|
20
|
-
onSuccess = noop
|
|
20
|
+
onSuccess = noop,
|
|
21
|
+
children
|
|
21
22
|
}) => {
|
|
22
23
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
23
24
|
const {
|
|
@@ -66,13 +67,13 @@ const ConfirmCashPaymentButton = ({
|
|
|
66
67
|
children: ({
|
|
67
68
|
isSubmitting
|
|
68
69
|
}) => /*#__PURE__*/jsxs(Fragment, {
|
|
69
|
-
children: [/*#__PURE__*/
|
|
70
|
-
children: /*#__PURE__*/jsx(Textarea, {
|
|
70
|
+
children: [/*#__PURE__*/jsxs(Modal.Body, {
|
|
71
|
+
children: [children, /*#__PURE__*/jsx(Textarea, {
|
|
71
72
|
"data-testid": "confirm-booking-modal-input-textfield",
|
|
72
73
|
label: t("neetoPayments.cash.confirmModal.notes"),
|
|
73
74
|
name: "notes",
|
|
74
75
|
placeholder: t("neetoPayments.cash.confirmModal.notesPlaceholder")
|
|
75
|
-
})
|
|
76
|
+
})]
|
|
76
77
|
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
77
78
|
className: "space-x-2",
|
|
78
79
|
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmCashPaymentButton.js","sources":["../app/javascript/src/components/ConfirmCashPaymentButton.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateCashPayment } from \"hooks/reactQuery/cash/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, ActionBlock } from \"neetoui/formik\";\n\nconst ConfirmCashPaymentButton = ({\n paymentId,\n payableId,\n onSuccess = noop,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const { mutate: updateUpiPayment, isPending } = useUpdateCashPayment(\n paymentId,\n { onSuccess }\n );\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ notes }) => {\n const payload = { notes, payableId, status: \"successful\" };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-cash-payment-button\"\n label={t(\"neetoPayments.common.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.cash.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues: { notes: \"\" },\n onSubmit: handleSubmit,\n }}\n >\n {({ isSubmitting }) => (\n <>\n <Modal.Body>\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.cash.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.cash.confirmModal.notesPlaceholder\"\n )}\n />\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled: isSubmitting || isPending,\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ConfirmCashPaymentButton;\n"],"names":["ConfirmCashPaymentButton","paymentId","payableId","onSuccess","noop","isModalOpen","setIsModalOpen","useState","t","useTranslation","mutate","updateUpiPayment","isPending","useUpdateCashPayment","onClose","handleSubmit","notes","payload","status","_jsxs","_Fragment","
|
|
1
|
+
{"version":3,"file":"ConfirmCashPaymentButton.js","sources":["../app/javascript/src/components/ConfirmCashPaymentButton.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateCashPayment } from \"hooks/reactQuery/cash/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, ActionBlock } from \"neetoui/formik\";\n\nconst ConfirmCashPaymentButton = ({\n paymentId,\n payableId,\n onSuccess = noop,\n children,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const { mutate: updateUpiPayment, isPending } = useUpdateCashPayment(\n paymentId,\n { onSuccess }\n );\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ notes }) => {\n const payload = { notes, payableId, status: \"successful\" };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-cash-payment-button\"\n label={t(\"neetoPayments.common.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.cash.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues: { notes: \"\" },\n onSubmit: handleSubmit,\n }}\n >\n {({ isSubmitting }) => (\n <>\n <Modal.Body>\n {children}\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.cash.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.cash.confirmModal.notesPlaceholder\"\n )}\n />\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled: isSubmitting || isPending,\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ConfirmCashPaymentButton;\n"],"names":["ConfirmCashPaymentButton","paymentId","payableId","onSuccess","noop","children","isModalOpen","setIsModalOpen","useState","t","useTranslation","mutate","updateUpiPayment","isPending","useUpdateCashPayment","onClose","handleSubmit","notes","payload","status","_jsxs","_Fragment","_jsx","Button","label","loading","size","onClick","Modal","isOpen","Header","Typography","style","Form","formikProps","initialValues","onSubmit","isSubmitting","Body","Textarea","name","placeholder","Footer","className","ActionBlock","position","cancelButtonProps","submitButtonProps","disabled"],"mappings":";;;;;;;;;;;;;;;;AASMA,MAAAA,wBAAwB,GAAGA,CAAC;EAChCC,SAAS;EACTC,SAAS;AACTC,EAAAA,SAAS,GAAGC,IAAI;AAChBC,EAAAA;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EAErD,MAAM;AAAEC,IAAAA;GAAG,GAAGC,cAAc,EAAE;EAE9B,MAAM;AAAEC,IAAAA,MAAM,EAAEC,gBAAgB;AAAEC,IAAAA;AAAU,GAAC,GAAGC,oBAAoB,CAClEb,SAAS,EACT;AAAEE,IAAAA;AAAU,GACd,CAAC;AAED,EAAA,MAAMY,OAAO,GAAGA,MAAMR,cAAc,CAAC,KAAK,CAAC;EAE3C,MAAMS,YAAY,GAAGA,CAAC;AAAEC,IAAAA;AAAM,GAAC,KAAK;AAClC,IAAA,MAAMC,OAAO,GAAG;M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AI,EAAC,OAAO;cACZC,WAAW,EAAEhC,CAAC,CACZ,kDACF;AAAE,aACH,CAAC;AAAA,WACQ,CAAC,eACba,GAAA,CAACM,KAAK,CAACc,MAAM,EAAA;AAACC,YAAAA,SAAS,EAAC,WAAW;YAAAtC,QAAA,eACjCiB,GAAA,CAACsB,WAAW,EAAA;AACVP,cAAAA,YAAY,EAAExB,SAAU;AACxBgC,cAAAA,QAAQ,EAAC,OAAO;AAChBC,cAAAA,iBAAiB,EAAE;AACjBnB,gBAAAA,OAAO,EAAEZ,OAAO;AAChBiB,gBAAAA,KAAK,EAAE;eACP;AACFe,cAAAA,iBAAiB,EAAE;gBACjBC,QAAQ,EAAEX,YAAY,IAAIxB,SAAS;gBACnCW,KAAK,EAAEf,CAAC,CAAC,8BAA8B;AACzC;aACD;AAAC,WACU,CAAC;SACf;AACH,OACG,CAAC;AAAA,KACF,CAAC;AAAA,GACR,CAAC;AAEP;;;;"}
|
|
@@ -32,7 +32,8 @@ const ManualUpiPaymentConfirmButton = ({
|
|
|
32
32
|
manualUpiId,
|
|
33
33
|
payableId,
|
|
34
34
|
onSuccess = noop,
|
|
35
|
-
keysToInvalidate = []
|
|
35
|
+
keysToInvalidate = [],
|
|
36
|
+
children
|
|
36
37
|
}) => {
|
|
37
38
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
38
39
|
const {
|
|
@@ -101,8 +102,8 @@ const ManualUpiPaymentConfirmButton = ({
|
|
|
101
102
|
dirty,
|
|
102
103
|
isSubmitting
|
|
103
104
|
}) => /*#__PURE__*/jsxs(Fragment, {
|
|
104
|
-
children: [/*#__PURE__*/
|
|
105
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
105
|
+
children: [/*#__PURE__*/jsxs(Modal.Body, {
|
|
106
|
+
children: [children, /*#__PURE__*/jsxs("div", {
|
|
106
107
|
className: "flex flex-col space-y-4",
|
|
107
108
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
108
109
|
lineHeight: "normal",
|
|
@@ -129,7 +130,7 @@ const ManualUpiPaymentConfirmButton = ({
|
|
|
129
130
|
name: "notes",
|
|
130
131
|
placeholder: t("neetoPayments.upi.confirmModal.notesPlaceholder")
|
|
131
132
|
})]
|
|
132
|
-
})
|
|
133
|
+
})]
|
|
133
134
|
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
134
135
|
className: "space-x-2",
|
|
135
136
|
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualUpiPaymentConfirmButton.js","sources":["../app/javascript/src/components/ManualUpiPaymentConfirmButton/constants.js","../app/javascript/src/components/ManualUpiPaymentConfirmButton/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const INITIAL_VALUE = { vpaId: \"\", notes: \"\" };\n\nexport const VALIDATION_SCHEMA = yup.object({\n vpaId: yup\n .string()\n .required(t(\"neetoPayments.upi.confirmModal.vpasIdRequired\")),\n});\n","import { useState } from \"react\";\n\nimport { findBy, noop } from \"neetocist\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateUpiPayment } from \"hooks/reactQuery/manualUpi/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, Select, ActionBlock } from \"neetoui/formik\";\n\nimport { INITIAL_VALUE, VALIDATION_SCHEMA } from \"./constants\";\n\nconst ManualUpiPaymentConfirmButton = ({\n vpas,\n identifier,\n paymentId,\n manualUpiId,\n payableId,\n onSuccess = noop,\n keysToInvalidate = [],\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const onSuccessfulUpdate = () => {\n setIsModalOpen(false);\n onSuccess();\n };\n\n const { mutate: updateUpiPayment, isPending } = useUpdateUpiPayment({\n id: paymentId,\n manualUpiId,\n keysToInvalidate,\n options: { onSuccess: onSuccessfulUpdate },\n });\n\n const initialValues =\n vpas.length === 1\n ? mergeLeft({ vpaId: vpas[0].id }, INITIAL_VALUE)\n : INITIAL_VALUE;\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ vpaId, notes }) => {\n const vpa = findBy({ id: vpaId }, vpas);\n const payload = {\n notes,\n vpaId,\n payableId,\n upiId: vpa.upiId,\n status: \"successful\",\n };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-payment-btn\"\n label={t(\"neetoPayments.upi.payment.buttons.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.upi.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues,\n enableReinitialize: true,\n onSubmit: handleSubmit,\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n {({ setFieldValue, dirty, isSubmitting }) => (\n <>\n <Modal.Body>\n <div className=\"flex flex-col space-y-4\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {t(\"neetoPayments.upi.confirmModal.upiTransactionId\", {\n identifier,\n })}\n </Typography>\n <Select\n label={t(\"neetoPayments.upi.confirmModal.accountIdLabel\")}\n name=\"vpaId\"\n options={vpas?.map(({ address, id }) => ({\n label: address,\n value: id,\n }))}\n onChange={({ value }) => setFieldValue(\"vpaId\", value)}\n />\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.upi.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.upi.confirmModal.notesPlaceholder\"\n )}\n />\n </div>\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled:\n isSubmitting ||\n isPending ||\n (vpas.length !== 1 && !dirty),\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ManualUpiPaymentConfirmButton;\n"],"names":["INITIAL_VALUE","vpaId","notes","VALIDATION_SCHEMA","yup","object","string","required","t","ManualUpiPaymentConfirmButton","vpas","identifier","paymentId","manualUpiId","payableId","onSuccess","noop","keysToInvalidate","isModalOpen","setIsModalOpen","useState","useTranslation","onSuccessfulUpdate","mutate","updateUpiPayment","isPending","useUpdateUpiPayment","id","options","initialValues","length","mergeLeft","onClose","handleSubmit","vpa","findBy","payload","upiId","status","_jsxs","_Fragment","
|
|
1
|
+
{"version":3,"file":"ManualUpiPaymentConfirmButton.js","sources":["../app/javascript/src/components/ManualUpiPaymentConfirmButton/constants.js","../app/javascript/src/components/ManualUpiPaymentConfirmButton/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const INITIAL_VALUE = { vpaId: \"\", notes: \"\" };\n\nexport const VALIDATION_SCHEMA = yup.object({\n vpaId: yup\n .string()\n .required(t(\"neetoPayments.upi.confirmModal.vpasIdRequired\")),\n});\n","import { useState } from \"react\";\n\nimport { findBy, noop } from \"neetocist\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateUpiPayment } from \"hooks/reactQuery/manualUpi/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, Select, ActionBlock } from \"neetoui/formik\";\n\nimport { INITIAL_VALUE, VALIDATION_SCHEMA } from \"./constants\";\n\nconst ManualUpiPaymentConfirmButton = ({\n vpas,\n identifier,\n paymentId,\n manualUpiId,\n payableId,\n onSuccess = noop,\n keysToInvalidate = [],\n children,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const onSuccessfulUpdate = () => {\n setIsModalOpen(false);\n onSuccess();\n };\n\n const { mutate: updateUpiPayment, isPending } = useUpdateUpiPayment({\n id: paymentId,\n manualUpiId,\n keysToInvalidate,\n options: { onSuccess: onSuccessfulUpdate },\n });\n\n const initialValues =\n vpas.length === 1\n ? mergeLeft({ vpaId: vpas[0].id }, INITIAL_VALUE)\n : INITIAL_VALUE;\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ vpaId, notes }) => {\n const vpa = findBy({ id: vpaId }, vpas);\n const payload = {\n notes,\n vpaId,\n payableId,\n upiId: vpa.upiId,\n status: \"successful\",\n };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-payment-btn\"\n label={t(\"neetoPayments.upi.payment.buttons.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.upi.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues,\n enableReinitialize: true,\n onSubmit: handleSubmit,\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n {({ setFieldValue, dirty, isSubmitting }) => (\n <>\n <Modal.Body>\n {children}\n <div className=\"flex flex-col space-y-4\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {t(\"neetoPayments.upi.confirmModal.upiTransactionId\", {\n identifier,\n })}\n </Typography>\n <Select\n label={t(\"neetoPayments.upi.confirmModal.accountIdLabel\")}\n name=\"vpaId\"\n options={vpas?.map(({ address, id }) => ({\n label: address,\n value: id,\n }))}\n onChange={({ value }) => setFieldValue(\"vpaId\", value)}\n />\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.upi.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.upi.confirmModal.notesPlaceholder\"\n )}\n />\n </div>\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled:\n isSubmitting ||\n isPending ||\n (vpas.length !== 1 && !dirty),\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ManualUpiPaymentConfirmButton;\n"],"names":["INITIAL_VALUE","vpaId","notes","VALIDATION_SCHEMA","yup","object","string","required","t","ManualUpiPaymentConfirmButton","vpas","identifier","paymentId","manualUpiId","payableId","onSuccess","noop","keysToInvalidate","children","isModalOpen","setIsModalOpen","useState","useTranslation","onSuccessfulUpdate","mutate","updateUpiPayment","isPending","useUpdateUpiPayment","id","options","initialValues","length","mergeLeft","onClose","handleSubmit","vpa","findBy","payload","upiId","status","_jsxs","_Fragment","_jsx","Button","label","loading","size","onClick","Modal","isOpen","Header","Typography","style","Form","formikProps","enableReinitialize","onSubmit","validationSchema","setFieldValue","dirty","isSubmitting","Body","className","lineHeight","Select","name","map","address","value","onChange","Textarea","placeholder","Footer","ActionBlock","position","cancelButtonProps","submitButtonProps","disabled"],"mappings":";;;;;;;;;;;;;;;;;;;AAGO,MAAMA,aAAa,GAAG;AAAEC,EAAAA,KAAK,EAAE,EAAE;AAAEC,EAAAA,KAAK,EAAE;AAAG,CAAC;AAE9C,MAAMC,iBAAiB,GAAGC,GAAG,CAACC,MAAM,CAAC;AAC1CJ,EAAAA,KAAK,EAAEG,GAAG,CACPE,MAAM,EAAE,CACRC,QAAQ,CAACC,CAAC,CAAC,+CAA+C,CAAC;AAChE,CAAC,CAAC;;ACGIC,MAAAA,6BAA6B,GAAGA,CAAC;EACrCC,IAAI;EACJC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;AACTC,EAAAA,SAAS,GAAGC,IAAI;AAChBC,EAAAA,gBAAgB,GAAG,EAAE;AACrBC,EAAAA;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EA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22
|
-
onSuccess = neetocist.noop
|
|
22
|
+
onSuccess = neetocist.noop,
|
|
23
|
+
children
|
|
23
24
|
}) => {
|
|
24
25
|
const [isModalOpen, setIsModalOpen] = react.useState(false);
|
|
25
26
|
const {
|
|
@@ -68,13 +69,13 @@ const ConfirmCashPaymentButton = ({
|
|
|
68
69
|
children: ({
|
|
69
70
|
isSubmitting
|
|
70
71
|
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
71
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
72
|
-
children: /*#__PURE__*/jsxRuntime.jsx(formik.Textarea, {
|
|
72
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoui.Modal.Body, {
|
|
73
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(formik.Textarea, {
|
|
73
74
|
"data-testid": "confirm-booking-modal-input-textfield",
|
|
74
75
|
label: t("neetoPayments.cash.confirmModal.notes"),
|
|
75
76
|
name: "notes",
|
|
76
77
|
placeholder: t("neetoPayments.cash.confirmModal.notesPlaceholder")
|
|
77
|
-
})
|
|
78
|
+
})]
|
|
78
79
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Footer, {
|
|
79
80
|
className: "space-x-2",
|
|
80
81
|
children: /*#__PURE__*/jsxRuntime.jsx(formik.ActionBlock, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmCashPaymentButton.js","sources":["../../app/javascript/src/components/ConfirmCashPaymentButton.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateCashPayment } from \"hooks/reactQuery/cash/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, ActionBlock } from \"neetoui/formik\";\n\nconst ConfirmCashPaymentButton = ({\n paymentId,\n payableId,\n onSuccess = noop,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const { mutate: updateUpiPayment, isPending } = useUpdateCashPayment(\n paymentId,\n { onSuccess }\n );\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ notes }) => {\n const payload = { notes, payableId, status: \"successful\" };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-cash-payment-button\"\n label={t(\"neetoPayments.common.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.cash.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues: { notes: \"\" },\n onSubmit: handleSubmit,\n }}\n >\n {({ isSubmitting }) => (\n <>\n <Modal.Body>\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.cash.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.cash.confirmModal.notesPlaceholder\"\n )}\n />\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled: isSubmitting || isPending,\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ConfirmCashPaymentButton;\n"],"names":["ConfirmCashPaymentButton","paymentId","payableId","onSuccess","noop","isModalOpen","setIsModalOpen","useState","t","useTranslation","mutate","updateUpiPayment","isPending","useUpdateCashPayment","onClose","handleSubmit","notes","payload","status","_jsxs","_Fragment","
|
|
1
|
+
{"version":3,"file":"ConfirmCashPaymentButton.js","sources":["../../app/javascript/src/components/ConfirmCashPaymentButton.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateCashPayment } from \"hooks/reactQuery/cash/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, ActionBlock } from \"neetoui/formik\";\n\nconst ConfirmCashPaymentButton = ({\n paymentId,\n payableId,\n onSuccess = noop,\n children,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const { mutate: updateUpiPayment, isPending } = useUpdateCashPayment(\n paymentId,\n { onSuccess }\n );\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ notes }) => {\n const payload = { notes, payableId, status: \"successful\" };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-cash-payment-button\"\n label={t(\"neetoPayments.common.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.cash.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues: { notes: \"\" },\n onSubmit: handleSubmit,\n }}\n >\n {({ isSubmitting }) => (\n <>\n <Modal.Body>\n {children}\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.cash.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.cash.confirmModal.notesPlaceholder\"\n )}\n />\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled: isSubmitting || isPending,\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ConfirmCashPaymentButton;\n"],"names":["ConfirmCashPaymentButton","paymentId","payableId","onSuccess","noop","children","isModalOpen","setIsModalOpen","useState","t","useTranslation","mutate","updateUpiPayment","isPending","useUpdateCashPayment","onClose","handleSubmit","notes","payload","status","_jsxs","_Fragment","_jsx","Button","label","loading","size","onClick","Modal","isOpen","Header","Typography","style","Form","formikProps","initialValues","onSubmit","isSubmitting","Body","Textarea","name","placeholder","Footer","className","ActionBlock","position","cancelButtonProps","submitButtonProps","disabled"],"mappings":";;;;;;;;;;;;;;;;;;AASMA,MAAAA,wBAAwB,GAAGA,CAAC;EAChCC,SAAS;EACTC,SAAS;AACTC,EAAAA,SAAS,GAAGC,cAAI;AAChBC,EAAAA;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;EAErD,MAAM;AAAEC,IAAAA;GAAG,GAAGC,2BAAc,EAAE;EAE9B,MAAM;AAAEC,IAAAA,MAAM,EAAEC,gBAAgB;AAAEC,IAAAA;AAAU,GAAC,GAAGC,kCAAoB,CAClEb,SAAS,EACT;AAAEE,IAAAA;AAAU,GACd,CAAC;AAED,EAAA,MAAMY,OAAO,GAAGA,MAAMR,cAAc,CAAC,KAAK,CAAC;EAE3C,MAAMS,YAAY,GAAGA,CAAC;AAAEC,IAAAA;AAAM,GAAC,KAAK;AAClC,IAAA,MAAMC,OAAO,GAAG;MAAED,KAAK;MAAEf,SAAS;AAAEiB,MAAAA,MAAM,EAAE;KAAc;IAC1DP,gBAAgB,CAACM,OAAO,CAAC;GAC1B;EAED,oBACEE,eAAA,CAAAC,mBAAA,EAAA;IAAAhB,QAAA,EAAA,cACEiB,cAAA,CAACC,cAAM,EAAA;AACL,MAAA,aAAA,EAAY,6BAA6B;AACzCC,MAAAA,KAAK,EAAEf,CAAC,CAAC,qCAAqC,CAAE;AAChDgB,MAAAA,OAAO,EAAEZ,SAAU;AACnBa,MAAAA,IAAI,EAAC,OAAO;AACZC,MAAAA,OAAO,EAAEA,MAAMpB,cAAc,CAAC,IAAI;AAAE,KACrC,CAAC,eACFa,eAAA,C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EX,YAAY,IAAIxB,SAAS;gBACnCW,KAAK,EAAEf,CAAC,CAAC,8BAA8B;AACzC;aACD;AAAC,WACU,CAAC;SACf;AACH,OACG,CAAC;AAAA,KACF,CAAC;AAAA,GACR,CAAC;AAEP;;;;"}
|
|
@@ -53,7 +53,8 @@ const ManualUpiPaymentConfirmButton = ({
|
|
|
53
53
|
manualUpiId,
|
|
54
54
|
payableId,
|
|
55
55
|
onSuccess = neetocist.noop,
|
|
56
|
-
keysToInvalidate = []
|
|
56
|
+
keysToInvalidate = [],
|
|
57
|
+
children
|
|
57
58
|
}) => {
|
|
58
59
|
const [isModalOpen, setIsModalOpen] = react.useState(false);
|
|
59
60
|
const {
|
|
@@ -122,8 +123,8 @@ const ManualUpiPaymentConfirmButton = ({
|
|
|
122
123
|
dirty,
|
|
123
124
|
isSubmitting
|
|
124
125
|
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
125
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
126
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
126
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoui.Modal.Body, {
|
|
127
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
127
128
|
className: "flex flex-col space-y-4",
|
|
128
129
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
|
|
129
130
|
lineHeight: "normal",
|
|
@@ -150,7 +151,7 @@ const ManualUpiPaymentConfirmButton = ({
|
|
|
150
151
|
name: "notes",
|
|
151
152
|
placeholder: t("neetoPayments.upi.confirmModal.notesPlaceholder")
|
|
152
153
|
})]
|
|
153
|
-
})
|
|
154
|
+
})]
|
|
154
155
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Footer, {
|
|
155
156
|
className: "space-x-2",
|
|
156
157
|
children: /*#__PURE__*/jsxRuntime.jsx(formik.ActionBlock, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualUpiPaymentConfirmButton.js","sources":["../../app/javascript/src/components/ManualUpiPaymentConfirmButton/constants.js","../../app/javascript/src/components/ManualUpiPaymentConfirmButton/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const INITIAL_VALUE = { vpaId: \"\", notes: \"\" };\n\nexport const VALIDATION_SCHEMA = yup.object({\n vpaId: yup\n .string()\n .required(t(\"neetoPayments.upi.confirmModal.vpasIdRequired\")),\n});\n","import { useState } from \"react\";\n\nimport { findBy, noop } from \"neetocist\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateUpiPayment } from \"hooks/reactQuery/manualUpi/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, Select, ActionBlock } from \"neetoui/formik\";\n\nimport { INITIAL_VALUE, VALIDATION_SCHEMA } from \"./constants\";\n\nconst ManualUpiPaymentConfirmButton = ({\n vpas,\n identifier,\n paymentId,\n manualUpiId,\n payableId,\n onSuccess = noop,\n keysToInvalidate = [],\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const onSuccessfulUpdate = () => {\n setIsModalOpen(false);\n onSuccess();\n };\n\n const { mutate: updateUpiPayment, isPending } = useUpdateUpiPayment({\n id: paymentId,\n manualUpiId,\n keysToInvalidate,\n options: { onSuccess: onSuccessfulUpdate },\n });\n\n const initialValues =\n vpas.length === 1\n ? mergeLeft({ vpaId: vpas[0].id }, INITIAL_VALUE)\n : INITIAL_VALUE;\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ vpaId, notes }) => {\n const vpa = findBy({ id: vpaId }, vpas);\n const payload = {\n notes,\n vpaId,\n payableId,\n upiId: vpa.upiId,\n status: \"successful\",\n };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-payment-btn\"\n label={t(\"neetoPayments.upi.payment.buttons.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.upi.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues,\n enableReinitialize: true,\n onSubmit: handleSubmit,\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n {({ setFieldValue, dirty, isSubmitting }) => (\n <>\n <Modal.Body>\n <div className=\"flex flex-col space-y-4\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {t(\"neetoPayments.upi.confirmModal.upiTransactionId\", {\n identifier,\n })}\n </Typography>\n <Select\n label={t(\"neetoPayments.upi.confirmModal.accountIdLabel\")}\n name=\"vpaId\"\n options={vpas?.map(({ address, id }) => ({\n label: address,\n value: id,\n }))}\n onChange={({ value }) => setFieldValue(\"vpaId\", value)}\n />\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.upi.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.upi.confirmModal.notesPlaceholder\"\n )}\n />\n </div>\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled:\n isSubmitting ||\n isPending ||\n (vpas.length !== 1 && !dirty),\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ManualUpiPaymentConfirmButton;\n"],"names":["INITIAL_VALUE","vpaId","notes","VALIDATION_SCHEMA","yup","object","string","required","t","ManualUpiPaymentConfirmButton","vpas","identifier","paymentId","manualUpiId","payableId","onSuccess","noop","keysToInvalidate","isModalOpen","setIsModalOpen","useState","useTranslation","onSuccessfulUpdate","mutate","updateUpiPayment","isPending","useUpdateUpiPayment","id","options","initialValues","length","mergeLeft","onClose","handleSubmit","vpa","findBy","payload","upiId","status","_jsxs","_Fragment","
|
|
1
|
+
{"version":3,"file":"ManualUpiPaymentConfirmButton.js","sources":["../../app/javascript/src/components/ManualUpiPaymentConfirmButton/constants.js","../../app/javascript/src/components/ManualUpiPaymentConfirmButton/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const INITIAL_VALUE = { vpaId: \"\", notes: \"\" };\n\nexport const VALIDATION_SCHEMA = yup.object({\n vpaId: yup\n .string()\n .required(t(\"neetoPayments.upi.confirmModal.vpasIdRequired\")),\n});\n","import { useState } from \"react\";\n\nimport { findBy, noop } from \"neetocist\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateUpiPayment } from \"hooks/reactQuery/manualUpi/usePaymentApi\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, Select, ActionBlock } from \"neetoui/formik\";\n\nimport { INITIAL_VALUE, VALIDATION_SCHEMA } from \"./constants\";\n\nconst ManualUpiPaymentConfirmButton = ({\n vpas,\n identifier,\n paymentId,\n manualUpiId,\n payableId,\n onSuccess = noop,\n keysToInvalidate = [],\n children,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const onSuccessfulUpdate = () => {\n setIsModalOpen(false);\n onSuccess();\n };\n\n const { mutate: updateUpiPayment, isPending } = useUpdateUpiPayment({\n id: paymentId,\n manualUpiId,\n keysToInvalidate,\n options: { onSuccess: onSuccessfulUpdate },\n });\n\n const initialValues =\n vpas.length === 1\n ? mergeLeft({ vpaId: vpas[0].id }, INITIAL_VALUE)\n : INITIAL_VALUE;\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ vpaId, notes }) => {\n const vpa = findBy({ id: vpaId }, vpas);\n const payload = {\n notes,\n vpaId,\n payableId,\n upiId: vpa.upiId,\n status: \"successful\",\n };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-testid=\"confirm-payment-btn\"\n label={t(\"neetoPayments.upi.payment.buttons.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.upi.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues,\n enableReinitialize: true,\n onSubmit: handleSubmit,\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n {({ setFieldValue, dirty, isSubmitting }) => (\n <>\n <Modal.Body>\n {children}\n <div className=\"flex flex-col space-y-4\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {t(\"neetoPayments.upi.confirmModal.upiTransactionId\", {\n identifier,\n })}\n </Typography>\n <Select\n label={t(\"neetoPayments.upi.confirmModal.accountIdLabel\")}\n name=\"vpaId\"\n options={vpas?.map(({ address, id }) => ({\n label: address,\n value: id,\n }))}\n onChange={({ value }) => setFieldValue(\"vpaId\", value)}\n />\n <Textarea\n data-testid=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.upi.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.upi.confirmModal.notesPlaceholder\"\n )}\n />\n </div>\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled:\n isSubmitting ||\n isPending ||\n (vpas.length !== 1 && !dirty),\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ManualUpiPaymentConfirmButton;\n"],"names":["INITIAL_VALUE","vpaId","notes","VALIDATION_SCHEMA","yup","object","string","required","t","ManualUpiPaymentConfirmButton","vpas","identifier","paymentId","manualUpiId","payableId","onSuccess","noop","keysToInvalidate","children","isModalOpen","setIsModalOpen","useState","useTranslation","onSuccessfulUpdate","mutate","updateUpiPayment","isPending","useUpdateUpiPayment","id","options","initialValues","length","mergeLeft","onClose","handleSubmit","vpa","findBy","payload","upiId","status","_jsxs","_Fragment","_jsx","Button","label","loading","size","onClick","Modal","isOpen","Header","Typography","style","Form","formikProps","enableReinitialize","onSubmit","validationSchema","setFieldValue","dirty","isSubmitting","Body","className","lineHeight","Select","name","map","address","value","onChange","Textarea","placeholder","Footer","ActionBlock","position","cancelButtonProps","submitButtonProps","disabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,aAAa,GAAG;AAAEC,EAAAA,KAAK,EAAE,EAAE;AAAEC,EAAAA,KAAK,EAAE;AAAG,CAAC;AAE9C,MAAMC,iBAAiB,GAAGC,cAAG,CAACC,MAAM,CAAC;AAC1CJ,EAAAA,KAAK,EAAEG,cAAG,CACPE,MAAM,EAAE,CACRC,QAAQ,CAACC,SAAC,CAAC,+CAA+C,CAAC;AAChE,CAAC,CAAC;;ACGIC,MAAAA,6BAA6B,GAAGA,CAAC;EACrCC,IAAI;EACJC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;AACTC,EAAAA,SAAS,GAAGC,cAAI;AAChBC,EAAAA,gBAAgB,GAAG,EAAE;AACrBC,EAAAA;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;EAErD,MAAM;AAAEb,IAAAA;GAAG,GAAGc,2BAAc,EAAE;EAE9B,MAAMC,kBAAkB,GAAGA,MAAM;IAC/BH,cAAc,CAAC,KAAK,CAAC;AACrBL,IAAAA,SAAS,EAAE;GACZ;EAED,MAAM;AAAES,IAAAA,MAAM,EAAEC,gBAAgB;AAAEC,IAAAA;GAAW,GAAGC,iCAAmB,CAAC;AAClEC,IAAAA,EAAE,EAAEhB,SAAS;IAC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,EAAEU,KAAK;AAAE,eACxD,CAAC,eACF1B,cAAA,CAAC4B,eAAQ,EAAA;AACP,gBAAA,aAAA,EAAY,uCAAuC;AACnD1B,gBAAAA,KAAK,EAAEpC,CAAC,CAAC,sCAAsC,CAAE;AACjDyD,gBAAAA,IAAI,EAAC,OAAO;gBACZM,WAAW,EAAE/D,CAAC,CACZ,iDACF;AAAE,eACH,CAAC;AAAA,aACC,CAAC;AAAA,WACI,CAAC,eACbkC,cAAA,CAACM,aAAK,CAACwB,MAAM,EAAA;AAACV,YAAAA,SAAS,EAAC,WAAW;YAAA5C,QAAA,eACjCwB,cAAA,CAAC+B,kBAAW,EAAA;AACVb,cAAAA,YAAY,EAAElC,SAAU;AACxBgD,cAAAA,QAAQ,EAAC,OAAO;AAChBC,cAAAA,iBAAiB,EAAE;AACjB5B,gBAAAA,OAAO,EAAEd,OAAO;AAChBmB,gBAAAA,KAAK,EAAE;eACP;AACFwB,cAAAA,iBAAiB,EAAE;AACjBC,gBAAAA,QAAQ,EACNjB,YAAY,IACZlC,SAAS,IACRhB,IAAI,CAACqB,MAAM,KAAK,CAAC,IAAI,CAAC4B,KAAM;gBAC/Bf,KAAK,EAAEpC,CAAC,CAAC,8BAA8B;AACzC;aACD;AAAC,WACU,CAAC;SACf;AACH,OACG,CAAC;AAAA,KACF,CAAC;AAAA,GACR,CAAC;AAEP;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-payments-frontend",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.26",
|
|
4
4
|
"description": "To manage payments across the neeto products.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-payments-nano",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "NODE_ENV=production rollup --bundleConfigAsCjs -c --environment production",
|
|
24
24
|
"build-preview": "NODE_ENV=production webpack",
|
|
25
|
-
"prepare": "husky install",
|
|
25
|
+
"prepare": "npx husky install",
|
|
26
26
|
"release": "yarn build && yalc push --sig"
|
|
27
27
|
},
|
|
28
28
|
"lint-staged": {
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"@bigbinary/babel-preset-neeto": "^1.0.3",
|
|
64
64
|
"@bigbinary/eslint-plugin-neeto": "1.8.2",
|
|
65
65
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
66
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
66
|
+
"@bigbinary/neeto-editor": "1.47.95",
|
|
67
67
|
"@bigbinary/neeto-filters-frontend": "4.3.32",
|
|
68
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
68
|
+
"@bigbinary/neeto-icons": "1.20.86",
|
|
69
69
|
"@dnd-kit/core": "6.3.1",
|
|
70
70
|
"@dnd-kit/sortable": "10.0.0",
|
|
71
71
|
"@emotion/is-prop-valid": "1.2.0",
|
|
@@ -146,7 +146,6 @@
|
|
|
146
146
|
"react-i18next": "12.3.1",
|
|
147
147
|
"react-router-dom": "5.3.3",
|
|
148
148
|
"react-toastify": "8.0.2",
|
|
149
|
-
"react_ujs": "^3.1.1",
|
|
150
149
|
"rollup": "4.25.0",
|
|
151
150
|
"rollup-plugin-analyzer": "4.0.0",
|
|
152
151
|
"rollup-plugin-cleaner": "1.0.0",
|
|
@@ -174,9 +173,9 @@
|
|
|
174
173
|
"peerDependencies": {
|
|
175
174
|
"@babel/runtime": "7.26.10",
|
|
176
175
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
177
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
176
|
+
"@bigbinary/neeto-editor": "1.47.95",
|
|
178
177
|
"@bigbinary/neeto-filters-frontend": "4.3.32",
|
|
179
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
178
|
+
"@bigbinary/neeto-icons": "1.20.86",
|
|
180
179
|
"@dnd-kit/core": "6.3.1",
|
|
181
180
|
"@dnd-kit/sortable": "10.0.0",
|
|
182
181
|
"@honeybadger-io/js": "6.10.1",
|