@feedmepos/mf-hrm-portal 1.1.3-dev.7 → 1.1.3-dev.8
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-n6xAYZGv.js → AuditLogList-CVOicxwC.js} +90 -76
- package/dist/{EmployeeList-D9rLxXo5.js → EmployeeList-CSBiU32b.js} +5 -5
- package/dist/{Main-zQF3GD9j.js → Main-BTCSW3JL.js} +8 -8
- package/dist/{Main-BCa8A1rV.js → Main-D9xZDqBk.js} +5 -5
- package/dist/PermissionSetList-r1ZvAW01.js +323 -0
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BA1LS-wd.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DXsl8Y5d.js} +169 -169
- package/dist/{RoleList-Cfv9wKaN.js → RoleList-Ca2gg1OL.js} +6 -6
- package/dist/{TeamMemberList-HkvCqzPj.js → TeamMemberList-D__tUUst.js} +196 -196
- package/dist/{TimesheetList-B0e-Muws.js → TimesheetList-DGRLp8ZY.js} +6 -6
- package/dist/{app-DKSPx49S.js → app-c-GiPrdn.js} +12 -4
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-DZJQ_JpV.js → dayjs.min-CJ2WQsea.js} +1 -1
- package/dist/{employee-DKRqMph9.js → employee-8oXtifwK.js} +3 -3
- package/dist/{index-BwyUbhZj.js → index-AdCh0qd6.js} +1 -1
- package/dist/{index-D09s817L.js → index-DSwL5tAm.js} +3 -3
- package/dist/{lodash-CL6AaeJB.js → lodash-C7JpKSnW.js} +1 -1
- package/dist/{team-DEjtUFVl.js → team-Fs4KPQg5.js} +1 -1
- package/dist/{timesheet-B0usAfjL.js → timesheet-D05cQ6a7.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-DfaKfSuR.js → useAppStore-D1eLjzj4.js} +1 -1
- package/dist/{useLoading-D2AX24ph.js → useLoading-DB77wFeJ.js} +1 -1
- package/dist/{useReportPermissions-CwsHq61C.js → useReportPermissions-p2VZ4ugv.js} +2 -2
- package/dist/views/audit-log/locales/index.d.ts +8 -0
- package/package.json +2 -2
- package/dist/PermissionSetList-EsoA_anf.js +0 -338
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ae, ref as V, resolveComponent as _, createBlock as $, openBlock as d, withCtx as L, createElementVNode as r, renderSlot as ve, createCommentVNode as W, withModifiers as we, nextTick as ke, createElementBlock as j, normalizeClass as $e, createTextVNode as Pe, toDisplayString as D, computed as C, Fragment as ie, renderList as be, createVNode as i, unref as n, watch as Ie, isRef as ye, createSlots as Oe } from "vue";
|
|
2
2
|
import { useI18n as ue, useCoreStore as me, baseClientInstance as _e, RestaurantSelector as ge } from "@feedmepos/mf-common";
|
|
3
3
|
import { useBreakpoints as Me, useSnackbar as Ce, useDialog as Ae, components as xe } from "@feedmepos/ui-library";
|
|
4
4
|
import { _ as Ee, S as Ve } from "./SelectFilter-NbXrJ4iH.js";
|
|
5
|
-
import { s as Le, w as je, _ as Te } from "./app-
|
|
5
|
+
import { s as Le, w as je, _ as Te } from "./app-c-GiPrdn.js";
|
|
6
6
|
import { _ as ze } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
7
7
|
import { u as Re } from "./useSearch-B6WK1LBB.js";
|
|
8
|
-
import { u as Ke } from "./useLoading-
|
|
9
|
-
import { g as Fe, l as Ne, u as Be, m as Ge, n as qe, o as
|
|
10
|
-
import "./index-
|
|
11
|
-
import { u as De } from "./useAppStore-
|
|
8
|
+
import { u as Ke } from "./useLoading-DB77wFeJ.js";
|
|
9
|
+
import { g as Fe, l as Ne, u as Be, m as Ge, n as qe, o as de, v as Se, w as We, x as Je, y as Qe, t as pe } from "./index-DSwL5tAm.js";
|
|
10
|
+
import "./index-AdCh0qd6.js";
|
|
11
|
+
import { u as De } from "./useAppStore-D1eLjzj4.js";
|
|
12
12
|
/* empty css */
|
|
13
|
-
import { _ as Xe, a as Ye } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { u as Ze } from "./team-
|
|
15
|
-
const He = /* @__PURE__ */
|
|
13
|
+
import { _ as Xe, a as Ye } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DXsl8Y5d.js";
|
|
14
|
+
import { u as Ze } from "./team-Fs4KPQg5.js";
|
|
15
|
+
const He = /* @__PURE__ */ ae({
|
|
16
16
|
__name: "BottomSheetMenu",
|
|
17
17
|
setup(s) {
|
|
18
|
-
const u =
|
|
18
|
+
const u = V(!1);
|
|
19
19
|
async function e() {
|
|
20
20
|
await ke(), u.value = !u.value;
|
|
21
21
|
}
|
|
22
22
|
return (y, m) => {
|
|
23
23
|
const O = _("FmButton"), P = _("FmBottomSheet");
|
|
24
|
-
return
|
|
24
|
+
return d(), $(P, {
|
|
25
25
|
modelValue: u.value,
|
|
26
26
|
"onUpdate:modelValue": m[1] || (m[1] = (h) => u.value = h),
|
|
27
27
|
"dismiss-away": "",
|
|
@@ -29,26 +29,26 @@ const He = /* @__PURE__ */ se({
|
|
|
29
29
|
"z-index": 110
|
|
30
30
|
}, {
|
|
31
31
|
"bottom-sheet-button": L(() => [
|
|
32
|
-
y.$slots.button ? W("", !0) : (
|
|
32
|
+
y.$slots.button ? W("", !0) : (d(), $(O, {
|
|
33
33
|
key: 0,
|
|
34
34
|
icon: "more_vert",
|
|
35
35
|
variant: "tertiary",
|
|
36
36
|
onClick: we(e, ["stop"])
|
|
37
37
|
})),
|
|
38
|
-
|
|
38
|
+
ve(y.$slots, "button")
|
|
39
39
|
]),
|
|
40
40
|
default: L(() => [
|
|
41
41
|
r("div", {
|
|
42
42
|
onClick: m[0] || (m[0] = (h) => u.value = !1)
|
|
43
43
|
}, [
|
|
44
|
-
|
|
44
|
+
ve(y.$slots, "default")
|
|
45
45
|
])
|
|
46
46
|
]),
|
|
47
47
|
_: 3
|
|
48
48
|
}, 8, ["modelValue"]);
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
}), et = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, tt = /* @__PURE__ */
|
|
51
|
+
}), et = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, tt = /* @__PURE__ */ ae({
|
|
52
52
|
__name: "BottomSheetMenuItem",
|
|
53
53
|
props: {
|
|
54
54
|
label: {},
|
|
@@ -60,8 +60,8 @@ const He = /* @__PURE__ */ se({
|
|
|
60
60
|
const u = s;
|
|
61
61
|
return (e, y) => {
|
|
62
62
|
const m = _("FmIcon");
|
|
63
|
-
return
|
|
64
|
-
e.$slots.content ? W("", !0) : (
|
|
63
|
+
return d(), j("div", et, [
|
|
64
|
+
e.$slots.content ? W("", !0) : (d(), j("div", {
|
|
65
65
|
key: 0,
|
|
66
66
|
class: $e(["flex items-center", {
|
|
67
67
|
"text-fm-color-typo-disabled": u.disabled,
|
|
@@ -70,17 +70,17 @@ const He = /* @__PURE__ */ se({
|
|
|
70
70
|
[u.itemClass || ""]: u.itemClass && !u.disabled
|
|
71
71
|
}])
|
|
72
72
|
}, [
|
|
73
|
-
s.icon ? (
|
|
73
|
+
s.icon ? (d(), $(m, {
|
|
74
74
|
key: 0,
|
|
75
75
|
name: s.icon
|
|
76
76
|
}, null, 8, ["name"])) : W("", !0),
|
|
77
77
|
Pe(" " + D(s.label), 1)
|
|
78
78
|
], 2)),
|
|
79
|
-
|
|
79
|
+
ve(e.$slots, "content")
|
|
80
80
|
]);
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
}), st = /* @__PURE__ */
|
|
83
|
+
}), st = /* @__PURE__ */ ae({
|
|
84
84
|
__name: "ResponsiveContextMenu",
|
|
85
85
|
props: {
|
|
86
86
|
items: {}
|
|
@@ -89,21 +89,21 @@ const He = /* @__PURE__ */ se({
|
|
|
89
89
|
const u = Me(), e = C(() => u.breakpoints.value.xs);
|
|
90
90
|
return (y, m) => {
|
|
91
91
|
const O = _("FmButton"), P = _("FmMenuItem"), h = _("FmMenu");
|
|
92
|
-
return e.value ? (
|
|
92
|
+
return e.value ? (d(), $(He, { key: 0 }, {
|
|
93
93
|
default: L(() => [
|
|
94
|
-
(
|
|
94
|
+
(d(!0), j(ie, null, be(s.items, ({ icon: v, label: c, disabled: g, itemClass: R, onClick: N }) => (d(), $(tt, {
|
|
95
95
|
key: c,
|
|
96
|
-
icon:
|
|
96
|
+
icon: v,
|
|
97
97
|
label: c,
|
|
98
|
-
disabled:
|
|
98
|
+
disabled: g,
|
|
99
99
|
itemClass: R,
|
|
100
100
|
onClick: () => {
|
|
101
|
-
!
|
|
101
|
+
!g && (N == null || N());
|
|
102
102
|
}
|
|
103
103
|
}, null, 8, ["icon", "label", "disabled", "itemClass", "onClick"]))), 128))
|
|
104
104
|
]),
|
|
105
105
|
_: 1
|
|
106
|
-
})) : (
|
|
106
|
+
})) : (d(), $(h, {
|
|
107
107
|
key: 1,
|
|
108
108
|
"stop-click-propagation": "",
|
|
109
109
|
shift: !0
|
|
@@ -118,18 +118,18 @@ const He = /* @__PURE__ */ se({
|
|
|
118
118
|
})
|
|
119
119
|
]),
|
|
120
120
|
default: L(() => [
|
|
121
|
-
(
|
|
122
|
-
key:
|
|
121
|
+
(d(!0), j(ie, null, be(s.items, ({ label: v, disabled: c, itemClass: g, onClick: R }) => (d(), $(P, {
|
|
122
|
+
key: v,
|
|
123
123
|
disabled: c,
|
|
124
|
-
label:
|
|
124
|
+
label: v,
|
|
125
125
|
onClick: () => {
|
|
126
126
|
!c && (R == null || R());
|
|
127
127
|
}
|
|
128
128
|
}, {
|
|
129
129
|
label: L(() => [
|
|
130
130
|
r("span", {
|
|
131
|
-
class: $e(c ? "text-fm-color-typo-disabled" :
|
|
132
|
-
}, D(
|
|
131
|
+
class: $e(c ? "text-fm-color-typo-disabled" : g)
|
|
132
|
+
}, D(v), 3)
|
|
133
133
|
]),
|
|
134
134
|
_: 2
|
|
135
135
|
}, 1032, ["disabled", "label", "onClick"]))), 128))
|
|
@@ -140,7 +140,7 @@ const He = /* @__PURE__ */ se({
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
var re = /* @__PURE__ */ ((s) => (s.Update = "Update", s.Remove = "Remove", s))(re || {});
|
|
143
|
-
const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-center gap-16" }, ot = { class: "space-y-4 min-w-0 flex-1" }, nt = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, rt = { class: "fm-typo-en-body-lg-600 truncate" }, it = { class: "w-full flex gap-16 items-center" }, mt = { class: "flex-1 flex flex-col gap-4 min-w-0" }, ut = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ct = { class: "fm-typo-en-body-lg-600 truncate" }, dt = { class: "flex-1 flex flex-col gap-4 min-w-0" }, pt = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ft = { class: "fm-typo-en-body-lg-600 truncate" }, vt = /* @__PURE__ */
|
|
143
|
+
const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-center gap-16" }, ot = { class: "space-y-4 min-w-0 flex-1" }, nt = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, rt = { class: "fm-typo-en-body-lg-600 truncate" }, it = { class: "w-full flex gap-16 items-center" }, mt = { class: "flex-1 flex flex-col gap-4 min-w-0" }, ut = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ct = { class: "fm-typo-en-body-lg-600 truncate" }, dt = { class: "flex-1 flex flex-col gap-4 min-w-0" }, pt = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ft = { class: "fm-typo-en-body-lg-600 truncate" }, vt = /* @__PURE__ */ ae({
|
|
144
144
|
__name: "MemberInfo",
|
|
145
145
|
props: {
|
|
146
146
|
data: {}
|
|
@@ -149,7 +149,7 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
149
149
|
const { t: u } = ue();
|
|
150
150
|
return (e, y) => {
|
|
151
151
|
const m = _("FmAvatar");
|
|
152
|
-
return
|
|
152
|
+
return d(), j("div", at, [
|
|
153
153
|
r("div", lt, [
|
|
154
154
|
i(m, {
|
|
155
155
|
size: "xl",
|
|
@@ -191,43 +191,43 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
191
191
|
}, bt = { class: "flex flex-col gap-24 w-full" }, yt = {
|
|
192
192
|
key: 0,
|
|
193
193
|
class: "flex flex-col gap-8"
|
|
194
|
-
}, ht = { class: "user-info-icon user-info-icon--lg" }, _t = { class: "flex-1 overflow-hidden" }, gt = { class: "profile-displayName" }, xt = { class: "profile-email" }, Vt = { class: "profile-phone" }, Ft = { key: 2 }, St = /* @__PURE__ */
|
|
194
|
+
}, ht = { class: "user-info-icon user-info-icon--lg" }, _t = { class: "flex-1 overflow-hidden" }, gt = { class: "profile-displayName" }, xt = { class: "profile-email" }, Vt = { class: "profile-phone" }, Ft = { key: 2 }, St = /* @__PURE__ */ ae({
|
|
195
195
|
__name: "PortalUserSearcher",
|
|
196
196
|
emits: ["invite"],
|
|
197
197
|
setup(s, { emit: u }) {
|
|
198
|
-
const e = u, { t: y } = ue(), m = Ce(), O = me(), P =
|
|
199
|
-
async function
|
|
200
|
-
if (!h.value && !
|
|
198
|
+
const e = u, { t: y } = ue(), m = Ce(), O = me(), P = V("phone"), h = V(""), v = V(""), c = V();
|
|
199
|
+
async function g() {
|
|
200
|
+
if (!h.value && !v.value) {
|
|
201
201
|
m.open({
|
|
202
202
|
type: "error",
|
|
203
203
|
title: y("team.memberForm.searchUser.emptyError")
|
|
204
204
|
});
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
|
-
const
|
|
208
|
-
|
|
207
|
+
const x = P.value === "phone" ? await Ue.readPermissionUserByPhoneNo(h.value.replace(/ /g, "")) : await Ue.readPermissionUserByEmail(v.value);
|
|
208
|
+
x || m.open({
|
|
209
209
|
type: "error",
|
|
210
210
|
title: y("team.memberForm.searchUser.userNotFound")
|
|
211
|
-
}), c.value =
|
|
211
|
+
}), c.value = x;
|
|
212
212
|
}
|
|
213
213
|
const R = C(() => {
|
|
214
214
|
var S;
|
|
215
|
-
let
|
|
216
|
-
|
|
217
|
-
const [F, T] =
|
|
215
|
+
let x = ((S = c.value) == null ? void 0 : S.displayName) ?? "";
|
|
216
|
+
x || (x = "Feed Me");
|
|
217
|
+
const [F, T] = x.split(" ");
|
|
218
218
|
return T ? `${F[0]}${T[0]}` : F.slice(0, 2);
|
|
219
|
-
}), N =
|
|
220
|
-
function
|
|
221
|
-
e("invite",
|
|
219
|
+
}), N = V(!1);
|
|
220
|
+
function le(x) {
|
|
221
|
+
e("invite", x), N.value = !0;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function oe() {
|
|
224
224
|
N.value = !1;
|
|
225
225
|
}
|
|
226
|
-
return (
|
|
226
|
+
return (x, F) => {
|
|
227
227
|
var I, z, K;
|
|
228
228
|
const T = _("FmRadio"), S = _("FmPhoneNumber"), a = _("FmTextField"), o = _("FmRadioGroup"), U = _("FmButton");
|
|
229
|
-
return
|
|
230
|
-
N.value ? W("", !0) : (
|
|
229
|
+
return d(), j("div", bt, [
|
|
230
|
+
N.value ? W("", !0) : (d(), j("div", yt, [
|
|
231
231
|
i(o, {
|
|
232
232
|
modelValue: P.value,
|
|
233
233
|
"onUpdate:modelValue": F[2] || (F[2] = (M) => P.value = M)
|
|
@@ -237,7 +237,7 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
237
237
|
value: "phone",
|
|
238
238
|
label: n(y)("team.memberForm.searchUser.phoneNumber")
|
|
239
239
|
}, null, 8, ["label"]),
|
|
240
|
-
P.value === "phone" ? (
|
|
240
|
+
P.value === "phone" ? (d(), $(S, {
|
|
241
241
|
key: 0,
|
|
242
242
|
modelValue: h.value,
|
|
243
243
|
"onUpdate:modelValue": F[0] || (F[0] = (M) => h.value = M),
|
|
@@ -248,10 +248,10 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
248
248
|
value: "email",
|
|
249
249
|
label: n(y)("team.memberForm.searchUser.email")
|
|
250
250
|
}, null, 8, ["label"]),
|
|
251
|
-
P.value === "email" ? (
|
|
251
|
+
P.value === "email" ? (d(), $(a, {
|
|
252
252
|
key: 1,
|
|
253
|
-
modelValue:
|
|
254
|
-
"onUpdate:modelValue": F[1] || (F[1] = (M) =>
|
|
253
|
+
modelValue: v.value,
|
|
254
|
+
"onUpdate:modelValue": F[1] || (F[1] = (M) => v.value = M),
|
|
255
255
|
placeholder: n(y)("team.memberForm.searchUser.emailPlaceholder"),
|
|
256
256
|
class: "ml-8"
|
|
257
257
|
}, null, 8, ["modelValue", "placeholder"])) : W("", !0)
|
|
@@ -261,13 +261,13 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
261
261
|
i(U, {
|
|
262
262
|
label: n(y)("team.memberForm.searchUser.search"),
|
|
263
263
|
variant: "secondary",
|
|
264
|
-
onClick:
|
|
264
|
+
onClick: g
|
|
265
265
|
}, null, 8, ["label"])
|
|
266
266
|
])),
|
|
267
|
-
c.value ? (
|
|
267
|
+
c.value ? (d(), j("div", {
|
|
268
268
|
key: 1,
|
|
269
269
|
class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
|
|
270
|
-
onClick: F[3] || (F[3] = (M) =>
|
|
270
|
+
onClick: F[3] || (F[3] = (M) => le(c.value))
|
|
271
271
|
}, [
|
|
272
272
|
r("div", ht, D(R.value), 1),
|
|
273
273
|
r("div", _t, [
|
|
@@ -276,17 +276,17 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
276
276
|
r("p", Vt, D((K = c.value) == null ? void 0 : K.phoneNumber), 1)
|
|
277
277
|
])
|
|
278
278
|
])) : W("", !0),
|
|
279
|
-
N.value ? (
|
|
279
|
+
N.value ? (d(), j("div", Ft, [
|
|
280
280
|
i(U, {
|
|
281
281
|
label: n(y)("team.memberForm.searchUser.changeUser"),
|
|
282
282
|
variant: "secondary",
|
|
283
|
-
onClick:
|
|
283
|
+
onClick: oe
|
|
284
284
|
}, null, 8, ["label"])
|
|
285
285
|
])) : W("", !0)
|
|
286
286
|
]);
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
}), Ut = /* @__PURE__ */ Ee(St, [["__scopeId", "data-v-c2c7ed35"]]), wt = { class: "flex flex-col gap-40" }, kt = { class: "flex items-center" }, $t = { class: "flex-1 flex flex-col" }, Pt = { class: "fm-typo-en-title-sm-600" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mt = { class: "flex flex-row gap-16" }, Ct = { class: "flex flex-col gap-8" }, Rt = { class: "fm-typo-en-body-lg-400" }, Nt = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" },
|
|
289
|
+
}), Ut = /* @__PURE__ */ Ee(St, [["__scopeId", "data-v-c2c7ed35"]]), wt = { class: "flex flex-col gap-40" }, kt = { class: "flex items-center" }, $t = { class: "flex-1 flex flex-col" }, Pt = { class: "fm-typo-en-title-sm-600" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mt = { class: "flex flex-row gap-16" }, Ct = { class: "flex flex-col gap-8" }, Rt = { class: "fm-typo-en-body-lg-400" }, Nt = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, fe = 4, Bt = /* @__PURE__ */ ae({
|
|
290
290
|
__name: "TeamMemberMasterUser",
|
|
291
291
|
props: {
|
|
292
292
|
modelValue: {
|
|
@@ -312,18 +312,18 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
312
312
|
},
|
|
313
313
|
emits: ["update:model-value"],
|
|
314
314
|
setup(s, { emit: u }) {
|
|
315
|
-
const e = s, y = u, { t: m } = ue(), { searchKey: O, filter: P } = Re(""), h =
|
|
315
|
+
const e = s, y = u, { t: m } = ue(), { searchKey: O, filter: P } = Re(""), h = V(!0), v = V([]), c = C(() => {
|
|
316
316
|
const a = {};
|
|
317
317
|
return e.roles.forEach((o) => {
|
|
318
318
|
a[o.value] = o.label;
|
|
319
319
|
}), a;
|
|
320
|
-
}),
|
|
320
|
+
}), g = C(() => {
|
|
321
321
|
var o;
|
|
322
322
|
const a = {};
|
|
323
323
|
return (o = e.modelValue) == null || o.roles.forEach((U) => {
|
|
324
324
|
a[U.restaurantId] = U.roleId;
|
|
325
325
|
}), a;
|
|
326
|
-
}), R = C(() => e.restaurants.filter((a) => P([a.profile.name, a.profile.code,
|
|
326
|
+
}), R = C(() => e.restaurants.filter((a) => P([a.profile.name, a.profile.code, le(a._id)])).map((a) => ({
|
|
327
327
|
label: `${a.profile.code ? a.profile.code + "-" : ""}${a.profile.name}`,
|
|
328
328
|
value: a._id,
|
|
329
329
|
slot: `checkbox-${a._id}-bottom`,
|
|
@@ -333,11 +333,11 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
333
333
|
const a = e.roles.find((o) => !o.disabled);
|
|
334
334
|
return a ? a.value : null;
|
|
335
335
|
});
|
|
336
|
-
function
|
|
337
|
-
const o =
|
|
336
|
+
function le(a) {
|
|
337
|
+
const o = g.value[a] ?? "";
|
|
338
338
|
return c.value[o] || "";
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function oe(a) {
|
|
341
341
|
a ? e.modelValue || y("update:model-value", {
|
|
342
342
|
code: "",
|
|
343
343
|
name: e.fallbackName,
|
|
@@ -345,14 +345,14 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
345
345
|
passcode: e.fallbackPasscode || ""
|
|
346
346
|
}) : y("update:model-value", void 0);
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function x(a, o) {
|
|
349
349
|
if (!e.modelValue || a === "passcode" && e.modelValue.passcode === o)
|
|
350
350
|
return;
|
|
351
351
|
const U = Ne(e.modelValue);
|
|
352
352
|
U[a] = o, y("update:model-value", U);
|
|
353
353
|
}
|
|
354
354
|
function F(a) {
|
|
355
|
-
|
|
355
|
+
x(
|
|
356
356
|
"roles",
|
|
357
357
|
a.map((o) => {
|
|
358
358
|
var z, K, M;
|
|
@@ -365,7 +365,7 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
367
|
function T(a, o) {
|
|
368
|
-
|
|
368
|
+
x("roles", [
|
|
369
369
|
...e.modelValue.roles.filter(
|
|
370
370
|
(U) => U.restaurantId !== a
|
|
371
371
|
),
|
|
@@ -376,7 +376,7 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
376
376
|
]);
|
|
377
377
|
}
|
|
378
378
|
function S() {
|
|
379
|
-
h.value && (h.value = !1,
|
|
379
|
+
h.value && (h.value = !1, v.value = [], x("passcode", ""));
|
|
380
380
|
}
|
|
381
381
|
return Ie(
|
|
382
382
|
() => {
|
|
@@ -384,12 +384,12 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
384
384
|
return (a = e.modelValue) == null ? void 0 : a.passcode;
|
|
385
385
|
},
|
|
386
386
|
(a) => {
|
|
387
|
-
a && a.length ===
|
|
387
|
+
a && a.length === fe ? (v.value = a.split(""), h.value = !0) : (v.value = [], h.value = !1);
|
|
388
388
|
},
|
|
389
389
|
{ immediate: !0 }
|
|
390
390
|
), (a, o) => {
|
|
391
391
|
const U = _("FmSwitch"), I = _("FmTextField"), z = _("FmPinField"), K = _("FmFormGroup"), M = _("FmSearch"), G = _("FmSelect");
|
|
392
|
-
return
|
|
392
|
+
return d(), j("div", wt, [
|
|
393
393
|
r("div", kt, [
|
|
394
394
|
r("div", $t, [
|
|
395
395
|
r("div", Pt, D(n(m)("team.memberForm.masterUser.title")), 1),
|
|
@@ -399,42 +399,42 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
399
399
|
i(U, {
|
|
400
400
|
"model-value": !!s.modelValue,
|
|
401
401
|
value: "master-user",
|
|
402
|
-
"onUpdate:modelValue":
|
|
402
|
+
"onUpdate:modelValue": oe
|
|
403
403
|
}, null, 8, ["model-value"])
|
|
404
404
|
])
|
|
405
405
|
]),
|
|
406
|
-
s.modelValue ? (
|
|
406
|
+
s.modelValue ? (d(), j(ie, { key: 0 }, [
|
|
407
407
|
r("div", Mt, [
|
|
408
408
|
i(I, {
|
|
409
409
|
"model-value": s.modelValue.code,
|
|
410
410
|
label: n(m)("team.memberForm.masterUser.code"),
|
|
411
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
411
|
+
"onUpdate:modelValue": o[0] || (o[0] = (p) => x("code", p))
|
|
412
412
|
}, null, 8, ["model-value", "label"]),
|
|
413
413
|
i(I, {
|
|
414
414
|
"model-value": s.modelValue.name,
|
|
415
415
|
class: "w-full",
|
|
416
416
|
label: n(m)("team.memberForm.masterUser.name"),
|
|
417
|
-
rules: [(
|
|
418
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
417
|
+
rules: [(p) => !!p || n(m)("team.memberForm.masterUser.nameEmptyError")],
|
|
418
|
+
"onUpdate:modelValue": o[1] || (o[1] = (p) => x("name", p))
|
|
419
419
|
}, null, 8, ["model-value", "label", "rules"])
|
|
420
420
|
]),
|
|
421
421
|
r("div", Ct, [
|
|
422
422
|
r("div", Rt, D(n(m)("team.memberForm.masterUser.passcode")), 1),
|
|
423
423
|
i(K, {
|
|
424
|
-
modelValue:
|
|
425
|
-
"onUpdate:modelValue": o[4] || (o[4] = (
|
|
424
|
+
modelValue: v.value,
|
|
425
|
+
"onUpdate:modelValue": o[4] || (o[4] = (p) => v.value = p),
|
|
426
426
|
rules: [
|
|
427
|
-
(
|
|
427
|
+
(p) => (p == null ? void 0 : p.filter((b) => !!b).length) !== fe ? n(m)("team.memberForm.masterUser.passcodeRequired") : !0
|
|
428
428
|
]
|
|
429
429
|
}, {
|
|
430
430
|
default: L(() => [
|
|
431
|
-
(
|
|
431
|
+
(d(), $(z, {
|
|
432
432
|
key: `pin-field-${h.value}`,
|
|
433
|
-
modelValue:
|
|
434
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
435
|
-
length:
|
|
433
|
+
modelValue: v.value,
|
|
434
|
+
"onUpdate:modelValue": o[2] || (o[2] = (p) => v.value = p),
|
|
435
|
+
length: fe,
|
|
436
436
|
masked: h.value,
|
|
437
|
-
onComplete: o[3] || (o[3] = (
|
|
437
|
+
onComplete: o[3] || (o[3] = (p) => x("passcode", p)),
|
|
438
438
|
onFocus: S
|
|
439
439
|
}, null, 8, ["modelValue", "masked"]))
|
|
440
440
|
]),
|
|
@@ -444,27 +444,27 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
444
444
|
r("div", Nt, [
|
|
445
445
|
i(M, {
|
|
446
446
|
modelValue: n(O),
|
|
447
|
-
"onUpdate:modelValue": o[5] || (o[5] = (
|
|
447
|
+
"onUpdate:modelValue": o[5] || (o[5] = (p) => ye(O) ? O.value = p : null),
|
|
448
448
|
placeholder: n(m)("team.memberForm.posRole.placeholder"),
|
|
449
449
|
class: "mb-16"
|
|
450
450
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
451
451
|
i(Xe, {
|
|
452
|
-
"model-value": s.modelValue.roles.map((
|
|
452
|
+
"model-value": s.modelValue.roles.map((p) => p.restaurantId),
|
|
453
453
|
options: R.value,
|
|
454
454
|
min: 1,
|
|
455
455
|
title: n(m)("team.memberForm.masterUser.role"),
|
|
456
456
|
"onUpdate:modelValue": F
|
|
457
457
|
}, Oe({ _: 2 }, [
|
|
458
|
-
|
|
459
|
-
name:
|
|
458
|
+
be(R.value, (p) => ({
|
|
459
|
+
name: p.slot,
|
|
460
460
|
fn: L(() => {
|
|
461
|
-
var
|
|
461
|
+
var b;
|
|
462
462
|
return [
|
|
463
463
|
r("div", null, [
|
|
464
464
|
i(G, {
|
|
465
|
-
"model-value": ((
|
|
466
|
-
items:
|
|
467
|
-
"onUpdate:modelValue": (
|
|
465
|
+
"model-value": ((b = s.modelValue.roles.find((f) => f.restaurantId === p.value)) == null ? void 0 : b.roleId) || N.value,
|
|
466
|
+
items: p.roleOptions,
|
|
467
|
+
"onUpdate:modelValue": (f) => T(p.value, f)
|
|
468
468
|
}, null, 8, ["model-value", "items", "onUpdate:modelValue"])
|
|
469
469
|
])
|
|
470
470
|
];
|
|
@@ -476,7 +476,7 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
476
476
|
]);
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
|
-
}), Dt = { class: "flex flex-col gap-32" }, Ot = { class: "flex w-full" }, At = /* @__PURE__ */
|
|
479
|
+
}), Dt = { class: "flex flex-col gap-32" }, Ot = { class: "flex w-full" }, At = /* @__PURE__ */ ae({
|
|
480
480
|
__name: "AddMemberForm",
|
|
481
481
|
props: {
|
|
482
482
|
initialValue: {
|
|
@@ -488,109 +488,109 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
490
|
setup(s, { expose: u }) {
|
|
491
|
-
var M, G,
|
|
492
|
-
const e = s, { t: y } = ue(), m =
|
|
493
|
-
() => O.permissionSets.value.map((
|
|
494
|
-
label:
|
|
495
|
-
value:
|
|
491
|
+
var M, G, p;
|
|
492
|
+
const e = s, { t: y } = ue(), m = V(), O = Be(), P = C(
|
|
493
|
+
() => O.permissionSets.value.map((b) => ({
|
|
494
|
+
label: b.name,
|
|
495
|
+
value: b.id
|
|
496
496
|
}))
|
|
497
|
-
), h =
|
|
497
|
+
), h = V(((M = e.initialValue) == null ? void 0 : M.permissionSetIds) || []), v = C(
|
|
498
498
|
() => Ge(h.value, O.permissionSets.value)
|
|
499
|
-
), c =
|
|
499
|
+
), c = V((G = e.initialValue) == null ? void 0 : G.posUser), g = V(
|
|
500
500
|
qe(
|
|
501
|
-
|
|
502
|
-
((
|
|
501
|
+
de(v.value),
|
|
502
|
+
((p = e.initialValue) == null ? void 0 : p.permissions) || []
|
|
503
503
|
)
|
|
504
|
-
), { restaurants: R } = me(), N = De().roles,
|
|
505
|
-
const
|
|
504
|
+
), { restaurants: R } = me(), N = De().roles, le = C(() => Se(g.value)), oe = C(() => {
|
|
505
|
+
const b = le.value;
|
|
506
506
|
return N.value.map(
|
|
507
|
-
(
|
|
508
|
-
label:
|
|
509
|
-
value:
|
|
510
|
-
disabled: !!
|
|
507
|
+
(f) => ({
|
|
508
|
+
label: f.name,
|
|
509
|
+
value: f._id,
|
|
510
|
+
disabled: !!b && !b.includes(f._id)
|
|
511
511
|
})
|
|
512
512
|
);
|
|
513
513
|
});
|
|
514
|
-
function
|
|
515
|
-
m.value =
|
|
514
|
+
function x(b) {
|
|
515
|
+
m.value = b;
|
|
516
516
|
}
|
|
517
|
-
function F(
|
|
518
|
-
c.value = U(c.value,
|
|
517
|
+
function F(b) {
|
|
518
|
+
c.value = U(c.value, b);
|
|
519
519
|
}
|
|
520
520
|
function T() {
|
|
521
|
-
const
|
|
522
|
-
return Je(
|
|
521
|
+
const b = de(v.value), f = We(g.value);
|
|
522
|
+
return Je(b, f);
|
|
523
523
|
}
|
|
524
524
|
function S() {
|
|
525
|
-
var
|
|
526
|
-
const
|
|
525
|
+
var A, J, B, Y, se, ne, Z, H, q, ce;
|
|
526
|
+
const b = T(), f = g.value.filter((ee) => !ee.inverted);
|
|
527
527
|
return {
|
|
528
|
-
email: ((
|
|
529
|
-
phoneNumber: ((
|
|
530
|
-
customPermissions:
|
|
528
|
+
email: ((A = m.value) == null ? void 0 : A.email) ?? void 0,
|
|
529
|
+
phoneNumber: ((J = m.value) == null ? void 0 : J.phoneNumber) ?? void 0,
|
|
530
|
+
customPermissions: b,
|
|
531
531
|
// Deprecated: keep for backward compatibility, will be removed in the future
|
|
532
|
-
permissions:
|
|
533
|
-
...
|
|
534
|
-
subject: Le(
|
|
532
|
+
permissions: f.map((ee) => ({
|
|
533
|
+
...ee,
|
|
534
|
+
subject: Le(ee.subject)
|
|
535
535
|
})),
|
|
536
536
|
permissionSetIds: h.value,
|
|
537
|
-
name: ((
|
|
537
|
+
name: ((B = m.value) == null ? void 0 : B.displayName) || ((Y = e.initialValue) == null ? void 0 : Y.name) || "",
|
|
538
538
|
posUser: c.value ? {
|
|
539
539
|
...c.value,
|
|
540
|
-
name: c.value.name || ((
|
|
541
|
-
code: c.value.code || ((
|
|
540
|
+
name: c.value.name || ((ne = (se = e.initialValue) == null ? void 0 : se.posUser) == null ? void 0 : ne.name) || ((Z = e.initialValue) == null ? void 0 : Z.name) || ((H = m.value) == null ? void 0 : H.displayName) || "",
|
|
541
|
+
code: c.value.code || ((ce = (q = e.initialValue) == null ? void 0 : q.posUser) == null ? void 0 : ce.code) || "",
|
|
542
542
|
passcode: c.value.passcode,
|
|
543
|
-
roles: c.value.roles.filter((
|
|
543
|
+
roles: c.value.roles.filter((ee) => !!ee.roleId)
|
|
544
544
|
} : void 0
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
|
-
const a =
|
|
547
|
+
const a = V();
|
|
548
548
|
function o() {
|
|
549
|
-
|
|
549
|
+
g.value = de(v.value);
|
|
550
550
|
}
|
|
551
|
-
function U(
|
|
552
|
-
if (!
|
|
553
|
-
const A = Se(
|
|
554
|
-
if (!A) return
|
|
555
|
-
const J = Ne(
|
|
551
|
+
function U(b, f) {
|
|
552
|
+
if (!b) return;
|
|
553
|
+
const A = Se(f);
|
|
554
|
+
if (!A) return b;
|
|
555
|
+
const J = Ne(b);
|
|
556
556
|
return J.roles = J.roles.reduce((B, Y) => (A.includes(Y.roleId) && B.push(Y), B), []), J;
|
|
557
557
|
}
|
|
558
558
|
async function I() {
|
|
559
559
|
await ke(), a.value && a.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
560
560
|
}
|
|
561
|
-
const z =
|
|
561
|
+
const z = V();
|
|
562
562
|
async function K() {
|
|
563
563
|
return (await z.value.validateInputsWithoutSubmit()).length ? null : S();
|
|
564
564
|
}
|
|
565
565
|
return u({
|
|
566
566
|
readFormData: S,
|
|
567
567
|
validate: K
|
|
568
|
-
}), (
|
|
568
|
+
}), (b, f) => {
|
|
569
569
|
const A = _("FmSelect"), J = _("FmForm");
|
|
570
|
-
return
|
|
570
|
+
return d(), $(J, {
|
|
571
571
|
ref_key: "formRef",
|
|
572
572
|
ref: z,
|
|
573
573
|
class: "mx-4"
|
|
574
574
|
}, {
|
|
575
575
|
default: L(() => {
|
|
576
|
-
var B, Y,
|
|
576
|
+
var B, Y, se, ne, Z, H;
|
|
577
577
|
return [
|
|
578
578
|
r("div", Dt, [
|
|
579
579
|
r("div", Ot, [
|
|
580
|
-
s.initialValue ? (
|
|
580
|
+
s.initialValue ? (d(), $(vt, {
|
|
581
581
|
key: 1,
|
|
582
582
|
data: s.initialValue
|
|
583
|
-
}, null, 8, ["data"])) : (
|
|
583
|
+
}, null, 8, ["data"])) : (d(), $(Ut, {
|
|
584
584
|
key: 0,
|
|
585
|
-
onInvite:
|
|
585
|
+
onInvite: f[0] || (f[0] = (q) => x(q))
|
|
586
586
|
}))
|
|
587
587
|
]),
|
|
588
|
-
m.value || s.initialValue ? (
|
|
589
|
-
(B = s.initialValue) != null && B.isOwner ? W("", !0) : (
|
|
588
|
+
m.value || s.initialValue ? (d(), j(ie, { key: 0 }, [
|
|
589
|
+
(B = s.initialValue) != null && B.isOwner ? W("", !0) : (d(), $(A, {
|
|
590
590
|
key: 0,
|
|
591
591
|
modelValue: h.value,
|
|
592
592
|
"onUpdate:modelValue": [
|
|
593
|
-
|
|
593
|
+
f[1] || (f[1] = (q) => h.value = q),
|
|
594
594
|
o
|
|
595
595
|
],
|
|
596
596
|
multiselect: "",
|
|
@@ -600,11 +600,11 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
600
600
|
label: n(y)("team.memberForm.permissionSet.title"),
|
|
601
601
|
placeholder: n(y)("team.memberForm.permissionSet.selectPlaceholder")
|
|
602
602
|
}, null, 8, ["modelValue", "items", "label", "placeholder"])),
|
|
603
|
-
(Y = s.initialValue) != null && Y.isOwner ? W("", !0) : (
|
|
603
|
+
(Y = s.initialValue) != null && Y.isOwner ? W("", !0) : (d(), $(Ye, {
|
|
604
604
|
key: 1,
|
|
605
|
-
modelValue:
|
|
606
|
-
"onUpdate:modelValue":
|
|
607
|
-
"inherit-permissions":
|
|
605
|
+
modelValue: g.value,
|
|
606
|
+
"onUpdate:modelValue": f[2] || (f[2] = (q) => g.value = q),
|
|
607
|
+
"inherit-permissions": v.value,
|
|
608
608
|
onPermissionChanged: F
|
|
609
609
|
}, null, 8, ["modelValue", "inherit-permissions"])),
|
|
610
610
|
i(Bt, {
|
|
@@ -612,12 +612,12 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
612
612
|
ref: a,
|
|
613
613
|
modelValue: c.value,
|
|
614
614
|
"onUpdate:modelValue": [
|
|
615
|
-
|
|
615
|
+
f[3] || (f[3] = (q) => c.value = q),
|
|
616
616
|
I
|
|
617
617
|
],
|
|
618
|
-
"fallback-name": ((
|
|
618
|
+
"fallback-name": ((se = s.initialValue) == null ? void 0 : se.name) || ((ne = m.value) == null ? void 0 : ne.displayName) || "",
|
|
619
619
|
"fallback-passcode": (H = (Z = s.initialValue) == null ? void 0 : Z.posUser) == null ? void 0 : H.passcode,
|
|
620
|
-
roles:
|
|
620
|
+
roles: oe.value,
|
|
621
621
|
restaurants: n(R)
|
|
622
622
|
}, null, 8, ["modelValue", "fallback-name", "fallback-passcode", "roles", "restaurants"])
|
|
623
623
|
], 64)) : W("", !0)
|
|
@@ -646,30 +646,30 @@ const at = { class: "w-full flex flex-col gap-16" }, lt = { class: "flex items-c
|
|
|
646
646
|
var X = /* @__PURE__ */ function(s) {
|
|
647
647
|
return s[s.ADD = 0] = "ADD", s[s.UPDATE = 1] = "UPDATE", s[s.CLOSED = 2] = "CLOSED", s;
|
|
648
648
|
}(X || {});
|
|
649
|
-
const ns = /* @__PURE__ */
|
|
649
|
+
const ns = /* @__PURE__ */ ae({
|
|
650
650
|
__name: "TeamMemberList",
|
|
651
651
|
setup(s, {
|
|
652
652
|
expose: u
|
|
653
653
|
}) {
|
|
654
654
|
const {
|
|
655
655
|
t: e
|
|
656
|
-
} = ue(), y = me(), m = De(), O = Ce(), P = Ke(O), h = Be(),
|
|
656
|
+
} = ue(), y = me(), m = De(), O = Ce(), P = Ke(O), h = Be(), v = Qe(), c = Ze(), g = V(!0), R = ({
|
|
657
657
|
member: t,
|
|
658
658
|
className: l = ""
|
|
659
659
|
}) => {
|
|
660
660
|
const k = {
|
|
661
661
|
label: e("common.update"),
|
|
662
662
|
onClick: () => F(re.Update, t)
|
|
663
|
-
},
|
|
663
|
+
}, te = {
|
|
664
664
|
label: e("common.remove"),
|
|
665
665
|
onClick: () => F(re.Remove, t),
|
|
666
666
|
itemClass: "text-fm-color-typo-error"
|
|
667
|
-
}, Q = t.doc.isOwner ? [k] : [k,
|
|
667
|
+
}, Q = t.doc.isOwner ? [k] : [k, te];
|
|
668
668
|
return i(st, {
|
|
669
669
|
class: l,
|
|
670
670
|
items: Q
|
|
671
671
|
}, null);
|
|
672
|
-
}, N = (t) => t.doc.isOwner ? e("team.labels.businessOwner") : t.restaurants.join(", "),
|
|
672
|
+
}, N = (t) => t.doc.isOwner ? e("team.labels.businessOwner") : t.restaurants.join(", "), le = [{
|
|
673
673
|
accessorKey: "name",
|
|
674
674
|
header: () => e("team.table.columns.name"),
|
|
675
675
|
enableSorting: !1
|
|
@@ -690,8 +690,8 @@ const ns = /* @__PURE__ */ se({
|
|
|
690
690
|
header: () => e("team.table.columns.assignedRoles"),
|
|
691
691
|
enableSorting: !1,
|
|
692
692
|
cell(t) {
|
|
693
|
-
const l = t.row.original, k =
|
|
694
|
-
return h.permissionSets.value.filter((E) =>
|
|
693
|
+
const l = t.row.original, k = v.getPermissionAssignmentByUserId(l.id), te = (k == null ? void 0 : k.permissionSetIds) || l.doc.permissionSetIds || [];
|
|
694
|
+
return h.permissionSets.value.filter((E) => te.includes(E.id)).map((E) => E.name).join(", ");
|
|
695
695
|
}
|
|
696
696
|
}, {
|
|
697
697
|
accessorKey: "permission",
|
|
@@ -699,7 +699,7 @@ const ns = /* @__PURE__ */ se({
|
|
|
699
699
|
enableSorting: !1,
|
|
700
700
|
cell(t) {
|
|
701
701
|
const l = t.row.original;
|
|
702
|
-
return
|
|
702
|
+
return oe(l);
|
|
703
703
|
},
|
|
704
704
|
meta: {
|
|
705
705
|
width: "200px"
|
|
@@ -719,7 +719,7 @@ const ns = /* @__PURE__ */ se({
|
|
|
719
719
|
},
|
|
720
720
|
enableSorting: !1
|
|
721
721
|
}];
|
|
722
|
-
function
|
|
722
|
+
function oe(t) {
|
|
723
723
|
if (t.doc.isOwner)
|
|
724
724
|
return e("team.labels.businessOwner");
|
|
725
725
|
const l = i(xe.FmTooltip, {
|
|
@@ -738,9 +738,9 @@ const ns = /* @__PURE__ */ se({
|
|
|
738
738
|
count: t.permissionLabels.length
|
|
739
739
|
})]), t.permissionLabels.length > 0 && l]);
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function x(t) {
|
|
742
742
|
var Q, E, w, he;
|
|
743
|
-
const l =
|
|
743
|
+
const l = v.getPermissionAssignmentByUserId(t.id), k = (l == null ? void 0 : l.customPermissions) || t.permissions || [], te = (l == null ? void 0 : l.permissionSetIds) || [];
|
|
744
744
|
return {
|
|
745
745
|
id: t.id,
|
|
746
746
|
isOwner: t.doc.isOwner,
|
|
@@ -748,7 +748,7 @@ const ns = /* @__PURE__ */ se({
|
|
|
748
748
|
phoneNumber: t.phoneNumber,
|
|
749
749
|
email: t.email,
|
|
750
750
|
permissions: k,
|
|
751
|
-
permissionSetIds:
|
|
751
|
+
permissionSetIds: te,
|
|
752
752
|
posUser: t.doc.posUser ? {
|
|
753
753
|
code: ((Q = t.doc.posUser) == null ? void 0 : Q.code) ?? "",
|
|
754
754
|
name: ((E = t.doc.posUser) == null ? void 0 : E.name) ?? t.name,
|
|
@@ -759,11 +759,11 @@ const ns = /* @__PURE__ */ se({
|
|
|
759
759
|
}
|
|
760
760
|
const F = (t, l) => {
|
|
761
761
|
if (t == re.Update) {
|
|
762
|
-
const k =
|
|
762
|
+
const k = x(l);
|
|
763
763
|
I.value = k, S.value = X.UPDATE;
|
|
764
764
|
}
|
|
765
765
|
t == re.Remove && G(l);
|
|
766
|
-
}, T = Ae(), S =
|
|
766
|
+
}, T = Ae(), S = V(X.CLOSED), a = C(() => S.value !== X.CLOSED), o = C(() => S.value === X.ADD ? e("common.add") : e("common.update")), U = C(() => S.value === X.ADD ? e("team.actions.addMember") : e("team.actions.updateMember")), I = V();
|
|
767
767
|
function z(t) {
|
|
768
768
|
t || (S.value = X.CLOSED);
|
|
769
769
|
}
|
|
@@ -790,45 +790,45 @@ const ns = /* @__PURE__ */ se({
|
|
|
790
790
|
}
|
|
791
791
|
}).onPrimary(async () => {
|
|
792
792
|
await P.minor(async () => {
|
|
793
|
-
await
|
|
793
|
+
await pe.deleteTeamMember(t.id), await Z();
|
|
794
794
|
}, {
|
|
795
795
|
successMessage: e("team.removeMember.successMessage", {
|
|
796
796
|
memberName: t.name
|
|
797
797
|
})
|
|
798
798
|
}), T.close();
|
|
799
799
|
});
|
|
800
|
-
},
|
|
800
|
+
}, p = () => {
|
|
801
801
|
I.value = null, S.value = X.ADD;
|
|
802
|
-
},
|
|
802
|
+
}, b = C(() => c.members), f = V(), A = V(), J = C(() => Object.values(je).map((t) => ({
|
|
803
803
|
label: t.label,
|
|
804
804
|
value: t.subject
|
|
805
805
|
}))), {
|
|
806
806
|
searchKey: B,
|
|
807
807
|
filter: Y
|
|
808
|
-
} = Re(""),
|
|
808
|
+
} = Re(""), se = C(() => b.value.filter((t) => {
|
|
809
809
|
var Q;
|
|
810
|
-
const l = !
|
|
811
|
-
return l &&
|
|
810
|
+
const l = !f.value || t.managableRestaurantIds.some((E) => f.value.includes(E)), k = ((Q = t.permissions) == null ? void 0 : Q.map((E) => E.subject).flat().filter(Boolean)) || [], te = !A.value || k.some((E) => A.value.includes(E));
|
|
811
|
+
return l && te && Y([t.name, t.phoneNumber, N(t)]);
|
|
812
812
|
}));
|
|
813
|
-
async function
|
|
813
|
+
async function ne() {
|
|
814
814
|
await m.readRoles();
|
|
815
815
|
}
|
|
816
816
|
async function Z() {
|
|
817
|
-
|
|
817
|
+
g.value = !0;
|
|
818
818
|
try {
|
|
819
819
|
await c.readTeamMembers();
|
|
820
820
|
} finally {
|
|
821
|
-
|
|
821
|
+
g.value = !1;
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
|
-
const H =
|
|
824
|
+
const H = V();
|
|
825
825
|
async function q() {
|
|
826
826
|
if (!H.value) return;
|
|
827
827
|
const t = await H.value.validate();
|
|
828
828
|
if (!t) return;
|
|
829
829
|
const l = S.value === X.ADD;
|
|
830
830
|
await P.minor(async () => {
|
|
831
|
-
await (l ?
|
|
831
|
+
await (l ? pe.createTeamMember(t) : pe.updateTeamMember(I.value.id, t)), K(), await ee(), await Z();
|
|
832
832
|
}, {
|
|
833
833
|
successMessage: l ? e("team.addMember.successMessage", {
|
|
834
834
|
memberName: t.name
|
|
@@ -837,24 +837,24 @@ const ns = /* @__PURE__ */ se({
|
|
|
837
837
|
})
|
|
838
838
|
}), S.value = X.CLOSED;
|
|
839
839
|
}
|
|
840
|
-
async function
|
|
840
|
+
async function ce() {
|
|
841
841
|
await h.readPermissionSets();
|
|
842
842
|
}
|
|
843
|
-
async function
|
|
844
|
-
await
|
|
843
|
+
async function ee() {
|
|
844
|
+
await v.readPermissionAssignments();
|
|
845
845
|
}
|
|
846
846
|
return Ie(y.currentBusiness, async () => {
|
|
847
847
|
var t;
|
|
848
|
-
(t = y.currentBusiness.value) != null && t._id && (await
|
|
848
|
+
(t = y.currentBusiness.value) != null && t._id && (await ce(), await ee(), Z(), ne());
|
|
849
849
|
}, {
|
|
850
850
|
immediate: !0
|
|
851
851
|
}), u({
|
|
852
|
-
create:
|
|
852
|
+
create: p
|
|
853
853
|
}), (t, l) => {
|
|
854
|
-
const k = _("FmSearch"),
|
|
855
|
-
return
|
|
856
|
-
modelValue:
|
|
857
|
-
"onUpdate:modelValue": l[0] || (l[0] = (w) =>
|
|
854
|
+
const k = _("FmSearch"), te = _("FmTable"), Q = _("FmButton"), E = _("FmSideSheet");
|
|
855
|
+
return d(), j(ie, null, [r("div", Et, [r("div", Lt, [r("div", jt, [r("div", Tt, [i(n(ge), {
|
|
856
|
+
modelValue: f.value,
|
|
857
|
+
"onUpdate:modelValue": l[0] || (l[0] = (w) => f.value = w),
|
|
858
858
|
"managable-only": !1,
|
|
859
859
|
multiple: "",
|
|
860
860
|
variant: "dark",
|
|
@@ -869,19 +869,19 @@ const ns = /* @__PURE__ */ se({
|
|
|
869
869
|
placeholder: n(e)("team.filter.permission_placeholder")
|
|
870
870
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), i(k, {
|
|
871
871
|
modelValue: n(B),
|
|
872
|
-
"onUpdate:modelValue": l[2] || (l[2] = (w) =>
|
|
872
|
+
"onUpdate:modelValue": l[2] || (l[2] = (w) => ye(B) ? B.value = w : null),
|
|
873
873
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
874
874
|
autofocus: "",
|
|
875
875
|
placeholder: n(e)("team.search.placeholder")
|
|
876
876
|
}, null, 8, ["modelValue", "placeholder"])]), r("div", zt, [i(k, {
|
|
877
877
|
modelValue: n(B),
|
|
878
|
-
"onUpdate:modelValue": l[3] || (l[3] = (w) =>
|
|
878
|
+
"onUpdate:modelValue": l[3] || (l[3] = (w) => ye(B) ? B.value = w : null),
|
|
879
879
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
880
880
|
autofocus: "",
|
|
881
881
|
placeholder: n(e)("team.search.placeholder")
|
|
882
882
|
}, null, 8, ["modelValue", "placeholder"]), r("div", Kt, [i(n(ge), {
|
|
883
|
-
modelValue:
|
|
884
|
-
"onUpdate:modelValue": l[4] || (l[4] = (w) =>
|
|
883
|
+
modelValue: f.value,
|
|
884
|
+
"onUpdate:modelValue": l[4] || (l[4] = (w) => f.value = w),
|
|
885
885
|
"managable-only": !1,
|
|
886
886
|
multiple: "",
|
|
887
887
|
variant: "dark",
|
|
@@ -894,18 +894,18 @@ const ns = /* @__PURE__ */ se({
|
|
|
894
894
|
items: J.value,
|
|
895
895
|
"selected-prefix": n(e)("team.filter.selected_permission_prefix"),
|
|
896
896
|
placeholder: n(e)("team.filter.permission_placeholder")
|
|
897
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]),
|
|
897
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), b.value.length === 0 && !g.value ? (d(), $(n(ze), {
|
|
898
898
|
key: 0,
|
|
899
899
|
title: n(e)("team.emptyState.title"),
|
|
900
900
|
subtitle: n(e)("team.emptyState.description")
|
|
901
|
-
}, null, 8, ["title", "subtitle"])) : (
|
|
901
|
+
}, null, 8, ["title", "subtitle"])) : (d(), $(Te, {
|
|
902
902
|
key: 1
|
|
903
903
|
}, {
|
|
904
|
-
default: L(() => [i(
|
|
905
|
-
"column-defs":
|
|
906
|
-
"row-data":
|
|
907
|
-
"page-size":
|
|
908
|
-
loading:
|
|
904
|
+
default: L(() => [i(te, {
|
|
905
|
+
"column-defs": le,
|
|
906
|
+
"row-data": se.value,
|
|
907
|
+
"page-size": se.value.length,
|
|
908
|
+
loading: g.value,
|
|
909
909
|
"pin-header-row": "",
|
|
910
910
|
"hide-footer": "",
|
|
911
911
|
onRowClick: l[6] || (l[6] = (w) => F(n(re).Update, w.original))
|