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