@feedmepos/mf-hrm-portal 2.0.20-dev.1 → 2.0.20-dev.3
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 → AuditLogList-7E8iWQWx.js} +4 -4
- package/dist/EmployeeList-DyNW3cUo.js +851 -0
- package/dist/{Main-CSMAtoMj.js → Main-BLJyOcEv.js} +184 -176
- package/dist/{Main-BGc6kNaR.js → Main-BZjZxFHp.js} +2008 -2001
- package/dist/Main-C9lMH4EN.js +90 -0
- package/dist/PermissionSetList-BuCp14Os.js +355 -0
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js} +675 -661
- package/dist/RoleList-L8L1xmJ2.js +564 -0
- package/dist/TeamMemberList-DEN9rHqb.js +1124 -0
- package/dist/{TimesheetList-tFjvFHqH.js → TimesheetList-D88u0GFn.js} +61 -53
- package/dist/{app-CL7rUfL3.js → app-g_SrJtfC.js} +191 -193
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-ChdFPuFV.js → dayjs.min-BGHzwXCt.js} +1 -1
- package/dist/employee-Dep-q_aU.js +200 -0
- package/dist/{iteration-BbD0nOgO.js → iteration-Dc-Bz5bA.js} +173 -175
- package/dist/{lodash-CDf3aG6G.js → lodash-Cxw1GZ6L.js} +1 -1
- package/dist/{rule-BJ-y3Sp8.js → rule-ClRtpdqO.js} +27 -26
- package/dist/src/types/team.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{timesheet-BmV02Rkz.js → timesheet-CZoSvFYT.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-D8QAGZ02.js → useAppStore-CTBRpqmO.js} +36 -38
- package/dist/{useLoading-KpcQw0p4.js → useLoading-XvrLj1VM.js} +1 -1
- package/dist/{useReportPermissions-CmGJAz_N.js → useReportPermissions-nivbQm9V.js} +3 -3
- package/package.json +1 -1
- package/dist/EmployeeList-Cy2ayCko.js +0 -824
- package/dist/Main-D7bV8EuC.js +0 -86
- package/dist/PermissionSetList-CuHhDqWl.js +0 -347
- package/dist/RoleList-e0WUqt4Y.js +0 -545
- package/dist/TeamMemberList-CpPa1KyV.js +0 -1097
- package/dist/employee-kKV7UnHU.js +0 -204
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as I, defineComponent as Q, computed as F, watch as ie, resolveComponent as h, createElementBlock as E, openBlock as S, Fragment as J, renderSlot as ge, createVNode as n, unref as r, withCtx as x, createElementVNode as c, toDisplayString as w, createBlock as K, isRef as oe, renderList as fe, createCommentVNode as ve, withModifiers as ne, createTextVNode as le, normalizeClass as _e, h as _ } from "vue";
|
|
2
2
|
import { useI18n as X, useCoreStore as ye } from "@feedmepos/mf-common";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useSnackbar as Y, components as M, useDialog as Ue, useBreakpoints as he, FmButtonVariant as q } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as xe } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
5
|
+
import { u as Z } from "./useAppStore-CTBRpqmO.js";
|
|
6
|
+
import { g as z, a as be, b as H, u as ee } from "./iteration-Dc-Bz5bA.js";
|
|
7
|
+
import { defineStore as ke } from "pinia";
|
|
8
8
|
import { S as D } from "./SelectFilter-DUj7GBtT.js";
|
|
9
|
-
import { _ as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { u as ue } from "./useLoading-
|
|
13
|
-
import { _ as
|
|
9
|
+
import { _ as we } from "./app-g_SrJtfC.js";
|
|
10
|
+
import { _ as ce, u as Fe, H as Ve } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
|
|
11
|
+
import { _ as Se } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
12
|
+
import { u as ue } from "./useLoading-XvrLj1VM.js";
|
|
13
|
+
import { _ as Ie } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
14
14
|
const W = {
|
|
15
15
|
async getGrantUsers() {
|
|
16
|
-
return z(await
|
|
16
|
+
return z(await H("grant").get(""));
|
|
17
17
|
},
|
|
18
|
-
async createGrantUser(
|
|
19
|
-
return z(await
|
|
18
|
+
async createGrantUser(m) {
|
|
19
|
+
return z(await H("grant").post("", m));
|
|
20
20
|
},
|
|
21
|
-
async revokeGrantUser(
|
|
21
|
+
async revokeGrantUser(m, y) {
|
|
22
22
|
return z(
|
|
23
|
-
await
|
|
23
|
+
await H("grant").patch(`/revoke/${m}`, null, {
|
|
24
24
|
params: { restaurantId: y }
|
|
25
25
|
})
|
|
26
26
|
);
|
|
27
27
|
},
|
|
28
28
|
// Test grant validation
|
|
29
|
-
async validatePasscode(
|
|
29
|
+
async validatePasscode(m, y) {
|
|
30
30
|
return z(
|
|
31
|
-
await
|
|
32
|
-
passcode:
|
|
31
|
+
await be().post("", {
|
|
32
|
+
passcode: m,
|
|
33
33
|
restaurantId: y
|
|
34
34
|
})
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
|
-
}, Ce =
|
|
38
|
-
const
|
|
37
|
+
}, Ce = ke("grantUser", () => {
|
|
38
|
+
const m = I([]), y = I(!1);
|
|
39
39
|
async function a() {
|
|
40
40
|
y.value = !0;
|
|
41
41
|
try {
|
|
42
|
-
|
|
43
|
-
(u,
|
|
42
|
+
m.value = (await W.getGrantUsers()).sort(
|
|
43
|
+
(u, p) => u.createdAt < p.createdAt ? 1 : -1
|
|
44
44
|
);
|
|
45
45
|
} catch (u) {
|
|
46
46
|
throw console.error("Error reading grant users:", u), u;
|
|
@@ -50,77 +50,77 @@ const W = {
|
|
|
50
50
|
}
|
|
51
51
|
async function U(u) {
|
|
52
52
|
try {
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
} catch (
|
|
56
|
-
throw console.error("Error creating grant user:",
|
|
53
|
+
const p = await W.createGrantUser(u);
|
|
54
|
+
return m.value = [p, ...m.value], p;
|
|
55
|
+
} catch (p) {
|
|
56
|
+
throw console.error("Error creating grant user:", p), p;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
async function b(u,
|
|
59
|
+
async function b(u, p) {
|
|
60
60
|
try {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
} catch (
|
|
64
|
-
throw console.error("Error revoking grant user:",
|
|
61
|
+
const l = await W.revokeGrantUser(u, p), i = m.value.findIndex((s) => s._id === u);
|
|
62
|
+
i !== -1 && (m.value[i] = l);
|
|
63
|
+
} catch (l) {
|
|
64
|
+
throw console.error("Error revoking grant user:", l), l;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
return {
|
|
68
|
-
grantUsers:
|
|
68
|
+
grantUsers: m,
|
|
69
69
|
isLoading: y,
|
|
70
70
|
readGrantUsers: a,
|
|
71
71
|
createGrantUser: U,
|
|
72
72
|
revokeGrantUser: b
|
|
73
73
|
};
|
|
74
|
-
}),
|
|
74
|
+
}), te = 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({
|
|
75
75
|
__name: "GrantUserForm",
|
|
76
|
-
setup(
|
|
77
|
-
const a =
|
|
76
|
+
setup(m, { expose: y }) {
|
|
77
|
+
const a = te(), U = Z(), b = ee(), u = Y(), p = ue(u), { t: l } = X(), i = I(!1), s = I({
|
|
78
78
|
name: "",
|
|
79
79
|
restaurantId: "",
|
|
80
80
|
roleId: ""
|
|
81
|
-
}),
|
|
82
|
-
|
|
81
|
+
}), k = () => {
|
|
82
|
+
s.value = {
|
|
83
83
|
name: "",
|
|
84
84
|
restaurantId: "",
|
|
85
85
|
roleId: ""
|
|
86
|
-
},
|
|
87
|
-
},
|
|
86
|
+
}, i.value = !0;
|
|
87
|
+
}, V = F(() => l("grantUser.form.title")), C = F(() => l("common.create")), B = F(() => b.restaurants.value.map((d) => ({
|
|
88
88
|
label: `${d.profile.code ? d.profile.code + " - " : ""}${d.profile.name}`,
|
|
89
89
|
value: d._id
|
|
90
|
-
}))), R =
|
|
90
|
+
}))), R = F(() => s.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === s.value.restaurantId)).map((d) => ({
|
|
91
91
|
label: d.name,
|
|
92
92
|
value: d._id,
|
|
93
93
|
disabled: !d.isUsable
|
|
94
94
|
})) : []);
|
|
95
|
-
|
|
96
|
-
() =>
|
|
95
|
+
ie(
|
|
96
|
+
() => s.value.restaurantId,
|
|
97
97
|
() => {
|
|
98
|
-
|
|
98
|
+
s.value.roleId = "";
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
101
|
async function P() {
|
|
102
|
-
await
|
|
103
|
-
const d = await a.createGrantUser(
|
|
102
|
+
await p.minor(async () => {
|
|
103
|
+
const d = await a.createGrantUser(s.value);
|
|
104
104
|
u.open({
|
|
105
|
-
message:
|
|
105
|
+
message: l("grantUser.create.successMessage", {
|
|
106
106
|
passcode: d.passcode
|
|
107
107
|
}),
|
|
108
108
|
type: "success"
|
|
109
109
|
});
|
|
110
|
-
}),
|
|
110
|
+
}), i.value = !1;
|
|
111
111
|
}
|
|
112
112
|
return y({
|
|
113
|
-
show:
|
|
114
|
-
trigger:
|
|
113
|
+
show: i,
|
|
114
|
+
trigger: k
|
|
115
115
|
}), (d, g) => {
|
|
116
|
-
const T = h("FmTextField"),
|
|
117
|
-
return
|
|
118
|
-
ge(d.$slots, "default", { trigger:
|
|
116
|
+
const T = h("FmTextField"), G = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
|
|
117
|
+
return S(), E(J, null, [
|
|
118
|
+
ge(d.$slots, "default", { trigger: k }),
|
|
119
119
|
n(N, {
|
|
120
120
|
id: "grant-user-form",
|
|
121
|
-
modelValue:
|
|
122
|
-
"onUpdate:modelValue": g[4] || (g[4] = (f) =>
|
|
123
|
-
"is-container":
|
|
121
|
+
modelValue: i.value,
|
|
122
|
+
"onUpdate:modelValue": g[4] || (g[4] = (f) => i.value = f),
|
|
123
|
+
"is-container": r(M).FmForm,
|
|
124
124
|
"is-container-props": {
|
|
125
125
|
onValidationSuccess: P,
|
|
126
126
|
blameFormChildOnValidationFailed: !0
|
|
@@ -128,61 +128,61 @@ const W = {
|
|
|
128
128
|
"max-width": 560
|
|
129
129
|
}, {
|
|
130
130
|
"side-sheet-header": x(() => [
|
|
131
|
-
|
|
131
|
+
c("p", Be, w(V.value), 1)
|
|
132
132
|
]),
|
|
133
133
|
"side-sheet-footer": x(() => [
|
|
134
|
-
|
|
134
|
+
c("div", Ge, [
|
|
135
135
|
n(L, {
|
|
136
|
-
label:
|
|
136
|
+
label: C.value,
|
|
137
137
|
size: "lg",
|
|
138
138
|
type: "submit",
|
|
139
139
|
variant: "primary"
|
|
140
140
|
}, null, 8, ["label"]),
|
|
141
141
|
n(L, {
|
|
142
|
-
label:
|
|
142
|
+
label: r(l)("common.cancel"),
|
|
143
143
|
size: "lg",
|
|
144
144
|
variant: "tertiary",
|
|
145
|
-
onClick: g[3] || (g[3] = () =>
|
|
145
|
+
onClick: g[3] || (g[3] = () => i.value = !1)
|
|
146
146
|
}, null, 8, ["label"])
|
|
147
147
|
])
|
|
148
148
|
]),
|
|
149
149
|
default: x(() => [
|
|
150
|
-
|
|
151
|
-
n(
|
|
152
|
-
title:
|
|
150
|
+
c("div", $e, [
|
|
151
|
+
n(Ie, {
|
|
152
|
+
title: r(l)("grantUser.form.section")
|
|
153
153
|
}, {
|
|
154
154
|
default: x(() => [
|
|
155
155
|
n(T, {
|
|
156
|
-
modelValue:
|
|
157
|
-
"onUpdate:modelValue": g[0] || (g[0] = (f) =>
|
|
158
|
-
label:
|
|
159
|
-
rules: [(f) => !!f ||
|
|
156
|
+
modelValue: s.value.name,
|
|
157
|
+
"onUpdate:modelValue": g[0] || (g[0] = (f) => s.value.name = f),
|
|
158
|
+
label: r(l)("grantUser.form.name"),
|
|
159
|
+
rules: [(f) => !!f || r(l)("grantUser.form.nameRequired")]
|
|
160
160
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
161
|
-
n(
|
|
162
|
-
label:
|
|
161
|
+
n(ce, {
|
|
162
|
+
label: r(l)("grantUser.form.restaurant")
|
|
163
163
|
}, {
|
|
164
164
|
default: x(() => [
|
|
165
|
-
n(
|
|
166
|
-
modelValue:
|
|
167
|
-
"onUpdate:modelValue": g[1] || (g[1] = (f) =>
|
|
168
|
-
items:
|
|
169
|
-
placeholder:
|
|
170
|
-
rules: [(f) => !!f ||
|
|
165
|
+
n(G, {
|
|
166
|
+
modelValue: s.value.restaurantId,
|
|
167
|
+
"onUpdate:modelValue": g[1] || (g[1] = (f) => s.value.restaurantId = f),
|
|
168
|
+
items: B.value,
|
|
169
|
+
placeholder: r(l)("grantUser.form.selectRestaurant"),
|
|
170
|
+
rules: [(f) => !!f || r(l)("grantUser.form.restaurantRequired")]
|
|
171
171
|
}, null, 8, ["modelValue", "items", "placeholder", "rules"])
|
|
172
172
|
]),
|
|
173
173
|
_: 1
|
|
174
174
|
}, 8, ["label"]),
|
|
175
|
-
n(
|
|
176
|
-
label:
|
|
175
|
+
n(ce, {
|
|
176
|
+
label: r(l)("grantUser.form.role")
|
|
177
177
|
}, {
|
|
178
178
|
default: x(() => [
|
|
179
|
-
n(
|
|
180
|
-
modelValue:
|
|
181
|
-
"onUpdate:modelValue": g[2] || (g[2] = (f) =>
|
|
179
|
+
n(G, {
|
|
180
|
+
modelValue: s.value.roleId,
|
|
181
|
+
"onUpdate:modelValue": g[2] || (g[2] = (f) => s.value.roleId = f),
|
|
182
182
|
items: R.value,
|
|
183
|
-
placeholder:
|
|
184
|
-
disabled: !
|
|
185
|
-
rules: [(f) => !!f ||
|
|
183
|
+
placeholder: r(l)("grantUser.form.selectRole"),
|
|
184
|
+
disabled: !s.value.restaurantId,
|
|
185
|
+
rules: [(f) => !!f || r(l)("grantUser.form.roleRequired")]
|
|
186
186
|
}, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
|
|
187
187
|
]),
|
|
188
188
|
_: 1
|
|
@@ -207,9 +207,9 @@ const W = {
|
|
|
207
207
|
class: "space-y-4 hidden xs:block"
|
|
208
208
|
}, De = {
|
|
209
209
|
class: "px-16"
|
|
210
|
-
}, Ke = {
|
|
211
|
-
class: "px-16 flex items-start gap-8"
|
|
212
210
|
}, Ee = {
|
|
211
|
+
class: "px-16 flex items-start gap-8"
|
|
212
|
+
}, Ke = {
|
|
213
213
|
class: "pb-64 hidden xs:block"
|
|
214
214
|
}, Me = {
|
|
215
215
|
class: "space-y-4"
|
|
@@ -234,35 +234,35 @@ const W = {
|
|
|
234
234
|
class: "flex flex-col gap-4"
|
|
235
235
|
}, Xe = /* @__PURE__ */ Q({
|
|
236
236
|
__name: "GrantUserList",
|
|
237
|
-
setup(
|
|
237
|
+
setup(m, {
|
|
238
238
|
expose: y
|
|
239
239
|
}) {
|
|
240
240
|
const {
|
|
241
241
|
t: a
|
|
242
|
-
} = X(), U =
|
|
242
|
+
} = X(), U = I(), b = te(), {
|
|
243
243
|
restaurants: u
|
|
244
|
-
} =
|
|
245
|
-
roles:
|
|
246
|
-
} =
|
|
247
|
-
searchKey:
|
|
248
|
-
filter:
|
|
249
|
-
} =
|
|
244
|
+
} = ee(), {
|
|
245
|
+
roles: p
|
|
246
|
+
} = Z(), l = F(() => b.grantUsers), {
|
|
247
|
+
searchKey: i,
|
|
248
|
+
filter: s
|
|
249
|
+
} = Fe(), k = F(() => {
|
|
250
250
|
var e;
|
|
251
|
-
return (e =
|
|
252
|
-
const v = !U.value || U.value.includes(t.restaurantId), O =
|
|
253
|
-
return v && O &&
|
|
251
|
+
return (e = l.value) == null ? void 0 : e.filter((t) => {
|
|
252
|
+
const v = !U.value || U.value.includes(t.restaurantId), O = !$.value || $.value.includes(t.status), A = V.value[t.restaurantId] || "", j = C.value[t.roleId] || "";
|
|
253
|
+
return v && O && s([t.passcode, t.name, A, j, t.grantByName]);
|
|
254
254
|
});
|
|
255
|
-
}),
|
|
255
|
+
}), V = F(() => {
|
|
256
256
|
const e = {};
|
|
257
257
|
return u.value.forEach((t) => {
|
|
258
258
|
e[t._id] = t.profile.name;
|
|
259
259
|
}), e;
|
|
260
|
-
}),
|
|
260
|
+
}), C = F(() => {
|
|
261
261
|
const e = {};
|
|
262
|
-
return
|
|
262
|
+
return p.value.forEach((t) => {
|
|
263
263
|
e[t._id] = t.name;
|
|
264
264
|
}), e;
|
|
265
|
-
}),
|
|
265
|
+
}), B = (e) => {
|
|
266
266
|
switch (e) {
|
|
267
267
|
case "active":
|
|
268
268
|
return "bg-fm-color-system-success-100 text-fm-color-typo-success";
|
|
@@ -284,7 +284,7 @@ const W = {
|
|
|
284
284
|
return _("div", {
|
|
285
285
|
class: "flex items-center gap-8"
|
|
286
286
|
}, [_(M.FmButton, {
|
|
287
|
-
variant:
|
|
287
|
+
variant: q.Tertiary,
|
|
288
288
|
textColor: "neutral-gray-400",
|
|
289
289
|
icon: "content_copy",
|
|
290
290
|
onClick: (v) => {
|
|
@@ -299,23 +299,23 @@ const W = {
|
|
|
299
299
|
header: () => a("grantUser.columns.name")
|
|
300
300
|
}, {
|
|
301
301
|
accessorKey: "restaurantName",
|
|
302
|
-
accessorFn: (e) =>
|
|
302
|
+
accessorFn: (e) => V.value[e.restaurantId],
|
|
303
303
|
header: () => a("grantUser.columns.restaurant"),
|
|
304
304
|
meta: {
|
|
305
305
|
width: "250px"
|
|
306
306
|
},
|
|
307
307
|
cell(e) {
|
|
308
|
-
const t = e.row.original.restaurantId, v =
|
|
308
|
+
const t = e.row.original.restaurantId, v = V.value[t] || "-";
|
|
309
309
|
return _("div", [_("div", v), _("div", {
|
|
310
310
|
class: "text-fm-color-typo-secondary text-sm"
|
|
311
311
|
}, `${t}`)]);
|
|
312
312
|
}
|
|
313
313
|
}, {
|
|
314
314
|
accessorKey: "roleName",
|
|
315
|
-
accessorFn: (e) =>
|
|
315
|
+
accessorFn: (e) => C.value[e.roleId],
|
|
316
316
|
header: () => a("grantUser.columns.role"),
|
|
317
317
|
cell(e) {
|
|
318
|
-
const t = e.row.original.roleId, v =
|
|
318
|
+
const t = e.row.original.roleId, v = C.value[t] || "-";
|
|
319
319
|
return _("div", v);
|
|
320
320
|
}
|
|
321
321
|
}, {
|
|
@@ -328,7 +328,7 @@ const W = {
|
|
|
328
328
|
const t = e.row.original.status;
|
|
329
329
|
return _(M.FmChip, {
|
|
330
330
|
label: R(t),
|
|
331
|
-
class:
|
|
331
|
+
class: B(t)
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
}, {
|
|
@@ -360,15 +360,15 @@ const W = {
|
|
|
360
360
|
class: "w-full flex justify-end items-center gap-4"
|
|
361
361
|
}, [_(M.FmButton, {
|
|
362
362
|
label: a("grantUser.actions.revoke"),
|
|
363
|
-
variant:
|
|
363
|
+
variant: q.Secondary,
|
|
364
364
|
onClick: (v) => {
|
|
365
365
|
v.stopPropagation(), N(t);
|
|
366
366
|
}
|
|
367
367
|
})]);
|
|
368
368
|
}
|
|
369
|
-
}], d =
|
|
369
|
+
}], d = Y(), g = Ue(), T = ue(d), G = I(), {
|
|
370
370
|
breakpoints: L
|
|
371
|
-
} =
|
|
371
|
+
} = he(), N = (e) => {
|
|
372
372
|
g.open({
|
|
373
373
|
title: a("grantUser.revoke.title"),
|
|
374
374
|
message: a("grantUser.revoke.message", {
|
|
@@ -396,9 +396,9 @@ const W = {
|
|
|
396
396
|
};
|
|
397
397
|
function f() {
|
|
398
398
|
var e;
|
|
399
|
-
(e =
|
|
399
|
+
(e = G.value) == null || e.trigger();
|
|
400
400
|
}
|
|
401
|
-
const
|
|
401
|
+
const ae = F(() => [{
|
|
402
402
|
label: a("grantUser.status.active"),
|
|
403
403
|
value: "active"
|
|
404
404
|
}, {
|
|
@@ -407,10 +407,10 @@ const W = {
|
|
|
407
407
|
}, {
|
|
408
408
|
label: a("grantUser.status.revoked"),
|
|
409
409
|
value: "revoked"
|
|
410
|
-
}]),
|
|
410
|
+
}]), re = F(() => u.value.map((e) => ({
|
|
411
411
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
412
412
|
value: e._id
|
|
413
|
-
}))),
|
|
413
|
+
}))), $ = I();
|
|
414
414
|
async function se(e) {
|
|
415
415
|
try {
|
|
416
416
|
await navigator.clipboard.writeText(e), d.open({
|
|
@@ -426,134 +426,142 @@ const W = {
|
|
|
426
426
|
}
|
|
427
427
|
return y({
|
|
428
428
|
create: f,
|
|
429
|
-
filteredGrantUsers:
|
|
429
|
+
filteredGrantUsers: k
|
|
430
430
|
}), (e, t) => {
|
|
431
431
|
const v = h("FmSearch"), O = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
|
|
432
|
-
return
|
|
432
|
+
return S(), E(J, null, [n(Re, {
|
|
433
433
|
ref_key: "grantUserFormRef",
|
|
434
|
-
ref:
|
|
434
|
+
ref: G,
|
|
435
435
|
class: "gap-8"
|
|
436
|
-
}, null, 512),
|
|
436
|
+
}, null, 512), c("div", Le, [c("div", Ne, [c("div", Ae, [n(D, {
|
|
437
437
|
modelValue: U.value,
|
|
438
438
|
"onUpdate:modelValue": t[0] || (t[0] = (o) => U.value = o),
|
|
439
439
|
multiple: "",
|
|
440
|
-
items:
|
|
440
|
+
items: re.value,
|
|
441
441
|
variant: "dark",
|
|
442
|
-
"selected-prefix":
|
|
443
|
-
placeholder:
|
|
442
|
+
"selected-prefix": r(a)("grantUser.columns.restaurant"),
|
|
443
|
+
placeholder: r(a)("grantUser.columns.restaurant"),
|
|
444
444
|
class: "!w-auto"
|
|
445
445
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
|
|
446
|
-
modelValue:
|
|
447
|
-
"onUpdate:modelValue": t[1] || (t[1] = (o) =>
|
|
446
|
+
modelValue: $.value,
|
|
447
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => $.value = o),
|
|
448
448
|
multiple: "",
|
|
449
449
|
variant: "dark",
|
|
450
|
-
items:
|
|
451
|
-
"selected-prefix":
|
|
452
|
-
placeholder:
|
|
450
|
+
items: ae.value,
|
|
451
|
+
"selected-prefix": r(a)("grantUser.filter.selected_status_prefix"),
|
|
452
|
+
placeholder: r(a)("grantUser.filter.status_placeholder")
|
|
453
453
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
|
|
454
|
-
modelValue:
|
|
455
|
-
"onUpdate:modelValue": t[2] || (t[2] = (o) =>
|
|
454
|
+
modelValue: r(i),
|
|
455
|
+
"onUpdate:modelValue": t[2] || (t[2] = (o) => oe(i) ? i.value = o : null),
|
|
456
456
|
autofocus: "",
|
|
457
457
|
class: "pl-4 w-[320px]",
|
|
458
|
-
placeholder:
|
|
459
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
460
|
-
modelValue:
|
|
461
|
-
"onUpdate:modelValue": t[3] || (t[3] = (o) =>
|
|
458
|
+
placeholder: r(a)("grantUser.search.placeholder")
|
|
459
|
+
}, null, 8, ["modelValue", "placeholder"])]), c("div", ze, [c("div", De, [n(v, {
|
|
460
|
+
modelValue: r(i),
|
|
461
|
+
"onUpdate:modelValue": t[3] || (t[3] = (o) => oe(i) ? i.value = o : null),
|
|
462
462
|
autofocus: "",
|
|
463
|
-
placeholder:
|
|
464
|
-
}, null, 8, ["modelValue", "placeholder"])]), n(
|
|
463
|
+
placeholder: r(a)("grantUser.search.placeholder")
|
|
464
|
+
}, null, 8, ["modelValue", "placeholder"])]), n(Ve), c("div", Ee, [n(D, {
|
|
465
465
|
modelValue: U.value,
|
|
466
466
|
"onUpdate:modelValue": t[4] || (t[4] = (o) => U.value = o),
|
|
467
467
|
multiple: "",
|
|
468
|
-
items:
|
|
468
|
+
items: re.value,
|
|
469
469
|
variant: "dark",
|
|
470
|
-
"selected-prefix":
|
|
471
|
-
placeholder:
|
|
470
|
+
"selected-prefix": r(a)("grantUser.columns.restaurant"),
|
|
471
|
+
placeholder: r(a)("grantUser.columns.restaurant"),
|
|
472
472
|
class: "!w-auto"
|
|
473
473
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
|
|
474
|
-
modelValue:
|
|
475
|
-
"onUpdate:modelValue": t[5] || (t[5] = (o) =>
|
|
474
|
+
modelValue: $.value,
|
|
475
|
+
"onUpdate:modelValue": t[5] || (t[5] = (o) => $.value = o),
|
|
476
476
|
multiple: "",
|
|
477
|
-
items:
|
|
477
|
+
items: ae.value,
|
|
478
478
|
variant: "dark",
|
|
479
|
-
"selected-prefix":
|
|
480
|
-
placeholder:
|
|
481
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]),
|
|
479
|
+
"selected-prefix": r(a)("grantUser.filter.selected_status_prefix"),
|
|
480
|
+
placeholder: r(a)("grantUser.filter.status_placeholder")
|
|
481
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), l.value.length > 0 || r(b).isLoading ? (S(), K(we, {
|
|
482
482
|
key: 0,
|
|
483
483
|
class: "overflow-auto"
|
|
484
484
|
}, {
|
|
485
485
|
default: x(() => [n(O, {
|
|
486
486
|
class: "xs:hidden",
|
|
487
487
|
"column-defs": P,
|
|
488
|
-
"row-data":
|
|
489
|
-
"page-size":
|
|
490
|
-
loading:
|
|
491
|
-
virtual:
|
|
488
|
+
"row-data": k.value,
|
|
489
|
+
"page-size": k.value.length,
|
|
490
|
+
loading: r(b).isLoading,
|
|
491
|
+
virtual: k.value.length > 0,
|
|
492
492
|
"pin-header-row": "",
|
|
493
493
|
"hide-footer": ""
|
|
494
|
-
}, null, 8, ["row-data", "page-size", "loading", "virtual"]),
|
|
494
|
+
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), c("div", Ke, [n(me, {
|
|
495
495
|
separator: ""
|
|
496
496
|
}, {
|
|
497
|
-
default: x(() => [(
|
|
497
|
+
default: x(() => [(S(!0), E(J, null, fe(k.value, (o) => (S(), K(de, {
|
|
498
498
|
key: o._id,
|
|
499
499
|
class: "py-12 px-16 items-center justify-between"
|
|
500
500
|
}, {
|
|
501
|
-
default: x(() => [
|
|
501
|
+
default: x(() => [c("div", Me, [c("div", Pe, [n(A, {
|
|
502
502
|
variant: "tertiary",
|
|
503
503
|
"text-color": "neutral-gray-400",
|
|
504
504
|
icon: "content_copy",
|
|
505
|
-
onClick:
|
|
506
|
-
}, null, 8, ["onClick"]),
|
|
505
|
+
onClick: ne((pe) => se(o.passcode), ["stop"])
|
|
506
|
+
}, null, 8, ["onClick"]), c("p", Te, [c("span", Oe, w(o.passcode), 1), le(" - " + w(o.name), 1)])]), c("div", je, [c("div", null, [le(w(V.value[o.restaurantId] || "-") + " ", 1), c("div", qe, w(o.restaurantId), 1), c("div", null, w(C.value[o.roleId] || "-"), 1)]), c("div", He, [c("div", We, w(r(a)("grantUser.columns.grantedBy")) + ": " + w(o.grantByName), 1), c("div", Je, w(r(a)("grantUser.columns.createdAt")) + ": " + w(new Date(o.createdAt).toLocaleString()), 1), n(j, {
|
|
507
507
|
label: R(o.status),
|
|
508
|
-
class: _e(
|
|
509
|
-
}, null, 8, ["label", "class"])])])]), o.status === "active" ? (
|
|
510
|
-
label:
|
|
511
|
-
variant:
|
|
512
|
-
onClick:
|
|
508
|
+
class: _e(B(o.status))
|
|
509
|
+
}, null, 8, ["label", "class"])])])]), o.status === "active" ? (S(), E("div", Qe, [n(A, {
|
|
510
|
+
label: r(a)("grantUser.actions.revoke"),
|
|
511
|
+
variant: r(q).Secondary,
|
|
512
|
+
onClick: ne((pe) => N(o), ["stop"])
|
|
513
513
|
}, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
|
|
514
514
|
_: 2
|
|
515
515
|
}, 1024))), 128))]),
|
|
516
516
|
_: 1
|
|
517
517
|
})])]),
|
|
518
518
|
_: 1
|
|
519
|
-
})) : (
|
|
519
|
+
})) : (S(), K(r(Se), {
|
|
520
520
|
key: 1,
|
|
521
|
-
title:
|
|
522
|
-
subtitle:
|
|
521
|
+
title: r(a)("grantUser.noData.title"),
|
|
522
|
+
subtitle: r(a)("grantUser.noData.subtitle")
|
|
523
523
|
}, null, 8, ["title", "subtitle"]))])], 64);
|
|
524
524
|
};
|
|
525
525
|
}
|
|
526
526
|
}), dt = /* @__PURE__ */ Q({
|
|
527
527
|
__name: "Main",
|
|
528
|
-
setup(
|
|
529
|
-
const { readGrantUsers: y } =
|
|
530
|
-
return
|
|
528
|
+
setup(m) {
|
|
529
|
+
const { readGrantUsers: y } = te(), { currentBusiness: a } = ye(), { readRoles: U } = Z(), { readRestaurants: b } = ee(), { t: u } = X(), p = Y(), l = I();
|
|
530
|
+
return ie(
|
|
531
531
|
a,
|
|
532
532
|
async () => {
|
|
533
|
-
var
|
|
534
|
-
(
|
|
533
|
+
var i;
|
|
534
|
+
if ((i = a.value) != null && i._id)
|
|
535
|
+
try {
|
|
536
|
+
await Promise.all([b(), U(), y()]);
|
|
537
|
+
} catch (s) {
|
|
538
|
+
console.error("Failed to load grant dependencies:", s), p.open({
|
|
539
|
+
message: s instanceof Error ? s.message : String(s),
|
|
540
|
+
type: "error"
|
|
541
|
+
});
|
|
542
|
+
}
|
|
535
543
|
},
|
|
536
544
|
{ immediate: !0 }
|
|
537
|
-
), (
|
|
538
|
-
const
|
|
539
|
-
return
|
|
540
|
-
heading:
|
|
545
|
+
), (i, s) => {
|
|
546
|
+
const k = h("FmSpacer"), V = h("FmButton");
|
|
547
|
+
return S(), K(xe, {
|
|
548
|
+
heading: r(u)("grantUser.title")
|
|
541
549
|
}, {
|
|
542
550
|
"append-heading": x(() => [
|
|
543
|
-
n(
|
|
544
|
-
n(
|
|
551
|
+
n(k),
|
|
552
|
+
n(V, {
|
|
545
553
|
"prepend-icon": "add",
|
|
546
|
-
label:
|
|
547
|
-
onClick:
|
|
548
|
-
var
|
|
549
|
-
return (
|
|
554
|
+
label: r(u)("grantUser.actions.create"),
|
|
555
|
+
onClick: s[0] || (s[0] = (C) => {
|
|
556
|
+
var B;
|
|
557
|
+
return (B = l.value) == null ? void 0 : B.create();
|
|
550
558
|
})
|
|
551
559
|
}, null, 8, ["label"])
|
|
552
560
|
]),
|
|
553
561
|
default: x(() => [
|
|
554
562
|
n(Xe, {
|
|
555
563
|
ref_key: "grantUserListRef",
|
|
556
|
-
ref:
|
|
564
|
+
ref: l
|
|
557
565
|
}, null, 512)
|
|
558
566
|
]),
|
|
559
567
|
_: 1
|