@feedmepos/mf-hrm-portal 2.0.19 → 2.0.20-dev.1
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/AuditLogList-Bsj-qg8n.js +1037 -0
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
- package/dist/EmployeeList-Cy2ayCko.js +824 -0
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js +45 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
- package/dist/{Main-BPM7QyFL.js → Main-BGc6kNaR.js} +758 -761
- package/dist/{Main-BC20s7cs.js → Main-CSMAtoMj.js} +181 -175
- package/dist/Main-D7bV8EuC.js +86 -0
- package/dist/PermissionSetList-CuHhDqWl.js +347 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js +3443 -0
- package/dist/RoleList-e0WUqt4Y.js +545 -0
- package/dist/TeamMemberList-CpPa1KyV.js +1097 -0
- package/dist/{TimesheetList-CdWXksIf.js → TimesheetList-tFjvFHqH.js} +132 -126
- package/dist/{app-D6OxaCEx.js → app-CL7rUfL3.js} +552 -504
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-C0I-OiL6.js → dayjs.min-ChdFPuFV.js} +1 -1
- package/dist/employee-kKV7UnHU.js +204 -0
- package/dist/{iteration-CcZFMm5X.js → iteration-BbD0nOgO.js} +9253 -9209
- package/dist/{lodash-CW7MBjcM.js → lodash-CDf3aG6G.js} +1 -1
- package/dist/{rule-6Lg9M_3I.js → rule-BJ-y3Sp8.js} +263 -265
- package/dist/src/api/audit-log/index.d.ts +9 -0
- package/dist/src/api/index.d.ts +0 -1
- package/dist/src/api/restaurant/index.d.ts +5 -0
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
- package/dist/src/components/Skeleton.vue.d.ts +7 -0
- package/dist/src/composables/useBasePermission.d.ts +1 -0
- package/dist/src/composables/useRestaurantMap.d.ts +2 -329
- package/dist/src/stores/restaurant.d.ts +181 -0
- package/dist/src/stores/role.d.ts +7 -7
- package/dist/src/stores/team.d.ts +6 -6
- package/dist/src/types/restaurant.d.ts +11 -0
- package/dist/src/types/team.d.ts +1 -1
- package/dist/src/views/hr/locales/index.d.ts +16 -0
- package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -7
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
- package/dist/src/views/team/locales/index.d.ts +32 -0
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +5 -3
- package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +3 -3
- package/dist/style.css +1 -1
- package/dist/{timesheet-CaSIm-Rv.js → timesheet-BmV02Rkz.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useAppStore-D8QAGZ02.js +171 -0
- package/dist/useDebounce-CWb5QR9G.js +28 -0
- package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
- package/dist/{useLoading-cnpr1-pP.js → useLoading-KpcQw0p4.js} +1 -1
- package/dist/{useReportPermissions-CNr0AdOf.js → useReportPermissions-CmGJAz_N.js} +3 -3
- package/package.json +1 -1
- package/dist/AuditLogList-Bw3sRBhW.js +0 -980
- package/dist/EmployeeList-C4tVWPJE.js +0 -736
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +0 -71
- package/dist/HorizontalSplitter-o860F4xM.js +0 -12
- package/dist/Main-eN8MDWpv.js +0 -85
- package/dist/PermissionSetList-CPSRrCsu.js +0 -341
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CXt721Zo.js +0 -3480
- package/dist/RoleList-tRu19xyl.js +0 -530
- package/dist/TeamMemberList-CvitYIKw.js +0 -1114
- package/dist/TeamMemberList.vue_vue_type_style_index_0_scoped_473cbd86_lang-BDjrD45a.js +0 -34
- package/dist/employee-yT17VCCS.js +0 -204
- package/dist/src/api/account/index.d.ts +0 -4
- package/dist/src/composables/useSupportedCountries.d.ts +0 -5
- package/dist/useAppStore-CONZvtGc.js +0 -171
- package/dist/useDebounce-B8ZPVS5C.js +0 -15
- package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
- package/dist/useSearch-B6WK1LBB.js +0 -15
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { ref as S, defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { _ as
|
|
4
|
-
import { u as Y } from "./useAppStore-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useSnackbar as ie, components as
|
|
8
|
-
import { S as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { H as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { u as
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const H = {
|
|
1
|
+
import { ref as S, defineComponent as Q, computed as V, watch as ce, resolveComponent as h, createElementBlock as K, openBlock as I, Fragment as J, renderSlot as ge, createVNode as n, unref as s, withCtx as x, createElementVNode as l, toDisplayString as k, createBlock as E, isRef as re, renderList as fe, createCommentVNode as ve, withModifiers as oe, createTextVNode as ne, normalizeClass as _e, h as _ } from "vue";
|
|
2
|
+
import { useI18n as X, useCoreStore as ye } from "@feedmepos/mf-common";
|
|
3
|
+
import { _ as Ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
4
|
+
import { u as Y } from "./useAppStore-D8QAGZ02.js";
|
|
5
|
+
import { g as z, a as he, b as q, u as Z } from "./iteration-BbD0nOgO.js";
|
|
6
|
+
import { defineStore as xe } from "pinia";
|
|
7
|
+
import { useSnackbar as ie, components as M, useDialog as be, useBreakpoints as we, FmButtonVariant as H } from "@feedmepos/ui-library";
|
|
8
|
+
import { S as D } from "./SelectFilter-DUj7GBtT.js";
|
|
9
|
+
import { _ as ke } from "./app-CL7rUfL3.js";
|
|
10
|
+
import { _ as le, u as Ve, H as Fe } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
|
|
11
|
+
import { _ as Ie } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
12
|
+
import { u as ue } from "./useLoading-KpcQw0p4.js";
|
|
13
|
+
import { _ as Se } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
14
|
+
const W = {
|
|
16
15
|
async getGrantUsers() {
|
|
17
|
-
return z(await
|
|
16
|
+
return z(await q("grant").get(""));
|
|
18
17
|
},
|
|
19
18
|
async createGrantUser(p) {
|
|
20
|
-
return z(await
|
|
19
|
+
return z(await q("grant").post("", p));
|
|
21
20
|
},
|
|
22
21
|
async revokeGrantUser(p, y) {
|
|
23
22
|
return z(
|
|
24
|
-
await
|
|
23
|
+
await q("grant").patch(`/revoke/${p}`, null, {
|
|
25
24
|
params: { restaurantId: y }
|
|
26
25
|
})
|
|
27
26
|
);
|
|
@@ -35,31 +34,31 @@ const H = {
|
|
|
35
34
|
})
|
|
36
35
|
);
|
|
37
36
|
}
|
|
38
|
-
},
|
|
37
|
+
}, Ce = xe("grantUser", () => {
|
|
39
38
|
const p = S([]), y = S(!1);
|
|
40
39
|
async function a() {
|
|
41
40
|
y.value = !0;
|
|
42
41
|
try {
|
|
43
|
-
p.value = (await
|
|
44
|
-
(
|
|
42
|
+
p.value = (await W.getGrantUsers()).sort(
|
|
43
|
+
(u, m) => u.createdAt < m.createdAt ? 1 : -1
|
|
45
44
|
);
|
|
46
|
-
} catch (
|
|
47
|
-
throw console.error("Error reading grant users:",
|
|
45
|
+
} catch (u) {
|
|
46
|
+
throw console.error("Error reading grant users:", u), u;
|
|
48
47
|
} finally {
|
|
49
48
|
y.value = !1;
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
|
-
async function U(
|
|
51
|
+
async function U(u) {
|
|
53
52
|
try {
|
|
54
|
-
const m = await
|
|
53
|
+
const m = await W.createGrantUser(u);
|
|
55
54
|
return p.value = [m, ...p.value], m;
|
|
56
55
|
} catch (m) {
|
|
57
56
|
throw console.error("Error creating grant user:", m), m;
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
async function b(
|
|
59
|
+
async function b(u, m) {
|
|
61
60
|
try {
|
|
62
|
-
const r = await
|
|
61
|
+
const r = await W.revokeGrantUser(u, m), c = p.value.findIndex((i) => i._id === u);
|
|
63
62
|
c !== -1 && (p.value[c] = r);
|
|
64
63
|
} catch (r) {
|
|
65
64
|
throw console.error("Error revoking grant user:", r), r;
|
|
@@ -72,10 +71,10 @@ const H = {
|
|
|
72
71
|
createGrantUser: U,
|
|
73
72
|
revokeGrantUser: b
|
|
74
73
|
};
|
|
75
|
-
}),
|
|
74
|
+
}), ee = Ce, Be = { class: "fm-typo-en-title-md-600" }, $e = { class: "space-y-40" }, Ge = { class: "flex gap-8 items-center justify-start" }, Re = /* @__PURE__ */ Q({
|
|
76
75
|
__name: "GrantUserForm",
|
|
77
76
|
setup(p, { expose: y }) {
|
|
78
|
-
const a =
|
|
77
|
+
const a = ee(), U = Y(), b = Z(), u = ie(), m = ue(u), { t: r } = X(), c = S(!1), i = S({
|
|
79
78
|
name: "",
|
|
80
79
|
restaurantId: "",
|
|
81
80
|
roleId: ""
|
|
@@ -85,13 +84,13 @@ const H = {
|
|
|
85
84
|
restaurantId: "",
|
|
86
85
|
roleId: ""
|
|
87
86
|
}, c.value = !0;
|
|
88
|
-
}, C =
|
|
89
|
-
label: `${
|
|
90
|
-
value:
|
|
91
|
-
}))), R =
|
|
92
|
-
label:
|
|
93
|
-
value:
|
|
94
|
-
disabled: !
|
|
87
|
+
}, C = V(() => r("grantUser.form.title")), F = V(() => r("common.create")), G = V(() => b.restaurants.value.map((d) => ({
|
|
88
|
+
label: `${d.profile.code ? d.profile.code + " - " : ""}${d.profile.name}`,
|
|
89
|
+
value: d._id
|
|
90
|
+
}))), R = V(() => i.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === i.value.restaurantId)).map((d) => ({
|
|
91
|
+
label: d.name,
|
|
92
|
+
value: d._id,
|
|
93
|
+
disabled: !d.isUsable
|
|
95
94
|
})) : []);
|
|
96
95
|
ce(
|
|
97
96
|
() => i.value.restaurantId,
|
|
@@ -99,12 +98,12 @@ const H = {
|
|
|
99
98
|
i.value.roleId = "";
|
|
100
99
|
}
|
|
101
100
|
);
|
|
102
|
-
async function
|
|
101
|
+
async function P() {
|
|
103
102
|
await m.minor(async () => {
|
|
104
|
-
const
|
|
105
|
-
|
|
103
|
+
const d = await a.createGrantUser(i.value);
|
|
104
|
+
u.open({
|
|
106
105
|
message: r("grantUser.create.successMessage", {
|
|
107
|
-
passcode:
|
|
106
|
+
passcode: d.passcode
|
|
108
107
|
}),
|
|
109
108
|
type: "success"
|
|
110
109
|
});
|
|
@@ -113,28 +112,28 @@ const H = {
|
|
|
113
112
|
return y({
|
|
114
113
|
show: c,
|
|
115
114
|
trigger: w
|
|
116
|
-
}), (
|
|
117
|
-
const
|
|
118
|
-
return I(),
|
|
119
|
-
ge(
|
|
115
|
+
}), (d, g) => {
|
|
116
|
+
const T = h("FmTextField"), $ = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
|
|
117
|
+
return I(), K(J, null, [
|
|
118
|
+
ge(d.$slots, "default", { trigger: w }),
|
|
120
119
|
n(N, {
|
|
121
120
|
id: "grant-user-form",
|
|
122
121
|
modelValue: c.value,
|
|
123
122
|
"onUpdate:modelValue": g[4] || (g[4] = (f) => c.value = f),
|
|
124
|
-
"is-container": s(
|
|
123
|
+
"is-container": s(M).FmForm,
|
|
125
124
|
"is-container-props": {
|
|
126
|
-
onValidationSuccess:
|
|
125
|
+
onValidationSuccess: P,
|
|
127
126
|
blameFormChildOnValidationFailed: !0
|
|
128
127
|
},
|
|
129
128
|
"max-width": 560
|
|
130
129
|
}, {
|
|
131
130
|
"side-sheet-header": x(() => [
|
|
132
|
-
l("p",
|
|
131
|
+
l("p", Be, k(C.value), 1)
|
|
133
132
|
]),
|
|
134
133
|
"side-sheet-footer": x(() => [
|
|
135
|
-
l("div",
|
|
134
|
+
l("div", Ge, [
|
|
136
135
|
n(L, {
|
|
137
|
-
label:
|
|
136
|
+
label: F.value,
|
|
138
137
|
size: "lg",
|
|
139
138
|
type: "submit",
|
|
140
139
|
variant: "primary"
|
|
@@ -148,12 +147,12 @@ const H = {
|
|
|
148
147
|
])
|
|
149
148
|
]),
|
|
150
149
|
default: x(() => [
|
|
151
|
-
l("div",
|
|
152
|
-
n(
|
|
150
|
+
l("div", $e, [
|
|
151
|
+
n(Se, {
|
|
153
152
|
title: s(r)("grantUser.form.section")
|
|
154
153
|
}, {
|
|
155
154
|
default: x(() => [
|
|
156
|
-
n(
|
|
155
|
+
n(T, {
|
|
157
156
|
modelValue: i.value.name,
|
|
158
157
|
"onUpdate:modelValue": g[0] || (g[0] = (f) => i.value.name = f),
|
|
159
158
|
label: s(r)("grantUser.form.name"),
|
|
@@ -198,73 +197,73 @@ const H = {
|
|
|
198
197
|
], 64);
|
|
199
198
|
};
|
|
200
199
|
}
|
|
201
|
-
}),
|
|
200
|
+
}), Le = {
|
|
202
201
|
class: "space-y-8"
|
|
203
|
-
}, Le = {
|
|
204
|
-
class: "xs:hidden flex w-full items-start justify-between"
|
|
205
202
|
}, Ne = {
|
|
206
|
-
class: "flex items-start
|
|
203
|
+
class: "xs:hidden flex w-full items-start justify-between"
|
|
207
204
|
}, Ae = {
|
|
208
|
-
class: "
|
|
205
|
+
class: "flex items-start gap-8"
|
|
209
206
|
}, ze = {
|
|
210
|
-
class: "
|
|
207
|
+
class: "space-y-4 hidden xs:block"
|
|
211
208
|
}, De = {
|
|
212
|
-
class: "px-16
|
|
209
|
+
class: "px-16"
|
|
213
210
|
}, Ke = {
|
|
214
|
-
class: "
|
|
211
|
+
class: "px-16 flex items-start gap-8"
|
|
215
212
|
}, Ee = {
|
|
216
|
-
class: "
|
|
213
|
+
class: "pb-64 hidden xs:block"
|
|
217
214
|
}, Me = {
|
|
218
|
-
class: "
|
|
215
|
+
class: "space-y-4"
|
|
219
216
|
}, Pe = {
|
|
220
|
-
class: "
|
|
217
|
+
class: "flex items-center gap-8"
|
|
221
218
|
}, Te = {
|
|
219
|
+
class: "fm-typo-en-body-lg-600"
|
|
220
|
+
}, Oe = {
|
|
222
221
|
class: "font-mono text-lg font-bold mr-4"
|
|
223
222
|
}, je = {
|
|
224
223
|
class: "text-fm-color-typo-secondary"
|
|
225
|
-
}, Oe = {
|
|
226
|
-
class: "text-xs"
|
|
227
224
|
}, qe = {
|
|
228
|
-
class: "mt-4 space-y-2"
|
|
229
|
-
}, He = {
|
|
230
225
|
class: "text-xs"
|
|
226
|
+
}, He = {
|
|
227
|
+
class: "mt-4 space-y-2"
|
|
231
228
|
}, We = {
|
|
232
229
|
class: "text-xs"
|
|
233
230
|
}, Je = {
|
|
231
|
+
class: "text-xs"
|
|
232
|
+
}, Qe = {
|
|
234
233
|
key: 0,
|
|
235
234
|
class: "flex flex-col gap-4"
|
|
236
|
-
},
|
|
235
|
+
}, Xe = /* @__PURE__ */ Q({
|
|
237
236
|
__name: "GrantUserList",
|
|
238
237
|
setup(p, {
|
|
239
238
|
expose: y
|
|
240
239
|
}) {
|
|
241
240
|
const {
|
|
242
241
|
t: a
|
|
243
|
-
} = X(), U = S(), b =
|
|
244
|
-
restaurants:
|
|
245
|
-
} =
|
|
242
|
+
} = X(), U = S(), b = ee(), {
|
|
243
|
+
restaurants: u
|
|
244
|
+
} = Z(), {
|
|
246
245
|
roles: m
|
|
247
|
-
} = Y(), r =
|
|
246
|
+
} = Y(), r = V(() => b.grantUsers), {
|
|
248
247
|
searchKey: c,
|
|
249
248
|
filter: i
|
|
250
|
-
} =
|
|
251
|
-
var
|
|
252
|
-
return (
|
|
253
|
-
const v = !U.value || U.value.includes(
|
|
254
|
-
return v &&
|
|
249
|
+
} = Ve(), w = V(() => {
|
|
250
|
+
var e;
|
|
251
|
+
return (e = r.value) == null ? void 0 : e.filter((t) => {
|
|
252
|
+
const v = !U.value || U.value.includes(t.restaurantId), O = !B.value || B.value.includes(t.status), A = C.value[t.restaurantId] || "", j = F.value[t.roleId] || "";
|
|
253
|
+
return v && O && i([t.passcode, t.name, A, j, t.grantByName]);
|
|
255
254
|
});
|
|
256
|
-
}), C =
|
|
257
|
-
const
|
|
258
|
-
return
|
|
259
|
-
t
|
|
260
|
-
}),
|
|
261
|
-
}),
|
|
262
|
-
const
|
|
263
|
-
return m.value.forEach((
|
|
264
|
-
t
|
|
265
|
-
}),
|
|
266
|
-
}), G = (
|
|
267
|
-
switch (
|
|
255
|
+
}), C = V(() => {
|
|
256
|
+
const e = {};
|
|
257
|
+
return u.value.forEach((t) => {
|
|
258
|
+
e[t._id] = t.profile.name;
|
|
259
|
+
}), e;
|
|
260
|
+
}), F = V(() => {
|
|
261
|
+
const e = {};
|
|
262
|
+
return m.value.forEach((t) => {
|
|
263
|
+
e[t._id] = t.name;
|
|
264
|
+
}), e;
|
|
265
|
+
}), G = (e) => {
|
|
266
|
+
switch (e) {
|
|
268
267
|
case "active":
|
|
269
268
|
return "bg-fm-color-system-success-100 text-fm-color-typo-success";
|
|
270
269
|
case "used":
|
|
@@ -274,49 +273,49 @@ const H = {
|
|
|
274
273
|
default:
|
|
275
274
|
return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
|
|
276
275
|
}
|
|
277
|
-
}, R = (
|
|
276
|
+
}, R = (e) => a(`grantUser.status.${e}`), P = [{
|
|
278
277
|
accessorKey: "passcode",
|
|
279
278
|
size: 120,
|
|
280
279
|
maxSize: 120,
|
|
281
280
|
minSize: 120,
|
|
282
281
|
header: () => a("grantUser.columns.passcode"),
|
|
283
|
-
cell(
|
|
284
|
-
const
|
|
282
|
+
cell(e) {
|
|
283
|
+
const t = e.row.original.passcode;
|
|
285
284
|
return _("div", {
|
|
286
285
|
class: "flex items-center gap-8"
|
|
287
|
-
}, [_(
|
|
288
|
-
variant:
|
|
286
|
+
}, [_(M.FmButton, {
|
|
287
|
+
variant: H.Tertiary,
|
|
289
288
|
textColor: "neutral-gray-400",
|
|
290
289
|
icon: "content_copy",
|
|
291
290
|
onClick: (v) => {
|
|
292
|
-
v.stopPropagation(),
|
|
291
|
+
v.stopPropagation(), se(t);
|
|
293
292
|
}
|
|
294
293
|
}), _("span", {
|
|
295
294
|
class: "font-mono text-lg font-bold"
|
|
296
|
-
},
|
|
295
|
+
}, t)]);
|
|
297
296
|
}
|
|
298
297
|
}, {
|
|
299
298
|
accessorKey: "name",
|
|
300
299
|
header: () => a("grantUser.columns.name")
|
|
301
300
|
}, {
|
|
302
301
|
accessorKey: "restaurantName",
|
|
303
|
-
accessorFn: (
|
|
302
|
+
accessorFn: (e) => C.value[e.restaurantId],
|
|
304
303
|
header: () => a("grantUser.columns.restaurant"),
|
|
305
304
|
meta: {
|
|
306
305
|
width: "250px"
|
|
307
306
|
},
|
|
308
|
-
cell(
|
|
309
|
-
const
|
|
307
|
+
cell(e) {
|
|
308
|
+
const t = e.row.original.restaurantId, v = C.value[t] || "-";
|
|
310
309
|
return _("div", [_("div", v), _("div", {
|
|
311
310
|
class: "text-fm-color-typo-secondary text-sm"
|
|
312
|
-
}, `${
|
|
311
|
+
}, `${t}`)]);
|
|
313
312
|
}
|
|
314
313
|
}, {
|
|
315
314
|
accessorKey: "roleName",
|
|
316
|
-
accessorFn: (
|
|
315
|
+
accessorFn: (e) => F.value[e.roleId],
|
|
317
316
|
header: () => a("grantUser.columns.role"),
|
|
318
|
-
cell(
|
|
319
|
-
const
|
|
317
|
+
cell(e) {
|
|
318
|
+
const t = e.row.original.roleId, v = F.value[t] || "-";
|
|
320
319
|
return _("div", v);
|
|
321
320
|
}
|
|
322
321
|
}, {
|
|
@@ -325,28 +324,28 @@ const H = {
|
|
|
325
324
|
meta: {
|
|
326
325
|
maxWidth: "120px"
|
|
327
326
|
},
|
|
328
|
-
cell(
|
|
329
|
-
const
|
|
330
|
-
return _(
|
|
331
|
-
label: R(
|
|
332
|
-
class: G(
|
|
327
|
+
cell(e) {
|
|
328
|
+
const t = e.row.original.status;
|
|
329
|
+
return _(M.FmChip, {
|
|
330
|
+
label: R(t),
|
|
331
|
+
class: G(t)
|
|
333
332
|
});
|
|
334
333
|
}
|
|
335
334
|
}, {
|
|
336
335
|
accessorKey: "grantByName",
|
|
337
336
|
header: () => a("grantUser.columns.grantedBy"),
|
|
338
|
-
cell(
|
|
339
|
-
const
|
|
337
|
+
cell(e) {
|
|
338
|
+
const t = e.row.original.grantById, v = e.row.original.grantByName;
|
|
340
339
|
return _("div", [_("div", v), _("div", {
|
|
341
340
|
class: "text-fm-color-typo-secondary text-sm"
|
|
342
|
-
}, `${
|
|
341
|
+
}, `${t}`)]);
|
|
343
342
|
}
|
|
344
343
|
}, {
|
|
345
344
|
accessorKey: "createdAt",
|
|
346
345
|
header: () => a("grantUser.columns.createdAt"),
|
|
347
|
-
cell(
|
|
348
|
-
const
|
|
349
|
-
return _("div", new Date(
|
|
346
|
+
cell(e) {
|
|
347
|
+
const t = e.row.original.createdAt;
|
|
348
|
+
return _("div", new Date(t).toLocaleString());
|
|
350
349
|
}
|
|
351
350
|
}, {
|
|
352
351
|
id: "action",
|
|
@@ -355,25 +354,25 @@ const H = {
|
|
|
355
354
|
cellClass: "p-16",
|
|
356
355
|
headerContentClass: "-mx-16"
|
|
357
356
|
},
|
|
358
|
-
cell: (
|
|
359
|
-
const
|
|
360
|
-
return
|
|
357
|
+
cell: (e) => {
|
|
358
|
+
const t = e.row.original;
|
|
359
|
+
return t.status !== "active" ? null : _("div", {
|
|
361
360
|
class: "w-full flex justify-end items-center gap-4"
|
|
362
|
-
}, [_(
|
|
361
|
+
}, [_(M.FmButton, {
|
|
363
362
|
label: a("grantUser.actions.revoke"),
|
|
364
|
-
variant:
|
|
363
|
+
variant: H.Secondary,
|
|
365
364
|
onClick: (v) => {
|
|
366
|
-
v.stopPropagation(), N(
|
|
365
|
+
v.stopPropagation(), N(t);
|
|
367
366
|
}
|
|
368
367
|
})]);
|
|
369
368
|
}
|
|
370
|
-
}],
|
|
369
|
+
}], d = ie(), g = be(), T = ue(d), $ = S(), {
|
|
371
370
|
breakpoints: L
|
|
372
|
-
} =
|
|
371
|
+
} = we(), N = (e) => {
|
|
373
372
|
g.open({
|
|
374
373
|
title: a("grantUser.revoke.title"),
|
|
375
374
|
message: a("grantUser.revoke.message", {
|
|
376
|
-
name:
|
|
375
|
+
name: e.name
|
|
377
376
|
}),
|
|
378
377
|
minWidth: L.value.lg ? 588 : 0,
|
|
379
378
|
primaryActions: {
|
|
@@ -386,20 +385,20 @@ const H = {
|
|
|
386
385
|
close: !0
|
|
387
386
|
}
|
|
388
387
|
}).onPrimary(async () => {
|
|
389
|
-
|
|
390
|
-
await b.revokeGrantUser(
|
|
388
|
+
T.minor(async () => {
|
|
389
|
+
await b.revokeGrantUser(e._id, e.restaurantId);
|
|
391
390
|
}, {
|
|
392
391
|
successMessage: a("grantUser.revoke.successMessage", {
|
|
393
|
-
name:
|
|
392
|
+
name: e.name
|
|
394
393
|
})
|
|
395
394
|
}), g.close();
|
|
396
395
|
});
|
|
397
396
|
};
|
|
398
397
|
function f() {
|
|
399
|
-
var
|
|
400
|
-
(
|
|
398
|
+
var e;
|
|
399
|
+
(e = $.value) == null || e.trigger();
|
|
401
400
|
}
|
|
402
|
-
const
|
|
401
|
+
const te = V(() => [{
|
|
403
402
|
label: a("grantUser.status.active"),
|
|
404
403
|
value: "active"
|
|
405
404
|
}, {
|
|
@@ -408,16 +407,19 @@ const H = {
|
|
|
408
407
|
}, {
|
|
409
408
|
label: a("grantUser.status.revoked"),
|
|
410
409
|
value: "revoked"
|
|
411
|
-
}]),
|
|
412
|
-
|
|
410
|
+
}]), ae = V(() => u.value.map((e) => ({
|
|
411
|
+
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
412
|
+
value: e._id
|
|
413
|
+
}))), B = S();
|
|
414
|
+
async function se(e) {
|
|
413
415
|
try {
|
|
414
|
-
await navigator.clipboard.writeText(
|
|
416
|
+
await navigator.clipboard.writeText(e), d.open({
|
|
415
417
|
message: a("grantUser.passcode.copied"),
|
|
416
418
|
type: "success"
|
|
417
419
|
});
|
|
418
|
-
} catch (
|
|
419
|
-
|
|
420
|
-
message: String(
|
|
420
|
+
} catch (t) {
|
|
421
|
+
d.open({
|
|
422
|
+
message: String(t),
|
|
421
423
|
type: "error"
|
|
422
424
|
});
|
|
423
425
|
}
|
|
@@ -425,127 +427,131 @@ const H = {
|
|
|
425
427
|
return y({
|
|
426
428
|
create: f,
|
|
427
429
|
filteredGrantUsers: w
|
|
428
|
-
}), (
|
|
429
|
-
const v = h("FmSearch"),
|
|
430
|
-
return I(),
|
|
430
|
+
}), (e, t) => {
|
|
431
|
+
const v = h("FmSearch"), O = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
|
|
432
|
+
return I(), K(J, null, [n(Re, {
|
|
431
433
|
ref_key: "grantUserFormRef",
|
|
432
434
|
ref: $,
|
|
433
435
|
class: "gap-8"
|
|
434
|
-
}, null, 512), l("div",
|
|
436
|
+
}, null, 512), l("div", Le, [l("div", Ne, [l("div", Ae, [n(D, {
|
|
435
437
|
modelValue: U.value,
|
|
436
|
-
"onUpdate:modelValue":
|
|
437
|
-
"managable-only": !1,
|
|
438
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => U.value = o),
|
|
438
439
|
multiple: "",
|
|
440
|
+
items: ae.value,
|
|
439
441
|
variant: "dark",
|
|
442
|
+
"selected-prefix": s(a)("grantUser.columns.restaurant"),
|
|
443
|
+
placeholder: s(a)("grantUser.columns.restaurant"),
|
|
440
444
|
class: "!w-auto"
|
|
441
|
-
}, null, 8, ["modelValue"]), n(
|
|
445
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
|
|
442
446
|
modelValue: B.value,
|
|
443
|
-
"onUpdate:modelValue":
|
|
447
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => B.value = o),
|
|
444
448
|
multiple: "",
|
|
445
449
|
variant: "dark",
|
|
446
|
-
items:
|
|
450
|
+
items: te.value,
|
|
447
451
|
"selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
|
|
448
452
|
placeholder: s(a)("grantUser.filter.status_placeholder")
|
|
449
453
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
|
|
450
454
|
modelValue: s(c),
|
|
451
|
-
"onUpdate:modelValue":
|
|
455
|
+
"onUpdate:modelValue": t[2] || (t[2] = (o) => re(c) ? c.value = o : null),
|
|
452
456
|
autofocus: "",
|
|
453
457
|
class: "pl-4 w-[320px]",
|
|
454
458
|
placeholder: s(a)("grantUser.search.placeholder")
|
|
455
|
-
}, null, 8, ["modelValue", "placeholder"])]), l("div",
|
|
459
|
+
}, null, 8, ["modelValue", "placeholder"])]), l("div", ze, [l("div", De, [n(v, {
|
|
456
460
|
modelValue: s(c),
|
|
457
|
-
"onUpdate:modelValue":
|
|
461
|
+
"onUpdate:modelValue": t[3] || (t[3] = (o) => re(c) ? c.value = o : null),
|
|
458
462
|
autofocus: "",
|
|
459
463
|
placeholder: s(a)("grantUser.search.placeholder")
|
|
460
|
-
}, null, 8, ["modelValue", "placeholder"])]), n(
|
|
464
|
+
}, null, 8, ["modelValue", "placeholder"])]), n(Fe), l("div", Ke, [n(D, {
|
|
461
465
|
modelValue: U.value,
|
|
462
|
-
"onUpdate:modelValue":
|
|
463
|
-
"managable-only": !1,
|
|
466
|
+
"onUpdate:modelValue": t[4] || (t[4] = (o) => U.value = o),
|
|
464
467
|
multiple: "",
|
|
468
|
+
items: ae.value,
|
|
465
469
|
variant: "dark",
|
|
470
|
+
"selected-prefix": s(a)("grantUser.columns.restaurant"),
|
|
471
|
+
placeholder: s(a)("grantUser.columns.restaurant"),
|
|
466
472
|
class: "!w-auto"
|
|
467
|
-
}, null, 8, ["modelValue"]), n(
|
|
473
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
|
|
468
474
|
modelValue: B.value,
|
|
469
|
-
"onUpdate:modelValue":
|
|
475
|
+
"onUpdate:modelValue": t[5] || (t[5] = (o) => B.value = o),
|
|
470
476
|
multiple: "",
|
|
471
|
-
items:
|
|
477
|
+
items: te.value,
|
|
472
478
|
variant: "dark",
|
|
473
479
|
"selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
|
|
474
480
|
placeholder: s(a)("grantUser.filter.status_placeholder")
|
|
475
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(),
|
|
481
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(), E(ke, {
|
|
476
482
|
key: 0,
|
|
477
483
|
class: "overflow-auto"
|
|
478
484
|
}, {
|
|
479
|
-
default: x(() => [n(
|
|
485
|
+
default: x(() => [n(O, {
|
|
480
486
|
class: "xs:hidden",
|
|
481
|
-
"column-defs":
|
|
487
|
+
"column-defs": P,
|
|
482
488
|
"row-data": w.value,
|
|
483
489
|
"page-size": w.value.length,
|
|
484
490
|
loading: s(b).isLoading,
|
|
485
491
|
virtual: w.value.length > 0,
|
|
486
492
|
"pin-header-row": "",
|
|
487
493
|
"hide-footer": ""
|
|
488
|
-
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div",
|
|
494
|
+
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ee, [n(me, {
|
|
489
495
|
separator: ""
|
|
490
496
|
}, {
|
|
491
|
-
default: x(() => [(I(!0),
|
|
497
|
+
default: x(() => [(I(!0), K(J, null, fe(w.value, (o) => (I(), E(de, {
|
|
492
498
|
key: o._id,
|
|
493
499
|
class: "py-12 px-16 items-center justify-between"
|
|
494
500
|
}, {
|
|
495
|
-
default: x(() => [l("div",
|
|
501
|
+
default: x(() => [l("div", Me, [l("div", Pe, [n(A, {
|
|
496
502
|
variant: "tertiary",
|
|
497
503
|
"text-color": "neutral-gray-400",
|
|
498
504
|
icon: "content_copy",
|
|
499
|
-
onClick:
|
|
500
|
-
}, null, 8, ["onClick"]), l("p",
|
|
505
|
+
onClick: oe((pe) => se(o.passcode), ["stop"])
|
|
506
|
+
}, null, 8, ["onClick"]), l("p", Te, [l("span", Oe, k(o.passcode), 1), ne(" - " + k(o.name), 1)])]), l("div", je, [l("div", null, [ne(k(C.value[o.restaurantId] || "-") + " ", 1), l("div", qe, k(o.restaurantId), 1), l("div", null, k(F.value[o.roleId] || "-"), 1)]), l("div", He, [l("div", We, k(s(a)("grantUser.columns.grantedBy")) + ": " + k(o.grantByName), 1), l("div", Je, k(s(a)("grantUser.columns.createdAt")) + ": " + k(new Date(o.createdAt).toLocaleString()), 1), n(j, {
|
|
501
507
|
label: R(o.status),
|
|
502
508
|
class: _e(G(o.status))
|
|
503
|
-
}, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(),
|
|
509
|
+
}, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), K("div", Qe, [n(A, {
|
|
504
510
|
label: s(a)("grantUser.actions.revoke"),
|
|
505
|
-
variant: s(
|
|
506
|
-
onClick:
|
|
511
|
+
variant: s(H).Secondary,
|
|
512
|
+
onClick: oe((pe) => N(o), ["stop"])
|
|
507
513
|
}, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
|
|
508
514
|
_: 2
|
|
509
515
|
}, 1024))), 128))]),
|
|
510
516
|
_: 1
|
|
511
517
|
})])]),
|
|
512
518
|
_: 1
|
|
513
|
-
})) : (I(),
|
|
519
|
+
})) : (I(), E(s(Ie), {
|
|
514
520
|
key: 1,
|
|
515
521
|
title: s(a)("grantUser.noData.title"),
|
|
516
522
|
subtitle: s(a)("grantUser.noData.subtitle")
|
|
517
523
|
}, null, 8, ["title", "subtitle"]))])], 64);
|
|
518
524
|
};
|
|
519
525
|
}
|
|
520
|
-
}), dt = /* @__PURE__ */
|
|
526
|
+
}), dt = /* @__PURE__ */ Q({
|
|
521
527
|
__name: "Main",
|
|
522
528
|
setup(p) {
|
|
523
|
-
const { readGrantUsers: y } =
|
|
529
|
+
const { readGrantUsers: y } = ee(), { currentBusiness: a } = ye(), { readRoles: U } = Y(), { readRestaurants: b } = Z(), { t: u } = X(), m = S();
|
|
524
530
|
return ce(
|
|
525
|
-
|
|
531
|
+
a,
|
|
526
532
|
async () => {
|
|
527
533
|
var r;
|
|
528
|
-
(r =
|
|
534
|
+
(r = a.value) != null && r._id && await Promise.all([b(), U(), y()]);
|
|
529
535
|
},
|
|
530
536
|
{ immediate: !0 }
|
|
531
537
|
), (r, c) => {
|
|
532
538
|
const i = h("FmSpacer"), w = h("FmButton");
|
|
533
|
-
return I(),
|
|
534
|
-
heading: s(
|
|
539
|
+
return I(), E(Ue, {
|
|
540
|
+
heading: s(u)("grantUser.title")
|
|
535
541
|
}, {
|
|
536
542
|
"append-heading": x(() => [
|
|
537
543
|
n(i),
|
|
538
544
|
n(w, {
|
|
539
545
|
"prepend-icon": "add",
|
|
540
|
-
label: s(
|
|
546
|
+
label: s(u)("grantUser.actions.create"),
|
|
541
547
|
onClick: c[0] || (c[0] = (C) => {
|
|
542
|
-
var
|
|
543
|
-
return (
|
|
548
|
+
var F;
|
|
549
|
+
return (F = m.value) == null ? void 0 : F.create();
|
|
544
550
|
})
|
|
545
551
|
}, null, 8, ["label"])
|
|
546
552
|
]),
|
|
547
553
|
default: x(() => [
|
|
548
|
-
n(
|
|
554
|
+
n(Xe, {
|
|
549
555
|
ref_key: "grantUserListRef",
|
|
550
556
|
ref: m
|
|
551
557
|
}, null, 512)
|