@mx-cartographer/experiences 9.4.1-alpha.al0 → 9.4.2
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/CHANGELOG.md +8 -2
- package/dist/budgets/BubbleBudgetsWidget.es.js +29 -29
- package/dist/budgets/BubbleBudgetsWidget.es.js.map +1 -1
- package/dist/budgets/components/AddBudgets.es.js +16 -13
- package/dist/budgets/components/AddBudgets.es.js.map +1 -1
- package/dist/budgets/components/BudgetDetailsDrawer.es.js +95 -95
- package/dist/budgets/components/BudgetDetailsDrawer.es.js.map +1 -1
- package/dist/budgets/components/BudgetDetailsDrawerV2.es.js +16 -13
- package/dist/budgets/components/BudgetDetailsDrawerV2.es.js.map +1 -1
- package/dist/budgets/components/addbudget/RecalculateBudgets.es.js +14 -11
- package/dist/budgets/components/addbudget/RecalculateBudgets.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/AddSubBudget.es.js +63 -61
- package/dist/budgets/components/budgetdetails/AddSubBudget.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/BudgetDetails.es.js +8 -5
- package/dist/budgets/components/budgetdetails/BudgetDetails.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/SubBudgetAmounts.d.ts +3 -4
- package/dist/budgets/components/budgetdetails/SubBudgetAmounts.es.js +42 -31
- package/dist/budgets/components/budgetdetails/SubBudgetAmounts.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/SubBudgetList.es.js +71 -59
- package/dist/budgets/components/budgetdetails/SubBudgetList.es.js.map +1 -1
- package/dist/budgets/components/shared/SubBudgetCategory.d.ts +2 -2
- package/dist/budgets/components/shared/SubBudgetCategory.es.js.map +1 -1
- package/dist/core/stores/BudgetsStore.d.ts +13 -6
- package/dist/core/stores/BudgetsStore.es.js +36 -42
- package/dist/core/stores/BudgetsStore.es.js.map +1 -1
- package/dist/core/types/RepeatingTransaction.d.ts +2 -2
- package/dist/core/types/RepeatingTransaction.es.js.map +1 -1
- package/dist/core/utils/BudgetUtil.d.ts +1 -0
- package/dist/core/utils/BudgetUtil.es.js +55 -57
- package/dist/core/utils/BudgetUtil.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurrenceRow.es.js +1 -1
- package/dist/recurringtransactions/components/RecurrenceRow.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/RecurringRow.es.js +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/RecurringRow.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/SelectTransaction.es.js +14 -15
- package/dist/recurringtransactions/components/shared/recurringsettings/SelectTransaction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.es.js +85 -82
- package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.es.js.map +1 -1
- package/package.json +1 -1
package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.es.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { buildDynamicCopy as n } from "../../../../../core/utils/Localization.es.js";
|
|
2
|
-
import { useAccountStore as
|
|
3
|
-
import { useAriaLive as
|
|
4
|
-
import { formatCurrency as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { observer as
|
|
9
|
-
import { Text as
|
|
10
|
-
import { endOfMonth as
|
|
11
|
-
import { startOfMonth as
|
|
12
|
-
import { Icon as
|
|
13
|
-
import { jsx as r, jsxs as
|
|
14
|
-
import { useTheme as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
var
|
|
2
|
+
import { useAccountStore as N, useBudgetsStore as z, useGlobalCopyStore as H, useTransactionStore as V } from "../../../../../common/context/hooks.es.js";
|
|
3
|
+
import { useAriaLive as W } from "../../../../../common/hooks/useAriaLive.es.js";
|
|
4
|
+
import { formatCurrency as B } from "../../../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import q from "../../../../../common/components/CurrencyDialog.es.js";
|
|
6
|
+
import J from "../../../../../budgets/components/MerchantBudgetDetailsDrawer.es.js";
|
|
7
|
+
import s from "react";
|
|
8
|
+
import { observer as K } from "mobx-react-lite";
|
|
9
|
+
import { Text as Q, Toast as U } from "@mxenabled/mxui";
|
|
10
|
+
import { endOfMonth as X } from "date-fns/endOfMonth";
|
|
11
|
+
import { startOfMonth as Y } from "date-fns/startOfMonth";
|
|
12
|
+
import { Icon as v } from "@mxenabled/mx-icons";
|
|
13
|
+
import { jsx as r, jsxs as C } from "react/jsx-runtime";
|
|
14
|
+
import { useTheme as Z } from "@mui/material/styles";
|
|
15
|
+
import ee from "@mui/material/ListItem";
|
|
16
|
+
import te from "@mui/material/ListItemButton";
|
|
17
|
+
import re from "@mui/material/ListItemText";
|
|
18
|
+
import oe from "@mui/material/Avatar";
|
|
19
|
+
import ne from "@mui/material/ListItemAvatar";
|
|
20
|
+
import ie from "@mui/material/ListItemIcon";
|
|
21
|
+
var Ce = /* @__PURE__ */ (function(e) {
|
|
22
22
|
return e.CREATE = "create", e.EDIT = "edit", e.DELETE = "delete", e;
|
|
23
|
-
})({}),
|
|
24
|
-
const [o, c] =
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
23
|
+
})({}), De = K(({ transaction: e }) => {
|
|
24
|
+
const [o, c] = s.useState(null), [p, _] = s.useState(""), h = s.useRef(!1), [D, L] = s.useState(null), S = Z(), { addMerchantBudget: w, updateMerchantBudget: I, deleteMerchantBudget: R, getMerchantBudgetByMerchantGuid: E, alert: d, setAlert: A } = z(), { setFilter: O } = V(), { accounts: x } = N(), k = S.palette.mode === "dark" ? "grey.800" : "grey.100", { budgets: t, common: u } = H(), { announce: P, ariaLive: $ } = W(), [g, y] = s.useState(!1), i = e?.merchant_guid ? E(e.merchant_guid) : void 0, f = () => {
|
|
25
|
+
L(o), c(null), _("");
|
|
26
|
+
}, G = () => {
|
|
27
|
+
i ? y(!0) : c("create");
|
|
28
|
+
}, m = {
|
|
29
29
|
create: {
|
|
30
|
-
content: n(t.create_budget_content, /* @__PURE__ */ r("strong", { children: e.description }), `${
|
|
30
|
+
content: n(t.create_budget_content, /* @__PURE__ */ r("strong", { children: e.description }), `${B(e.amount, "0,0.00")}`),
|
|
31
31
|
title: t.dialog_create_budget_title,
|
|
32
32
|
primaryButtonText: t.dialog_primary_button_text,
|
|
33
33
|
errorAlertMessage: n(t.alert_merchant_budget_not_created, e.description),
|
|
34
34
|
errorRetryAction: () => c("create"),
|
|
35
35
|
successAlertMessage: n(t.alert_budget_created, e.description),
|
|
36
|
-
apiTrigger: async () => await
|
|
36
|
+
apiTrigger: async () => await w(e.merchant_guid, Number(p))
|
|
37
37
|
},
|
|
38
38
|
edit: {
|
|
39
39
|
content: n(t.edit_budget_content, /* @__PURE__ */ r("strong", { children: e.description })),
|
|
@@ -42,8 +42,8 @@ var Se = /* @__PURE__ */ (function(e) {
|
|
|
42
42
|
errorAlertMessage: n(t.error_alert_edit_merchant_budget, e.description),
|
|
43
43
|
errorRetryAction: () => c("edit"),
|
|
44
44
|
successAlertMessage: n(t.success_alert_edit_merchant_budget, e.description),
|
|
45
|
-
apiTrigger: async () => await
|
|
46
|
-
...
|
|
45
|
+
apiTrigger: async () => await I({
|
|
46
|
+
...i,
|
|
47
47
|
amount: Number(p)
|
|
48
48
|
})
|
|
49
49
|
},
|
|
@@ -54,64 +54,67 @@ var Se = /* @__PURE__ */ (function(e) {
|
|
|
54
54
|
errorAlertMessage: n(t.error_alert_delete_merchant_budget, e.description),
|
|
55
55
|
errorRetryAction: () => c("delete"),
|
|
56
56
|
successAlertMessage: n(t.success_alert_delete_merchant_budget, e.description),
|
|
57
|
-
apiTrigger: async () => await
|
|
57
|
+
apiTrigger: async () => await R(i.guid)
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, j = async () => {
|
|
60
60
|
if (h.current) return;
|
|
61
61
|
h.current = !0;
|
|
62
|
-
const { apiTrigger:
|
|
63
|
-
|
|
62
|
+
const { apiTrigger: l, successAlertMessage: a, errorAlertMessage: F } = m[o], { isSuccess: b } = await l(), M = b ? a : F;
|
|
63
|
+
f(), A({
|
|
64
|
+
msg: M,
|
|
65
|
+
severity: b ? "success" : "error"
|
|
66
|
+
}), P(M), b && o === "delete" && y(!1), h.current = !1;
|
|
64
67
|
};
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
start:
|
|
68
|
-
end:
|
|
68
|
+
s.useEffect(() => {
|
|
69
|
+
const l = {
|
|
70
|
+
start: Y(/* @__PURE__ */ new Date(e.date * 1e3)),
|
|
71
|
+
end: X(/* @__PURE__ */ new Date(e.date * 1e3))
|
|
69
72
|
};
|
|
70
|
-
g &&
|
|
71
|
-
accounts:
|
|
72
|
-
custom: g ? (
|
|
73
|
-
dateRange:
|
|
73
|
+
g && O({
|
|
74
|
+
accounts: x.map((a) => a.guid),
|
|
75
|
+
custom: g ? (a) => a.merchant_guid === e.merchant_guid : (a) => a.guid === e.guid,
|
|
76
|
+
dateRange: l
|
|
74
77
|
});
|
|
75
78
|
}, [
|
|
76
79
|
g,
|
|
77
80
|
e,
|
|
78
|
-
|
|
81
|
+
x
|
|
79
82
|
]);
|
|
80
|
-
const
|
|
83
|
+
const T = () => /* @__PURE__ */ r(U, {
|
|
81
84
|
actionText: t.autogenerate_budgets_error_primary_button,
|
|
82
85
|
autoHideDuration: 3500,
|
|
83
|
-
closeAriaLabel:
|
|
84
|
-
handleClose: () =>
|
|
85
|
-
message:
|
|
86
|
-
onActionClick:
|
|
87
|
-
open: !!
|
|
88
|
-
severity:
|
|
89
|
-
showAction:
|
|
86
|
+
closeAriaLabel: u.close_aria,
|
|
87
|
+
handleClose: () => A(null),
|
|
88
|
+
message: d?.msg ?? "",
|
|
89
|
+
onActionClick: m[D]?.errorRetryAction,
|
|
90
|
+
open: !!d,
|
|
91
|
+
severity: d?.severity ?? "success",
|
|
92
|
+
showAction: d?.severity === "error",
|
|
90
93
|
showClose: !0
|
|
91
94
|
});
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
/* @__PURE__ */ r(
|
|
95
|
+
return /* @__PURE__ */ C(s.Fragment, { children: [
|
|
96
|
+
$,
|
|
97
|
+
/* @__PURE__ */ r(ee, {
|
|
95
98
|
disableGutters: !0,
|
|
96
99
|
disablePadding: !0,
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
-
onClick:
|
|
100
|
+
children: /* @__PURE__ */ C(te, {
|
|
101
|
+
onClick: G,
|
|
99
102
|
children: [
|
|
100
|
-
/* @__PURE__ */ r(
|
|
101
|
-
sx: { bgcolor:
|
|
103
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(oe, {
|
|
104
|
+
sx: { bgcolor: k },
|
|
102
105
|
variant: "rounded",
|
|
103
|
-
children: /* @__PURE__ */ r(
|
|
106
|
+
children: /* @__PURE__ */ r(v, {
|
|
104
107
|
name: "bubble_chart",
|
|
105
108
|
sx: { color: "text.primary" }
|
|
106
109
|
})
|
|
107
110
|
}) }),
|
|
108
|
-
/* @__PURE__ */ r(
|
|
111
|
+
/* @__PURE__ */ r(re, {
|
|
109
112
|
primary: t.add_merchant_budget_primary_text,
|
|
110
|
-
secondary: /* @__PURE__ */ r(
|
|
113
|
+
secondary: /* @__PURE__ */ r(Q, {
|
|
111
114
|
bold: !0,
|
|
112
115
|
sx: { color: "text.primary" },
|
|
113
116
|
variant: "body1",
|
|
114
|
-
children:
|
|
117
|
+
children: i ? `${B(i.amount, "0,0.00")} / ${u.month_text}` : t.add_merchant_budget_secondary_text
|
|
115
118
|
}),
|
|
116
119
|
slotProps: { primary: {
|
|
117
120
|
variant: "caption",
|
|
@@ -119,43 +122,43 @@ var Se = /* @__PURE__ */ (function(e) {
|
|
|
119
122
|
fontWeight: "normal"
|
|
120
123
|
} }
|
|
121
124
|
}),
|
|
122
|
-
/* @__PURE__ */ r(
|
|
125
|
+
/* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r(v, {
|
|
123
126
|
name: "chevron_right",
|
|
124
127
|
sx: { color: "text.primary" }
|
|
125
128
|
}) })
|
|
126
129
|
]
|
|
127
130
|
})
|
|
128
131
|
}),
|
|
129
|
-
!!
|
|
132
|
+
!!i && /* @__PURE__ */ r(J, {
|
|
130
133
|
isOpen: g,
|
|
131
|
-
merchantBudget:
|
|
132
|
-
onClose: () =>
|
|
133
|
-
renderingToast: () =>
|
|
134
|
-
setCurrencyDialogAction: (
|
|
135
|
-
|
|
134
|
+
merchantBudget: i,
|
|
135
|
+
onClose: () => y(!1),
|
|
136
|
+
renderingToast: () => d && T(),
|
|
137
|
+
setCurrencyDialogAction: (l) => {
|
|
138
|
+
l === "edit" && _(i?.amount.toString() || ""), c(l);
|
|
136
139
|
},
|
|
137
140
|
transaction: e
|
|
138
141
|
}),
|
|
139
|
-
o && /* @__PURE__ */ r(
|
|
140
|
-
closeAriaLabel:
|
|
141
|
-
content:
|
|
142
|
+
o && /* @__PURE__ */ r(q, {
|
|
143
|
+
closeAriaLabel: u.close_aria,
|
|
144
|
+
content: m[o].content,
|
|
142
145
|
handleInputChange: _,
|
|
143
|
-
handleModalClose:
|
|
144
|
-
handlePrimaryAction:
|
|
145
|
-
handleSecondaryAction:
|
|
146
|
-
inputLabel: o !== "delete" ?
|
|
146
|
+
handleModalClose: f,
|
|
147
|
+
handlePrimaryAction: j,
|
|
148
|
+
handleSecondaryAction: f,
|
|
149
|
+
inputLabel: o !== "delete" ? u.amount_text : "",
|
|
147
150
|
inputValue: p,
|
|
148
151
|
isOpen: !!o,
|
|
149
|
-
primaryText:
|
|
150
|
-
secondaryText:
|
|
151
|
-
title:
|
|
152
|
+
primaryText: m[o].primaryButtonText,
|
|
153
|
+
secondaryText: u.cancel_button,
|
|
154
|
+
title: m[o].title
|
|
152
155
|
}),
|
|
153
|
-
!!
|
|
156
|
+
!!d && T()
|
|
154
157
|
] });
|
|
155
158
|
});
|
|
156
159
|
export {
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
De as AddMerchantBudgetAction,
|
|
161
|
+
Ce as CurrencyDialogAction
|
|
159
162
|
};
|
|
160
163
|
|
|
161
164
|
//# sourceMappingURL=AddMerchantBudgetAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddMerchantBudgetAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Avatar from '@mui/material/Avatar'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text, Toast } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { endOfMonth } from 'date-fns/endOfMonth'\n\nimport {\n CurrencyDialog,\n useAccountStore,\n useBudgetsStore,\n useGlobalCopyStore,\n useTransactionStore,\n} from '../../../../../common'\nimport { type Transaction } from '../../../../../core'\nimport { useAriaLive } from '../../../../../common/hooks/useAriaLive'\nimport MerchantBudgetDetailsDrawer from '../../../../../budgets/components/MerchantBudgetDetailsDrawer'\nimport { formatCurrency } from '../../../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface AddMerchantBudgetActionProps {\n transaction: Transaction\n}\n\nexport enum CurrencyDialogAction {\n CREATE = 'create',\n EDIT = 'edit',\n DELETE = 'delete',\n}\n\nexport const AddMerchantBudgetAction = observer(({ transaction }: AddMerchantBudgetActionProps) => {\n const [currencyDialogAction, setCurrencyDialogAction] =\n React.useState<CurrencyDialogAction | null>(null)\n\n const [amount, setAmount] = React.useState('')\n\n const [isError, setIsError] = React.useState(false)\n\n const inProgressRef = React.useRef(false)\n\n const [lastActionType, setLastActionType] = React.useState<CurrencyDialogAction | null>(null)\n\n const theme = useTheme()\n\n const {\n addMerchantBudget,\n updateMerchantBudget,\n deleteMerchantBudget,\n getMerchantBudgetByMerchantGuid,\n alert,\n setAlert,\n } = useBudgetsStore()\n const { setFilter } = useTransactionStore()\n const { accounts } = useAccountStore()\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n const { budgets: budgetsCopy, common: commonCopy } = useGlobalCopyStore()\n\n const { announce, ariaLive } = useAriaLive()\n\n const [merchantBudgetDetailsDrawerOpen, setMerchantBudgetDetailsDrawerOpen] =\n React.useState(false)\n\n const existingMerchantBudget = transaction?.merchant_guid\n ? getMerchantBudgetByMerchantGuid(transaction.merchant_guid)\n : undefined\n\n const handleModalClose = () => {\n setLastActionType(currencyDialogAction)\n setCurrencyDialogAction(null)\n setAmount('')\n }\n\n const handleClick = () => {\n if (!existingMerchantBudget) {\n setCurrencyDialogAction(CurrencyDialogAction.CREATE)\n } else {\n setMerchantBudgetDetailsDrawerOpen(true)\n }\n }\n\n // details needed for all the three states of the dialog - create, edit, delete\n const actionDetails = {\n [CurrencyDialogAction.CREATE]: {\n content: buildDynamicCopy(\n budgetsCopy.create_budget_content,\n <strong>{transaction.description}</strong>,\n `${formatCurrency(transaction.amount, '0,0.00')}`,\n ) as string,\n title: budgetsCopy.dialog_create_budget_title,\n primaryButtonText: budgetsCopy.dialog_primary_button_text,\n errorAlertMessage: buildDynamicCopy(\n budgetsCopy.alert_merchant_budget_not_created,\n transaction.description,\n ) as string,\n errorRetryAction: () => setCurrencyDialogAction(CurrencyDialogAction.CREATE),\n successAlertMessage: buildDynamicCopy(\n budgetsCopy.alert_budget_created,\n transaction.description,\n ) as string,\n apiTrigger: async () => await addMerchantBudget(transaction.merchant_guid!, Number(amount)),\n },\n\n [CurrencyDialogAction.EDIT]: {\n content: buildDynamicCopy(\n budgetsCopy.edit_budget_content,\n <strong>{transaction.description}</strong>,\n ) as string,\n title: budgetsCopy.details_edit_title,\n primaryButtonText: budgetsCopy.add_save_button,\n errorAlertMessage: buildDynamicCopy(\n budgetsCopy.error_alert_edit_merchant_budget,\n transaction.description,\n ) as string,\n errorRetryAction: () => setCurrencyDialogAction(CurrencyDialogAction.EDIT),\n successAlertMessage: buildDynamicCopy(\n budgetsCopy.success_alert_edit_merchant_budget,\n transaction.description,\n ) as string,\n apiTrigger: async () =>\n await updateMerchantBudget({\n ...existingMerchantBudget!,\n amount: Number(amount),\n }),\n },\n\n [CurrencyDialogAction.DELETE]: {\n content: buildDynamicCopy(\n budgetsCopy.delete_description,\n <strong>{transaction.description}</strong>,\n ) as string,\n title: budgetsCopy.delete_title,\n primaryButtonText: budgetsCopy.details_delete_button,\n errorAlertMessage: buildDynamicCopy(\n budgetsCopy.error_alert_delete_merchant_budget,\n transaction.description,\n ) as string,\n errorRetryAction: () => setCurrencyDialogAction(CurrencyDialogAction.DELETE),\n successAlertMessage: buildDynamicCopy(\n budgetsCopy.success_alert_delete_merchant_budget,\n transaction.description,\n ) as string,\n apiTrigger: async () => await deleteMerchantBudget(existingMerchantBudget!.guid),\n },\n }\n\n const handlePrimaryAction = async () => {\n if (inProgressRef.current) return\n\n inProgressRef.current = true\n\n const { apiTrigger, successAlertMessage, errorAlertMessage } =\n actionDetails[currencyDialogAction as CurrencyDialogAction]\n\n const { isSuccess } = await apiTrigger()\n const alertMessage = isSuccess ? successAlertMessage : errorAlertMessage\n handleModalClose()\n setIsError(!isSuccess)\n setAlert(alertMessage)\n announce(alertMessage)\n\n if (isSuccess && currencyDialogAction === CurrencyDialogAction.DELETE) {\n setMerchantBudgetDetailsDrawerOpen(false)\n }\n inProgressRef.current = false\n }\n\n React.useEffect(() => {\n const dateRange = {\n start: startOfMonth(new Date(transaction.date * 1000)),\n end: endOfMonth(new Date(transaction.date * 1000)),\n }\n\n if (merchantBudgetDetailsDrawerOpen) {\n setFilter({\n accounts: accounts.map((account) => account.guid),\n custom: merchantBudgetDetailsDrawerOpen\n ? (trn) => trn.merchant_guid === transaction.merchant_guid\n : (trn) => trn.guid === transaction.guid,\n dateRange,\n })\n }\n }, [merchantBudgetDetailsDrawerOpen, transaction, accounts])\n\n const snackBar = () => (\n <Toast\n actionText={budgetsCopy.autogenerate_budgets_error_primary_button}\n autoHideDuration={3500}\n closeAriaLabel={commonCopy.close_aria}\n handleClose={() => setAlert('')}\n message={alert}\n onActionClick={actionDetails[lastActionType as CurrencyDialogAction]?.errorRetryAction}\n open={Boolean(alert)}\n severity={isError ? 'error' : 'success'}\n showAction={isError}\n showClose={true}\n />\n )\n return (\n <React.Fragment>\n {ariaLive}\n\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton onClick={handleClick}>\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <Icon name=\"bubble_chart\" sx={{ color: 'text.primary' }} />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={budgetsCopy.add_merchant_budget_primary_text}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {existingMerchantBudget\n ? `${formatCurrency(existingMerchantBudget.amount, '0,0.00')} / ${commonCopy.month_text}`\n : budgetsCopy.add_merchant_budget_secondary_text}\n </Text>\n }\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n <ListItemIcon>\n <Icon name=\"chevron_right\" sx={{ color: 'text.primary' }} />\n </ListItemIcon>\n </ListItemButton>\n </ListItem>\n\n {!!existingMerchantBudget && (\n <MerchantBudgetDetailsDrawer\n isOpen={merchantBudgetDetailsDrawerOpen}\n merchantBudget={existingMerchantBudget}\n onClose={() => setMerchantBudgetDetailsDrawerOpen(false)}\n renderingToast={() => alert && snackBar()}\n setCurrencyDialogAction={(action) => {\n if (action === CurrencyDialogAction.EDIT) {\n setAmount(existingMerchantBudget?.amount.toString() || '')\n }\n setCurrencyDialogAction(action)\n }}\n transaction={transaction}\n />\n )}\n {currencyDialogAction && (\n <CurrencyDialog\n closeAriaLabel={commonCopy.close_aria}\n content={actionDetails[currencyDialogAction].content}\n handleInputChange={setAmount}\n handleModalClose={handleModalClose}\n handlePrimaryAction={handlePrimaryAction}\n handleSecondaryAction={handleModalClose}\n inputLabel={\n currencyDialogAction !== CurrencyDialogAction.DELETE ? commonCopy.amount_text : ''\n }\n inputValue={amount}\n isOpen={Boolean(currencyDialogAction)}\n primaryText={actionDetails[currencyDialogAction].primaryButtonText}\n secondaryText={commonCopy.cancel_button}\n title={actionDetails[currencyDialogAction].title}\n />\n )}\n\n {!!alert && snackBar()}\n </React.Fragment>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCA,IAAY,KAAL,0BAAA,GAAA;AACL,SAAA,EAAA,SAAA,UACA,EAAA,OAAA,QACA,EAAA,SAAA;AACF,GAAA,CAAA,CAAA,GAEa,KAA0B,EAAA,CAAU,EAAE,aAAA,EAAA,MAAgD;AACjG,QAAM,CAAC,GAAsB,CAAA,IAC3B,EAAM,SAAsC,IAAI,GAE5C,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAS,EAAE,GAEvC,CAAC,GAAS,CAAA,IAAc,EAAM,SAAS,EAAK,GAE5C,IAAgB,EAAM,OAAO,EAAK,GAElC,CAAC,GAAgB,CAAA,IAAqB,EAAM,SAAsC,IAAI,GAEtF,IAAQ,GAAS,GAEjB,EACJ,mBAAA,GACA,sBAAA,GACA,sBAAA,GACA,iCAAA,GACA,OAAA,GACA,UAAA,EAAA,IACE,EAAgB,GACd,EAAE,WAAA,EAAA,IAAc,EAAoB,GACpC,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,IAAU,EAAM,QAAQ,S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D;AAAA,YAAM,MAAK;AAAA,YAAgB,IAAI,EAAE,OAAO,eAAe;AAAA,UAAI,CAAA,EAC/C,CAAA;AAAA,QACA;AAAA;IACR,CAAA;AAAA,IAET,CAAC,CAAC,KACD,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,SAAA,MAAe,EAAmC,EAAK;AAAA,MACvD,gBAAA,MAAsB,KAAS,EAAS;AAAA,MACxC,yBAAA,CAA0B,MAAW;AACnC,QAAI,MAAA,UACF,EAAU,GAAwB,OAAO,SAAS,KAAK,EAAE,GAE3D,EAAwB,CAAM;AAAA,MAChC;AAAA,MACa,aAAA;AAAA,IACd,CAAA;AAAA,IAEF,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,EAAW;AAAA,MAC3B,SAAS,EAAc,CAAA,EAAsB;AAAA,MAC7C,mBAAmB;AAAA,MACD,kBAAA;AAAA,MACG,qBAAA;AAAA,MACrB,uBAAuB;AAAA,MACvB,YACE,MAAA,WAAuD,EAAW,cAAc;AAAA,MAElF,YAAY;AAAA,MACZ,QAAQ,EAAQ;AAAA,MAChB,aAAa,EAAc,CAAA,EAAsB;AAAA,MACjD,eAAe,EAAW;AAAA,MAC1B,OAAO,EAAc,CAAA,EAAsB;AAAA,IAC5C,CAAA;AAAA,IAGF,CAAC,CAAC,KAAS,EAAS;AAAA,EACP,EAAA,CAAA;AAEpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"AddMerchantBudgetAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Avatar from '@mui/material/Avatar'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text, Toast } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { endOfMonth } from 'date-fns/endOfMonth'\n\nimport {\n CurrencyDialog,\n useAccountStore,\n useBudgetsStore,\n useGlobalCopyStore,\n useTransactionStore,\n} from '../../../../../common'\nimport { type Transaction } from '../../../../../core'\nimport { useAriaLive } from '../../../../../common/hooks/useAriaLive'\nimport MerchantBudgetDetailsDrawer from '../../../../../budgets/components/MerchantBudgetDetailsDrawer'\nimport { formatCurrency } from '../../../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface AddMerchantBudgetActionProps {\n transaction: Transaction\n}\n\nexport enum CurrencyDialogAction {\n CREATE = 'create',\n EDIT = 'edit',\n DELETE = 'delete',\n}\n\nexport const AddMerchantBudgetAction = observer(({ transaction }: AddMerchantBudgetActionProps) => {\n const [currencyDialogAction, setCurrencyDialogAction] =\n React.useState<CurrencyDialogAction | null>(null)\n\n const [amount, setAmount] = React.useState('')\n\n const inProgressRef = React.useRef(false)\n\n const [lastActionType, setLastActionType] = React.useState<CurrencyDialogAction | null>(null)\n\n const theme = useTheme()\n\n const {\n addMerchantBudget,\n updateMerchantBudget,\n deleteMerchantBudget,\n getMerchantBudgetByMerchantGuid,\n alert,\n setAlert,\n } = useBudgetsStore()\n const { setFilter } = useTransactionStore()\n const { accounts } = useAccountStore()\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n const { budgets: budgetsCopy, common: commonCopy } = useGlobalCopyStore()\n\n const { announce, ariaLive } = useAriaLive()\n\n const [merchantBudgetDetailsDrawerOpen, setMerchantBudgetDetailsDrawerOpen] =\n React.useState(false)\n\n const existingMerchantBudget = transaction?.merchant_guid\n ? getMerchantBudgetByMerchantGuid(transaction.merchant_guid)\n : undefined\n\n const handleModalClose = () => {\n setLastActionType(currencyDialogAction)\n setCurrencyDialogAction(null)\n setAmount('')\n }\n\n const handleClick = () => {\n if (!existingMerchantBudget) {\n setCurrencyDialogAction(CurrencyDialogAction.CREATE)\n } else {\n setMerchantBudgetDetailsDrawerOpen(true)\n }\n }\n\n // details needed for all the three states of the dialog - create, edit, delete\n const actionDetails = {\n [CurrencyDialogAction.CREATE]: {\n content: buildDynamicCopy(\n budgetsCopy.create_budget_content,\n <strong>{transaction.description}</strong>,\n `${formatCurrency(transaction.amount, '0,0.00')}`,\n ) as string,\n title: budgetsCopy.dialog_create_budget_title,\n primaryButtonText: budgetsCopy.dialog_primary_button_text,\n errorAlertMessage: buildDynamicCopy(\n budgetsCopy.alert_merchant_budget_not_created,\n transaction.description,\n ) as string,\n errorRetryAction: () => setCurrencyDialogAction(CurrencyDialogAction.CREATE),\n successAlertMessage: buildDynamicCopy(\n budgetsCopy.alert_budget_created,\n transaction.description,\n ) as string,\n apiTrigger: async () => await addMerchantBudget(transaction.merchant_guid!, Number(amount)),\n },\n\n [CurrencyDialogAction.EDIT]: {\n content: buildDynamicCopy(\n budgetsCopy.edit_budget_content,\n <strong>{transaction.description}</strong>,\n ) as string,\n title: budgetsCopy.details_edit_title,\n primaryButtonText: budgetsCopy.add_save_button,\n errorAlertMessage: buildDynamicCopy(\n budgetsCopy.error_alert_edit_merchant_budget,\n transaction.description,\n ) as string,\n errorRetryAction: () => setCurrencyDialogAction(CurrencyDialogAction.EDIT),\n successAlertMessage: buildDynamicCopy(\n budgetsCopy.success_alert_edit_merchant_budget,\n transaction.description,\n ) as string,\n apiTrigger: async () =>\n await updateMerchantBudget({\n ...existingMerchantBudget!,\n amount: Number(amount),\n }),\n },\n\n [CurrencyDialogAction.DELETE]: {\n content: buildDynamicCopy(\n budgetsCopy.delete_description,\n <strong>{transaction.description}</strong>,\n ) as string,\n title: budgetsCopy.delete_title,\n primaryButtonText: budgetsCopy.details_delete_button,\n errorAlertMessage: buildDynamicCopy(\n budgetsCopy.error_alert_delete_merchant_budget,\n transaction.description,\n ) as string,\n errorRetryAction: () => setCurrencyDialogAction(CurrencyDialogAction.DELETE),\n successAlertMessage: buildDynamicCopy(\n budgetsCopy.success_alert_delete_merchant_budget,\n transaction.description,\n ) as string,\n apiTrigger: async () => await deleteMerchantBudget(existingMerchantBudget!.guid),\n },\n }\n\n const handlePrimaryAction = async () => {\n if (inProgressRef.current) return\n\n inProgressRef.current = true\n\n const { apiTrigger, successAlertMessage, errorAlertMessage } =\n actionDetails[currencyDialogAction as CurrencyDialogAction]\n\n const { isSuccess } = await apiTrigger()\n const alertMessage = isSuccess ? successAlertMessage : errorAlertMessage\n handleModalClose()\n setAlert({ msg: alertMessage, severity: isSuccess ? 'success' : 'error' })\n announce(alertMessage)\n\n if (isSuccess && currencyDialogAction === CurrencyDialogAction.DELETE) {\n setMerchantBudgetDetailsDrawerOpen(false)\n }\n inProgressRef.current = false\n }\n\n React.useEffect(() => {\n const dateRange = {\n start: startOfMonth(new Date(transaction.date * 1000)),\n end: endOfMonth(new Date(transaction.date * 1000)),\n }\n\n if (merchantBudgetDetailsDrawerOpen) {\n setFilter({\n accounts: accounts.map((account) => account.guid),\n custom: merchantBudgetDetailsDrawerOpen\n ? (trn) => trn.merchant_guid === transaction.merchant_guid\n : (trn) => trn.guid === transaction.guid,\n dateRange,\n })\n }\n }, [merchantBudgetDetailsDrawerOpen, transaction, accounts])\n\n const snackBar = () => (\n <Toast\n actionText={budgetsCopy.autogenerate_budgets_error_primary_button}\n autoHideDuration={3500}\n closeAriaLabel={commonCopy.close_aria}\n handleClose={() => setAlert(null)}\n message={alert?.msg ?? ''}\n onActionClick={actionDetails[lastActionType as CurrencyDialogAction]?.errorRetryAction}\n open={Boolean(alert)}\n severity={alert?.severity ?? 'success'}\n showAction={alert?.severity === 'error'}\n showClose={true}\n />\n )\n return (\n <React.Fragment>\n {ariaLive}\n\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton onClick={handleClick}>\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <Icon name=\"bubble_chart\" sx={{ color: 'text.primary' }} />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={budgetsCopy.add_merchant_budget_primary_text}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {existingMerchantBudget\n ? `${formatCurrency(existingMerchantBudget.amount, '0,0.00')} / ${commonCopy.month_text}`\n : budgetsCopy.add_merchant_budget_secondary_text}\n </Text>\n }\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n <ListItemIcon>\n <Icon name=\"chevron_right\" sx={{ color: 'text.primary' }} />\n </ListItemIcon>\n </ListItemButton>\n </ListItem>\n\n {!!existingMerchantBudget && (\n <MerchantBudgetDetailsDrawer\n isOpen={merchantBudgetDetailsDrawerOpen}\n merchantBudget={existingMerchantBudget}\n onClose={() => setMerchantBudgetDetailsDrawerOpen(false)}\n renderingToast={() => alert && snackBar()}\n setCurrencyDialogAction={(action) => {\n if (action === CurrencyDialogAction.EDIT) {\n setAmount(existingMerchantBudget?.amount.toString() || '')\n }\n setCurrencyDialogAction(action)\n }}\n transaction={transaction}\n />\n )}\n {currencyDialogAction && (\n <CurrencyDialog\n closeAriaLabel={commonCopy.close_aria}\n content={actionDetails[currencyDialogAction].content}\n handleInputChange={setAmount}\n handleModalClose={handleModalClose}\n handlePrimaryAction={handlePrimaryAction}\n handleSecondaryAction={handleModalClose}\n inputLabel={\n currencyDialogAction !== CurrencyDialogAction.DELETE ? commonCopy.amount_text : ''\n }\n inputValue={amount}\n isOpen={Boolean(currencyDialogAction)}\n primaryText={actionDetails[currencyDialogAction].primaryButtonText}\n secondaryText={commonCopy.cancel_button}\n title={actionDetails[currencyDialogAction].title}\n />\n )}\n\n {!!alert && snackBar()}\n </React.Fragment>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCA,IAAY,KAAL,0BAAA,GAAA;AACL,SAAA,EAAA,SAAA,UACA,EAAA,OAAA,QACA,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