mario-core 2.0.107-release → 2.0.108-release
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/Dashboard-BoYmBZNH.js +1 -0
- package/dist/Dashboard-BohWITqY.mjs +206 -0
- package/dist/Dashboard-CNeLkxKn.mjs +206 -0
- package/dist/Dashboard-CdE8azYL.mjs +206 -0
- package/dist/Dashboard-J2_aB4nr.js +1 -0
- package/dist/Dashboard-UaTWEdw7.js +1 -0
- package/dist/EmailTemplateDetail-BUXh0rmo.mjs +443 -0
- package/dist/EmailTemplateDetail-BVvZIx3m.js +1 -0
- package/dist/EmailTemplateDetail-B__EDhB8.mjs +443 -0
- package/dist/EmailTemplateDetail-CCjCTnSu.js +1 -0
- package/dist/EmailTemplateDetail-CxZ-vu_-.js +1 -0
- package/dist/EmailTemplateDetail-Qhx-osUA.mjs +443 -0
- package/dist/EmailTemplateList-B8f6wVB3.js +1 -0
- package/dist/EmailTemplateList-CUCMBqBJ.js +1 -0
- package/dist/EmailTemplateList-CzfA-3kQ.mjs +170 -0
- package/dist/EmailTemplateList-DBKq5mG7.mjs +170 -0
- package/dist/EmailTemplateList-DEmHB3bi.mjs +170 -0
- package/dist/EmailTemplateList-uuxfqcEO.js +1 -0
- package/dist/GalleryList-Bgwjxzce.js +1 -0
- package/dist/GalleryList-Bi89gGR2.mjs +329 -0
- package/dist/GalleryList-Dlc2e9PL.mjs +329 -0
- package/dist/GalleryList-DnhQAwOw.js +1 -0
- package/dist/GalleryList-P4_Es_iv.mjs +329 -0
- package/dist/GalleryList-w-ECfc3W.js +1 -0
- package/dist/Login-BNjTZptP.js +1 -0
- package/dist/Login-BtTGTO_G.js +1 -0
- package/dist/Login-CPYV_-gQ.mjs +1697 -0
- package/dist/Login-CSmQdSBL.js +1 -0
- package/dist/Login-CbC6Q-Yk.mjs +1697 -0
- package/dist/Login-Dx5u6cvm.mjs +1697 -0
- package/dist/NotificationList-BChmo09j.js +2 -0
- package/dist/NotificationList-BOytZRAN.mjs +3982 -0
- package/dist/NotificationList-BafFtIAD.js +2 -0
- package/dist/NotificationList-Bvy5c_o1.mjs +3982 -0
- package/dist/NotificationList-CubwqBsm.mjs +3982 -0
- package/dist/NotificationList-KmXVzoAr.js +2 -0
- package/dist/SkillList-CFZ22qQ9.mjs +386 -0
- package/dist/SkillList-C_1JfxfB.js +1 -0
- package/dist/SkillList-DKcDkv94.js +1 -0
- package/dist/SkillList-DmC__72S.mjs +386 -0
- package/dist/SkillList-IVVDVSZy.js +1 -0
- package/dist/SkillList-jK0IHAIH.mjs +386 -0
- package/dist/TeacherSelector-BpES1FKj.js +1 -0
- package/dist/TeacherSelector-BuhI-rGs.mjs +30 -0
- package/dist/TeacherSelector-De6mBvx2.mjs +30 -0
- package/dist/TeacherSelector-HTemy-Ez.js +1 -0
- package/dist/TeacherSelector-fEPchTjh.js +1 -0
- package/dist/TeacherSelector-lR6Ch-At.mjs +30 -0
- package/dist/TheContent-BHBSuj40.mjs +38 -0
- package/dist/TheContent-C-xV_3xT.js +1 -0
- package/dist/TheContent-DEgi129y.js +1 -0
- package/dist/TheContent-Di5D7Gbr.mjs +38 -0
- package/dist/TheContent-GAKUlCji.mjs +38 -0
- package/dist/TheContent-ZKcVU5qk.js +1 -0
- package/dist/UserContainer--xRA0JQU.js +5 -0
- package/dist/UserContainer-B6yMu-I3.js +5 -0
- package/dist/UserContainer-CkZ53kH4.mjs +2902 -0
- package/dist/UserContainer-D3Xz2HUW.mjs +2902 -0
- package/dist/UserContainer-DSQ-U3F0.js +5 -0
- package/dist/UserContainer-Dyn6ibh1.mjs +2902 -0
- package/dist/UserDetail-7FH_HSWR.mjs +903 -0
- package/dist/UserDetail-BKnlgUEz.js +1 -0
- package/dist/UserDetail-DBpzl5fo.mjs +903 -0
- package/dist/UserDetail-DQOnt-wM.js +1 -0
- package/dist/UserDetail-fUJTkzDg.mjs +903 -0
- package/dist/UserDetail-oF6NNexq.js +1 -0
- package/dist/UserList-B50qyfjL.mjs +1261 -0
- package/dist/UserList-C2Aaq5z8.js +7 -0
- package/dist/UserList-Cenxl6uR.mjs +1261 -0
- package/dist/UserList-DhIaXh_s.mjs +1261 -0
- package/dist/UserList-EX5eXQba.js +7 -0
- package/dist/UserList-EcYGduyj.js +7 -0
- package/dist/constants--_acGsaz.js +1 -0
- package/dist/constants-B9hWa6_R.mjs +286 -0
- package/dist/constants-BjESNXd6.mjs +286 -0
- package/dist/constants-C5BtfcR2.js +1 -0
- package/dist/constants-C5WkZZdL.mjs +286 -0
- package/dist/constants-DsRvQ2-W.js +1 -0
- package/dist/index-BGTGhZlt.js +15 -0
- package/dist/index-CO_pMkbk.mjs +19148 -0
- package/dist/index-CVKal53K.mjs +19158 -0
- package/dist/index-D0HO9-Jy.js +15 -0
- package/dist/index-DaEyv-Te.mjs +19158 -0
- package/dist/index-txMWO23Z.js +15 -0
- package/dist/index.js +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/mailCategoryService-B2QTjf12.js +1 -0
- package/dist/mailCategoryService-BFfwPcnM.mjs +11 -0
- package/dist/mailCategoryService-Bnr7gh_G.js +1 -0
- package/dist/mailCategoryService-D00fI25v.js +1 -0
- package/dist/mailCategoryService-DprdWJcz.mjs +11 -0
- package/dist/mailCategoryService-RFcp_8SH.mjs +11 -0
- package/dist/userService-B50oEL_l.mjs +56 -0
- package/dist/userService-B_lNnb--.js +1 -0
- package/dist/userService-C4d9YEpa.js +1 -0
- package/dist/userService-CiQiZh4G.mjs +56 -0
- package/dist/userService-DTLWpqzW.js +1 -0
- package/dist/userService-fA4Xahnz.mjs +56 -0
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Row as f, Col as c, Table as _ } from "reactstrap";
|
|
3
|
+
import { J as D, b as g, K as I, L as A, c as y, O as R, P as w, Q as x, R as P, S as k, T as M, U as j } from "./index-CO_pMkbk.mjs";
|
|
4
|
+
import { format as S } from "date-fns";
|
|
5
|
+
import { useCallback as T, useEffect as N } from "react";
|
|
6
|
+
import { useSelector as L, useDispatch as U } from "react-redux";
|
|
7
|
+
import { useNavigate as z } from "react-router-dom";
|
|
8
|
+
import { g as B, a as F, r as $ } from "./mailCategoryService-BFfwPcnM.mjs";
|
|
9
|
+
import { useTranslation as E } from "react-i18next";
|
|
10
|
+
const O = "/admin/email-template", J = "/admin/create-email-template", K = "Email template list", Q = () => {
|
|
11
|
+
const n = z(), { t: o } = E(), u = L(
|
|
12
|
+
(s) => s.emailTemplate.emailTemplateList
|
|
13
|
+
), d = L(
|
|
14
|
+
(s) => s.emailTemplate.totalItems
|
|
15
|
+
), r = L(
|
|
16
|
+
(s) => s.mailCategory.mailCategoryList
|
|
17
|
+
), { filters: i, changeFilters: h } = D(), t = U(), p = T(async () => {
|
|
18
|
+
t(g(!0));
|
|
19
|
+
try {
|
|
20
|
+
const s = await B(i), { items: m, totalItems: C } = s.data;
|
|
21
|
+
if (t(
|
|
22
|
+
I({ emailTemplateList: m, totalItems: C })
|
|
23
|
+
), r && r.length == 0) {
|
|
24
|
+
const v = await F();
|
|
25
|
+
t(A(v.data.items));
|
|
26
|
+
}
|
|
27
|
+
} catch (s) {
|
|
28
|
+
t(
|
|
29
|
+
y({
|
|
30
|
+
type: "danger",
|
|
31
|
+
message: s.response?.data?.title || s.message
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
t(g(!1));
|
|
36
|
+
}, [t, i]), a = T(
|
|
37
|
+
(s) => {
|
|
38
|
+
t(g(!0));
|
|
39
|
+
try {
|
|
40
|
+
t(
|
|
41
|
+
R({
|
|
42
|
+
isOpen: !0,
|
|
43
|
+
type: "warning",
|
|
44
|
+
message: o("do_you_want_to_remove_this_email_template"),
|
|
45
|
+
onConfirm: async () => {
|
|
46
|
+
await $(s), t(
|
|
47
|
+
y({
|
|
48
|
+
type: "success",
|
|
49
|
+
message: "Remove template successfully"
|
|
50
|
+
})
|
|
51
|
+
), h({ currentPage: 1 });
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
} catch (m) {
|
|
56
|
+
t(
|
|
57
|
+
y({
|
|
58
|
+
type: "danger",
|
|
59
|
+
message: m.response?.data?.title || m.message
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
t(g(!1));
|
|
64
|
+
},
|
|
65
|
+
[i]
|
|
66
|
+
), b = T((s) => {
|
|
67
|
+
const m = s ? `${O}/${s}` : J;
|
|
68
|
+
n(m);
|
|
69
|
+
}, []);
|
|
70
|
+
return N(() => {
|
|
71
|
+
document.title = K;
|
|
72
|
+
}, []), N(() => {
|
|
73
|
+
p();
|
|
74
|
+
}, [i]), {
|
|
75
|
+
emailTemplateList: u,
|
|
76
|
+
totalItems: d,
|
|
77
|
+
filters: i,
|
|
78
|
+
changeFilters: h,
|
|
79
|
+
getData: p,
|
|
80
|
+
removeData: a,
|
|
81
|
+
goToDetail: b,
|
|
82
|
+
mailCategoryList: r
|
|
83
|
+
};
|
|
84
|
+
}, q = "email_template", ae = () => {
|
|
85
|
+
const {
|
|
86
|
+
emailTemplateList: n,
|
|
87
|
+
totalItems: o,
|
|
88
|
+
filters: u,
|
|
89
|
+
changeFilters: d,
|
|
90
|
+
removeData: r,
|
|
91
|
+
goToDetail: i,
|
|
92
|
+
mailCategoryList: h
|
|
93
|
+
} = Q(), { t } = E(), p = (a) => {
|
|
94
|
+
r(a);
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ l("div", { className: "fadeIn animated", children: [
|
|
97
|
+
/* @__PURE__ */ e("h5", { className: "mb-2", children: t(q) }),
|
|
98
|
+
/* @__PURE__ */ l(f, { className: "my-2", children: [
|
|
99
|
+
/* @__PURE__ */ e(c, { md: 4, children: /* @__PURE__ */ e(
|
|
100
|
+
w,
|
|
101
|
+
{
|
|
102
|
+
text: t("create_template"),
|
|
103
|
+
onClick: () => i()
|
|
104
|
+
}
|
|
105
|
+
) }),
|
|
106
|
+
/* @__PURE__ */ l(
|
|
107
|
+
c,
|
|
108
|
+
{
|
|
109
|
+
md: 4,
|
|
110
|
+
className: "d-flex align-items-center justify-content-end",
|
|
111
|
+
children: [
|
|
112
|
+
t("total_of_templates"),
|
|
113
|
+
": ",
|
|
114
|
+
o
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ l(f, { className: "mb-2", children: [
|
|
120
|
+
/* @__PURE__ */ l(c, { md: 8, children: [
|
|
121
|
+
n && n.length > 0 ? /* @__PURE__ */ l(_, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
|
|
122
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { children: [
|
|
123
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("template_name") }),
|
|
124
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("category_name") }),
|
|
125
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("created_date") }),
|
|
126
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("status") }),
|
|
127
|
+
/* @__PURE__ */ e("th", { className: "text-center", children: t("action") })
|
|
128
|
+
] }) }),
|
|
129
|
+
/* @__PURE__ */ e("tbody", { children: n.map((a) => /* @__PURE__ */ l("tr", { children: [
|
|
130
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: /* @__PURE__ */ e(
|
|
131
|
+
x,
|
|
132
|
+
{
|
|
133
|
+
label: a.subject,
|
|
134
|
+
onClick: () => i(a.id)
|
|
135
|
+
}
|
|
136
|
+
) }),
|
|
137
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: a.category.name }),
|
|
138
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: S(
|
|
139
|
+
new Date(a.createdAt),
|
|
140
|
+
P
|
|
141
|
+
) }),
|
|
142
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: a.isDisabled ? t("disabled") : t("enabled") }),
|
|
143
|
+
/* @__PURE__ */ e("td", { className: "text-center align-middle", children: /* @__PURE__ */ e(
|
|
144
|
+
k,
|
|
145
|
+
{
|
|
146
|
+
onClick: () => p(a.id)
|
|
147
|
+
}
|
|
148
|
+
) })
|
|
149
|
+
] }, a.id)) })
|
|
150
|
+
] }) : /* @__PURE__ */ e(M, { label: t("template") }),
|
|
151
|
+
/* @__PURE__ */ e(f, { className: "mt-2", children: /* @__PURE__ */ e(c, { md: 12, children: /* @__PURE__ */ e(
|
|
152
|
+
j,
|
|
153
|
+
{
|
|
154
|
+
filters: u,
|
|
155
|
+
totalRecordCount: o,
|
|
156
|
+
changePageSize: (a) => d({ pageSize: a }),
|
|
157
|
+
changePage: (a) => d({ currentPage: a })
|
|
158
|
+
}
|
|
159
|
+
) }) })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ e(c, { md: 4, children: /* @__PURE__ */ l(_, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
|
|
162
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("th", { className: "align-top", children: t("category_name") }) }) }),
|
|
163
|
+
/* @__PURE__ */ e("tbody", { children: h.map((a) => /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { className: "align-middle", children: a.name }) }, a.id)) })
|
|
164
|
+
] }) })
|
|
165
|
+
] })
|
|
166
|
+
] });
|
|
167
|
+
};
|
|
168
|
+
export {
|
|
169
|
+
ae as default
|
|
170
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Row as f, Col as c, Table as _ } from "reactstrap";
|
|
3
|
+
import { J as D, b as g, K as I, L as A, c as y, O as R, P as w, Q as x, R as P, S as k, T as M, U as j } from "./index-DaEyv-Te.mjs";
|
|
4
|
+
import { format as S } from "date-fns";
|
|
5
|
+
import { useCallback as T, useEffect as N } from "react";
|
|
6
|
+
import { useSelector as L, useDispatch as U } from "react-redux";
|
|
7
|
+
import { useNavigate as z } from "react-router-dom";
|
|
8
|
+
import { g as B, a as F, r as $ } from "./mailCategoryService-RFcp_8SH.mjs";
|
|
9
|
+
import { useTranslation as E } from "react-i18next";
|
|
10
|
+
const O = "/admin/email-template", J = "/admin/create-email-template", K = "Email template list", Q = () => {
|
|
11
|
+
const n = z(), { t: o } = E(), u = L(
|
|
12
|
+
(s) => s.emailTemplate.emailTemplateList
|
|
13
|
+
), d = L(
|
|
14
|
+
(s) => s.emailTemplate.totalItems
|
|
15
|
+
), r = L(
|
|
16
|
+
(s) => s.mailCategory.mailCategoryList
|
|
17
|
+
), { filters: i, changeFilters: h } = D(), t = U(), p = T(async () => {
|
|
18
|
+
t(g(!0));
|
|
19
|
+
try {
|
|
20
|
+
const s = await B(i), { items: m, totalItems: C } = s.data;
|
|
21
|
+
if (t(
|
|
22
|
+
I({ emailTemplateList: m, totalItems: C })
|
|
23
|
+
), r && r.length == 0) {
|
|
24
|
+
const v = await F();
|
|
25
|
+
t(A(v.data.items));
|
|
26
|
+
}
|
|
27
|
+
} catch (s) {
|
|
28
|
+
t(
|
|
29
|
+
y({
|
|
30
|
+
type: "danger",
|
|
31
|
+
message: s.response?.data?.title || s.message
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
t(g(!1));
|
|
36
|
+
}, [t, i]), a = T(
|
|
37
|
+
(s) => {
|
|
38
|
+
t(g(!0));
|
|
39
|
+
try {
|
|
40
|
+
t(
|
|
41
|
+
R({
|
|
42
|
+
isOpen: !0,
|
|
43
|
+
type: "warning",
|
|
44
|
+
message: o("do_you_want_to_remove_this_email_template"),
|
|
45
|
+
onConfirm: async () => {
|
|
46
|
+
await $(s), t(
|
|
47
|
+
y({
|
|
48
|
+
type: "success",
|
|
49
|
+
message: "Remove template successfully"
|
|
50
|
+
})
|
|
51
|
+
), h({ currentPage: 1 });
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
} catch (m) {
|
|
56
|
+
t(
|
|
57
|
+
y({
|
|
58
|
+
type: "danger",
|
|
59
|
+
message: m.response?.data?.title || m.message
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
t(g(!1));
|
|
64
|
+
},
|
|
65
|
+
[i]
|
|
66
|
+
), b = T((s) => {
|
|
67
|
+
const m = s ? `${O}/${s}` : J;
|
|
68
|
+
n(m);
|
|
69
|
+
}, []);
|
|
70
|
+
return N(() => {
|
|
71
|
+
document.title = K;
|
|
72
|
+
}, []), N(() => {
|
|
73
|
+
p();
|
|
74
|
+
}, [i]), {
|
|
75
|
+
emailTemplateList: u,
|
|
76
|
+
totalItems: d,
|
|
77
|
+
filters: i,
|
|
78
|
+
changeFilters: h,
|
|
79
|
+
getData: p,
|
|
80
|
+
removeData: a,
|
|
81
|
+
goToDetail: b,
|
|
82
|
+
mailCategoryList: r
|
|
83
|
+
};
|
|
84
|
+
}, q = "email_template", ae = () => {
|
|
85
|
+
const {
|
|
86
|
+
emailTemplateList: n,
|
|
87
|
+
totalItems: o,
|
|
88
|
+
filters: u,
|
|
89
|
+
changeFilters: d,
|
|
90
|
+
removeData: r,
|
|
91
|
+
goToDetail: i,
|
|
92
|
+
mailCategoryList: h
|
|
93
|
+
} = Q(), { t } = E(), p = (a) => {
|
|
94
|
+
r(a);
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ l("div", { className: "fadeIn animated", children: [
|
|
97
|
+
/* @__PURE__ */ e("h5", { className: "mb-2", children: t(q) }),
|
|
98
|
+
/* @__PURE__ */ l(f, { className: "my-2", children: [
|
|
99
|
+
/* @__PURE__ */ e(c, { md: 4, children: /* @__PURE__ */ e(
|
|
100
|
+
w,
|
|
101
|
+
{
|
|
102
|
+
text: t("create_template"),
|
|
103
|
+
onClick: () => i()
|
|
104
|
+
}
|
|
105
|
+
) }),
|
|
106
|
+
/* @__PURE__ */ l(
|
|
107
|
+
c,
|
|
108
|
+
{
|
|
109
|
+
md: 4,
|
|
110
|
+
className: "d-flex align-items-center justify-content-end",
|
|
111
|
+
children: [
|
|
112
|
+
t("total_of_templates"),
|
|
113
|
+
": ",
|
|
114
|
+
o
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ l(f, { className: "mb-2", children: [
|
|
120
|
+
/* @__PURE__ */ l(c, { md: 8, children: [
|
|
121
|
+
n && n.length > 0 ? /* @__PURE__ */ l(_, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
|
|
122
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { children: [
|
|
123
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("template_name") }),
|
|
124
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("category_name") }),
|
|
125
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("created_date") }),
|
|
126
|
+
/* @__PURE__ */ e("th", { className: "align-top", children: t("status") }),
|
|
127
|
+
/* @__PURE__ */ e("th", { className: "text-center", children: t("action") })
|
|
128
|
+
] }) }),
|
|
129
|
+
/* @__PURE__ */ e("tbody", { children: n.map((a) => /* @__PURE__ */ l("tr", { children: [
|
|
130
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: /* @__PURE__ */ e(
|
|
131
|
+
x,
|
|
132
|
+
{
|
|
133
|
+
label: a.subject,
|
|
134
|
+
onClick: () => i(a.id)
|
|
135
|
+
}
|
|
136
|
+
) }),
|
|
137
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: a.category.name }),
|
|
138
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: S(
|
|
139
|
+
new Date(a.createdAt),
|
|
140
|
+
P
|
|
141
|
+
) }),
|
|
142
|
+
/* @__PURE__ */ e("td", { className: "align-middle", children: a.isDisabled ? t("disabled") : t("enabled") }),
|
|
143
|
+
/* @__PURE__ */ e("td", { className: "text-center align-middle", children: /* @__PURE__ */ e(
|
|
144
|
+
k,
|
|
145
|
+
{
|
|
146
|
+
onClick: () => p(a.id)
|
|
147
|
+
}
|
|
148
|
+
) })
|
|
149
|
+
] }, a.id)) })
|
|
150
|
+
] }) : /* @__PURE__ */ e(M, { label: t("template") }),
|
|
151
|
+
/* @__PURE__ */ e(f, { className: "mt-2", children: /* @__PURE__ */ e(c, { md: 12, children: /* @__PURE__ */ e(
|
|
152
|
+
j,
|
|
153
|
+
{
|
|
154
|
+
filters: u,
|
|
155
|
+
totalRecordCount: o,
|
|
156
|
+
changePageSize: (a) => d({ pageSize: a }),
|
|
157
|
+
changePage: (a) => d({ currentPage: a })
|
|
158
|
+
}
|
|
159
|
+
) }) })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ e(c, { md: 4, children: /* @__PURE__ */ l(_, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
|
|
162
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("th", { className: "align-top", children: t("category_name") }) }) }),
|
|
163
|
+
/* @__PURE__ */ e("tbody", { children: h.map((a) => /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { className: "align-middle", children: a.name }) }, a.id)) })
|
|
164
|
+
] }) })
|
|
165
|
+
] })
|
|
166
|
+
] });
|
|
167
|
+
};
|
|
168
|
+
export {
|
|
169
|
+
ae as default
|
|
170
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("reactstrap"),a=require("./index-D0HO9-Jy.js"),_=require("date-fns"),m=require("react"),x=require("react-redux"),b=require("react-router-dom"),j=require("./mailCategoryService-D00fI25v.js"),y=require("react-i18next"),N="/admin/email-template",f="/admin/create-email-template",E="Email template list",v=()=>{const c=b.useNavigate(),{t:d}=y.useTranslation(),p=x.useSelector(l=>l.emailTemplate.emailTemplateList),u=x.useSelector(l=>l.emailTemplate.totalItems),o=x.useSelector(l=>l.mailCategory.mailCategoryList),{filters:n,changeFilters:h}=a.useFilters(),t=x.useDispatch(),g=m.useCallback(async()=>{t(a.setLoading(!0));try{const l=await j.get(n),{items:r,totalItems:L}=l.data;if(t(a.setEmailTemplateList({emailTemplateList:r,totalItems:L})),o&&o.length==0){const C=await j.get$1();t(a.setMailCategory(C.data.items))}}catch(l){t(a.setAlert({type:"danger",message:l.response?.data?.title||l.message}))}t(a.setLoading(!1))},[t,n]),s=m.useCallback(l=>{t(a.setLoading(!0));try{t(a.setModal({isOpen:!0,type:"warning",message:d("do_you_want_to_remove_this_email_template"),onConfirm:async()=>{await j.remove(l),t(a.setAlert({type:"success",message:"Remove template successfully"})),h({currentPage:1})}}))}catch(r){t(a.setAlert({type:"danger",message:r.response?.data?.title||r.message}))}t(a.setLoading(!1))},[n]),T=m.useCallback(l=>{const r=l?`${N}/${l}`:f;c(r)},[]);return m.useEffect(()=>{document.title=E},[]),m.useEffect(()=>{g()},[n]),{emailTemplateList:p,totalItems:u,filters:n,changeFilters:h,getData:g,removeData:s,goToDetail:T,mailCategoryList:o}},R="email_template",D=()=>{const{emailTemplateList:c,totalItems:d,filters:p,changeFilters:u,removeData:o,goToDetail:n,mailCategoryList:h}=v(),{t}=y.useTranslation(),g=s=>{o(s)};return e.jsxs("div",{className:"fadeIn animated",children:[e.jsx("h5",{className:"mb-2",children:t(R)}),e.jsxs(i.Row,{className:"my-2",children:[e.jsx(i.Col,{md:4,children:e.jsx(a.AddButton,{text:t("create_template"),onClick:()=>n()})}),e.jsxs(i.Col,{md:4,className:"d-flex align-items-center justify-content-end",children:[t("total_of_templates"),": ",d]})]}),e.jsxs(i.Row,{className:"mb-2",children:[e.jsxs(i.Col,{md:8,children:[c&&c.length>0?e.jsxs(i.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"align-top",children:t("template_name")}),e.jsx("th",{className:"align-top",children:t("category_name")}),e.jsx("th",{className:"align-top",children:t("created_date")}),e.jsx("th",{className:"align-top",children:t("status")}),e.jsx("th",{className:"text-center",children:t("action")})]})}),e.jsx("tbody",{children:c.map(s=>e.jsxs("tr",{children:[e.jsx("td",{className:"align-middle",children:e.jsx(a.LinkEditButton,{label:s.subject,onClick:()=>n(s.id)})}),e.jsx("td",{className:"align-middle",children:s.category.name}),e.jsx("td",{className:"align-middle",children:_.format(new Date(s.createdAt),a.DATE_RESULT)}),e.jsx("td",{className:"align-middle",children:s.isDisabled?t("disabled"):t("enabled")}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(a.DeleteButtonIcon,{onClick:()=>g(s.id)})})]},s.id))})]}):e.jsx(a.EmptyDataAlert,{label:t("template")}),e.jsx(i.Row,{className:"mt-2",children:e.jsx(i.Col,{md:12,children:e.jsx(a.CustomPagination,{filters:p,totalRecordCount:d,changePageSize:s=>u({pageSize:s}),changePage:s=>u({currentPage:s})})})})]}),e.jsx(i.Col,{md:4,children:e.jsxs(i.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{className:"align-top",children:t("category_name")})})}),e.jsx("tbody",{children:h.map(s=>e.jsx("tr",{children:e.jsx("td",{className:"align-middle",children:s.name})},s.id))})]})})]})]})};exports.default=D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("reactstrap"),F=require("react-redux"),x=require("react"),t=require("./index-txMWO23Z.js"),v=require("formik"),E=require("yup"),D=require("react-i18next");function A(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,i.get?i:{enumerable:!0,get:()=>s[a]})}}return n.default=s,Object.freeze(n)}const b=A(E),G=b.object({name:b.string().required("Name is required")}),U=(s,n)=>{const{targetMedia:a,onConfirm:i}=s,r=a?.key?"Update":"Create",m=a?.key?"Rename":"Folder";return e.jsx(v.Formik,{initialValues:{name:a?.name},enableReinitialize:!0,validationSchema:G,onSubmit:(c,u)=>{i&&i(c),u.resetForm()},children:c=>{const{values:u,touched:g,errors:p,handleChange:y,handleBlur:C,handleSubmit:j}=c;return e.jsx(t.CommonModal,{header:m,confirmText:r,onConfirm:j,ref:n,children:e.jsx(l.Row,{children:e.jsxs(l.Col,{md:12,children:[e.jsx(l.Input,{name:"name",placeholder:`Enter your ${a?.key?"file":"folder"} name`,value:u.name,onChange:y,onBlur:C("question")}),g.name&&p.name&&e.jsx(t.ErrorHandler,{text:p.name})]})})})}})},R=x.forwardRef(U),S=({isLibrary:s,step:n,breadcumb:a,currentPrefix:i,targetMedia:r,handleSelectFile:m,handleCreateFolder:c,handleRenameFile:u,handleGoBack:g,handleDownloadMedia:p,handleDeleteMediaOrFolder:y,showErrorAlert:C})=>{const j=x.useRef(null),I=x.useRef(null),{t:O}=D.useTranslation(),f=()=>j?.current?.toggle(),_=()=>e.jsxs(l.Row,{className:"p-2 pl-3",style:{gap:"8px"},children:[!!n&&e.jsxs(l.Button,{className:"mr-2",color:"secondary",onClick:g,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaArrowLeft,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Go up"})]}),r&&!r.isFolder&&e.jsxs(l.Button,{className:"mr-2",color:"success",onClick:p,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaDownload,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Download"})]}),r&&!s&&e.jsxs(l.Button,{className:"mr-2",color:"danger",onClick:y,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaTrash,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Delete"})]}),r&&!s&&!r.isFolder&&e.jsxs(l.Button,{className:"mr-2",color:"primary",onClick:f,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaEdit,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Rename"})]}),!r&&!s&&e.jsxs(l.Button,{className:"mr-2",color:"success",onClick:f,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaFolderPlus,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:O("new_folder")})]}),!r&&!s&&e.jsxs(l.Button,{className:"mr-2",color:"info",onClick:()=>I?.current?.click(),style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaFileUpload,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:O("upload")})]}),a&&e.jsx(l.Col,{className:"h-100 d-flex align-items-center",children:a})]});return e.jsxs("div",{children:[_(),e.jsx(R,{ref:j,targetMedia:r,onConfirm:async h=>{h.name!=""?r&&!r.isFolder?(f(),await u(h.name)):(f(),await c(i,h.name)):C("Name can't be empty")}}),e.jsx("input",{type:"file",id:"customMediaUpload",ref:I,style:{display:"none"},onChange:async h=>{const d=h?.target?.files[0];d&&await m({key:i,file:d})}})]})},B=x.memo(S),N={"media-wrapper":"_media-wrapper_1nc2k_6","media-image":"_media-image_1nc2k_11","media-image-selected":"_media-image-selected_1nc2k_17","media-title":"_media-title_1nc2k_21","filter-media-file":"_filter-media-file_1nc2k_30"};var o=(s=>(s[s.IMAGE=0]="IMAGE",s[s.VIDEO=1]="VIDEO",s[s.AUDIO=2]="AUDIO",s[s.DOC=3]="DOC",s[s.UNKNOW=4]="UNKNOW",s))(o||{});const q=["png","jpg","jpeg","gif"],M=["mp4","mp4v"],V=["txt","pdf","doc","docx","xls","csv"],L=["wav","mp3"],k=s=>{if(s){if(q.includes(s))return o.IMAGE;if(M.includes(s))return o.VIDEO;if(V.includes(s))return o.DOC;if(L.includes(s))return o.AUDIO}return o.UNKNOW},$=s=>{if(s.isFolder)return t.Images.FOLDER_IMAGE;const n=k(s.extension);return n===o.IMAGE?t.Images.PHOTO_IMAGE:n===o.VIDEO?t.Images.VIDEO_IMAGE:n===o.AUDIO?t.Images.AUDIO_IMAGE:n===o.DOC?t.Images.DOCS_IMAGE:t.Images.UNKNOW_IMAGE},T=({media:s,isTarget:n})=>{const a=$(s);return e.jsxs(l.Card,{className:`${n?N["media-image-selected"]:""} border-0 `,children:[e.jsx(l.CardImg,{className:`${N["media-image"]} p-1`,top:!0,width:"90%",src:t.getStaticFileUrl(a),alt:s.name}),e.jsx(l.CardBody,{className:"p-1",style:{height:45},children:e.jsx(l.CardTitle,{tag:"h6",className:N["media-title"],children:s.name})})]})},H=x.memo(T),P=[{value:o.IMAGE,label:"images"},{value:o.AUDIO,label:"audios"},{value:o.DOC,label:"docs"},{value:o.VIDEO,label:"videos"}],K=({changeFilters:s})=>{const[n,a]=x.useState(),{t:i}=D.useTranslation();return e.jsxs(l.Row,{className:`${N["filter-media-file"]}`,children:[e.jsx(l.Col,{sm:8,children:e.jsx(t.SearchBox,{initValue:"",onSearch:r=>s({searchString:r}),placeholder:i("type_something_to_search_by_file_name")})}),e.jsx(l.Col,{sm:4,children:e.jsx(t.CustomSelector,{value:n,isMulti:!0,options:P.map(r=>({...r,label:i(r.label)})),onChange:r=>{a(r);const m=r.map(c=>c.value);s({types:m})}})})]})},W=({height:s,isLibrary:n})=>{const{filters:a,mediaList:i,targetMedia:r,router:m,breadcrumb:c,changeFilters:u,handleOpenFolder:g,handleSelectMedia:p,handleSelectFile:y,handleCreateFolder:C,handleRenameFile:j,handleDownloadMedia:I,handleDeleteMediaOrFolder:O,handleGoBack:f,showErrorAlert:_}=t.useGalleryList(n),h=()=>i.map(d=>{const w=r?.key===d.key;return e.jsx(l.Col,{className:"p-2",xs:"auto",children:e.jsx("div",{onDoubleClick:()=>g(d),onClick:()=>p(d),className:N["media-wrapper"],children:e.jsx(H,{media:d,isTarget:w})})},d.key)});return e.jsxs(l.Card,{children:[e.jsxs(l.CardHeader,{children:[e.jsx(K,{changeFilters:u,filters:a}),e.jsx(B,{isLibrary:n,step:m.step,breadcumb:c,currentPrefix:a.prefix||"",targetMedia:r,handleSelectFile:y,handleCreateFolder:C,handleRenameFile:j,handleDownloadMedia:I,handleDeleteMediaOrFolder:O,handleGoBack:f,showErrorAlert:_})]}),e.jsx(l.CardBody,{style:{minHeight:s},children:e.jsx(l.Row,{className:"p-1",children:h()})})]})},z=({targetMedia:s})=>{if(!s||s?.isFolder)return e.jsx("div",{});const n=k(s.extension),a=t.getFileUrl(s.key||"");return e.jsxs(l.Card,{className:"position-sticky",children:[e.jsx(l.CardHeader,{children:s?.name||"Media name"}),n===o.IMAGE&&e.jsx(l.CardImg,{className:"p-2",src:a,loading:"lazy"}),n===o.VIDEO&&e.jsx("div",{className:"p-2",children:e.jsx("video",{id:s.key,width:"100%",height:"100%",controls:!0,children:e.jsx("source",{src:a})})}),n===o.AUDIO&&e.jsx("div",{className:"p-2",children:e.jsx("audio",{controls:!0,className:"w-100",children:e.jsx("source",{src:a})})}),e.jsxs(l.CardBody,{children:[e.jsx(l.CardTitle,{tag:"h6",children:"General Info"}),e.jsxs(l.CardText,{children:["File extension: ",s.extension?.toUpperCase()]})]})]})},Q=x.memo(z),J="media_gallery",X=({isLibrary:s})=>{const n=F.useSelector(i=>i.gallery.targetMedia),{t:a}=D.useTranslation();return e.jsxs("div",{className:"fadeIn animated",children:[!s&&e.jsx("h5",{className:"mb-2",children:a(J)}),e.jsxs(l.Row,{className:"mb-2",children:[e.jsx(l.Col,{md:8,children:e.jsx(W,{height:"100vh",isLibrary:s})}),e.jsx(l.Col,{md:4,children:e.jsx(Q,{targetMedia:n},n?.key)})]})]})};exports.default=X;
|