@feedmepos/mf-hrm-portal 2.2.1 → 2.2.2-dev
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/{ApprovalCodeList-BWQBJGCZ.js → ApprovalCodeList-B9O8QzzI.js} +5 -5
- package/dist/AuditLogList-CtFEXKWZ.js +1722 -0
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BDOdtKwI.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C9MYbxum.js} +2 -2
- package/dist/{EmployeeList-BZ6fxRCN.js → EmployeeList-BFxMwFJq.js} +71 -71
- package/dist/{GrantUserList-CaVpRVzA.js → GrantUserList-CZtmMRoS.js} +6 -6
- package/dist/{Main-CEKiyT80.js → Main-B622Z4q4.js} +11 -11
- package/dist/{Main-CQpEciKH.js → Main-DD6IthCS.js} +5 -5
- package/dist/{Main-DrfRLxA5.js → Main-on0TXkQt.js} +8 -8
- package/dist/{PermissionSetList-BgOSJy4y.js → PermissionSetList-FCX3TBoi.js} +77 -78
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-B2SX3ZoV.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cl_YNh0k.js} +832 -837
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-Z-DH7ouY.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-XHuHin8t.js} +1 -1
- package/dist/RoleList-p_9KHzqF.js +725 -0
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +16 -0
- package/dist/{TeamMemberList-BXk_pXjc.js → TeamMemberList-BAU7Y3jh.js} +313 -312
- package/dist/{TimesheetList-DgaZmgug.js → TimesheetList-DtFBWhma.js} +7 -7
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-B_Lc8Xmy.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-Tatn3jUv.js} +3 -3
- package/dist/{app-DzagkC6l.js → app-Bbf6hEPt.js} +1086 -781
- package/dist/app.js +1 -1
- package/dist/{approval-code-BRClD2HN.js → approval-code-jIjkeVEb.js} +1 -1
- package/dist/{dayjs.min-CqJsImsm.js → dayjs.min-BAnGg8q2.js} +1 -1
- package/dist/{employee-CXBuv0Bx.js → employee-DVSD3L51.js} +4 -4
- package/dist/{grant-user-Dhi3ilC_.js → grant-user-SNiDV22U.js} +1 -1
- package/dist/{iteration-BCfwR_XH.js → iteration-BTZViJtd.js} +1 -1
- package/dist/{lodash-BJl3phr9.js → lodash-Cgdk4_YL.js} +1 -1
- package/dist/{restaurant-DiYb0pCm.js → restaurant-BTpBmfBV.js} +2 -2
- package/dist/{role-BfCNRnuy.js → role-CXVpO6fB.js} +2 -2
- package/dist/{rule-B3Eg-J8O.js → rule-TR3MVo-b.js} +259 -279
- package/dist/src/api/audit-log/index.d.ts +6 -0
- package/dist/src/api/user/index.d.ts +2 -2
- package/dist/src/composables/useReportPermissions.d.ts +0 -1
- package/dist/src/helpers/rule.d.ts +0 -2
- package/dist/src/types/audit-log.d.ts +1 -1
- package/dist/src/types/role.d.ts +0 -1
- package/dist/src/views/audit-log/change-nodes.d.ts +14 -0
- package/dist/src/views/audit-log/event-line.d.ts +13 -0
- package/dist/src/views/audit-log/locales/index.d.ts +300 -0
- package/dist/src/views/audit-log/operation-status.d.ts +2 -0
- package/dist/src/views/audit-log/snapshot-diff.d.ts +11 -0
- package/dist/src/views/hr/locales/index.d.ts +0 -4
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-BGhlB1_1.js → useAppStore-DCwd8GWN.js} +1 -1
- package/dist/useDebounce-B8ZPVS5C.js +15 -0
- package/dist/{useLoading-CvgqVDbF.js → useLoading-CXzTpIVv.js} +1 -1
- package/dist/useReportPermissions-BpAFyO17.js +71 -0
- package/package.json +1 -1
- package/dist/AuditLogList-CymSyHag.js +0 -1149
- package/dist/RoleList-C2PrTc1f.js +0 -739
- package/dist/useDebounce-CWb5QR9G.js +0 -28
- package/dist/useReportPermissions-CXXq725N.js +0 -82
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as Pe, useCoreStore as
|
|
3
|
-
import { useSnackbar as He, useDialog as es, useBreakpoints as ss, components as
|
|
4
|
-
import { u as fs
|
|
5
|
-
import { _ as
|
|
6
|
-
import { b as
|
|
7
|
-
import { u as
|
|
8
|
-
import { _ as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { u as
|
|
14
|
-
import { u as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { defineComponent as Ie, resolveComponent as F, createElementBlock as N, openBlock as y, createElementVNode as u, createVNode as d, toDisplayString as k, unref as r, computed as I, ref as b, createCommentVNode as K, withCtx as ue, createBlock as z, watch as fe, Fragment as Ne, renderList as us, withKeys as qe, withModifiers as Ve, nextTick as ms, onUnmounted as ds, h as cs, createTextVNode as ps } from "vue";
|
|
2
|
+
import { useI18n as Pe, useCoreStore as Ae, baseClientInstance as Ke } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as He, useDialog as es, useBreakpoints as ss, components as je } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as fs } from "./useDebounce-B8ZPVS5C.js";
|
|
5
|
+
import { _ as vs, S as ye } from "./SelectFilter-ATOm0hdn.js";
|
|
6
|
+
import { b as ze, m as bs, d as hs, _ as ys, a as _s } from "./app-Bbf6hEPt.js";
|
|
7
|
+
import { u as gs, _ as xs } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
|
+
import { _ as Us } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
9
|
+
import { _ as Ss } from "./Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js";
|
|
10
|
+
import { u as Fs } from "./useLoading-CXzTpIVv.js";
|
|
11
|
+
import { l as Se } from "./lodash-Cgdk4_YL.js";
|
|
12
|
+
import { c as he } from "./iteration-BTZViJtd.js";
|
|
13
|
+
import { u as ts, c as Le, d as Ge, m as Me, i as as, p as We, j as Vs, k as Je, l as Xe, n as ws, o as Is, q as Ps, v as ks, w as Rs, t as Fe } from "./rule-TR3MVo-b.js";
|
|
14
|
+
import { u as ls } from "./role-CXVpO6fB.js";
|
|
15
|
+
import { u as os, i as $s } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-XHuHin8t.js";
|
|
16
|
+
import { g as Ze, u as rs } from "./restaurant-BTpBmfBV.js";
|
|
17
|
+
import { _ as Cs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cl_YNh0k.js";
|
|
18
|
+
var ge = /* @__PURE__ */ ((i) => (i.Update = "Update", i.Remove = "Remove", i))(ge || {});
|
|
19
|
+
const we = "__unassigned__";
|
|
20
|
+
function Qe(i) {
|
|
21
|
+
if (!(i != null && i.length) || i[0] === we) return i;
|
|
22
|
+
const R = i.filter((n) => n !== we);
|
|
23
|
+
return R.length === i.length ? i : [we, ...R];
|
|
23
24
|
}
|
|
24
|
-
const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-center gap-16" }, As = { class: "space-y-4 min-w-0 flex-1" }, Es = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "w-full flex gap-16 items-center" }, Bs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, js = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ls = { class: "fm-typo-en-body-lg-600 truncate" }, Ts = { class: "flex-1 flex flex-col gap-4 min-w-0" }, qs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ks = { class: "fm-typo-en-body-lg-600 truncate" }, zs = /* @__PURE__ */
|
|
25
|
+
const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-center gap-16" }, As = { class: "space-y-4 min-w-0 flex-1" }, Es = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "w-full flex gap-16 items-center" }, Bs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, js = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ls = { class: "fm-typo-en-body-lg-600 truncate" }, Ts = { class: "flex-1 flex flex-col gap-4 min-w-0" }, qs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ks = { class: "fm-typo-en-body-lg-600 truncate" }, zs = /* @__PURE__ */ Ie({
|
|
25
26
|
__name: "MemberInfo",
|
|
26
27
|
props: {
|
|
27
28
|
data: {}
|
|
28
29
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const { t:
|
|
31
|
-
return (
|
|
30
|
+
setup(i) {
|
|
31
|
+
const { t: R } = Pe();
|
|
32
|
+
return (n, a) => {
|
|
32
33
|
const f = F("FmAvatar");
|
|
33
|
-
return y(),
|
|
34
|
-
|
|
34
|
+
return y(), N("div", Ms, [
|
|
35
|
+
u("div", Ns, [
|
|
35
36
|
d(f, {
|
|
36
37
|
size: "xl",
|
|
37
|
-
name:
|
|
38
|
+
name: i.data.name
|
|
38
39
|
}, null, 8, ["name"]),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
u("div", As, [
|
|
41
|
+
u("p", Es, k(r(R)("team.memberForm.memberInfo.memberName")), 1),
|
|
42
|
+
u("p", Ds, k(i.data.name || "--"), 1)
|
|
42
43
|
])
|
|
43
44
|
]),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
u("div", Os, [
|
|
46
|
+
u("div", Bs, [
|
|
47
|
+
u("p", js, k(r(R)("team.memberForm.memberInfo.mobileNumber")), 1),
|
|
48
|
+
u("p", Ls, k(i.data.phoneNumber || "--"), 1)
|
|
48
49
|
]),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
u("div", Ts, [
|
|
51
|
+
u("p", qs, k(r(R)("team.memberForm.memberInfo.emailAddress")), 1),
|
|
52
|
+
u("p", Ks, k(i.data.email || "--"), 1)
|
|
52
53
|
])
|
|
53
54
|
])
|
|
54
55
|
]);
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
|
-
}),
|
|
58
|
-
async readPermissionUserByPhoneNo(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
)
|
|
58
|
+
}), Ye = {
|
|
59
|
+
async readPermissionUserByPhoneNo(i) {
|
|
60
|
+
var n;
|
|
61
|
+
const { currentBusiness: R } = Ae();
|
|
62
|
+
return Ze(
|
|
63
|
+
await Ke("/").get(`/user/b/${(n = R.value) == null ? void 0 : n._id}/phone/${i}`)
|
|
63
64
|
);
|
|
64
65
|
},
|
|
65
|
-
async readPermissionUserByEmail(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)
|
|
66
|
+
async readPermissionUserByEmail(i) {
|
|
67
|
+
var n;
|
|
68
|
+
const { currentBusiness: R } = Ae();
|
|
69
|
+
return Ze(
|
|
70
|
+
await Ke("/").get(`/user/b/${(n = R.value) == null ? void 0 : n._id}/email/${i}`)
|
|
70
71
|
);
|
|
71
72
|
}
|
|
72
73
|
}, Gs = { class: "flex flex-col gap-24 w-full" }, Ws = {
|
|
73
74
|
key: 0,
|
|
74
75
|
class: "flex flex-col gap-8"
|
|
75
|
-
}, Js = { class: "user-info-icon user-info-icon--lg" }, Xs = { class: "flex-1 overflow-hidden" }, Zs = { class: "profile-displayName" }, Qs = { class: "profile-email" }, Ys = { class: "profile-phone" }, Hs = { key: 2 }, et = /* @__PURE__ */
|
|
76
|
+
}, Js = { class: "user-info-icon user-info-icon--lg" }, Xs = { class: "flex-1 overflow-hidden" }, Zs = { class: "profile-displayName" }, Qs = { class: "profile-email" }, Ys = { class: "profile-phone" }, Hs = { key: 2 }, et = /* @__PURE__ */ Ie({
|
|
76
77
|
__name: "PortalUserSearcher",
|
|
77
78
|
emits: ["invite"],
|
|
78
|
-
setup(
|
|
79
|
-
const
|
|
79
|
+
setup(i, { emit: R }) {
|
|
80
|
+
const n = R, { t: a } = Pe(), f = He(), A = Ae(), { supportedCountries: V, ready: $ } = os(), se = I(() => {
|
|
80
81
|
var l;
|
|
81
|
-
const o = (l =
|
|
82
|
+
const o = (l = A.currentCountry.value) == null ? void 0 : l.toUpperCase();
|
|
82
83
|
return o && $s(o) ? o : void 0;
|
|
83
|
-
}), g = b("phone"), S = b(""), p = b(""), h = b(), me = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, j =
|
|
84
|
+
}), g = b("phone"), S = b(""), p = b(""), h = b(), me = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, j = I(() => me.test(p.value.trim()));
|
|
84
85
|
async function L() {
|
|
85
86
|
const o = g.value === "phone" ? S.value.replace(/ /g, "") : p.value.trim();
|
|
86
87
|
if (!o) {
|
|
@@ -104,7 +105,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
104
105
|
});
|
|
105
106
|
};
|
|
106
107
|
try {
|
|
107
|
-
const v = g.value === "phone" ? await
|
|
108
|
+
const v = g.value === "phone" ? await Ye.readPermissionUserByPhoneNo(o) : await Ye.readPermissionUserByEmail(o);
|
|
108
109
|
if (!v) {
|
|
109
110
|
l();
|
|
110
111
|
return;
|
|
@@ -117,37 +118,37 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
const
|
|
121
|
-
var
|
|
122
|
-
let o = ((
|
|
121
|
+
const C = I(() => {
|
|
122
|
+
var x;
|
|
123
|
+
let o = ((x = h.value) == null ? void 0 : x.displayName) ?? "";
|
|
123
124
|
o || (o = "Feed Me");
|
|
124
125
|
const [l, v] = o.split(" ");
|
|
125
126
|
return v ? `${l[0]}${v[0]}` : l.slice(0, 2);
|
|
126
|
-
}),
|
|
127
|
+
}), E = b(!1);
|
|
127
128
|
function W(o) {
|
|
128
|
-
|
|
129
|
+
n("invite", o), E.value = !0;
|
|
129
130
|
}
|
|
130
131
|
function te() {
|
|
131
|
-
|
|
132
|
+
E.value = !1;
|
|
132
133
|
}
|
|
133
134
|
return (o, l) => {
|
|
134
135
|
var B, m, _;
|
|
135
|
-
const v = F("FmRadio"),
|
|
136
|
-
return y(),
|
|
137
|
-
|
|
136
|
+
const v = F("FmRadio"), x = F("FmPhoneNumber"), J = F("FmCircularProgress"), X = F("FmTextField"), O = F("FmRadioGroup"), D = F("FmButton");
|
|
137
|
+
return y(), N("div", Gs, [
|
|
138
|
+
E.value ? K("", !0) : (y(), N("div", Ws, [
|
|
138
139
|
d(O, {
|
|
139
140
|
modelValue: g.value,
|
|
140
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
141
|
+
"onUpdate:modelValue": l[2] || (l[2] = (w) => g.value = w)
|
|
141
142
|
}, {
|
|
142
143
|
default: ue(() => [
|
|
143
144
|
d(v, {
|
|
144
145
|
value: "phone",
|
|
145
146
|
label: r(a)("team.memberForm.searchUser.phoneNumber")
|
|
146
147
|
}, null, 8, ["label"]),
|
|
147
|
-
g.value === "phone" && r(
|
|
148
|
+
g.value === "phone" && r($) ? (y(), z(x, {
|
|
148
149
|
key: 0,
|
|
149
150
|
modelValue: S.value,
|
|
150
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
151
|
+
"onUpdate:modelValue": l[0] || (l[0] = (w) => S.value = w),
|
|
151
152
|
"default-country": se.value,
|
|
152
153
|
"extra-country-codes": r(V),
|
|
153
154
|
class: "ml-8"
|
|
@@ -162,36 +163,36 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
162
163
|
g.value === "email" ? (y(), z(X, {
|
|
163
164
|
key: 2,
|
|
164
165
|
modelValue: p.value,
|
|
165
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
166
|
+
"onUpdate:modelValue": l[1] || (l[1] = (w) => p.value = w),
|
|
166
167
|
placeholder: r(a)("team.memberForm.searchUser.emailPlaceholder"),
|
|
167
168
|
rules: [
|
|
168
|
-
(
|
|
169
|
+
(w) => !w || j.value || r(a)("team.memberForm.searchUser.invalidEmail")
|
|
169
170
|
],
|
|
170
171
|
class: "ml-8"
|
|
171
172
|
}, null, 8, ["modelValue", "placeholder", "rules"])) : K("", !0)
|
|
172
173
|
]),
|
|
173
174
|
_: 1
|
|
174
175
|
}, 8, ["modelValue"]),
|
|
175
|
-
d(
|
|
176
|
+
d(D, {
|
|
176
177
|
label: r(a)("team.memberForm.searchUser.search"),
|
|
177
178
|
variant: "secondary",
|
|
178
179
|
onClick: L
|
|
179
180
|
}, null, 8, ["label"])
|
|
180
181
|
])),
|
|
181
|
-
h.value ? (y(),
|
|
182
|
+
h.value ? (y(), N("div", {
|
|
182
183
|
key: 1,
|
|
183
184
|
class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
|
|
184
|
-
onClick: l[3] || (l[3] = (
|
|
185
|
+
onClick: l[3] || (l[3] = (w) => W(h.value))
|
|
185
186
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
u("div", Js, k(C.value), 1),
|
|
188
|
+
u("div", Xs, [
|
|
189
|
+
u("p", Zs, k((B = h.value) == null ? void 0 : B.displayName), 1),
|
|
190
|
+
u("p", Qs, k((m = h.value) == null ? void 0 : m.email), 1),
|
|
191
|
+
u("p", Ys, k((_ = h.value) == null ? void 0 : _.phoneNumber), 1)
|
|
191
192
|
])
|
|
192
193
|
])) : K("", !0),
|
|
193
|
-
|
|
194
|
-
d(
|
|
194
|
+
E.value ? (y(), N("div", Hs, [
|
|
195
|
+
d(D, {
|
|
195
196
|
label: r(a)("team.memberForm.searchUser.changeUser"),
|
|
196
197
|
variant: "secondary",
|
|
197
198
|
onClick: te
|
|
@@ -200,7 +201,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
200
201
|
]);
|
|
201
202
|
};
|
|
202
203
|
}
|
|
203
|
-
}), st = /* @__PURE__ */
|
|
204
|
+
}), st = /* @__PURE__ */ vs(et, [["__scopeId", "data-v-827dfd60"]]), tt = { class: "flex flex-col gap-40" }, at = { class: "flex items-center" }, lt = { class: "flex-1 flex flex-col" }, ot = { class: "fm-typo-en-title-sm-600" }, rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nt = { class: "flex flex-row gap-16" }, it = { class: "flex flex-col gap-8" }, ut = { class: "fm-typo-en-body-lg-400" }, mt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, dt = { class: "fm-typo-en-title-sm-600" }, ct = { class: "space-y-16" }, pt = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ft = { class: "text-sm font-semibold text-fm-color-typo-primary" }, vt = { class: "text-sm font-semibold text-fm-color-typo-primary" }, bt = { class: "flex justify-self-end" }, ht = ["aria-label", "onClick", "onKeydown"], Te = 4, yt = /* @__PURE__ */ Ie({
|
|
204
205
|
__name: "TeamMemberMasterUser",
|
|
205
206
|
props: {
|
|
206
207
|
modelValue: {
|
|
@@ -225,156 +226,156 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
225
226
|
}
|
|
226
227
|
},
|
|
227
228
|
emits: ["update:model-value"],
|
|
228
|
-
setup(
|
|
229
|
-
const
|
|
230
|
-
function
|
|
229
|
+
setup(i, { emit: R }) {
|
|
230
|
+
const n = i, a = R, { t: f } = Pe(), A = b(!0), V = b([]);
|
|
231
|
+
function $() {
|
|
231
232
|
return { restaurantId: "", roleId: "" };
|
|
232
233
|
}
|
|
233
|
-
const se =
|
|
234
|
+
const se = I(
|
|
234
235
|
() => {
|
|
235
236
|
var o;
|
|
236
|
-
return ((o =
|
|
237
|
+
return ((o = n.modelValue) == null ? void 0 : o.roles.map((l) => l.restaurantId).filter(Boolean)) ?? [];
|
|
237
238
|
}
|
|
238
239
|
);
|
|
239
240
|
function g(o) {
|
|
240
|
-
o ?
|
|
241
|
+
o ? n.modelValue || a("update:model-value", {
|
|
241
242
|
code: "",
|
|
242
|
-
name:
|
|
243
|
-
roles: [
|
|
244
|
-
passcode:
|
|
243
|
+
name: n.fallbackName,
|
|
244
|
+
roles: [$()],
|
|
245
|
+
passcode: n.fallbackPasscode || ""
|
|
245
246
|
}) : a("update:model-value", null);
|
|
246
247
|
}
|
|
247
248
|
function S(o, l) {
|
|
248
|
-
if (!
|
|
249
|
-
const v = he(
|
|
249
|
+
if (!n.modelValue || o === "passcode" && n.modelValue.passcode === l) return;
|
|
250
|
+
const v = he(n.modelValue);
|
|
250
251
|
v[o] = l, a("update:model-value", v);
|
|
251
252
|
}
|
|
252
253
|
function p(o = "") {
|
|
253
|
-
return
|
|
254
|
+
return n.restaurants.filter((l) => l.managable || l._id === o).map((l) => ({
|
|
254
255
|
label: `${l.profile.code ? `${l.profile.code} - ` : ""}${l.profile.name}`,
|
|
255
256
|
value: l._id,
|
|
256
257
|
disabled: se.value.includes(l._id) && l._id !== o
|
|
257
258
|
}));
|
|
258
259
|
}
|
|
259
260
|
function h(o = "") {
|
|
260
|
-
return
|
|
261
|
+
return n.roles.map((l) => ({
|
|
261
262
|
label: l.label,
|
|
262
263
|
value: l.value,
|
|
263
264
|
disabled: !!l.disabled && l.value !== o
|
|
264
265
|
}));
|
|
265
266
|
}
|
|
266
267
|
function me(o, l) {
|
|
267
|
-
var O,
|
|
268
|
-
if (!
|
|
269
|
-
const v =
|
|
268
|
+
var O, D, B;
|
|
269
|
+
if (!n.modelValue) return;
|
|
270
|
+
const v = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [$()], x = ((O = v[o]) == null ? void 0 : O.roleId) ?? "", J = h(x), X = ((D = J.find((m) => m.value === x && !m.disabled)) == null ? void 0 : D.value) ?? ((B = J.find((m) => !m.disabled)) == null ? void 0 : B.value) ?? "";
|
|
270
271
|
v[o] = { restaurantId: l, roleId: X }, S("roles", v);
|
|
271
272
|
}
|
|
272
273
|
function j(o, l) {
|
|
273
|
-
var
|
|
274
|
-
if (!
|
|
275
|
-
const v =
|
|
274
|
+
var x;
|
|
275
|
+
if (!n.modelValue) return;
|
|
276
|
+
const v = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [$()];
|
|
276
277
|
v[o] = {
|
|
277
|
-
restaurantId: ((
|
|
278
|
+
restaurantId: ((x = v[o]) == null ? void 0 : x.restaurantId) ?? "",
|
|
278
279
|
roleId: l
|
|
279
280
|
}, S("roles", v);
|
|
280
281
|
}
|
|
281
282
|
function L() {
|
|
282
|
-
|
|
283
|
+
n.modelValue && S("roles", [...n.modelValue.roles, $()]);
|
|
283
284
|
}
|
|
284
|
-
function
|
|
285
|
-
if (!
|
|
286
|
-
const l =
|
|
285
|
+
function C(o) {
|
|
286
|
+
if (!n.modelValue) return;
|
|
287
|
+
const l = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [$()];
|
|
287
288
|
S(
|
|
288
289
|
"roles",
|
|
289
|
-
l.length === 1 ? [
|
|
290
|
+
l.length === 1 ? [$()] : l.filter((v, x) => x !== o)
|
|
290
291
|
);
|
|
291
292
|
}
|
|
292
|
-
const
|
|
293
|
-
if (!
|
|
294
|
-
const o =
|
|
293
|
+
const E = I(() => {
|
|
294
|
+
if (!n.modelValue) return !1;
|
|
295
|
+
const o = n.restaurants.some(
|
|
295
296
|
(v) => v.managable && !se.value.includes(v._id)
|
|
296
|
-
), l =
|
|
297
|
+
), l = n.modelValue.roles.every(
|
|
297
298
|
(v) => v.restaurantId && v.roleId
|
|
298
299
|
);
|
|
299
300
|
return o && l;
|
|
300
301
|
});
|
|
301
302
|
function W() {
|
|
302
|
-
|
|
303
|
+
A.value && (A.value = !1, V.value = [], S("passcode", ""));
|
|
303
304
|
}
|
|
304
305
|
fe(
|
|
305
306
|
() => {
|
|
306
307
|
var o;
|
|
307
|
-
return (o =
|
|
308
|
+
return (o = n.modelValue) == null ? void 0 : o.passcode;
|
|
308
309
|
},
|
|
309
310
|
(o) => {
|
|
310
|
-
o && o.length ===
|
|
311
|
+
o && o.length === Te ? (V.value = o.split(""), A.value = !0) : (V.value = [], A.value = !1);
|
|
311
312
|
},
|
|
312
313
|
{ immediate: !0 }
|
|
313
314
|
), fe(
|
|
314
315
|
() => {
|
|
315
316
|
var o;
|
|
316
|
-
return (o =
|
|
317
|
+
return (o = n.modelValue) == null ? void 0 : o.roles;
|
|
317
318
|
},
|
|
318
319
|
(o) => {
|
|
319
|
-
|
|
320
|
+
n.modelValue && (!o || o.length === 0) && S("roles", [$()]);
|
|
320
321
|
},
|
|
321
322
|
{ immediate: !0, deep: !0 }
|
|
322
323
|
);
|
|
323
|
-
const te =
|
|
324
|
+
const te = I({
|
|
324
325
|
get: () => {
|
|
325
326
|
var o;
|
|
326
|
-
return ((o =
|
|
327
|
+
return ((o = n.modelValue) == null ? void 0 : o.roles) ?? [];
|
|
327
328
|
},
|
|
328
329
|
set: () => {
|
|
329
330
|
}
|
|
330
331
|
});
|
|
331
332
|
return (o, l) => {
|
|
332
|
-
const v = F("FmSwitch"),
|
|
333
|
-
return y(),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
const v = F("FmSwitch"), x = F("FmTextField"), J = F("FmPinField"), X = F("FmFormGroup"), O = F("FmSelect"), D = F("FmIcon"), B = F("FmButton");
|
|
334
|
+
return y(), N("div", tt, [
|
|
335
|
+
u("div", at, [
|
|
336
|
+
u("div", lt, [
|
|
337
|
+
u("div", ot, k(r(f)("team.memberForm.masterUser.title")), 1),
|
|
338
|
+
u("div", rt, k(r(f)("team.memberForm.masterUser.sublabel")), 1)
|
|
338
339
|
]),
|
|
339
|
-
|
|
340
|
+
u("div", null, [
|
|
340
341
|
d(v, {
|
|
341
|
-
"model-value": !!
|
|
342
|
+
"model-value": !!i.modelValue,
|
|
342
343
|
value: "master-user",
|
|
343
344
|
"onUpdate:modelValue": g
|
|
344
345
|
}, null, 8, ["model-value"])
|
|
345
346
|
])
|
|
346
347
|
]),
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
d(
|
|
350
|
-
"model-value":
|
|
348
|
+
i.modelValue ? (y(), N(Ne, { key: 0 }, [
|
|
349
|
+
u("div", nt, [
|
|
350
|
+
d(x, {
|
|
351
|
+
"model-value": i.modelValue.code,
|
|
351
352
|
label: r(f)("team.memberForm.masterUser.code"),
|
|
352
353
|
"onUpdate:modelValue": l[0] || (l[0] = (m) => S("code", m))
|
|
353
354
|
}, null, 8, ["model-value", "label"]),
|
|
354
|
-
d(
|
|
355
|
-
"model-value":
|
|
355
|
+
d(x, {
|
|
356
|
+
"model-value": i.modelValue.name,
|
|
356
357
|
class: "w-full",
|
|
357
358
|
label: r(f)("team.memberForm.masterUser.name"),
|
|
358
359
|
rules: [(m) => !!m || r(f)("team.memberForm.masterUser.nameEmptyError")],
|
|
359
360
|
"onUpdate:modelValue": l[1] || (l[1] = (m) => S("name", m))
|
|
360
361
|
}, null, 8, ["model-value", "label", "rules"])
|
|
361
362
|
]),
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
u("div", it, [
|
|
364
|
+
u("div", ut, k(r(f)("team.memberForm.masterUser.passcode")), 1),
|
|
364
365
|
d(X, {
|
|
365
366
|
modelValue: V.value,
|
|
366
367
|
"onUpdate:modelValue": l[4] || (l[4] = (m) => V.value = m),
|
|
367
368
|
rules: [
|
|
368
|
-
(m) => (m == null ? void 0 : m.filter((_) => !!_).length) !==
|
|
369
|
+
(m) => (m == null ? void 0 : m.filter((_) => !!_).length) !== Te ? r(f)("team.memberForm.masterUser.passcodeRequired") : !0
|
|
369
370
|
]
|
|
370
371
|
}, {
|
|
371
372
|
default: ue(() => [
|
|
372
373
|
(y(), z(J, {
|
|
373
|
-
key: `pin-field-${
|
|
374
|
+
key: `pin-field-${A.value}`,
|
|
374
375
|
modelValue: V.value,
|
|
375
376
|
"onUpdate:modelValue": l[2] || (l[2] = (m) => V.value = m),
|
|
376
|
-
length:
|
|
377
|
-
masked:
|
|
377
|
+
length: Te,
|
|
378
|
+
masked: A.value,
|
|
378
379
|
onComplete: l[3] || (l[3] = (m) => S("passcode", m)),
|
|
379
380
|
onFocus: W
|
|
380
381
|
}, null, 8, ["modelValue", "masked"]))
|
|
@@ -391,15 +392,15 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
391
392
|
]
|
|
392
393
|
}, {
|
|
393
394
|
default: ue(() => [
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
l[6] || (l[6] =
|
|
395
|
+
u("div", mt, [
|
|
396
|
+
u("div", dt, k(r(f)("team.memberForm.masterUser.assignmentSection")), 1),
|
|
397
|
+
u("div", ct, [
|
|
398
|
+
u("div", pt, [
|
|
399
|
+
u("div", ft, k(r(f)("team.table.columns.restaurant")), 1),
|
|
400
|
+
u("div", vt, k(r(f)("team.memberForm.masterUser.role")), 1),
|
|
401
|
+
l[6] || (l[6] = u("div", null, null, -1))
|
|
401
402
|
]),
|
|
402
|
-
(y(!0),
|
|
403
|
+
(y(!0), N(Ne, null, us(i.modelValue.roles, (m, _) => (y(), N("div", {
|
|
403
404
|
key: `${m.restaurantId || "new"}-${_}`,
|
|
404
405
|
class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
|
|
405
406
|
}, [
|
|
@@ -409,7 +410,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
409
410
|
items: p(m.restaurantId),
|
|
410
411
|
multiselect: !1,
|
|
411
412
|
placeholder: r(f)("team.table.columns.restaurant"),
|
|
412
|
-
"onUpdate:modelValue": (
|
|
413
|
+
"onUpdate:modelValue": (w) => me(_, w)
|
|
413
414
|
}, null, 8, ["model-value", "items", "placeholder", "onUpdate:modelValue"]),
|
|
414
415
|
d(O, {
|
|
415
416
|
class: "min-w-0",
|
|
@@ -418,22 +419,22 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
418
419
|
multiselect: !1,
|
|
419
420
|
placeholder: r(f)("team.memberForm.masterUser.role"),
|
|
420
421
|
disabled: !m.restaurantId,
|
|
421
|
-
"onUpdate:modelValue": (
|
|
422
|
+
"onUpdate:modelValue": (w) => j(_, w)
|
|
422
423
|
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
423
|
-
|
|
424
|
-
|
|
424
|
+
u("div", bt, [
|
|
425
|
+
i.modelValue.roles.length > 1 ? (y(), N("div", {
|
|
425
426
|
key: 0,
|
|
426
427
|
role: "button",
|
|
427
428
|
tabindex: "0",
|
|
428
429
|
class: "inline-flex h-40 w-40 shrink-0 cursor-pointer items-center justify-center rounded-lg text-fm-color-neutral-gray-400 transition-colors hover:bg-fm-color-neutral-gray-100 focus:outline-none focus:ring-2 focus:ring-fm-color-primary",
|
|
429
430
|
"aria-label": r(f)("common.remove"),
|
|
430
|
-
onClick: Ve((
|
|
431
|
+
onClick: Ve((w) => C(_), ["stop"]),
|
|
431
432
|
onKeydown: [
|
|
432
|
-
|
|
433
|
-
|
|
433
|
+
qe(Ve((w) => C(_), ["prevent", "stop"]), ["enter"]),
|
|
434
|
+
qe(Ve((w) => C(_), ["prevent", "stop"]), ["space"])
|
|
434
435
|
]
|
|
435
436
|
}, [
|
|
436
|
-
d(
|
|
437
|
+
d(D, {
|
|
437
438
|
name: "delete",
|
|
438
439
|
size: "md"
|
|
439
440
|
})
|
|
@@ -449,7 +450,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
449
450
|
"prepend-icon": "add",
|
|
450
451
|
label: r(f)("team.memberForm.masterUser.addAnother"),
|
|
451
452
|
size: "md",
|
|
452
|
-
disabled: !
|
|
453
|
+
disabled: !E.value,
|
|
453
454
|
onClick: Ve(L, ["stop"])
|
|
454
455
|
}, null, 8, ["label", "disabled"])
|
|
455
456
|
])
|
|
@@ -460,13 +461,13 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
460
461
|
]);
|
|
461
462
|
};
|
|
462
463
|
}
|
|
463
|
-
}), _t = { class: "flex flex-col gap-32" }, gt = { class: "flex w-full" },
|
|
464
|
+
}), _t = { class: "flex flex-col gap-32" }, gt = { class: "flex w-full" }, xt = {
|
|
464
465
|
key: 0,
|
|
465
466
|
class: "space-y-24"
|
|
466
|
-
},
|
|
467
|
+
}, Ut = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, St = { class: "fm-typo-en-title-sm-600" }, Ft = { class: "space-y-16" }, Vt = { class: "fm-typo-en-title-sm-600" }, wt = {
|
|
467
468
|
key: 1,
|
|
468
469
|
class: "flex items-center justify-center py-64"
|
|
469
|
-
},
|
|
470
|
+
}, It = /* @__PURE__ */ Ie({
|
|
470
471
|
__name: "AddMemberForm",
|
|
471
472
|
props: {
|
|
472
473
|
initialValue: {
|
|
@@ -481,37 +482,37 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
481
482
|
default: !1
|
|
482
483
|
}
|
|
483
484
|
},
|
|
484
|
-
setup(
|
|
485
|
+
setup(i, { expose: R }) {
|
|
485
486
|
var Re, le, Z;
|
|
486
|
-
const
|
|
487
|
-
() =>
|
|
487
|
+
const n = i, { t: a } = Pe(), f = es(), { breakpoints: A } = ss(), V = b(), $ = ts(), se = I(
|
|
488
|
+
() => $.permissionSets.value.map((s) => ({
|
|
488
489
|
label: s.name,
|
|
489
490
|
value: s.id
|
|
490
491
|
}))
|
|
491
|
-
), g = b(((Re =
|
|
492
|
-
() =>
|
|
493
|
-
), p = b((le =
|
|
494
|
-
|
|
492
|
+
), g = b(((Re = n.initialValue) == null ? void 0 : Re.permissionSetIds) || []), S = I(
|
|
493
|
+
() => Le(g.value, $.permissionSets.value)
|
|
494
|
+
), p = b((le = n.initialValue) == null ? void 0 : le.posUser), h = b(
|
|
495
|
+
Ge(
|
|
495
496
|
Me(S.value),
|
|
496
|
-
((Z =
|
|
497
|
+
((Z = n.initialValue) == null ? void 0 : Z.permissions) || []
|
|
497
498
|
)
|
|
498
499
|
), { customReportPermissions: me, isLoaded: j } = as(), L = new Set(
|
|
499
|
-
|
|
500
|
-
),
|
|
500
|
+
We.filter((s) => s.subject.startsWith(Vs)).map((s) => s.subject)
|
|
501
|
+
), C = I(() => {
|
|
501
502
|
const s = new Set(L);
|
|
502
503
|
for (const c of me.value) s.add(c.subject);
|
|
503
504
|
return s;
|
|
504
|
-
}),
|
|
505
|
+
}), E = I(() => {
|
|
505
506
|
const s = /* @__PURE__ */ new Set();
|
|
506
|
-
for (const c of
|
|
507
|
-
c.category ===
|
|
507
|
+
for (const c of We)
|
|
508
|
+
c.category === ze.reports && s.add(c.subject);
|
|
508
509
|
for (const c of me.value)
|
|
509
|
-
c.category ===
|
|
510
|
+
c.category === ze.reports && s.add(c.subject);
|
|
510
511
|
return s;
|
|
511
|
-
}), W = rs(), te = ls().roles, o =
|
|
512
|
-
const s =
|
|
512
|
+
}), W = rs(), te = ls().roles, o = I(() => Je(h.value)), l = I(() => {
|
|
513
|
+
const s = Xe(h.value);
|
|
513
514
|
return s === null ? W.restaurants.value : W.restaurants.value.filter((c) => s.includes(c._id));
|
|
514
|
-
}), v =
|
|
515
|
+
}), v = I(() => {
|
|
515
516
|
const s = o.value;
|
|
516
517
|
return te.value.map(
|
|
517
518
|
(c) => ({
|
|
@@ -520,34 +521,34 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
520
521
|
disabled: !!s && !s.includes(c._id)
|
|
521
522
|
})
|
|
522
523
|
);
|
|
523
|
-
}),
|
|
524
|
+
}), x = b({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
|
|
524
525
|
function J(s) {
|
|
525
|
-
V.value = void 0, g.value = [...(s == null ? void 0 : s.permissionSetIds) ?? []], h.value =
|
|
526
|
+
V.value = void 0, g.value = [...(s == null ? void 0 : s.permissionSetIds) ?? []], h.value = Ge(
|
|
526
527
|
Me(
|
|
527
|
-
|
|
528
|
+
Le(
|
|
528
529
|
g.value,
|
|
529
|
-
|
|
530
|
+
$.permissionSets.value
|
|
530
531
|
)
|
|
531
532
|
),
|
|
532
533
|
(s == null ? void 0 : s.permissions) || []
|
|
533
|
-
), p.value = s != null && s.posUser ? ve(he(s.posUser), h.value) : void 0, be.value = !!p.value,
|
|
534
|
+
), p.value = s != null && s.posUser ? ve(he(s.posUser), h.value) : void 0, be.value = !!p.value, x.value = {
|
|
534
535
|
permissionSetIds: [...g.value],
|
|
535
536
|
userPermissions: he(h.value),
|
|
536
537
|
posUser: p.value ? he(p.value) : void 0
|
|
537
538
|
};
|
|
538
539
|
}
|
|
539
540
|
function X() {
|
|
540
|
-
return !
|
|
541
|
+
return !n.initialValue && V.value ? !0 : !Se.isEqual(g.value, x.value.permissionSetIds) || !Se.isEqual(h.value, x.value.userPermissions) || !Se.isEqual(p.value, x.value.posUser);
|
|
541
542
|
}
|
|
542
543
|
function O(s) {
|
|
543
544
|
V.value = s;
|
|
544
545
|
}
|
|
545
|
-
function
|
|
546
|
+
function D(s) {
|
|
546
547
|
p.value = ve(p.value, s);
|
|
547
548
|
}
|
|
548
549
|
function B(s) {
|
|
549
550
|
return Me(
|
|
550
|
-
|
|
551
|
+
Le(s, $.permissionSets.value)
|
|
551
552
|
);
|
|
552
553
|
}
|
|
553
554
|
function m(s) {
|
|
@@ -567,7 +568,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
567
568
|
f.open({
|
|
568
569
|
title: a("permissionSet.form.overrideInherited.title"),
|
|
569
570
|
message: a("permissionSet.form.overrideInherited.message"),
|
|
570
|
-
minWidth:
|
|
571
|
+
minWidth: A.value.lg ? 588 : 0,
|
|
571
572
|
primaryActions: {
|
|
572
573
|
text: a("permissionSet.form.overrideInherited.override"),
|
|
573
574
|
close: !1
|
|
@@ -580,31 +581,31 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
580
581
|
m(c), f.close();
|
|
581
582
|
});
|
|
582
583
|
}
|
|
583
|
-
function
|
|
584
|
-
const s = j.value ?
|
|
585
|
-
return ks(c,
|
|
584
|
+
function w() {
|
|
585
|
+
const s = j.value ? C.value : L, c = Ps(h.value, s);
|
|
586
|
+
return ks(c, E.value);
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
-
const s = Me(S.value), c =
|
|
589
|
-
return
|
|
588
|
+
function Ee() {
|
|
589
|
+
const s = Me(S.value), c = ws(w());
|
|
590
|
+
return Is(s, c);
|
|
590
591
|
}
|
|
591
592
|
function ke() {
|
|
592
593
|
var T, G, Q, q, ce, Y, H, oe, pe, $e;
|
|
593
|
-
const s =
|
|
594
|
+
const s = Ee(), c = w().filter((re) => !re.inverted);
|
|
594
595
|
return {
|
|
595
596
|
email: ((T = V.value) == null ? void 0 : T.email) ?? void 0,
|
|
596
597
|
phoneNumber: ((G = V.value) == null ? void 0 : G.phoneNumber) ?? void 0,
|
|
597
598
|
customPermissions: s,
|
|
598
599
|
permissions: c.map((re) => ({
|
|
599
600
|
...re,
|
|
600
|
-
subject:
|
|
601
|
+
subject: bs(re.subject)
|
|
601
602
|
})),
|
|
602
603
|
permissionSetIds: g.value,
|
|
603
|
-
name: ((Q = V.value) == null ? void 0 : Q.displayName) || ((q =
|
|
604
|
+
name: ((Q = V.value) == null ? void 0 : Q.displayName) || ((q = n.initialValue) == null ? void 0 : q.name) || "",
|
|
604
605
|
posUser: p.value ? {
|
|
605
606
|
...p.value,
|
|
606
|
-
name: p.value.name || ((Y = (ce =
|
|
607
|
-
code: p.value.code || (($e = (pe =
|
|
607
|
+
name: p.value.name || ((Y = (ce = n.initialValue) == null ? void 0 : ce.posUser) == null ? void 0 : Y.name) || ((H = n.initialValue) == null ? void 0 : H.name) || ((oe = V.value) == null ? void 0 : oe.displayName) || "",
|
|
608
|
+
code: p.value.code || (($e = (pe = n.initialValue) == null ? void 0 : pe.posUser) == null ? void 0 : $e.code) || "",
|
|
608
609
|
passcode: p.value.passcode,
|
|
609
610
|
roles: p.value.roles.filter((re) => !!re.roleId)
|
|
610
611
|
} : p.value === null ? null : void 0
|
|
@@ -613,7 +614,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
613
614
|
const ae = b();
|
|
614
615
|
function ve(s, c) {
|
|
615
616
|
if (!s) return s;
|
|
616
|
-
const T =
|
|
617
|
+
const T = Je(c), G = Xe(c);
|
|
617
618
|
if (T === null && G === null) return s;
|
|
618
619
|
const Q = he(s);
|
|
619
620
|
return Q.roles = Q.roles.filter(
|
|
@@ -621,7 +622,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
621
622
|
), Q;
|
|
622
623
|
}
|
|
623
624
|
const be = b(!!p.value), de = b(!1);
|
|
624
|
-
function
|
|
625
|
+
function De(s) {
|
|
625
626
|
p.value = s, de.value = !0;
|
|
626
627
|
}
|
|
627
628
|
fe(
|
|
@@ -630,19 +631,19 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
630
631
|
s && !be.value && de.value && (await ms(), ae.value && ae.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), be.value = s;
|
|
631
632
|
}
|
|
632
633
|
);
|
|
633
|
-
const
|
|
634
|
-
async function
|
|
635
|
-
return (await
|
|
634
|
+
const xe = b();
|
|
635
|
+
async function Oe() {
|
|
636
|
+
return (await xe.value.validateInputsWithoutSubmit()).length ? null : ke();
|
|
636
637
|
}
|
|
637
638
|
return fe(
|
|
638
|
-
() =>
|
|
639
|
+
() => n.initialValue,
|
|
639
640
|
(s, c) => {
|
|
640
641
|
if (!c || !s || c.id !== s.id) {
|
|
641
642
|
de.value = !1, J(s);
|
|
642
643
|
return;
|
|
643
644
|
}
|
|
644
|
-
s.posUser !== void 0 && !de.value && (p.value = s.posUser ? ve(he(s.posUser), h.value) : void 0,
|
|
645
|
-
...
|
|
645
|
+
s.posUser !== void 0 && !de.value && (p.value = s.posUser ? ve(he(s.posUser), h.value) : void 0, x.value = {
|
|
646
|
+
...x.value,
|
|
646
647
|
posUser: p.value ? he(p.value) : void 0
|
|
647
648
|
});
|
|
648
649
|
},
|
|
@@ -653,34 +654,34 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
653
654
|
p.value = ve(p.value, s);
|
|
654
655
|
},
|
|
655
656
|
{ deep: !0 }
|
|
656
|
-
),
|
|
657
|
+
), R({
|
|
657
658
|
readFormData: ke,
|
|
658
|
-
validate:
|
|
659
|
+
validate: Oe,
|
|
659
660
|
isModified: X
|
|
660
661
|
}), (s, c) => {
|
|
661
662
|
const T = F("FmSelect"), G = F("FmCircularProgress"), Q = F("FmForm");
|
|
662
663
|
return y(), z(Q, {
|
|
663
664
|
ref_key: "formRef",
|
|
664
|
-
ref:
|
|
665
|
+
ref: xe,
|
|
665
666
|
class: "mx-4"
|
|
666
667
|
}, {
|
|
667
668
|
default: ue(() => {
|
|
668
669
|
var q, ce, Y, H, oe;
|
|
669
670
|
return [
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
671
|
+
u("div", _t, [
|
|
672
|
+
u("div", gt, [
|
|
673
|
+
i.initialValue ? (y(), z(zs, {
|
|
673
674
|
key: 1,
|
|
674
|
-
data:
|
|
675
|
+
data: i.initialValue
|
|
675
676
|
}, null, 8, ["data"])) : (y(), z(st, {
|
|
676
677
|
key: 0,
|
|
677
678
|
onInvite: c[0] || (c[0] = (pe) => O(pe))
|
|
678
679
|
}))
|
|
679
680
|
]),
|
|
680
|
-
V.value ||
|
|
681
|
-
(q =
|
|
682
|
-
|
|
683
|
-
|
|
681
|
+
V.value || i.initialValue ? (y(), N(Ne, { key: 0 }, [
|
|
682
|
+
(q = i.initialValue) != null && q.isOwner ? K("", !0) : (y(), N("div", xt, [
|
|
683
|
+
u("div", Ut, [
|
|
684
|
+
u("div", St, k(r(a)("team.memberForm.permissionSet.title")), 1),
|
|
684
685
|
d(T, {
|
|
685
686
|
"model-value": g.value,
|
|
686
687
|
multiselect: "",
|
|
@@ -691,28 +692,28 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
691
692
|
"onUpdate:modelValue": _
|
|
692
693
|
}, null, 8, ["model-value", "items", "placeholder"])
|
|
693
694
|
]),
|
|
694
|
-
|
|
695
|
-
|
|
695
|
+
u("div", Ft, [
|
|
696
|
+
u("div", Vt, k(r(a)("team.memberForm.permissions.title")), 1),
|
|
696
697
|
d(Cs, {
|
|
697
698
|
modelValue: h.value,
|
|
698
699
|
"onUpdate:modelValue": c[1] || (c[1] = (pe) => h.value = pe),
|
|
699
700
|
"inherit-permissions": S.value,
|
|
700
|
-
onPermissionChanged:
|
|
701
|
+
onPermissionChanged: D
|
|
701
702
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
702
703
|
])
|
|
703
704
|
])),
|
|
704
|
-
|
|
705
|
+
i.loading ? (y(), N("div", wt, [
|
|
705
706
|
d(G, { size: "xl" })
|
|
706
707
|
])) : (y(), z(yt, {
|
|
707
708
|
key: 2,
|
|
708
709
|
ref_key: "masterUserContentRef",
|
|
709
710
|
ref: ae,
|
|
710
711
|
"model-value": p.value,
|
|
711
|
-
"fallback-name": ((ce =
|
|
712
|
-
"fallback-passcode": (oe = (H =
|
|
712
|
+
"fallback-name": ((ce = i.initialValue) == null ? void 0 : ce.name) || ((Y = V.value) == null ? void 0 : Y.displayName) || "",
|
|
713
|
+
"fallback-passcode": (oe = (H = i.initialValue) == null ? void 0 : H.posUser) == null ? void 0 : oe.passcode,
|
|
713
714
|
roles: v.value,
|
|
714
715
|
restaurants: l.value,
|
|
715
|
-
"onUpdate:modelValue":
|
|
716
|
+
"onUpdate:modelValue": De
|
|
716
717
|
}, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "restaurants"]))
|
|
717
718
|
], 64)) : K("", !0)
|
|
718
719
|
])
|
|
@@ -745,48 +746,48 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
745
746
|
}, Dt = {
|
|
746
747
|
class: "flex items-center justify-start gap-8"
|
|
747
748
|
}, _e = 100;
|
|
748
|
-
var ee = /* @__PURE__ */ function(
|
|
749
|
-
return
|
|
749
|
+
var ee = /* @__PURE__ */ function(i) {
|
|
750
|
+
return i[i.ADD = 0] = "ADD", i[i.UPDATE = 1] = "UPDATE", i[i.CLOSED = 2] = "CLOSED", i;
|
|
750
751
|
}(ee || {});
|
|
751
|
-
const
|
|
752
|
+
const sa = /* @__PURE__ */ Ie({
|
|
752
753
|
__name: "TeamMemberList",
|
|
753
|
-
setup(
|
|
754
|
-
expose:
|
|
754
|
+
setup(i, {
|
|
755
|
+
expose: R
|
|
755
756
|
}) {
|
|
756
757
|
const {
|
|
757
|
-
fetchCustomReportPermissions:
|
|
758
|
+
fetchCustomReportPermissions: n
|
|
758
759
|
} = as();
|
|
759
760
|
os();
|
|
760
761
|
const {
|
|
761
762
|
t: a
|
|
762
|
-
} = Pe(), f =
|
|
763
|
-
fe(
|
|
763
|
+
} = Pe(), f = Ae(), A = rs(), V = ls(), $ = He(), se = Fs($), g = ts(), S = Rs(), p = b(!0), h = b(!1), me = I(() => A.isLoading.value), j = b([]), L = b(0), C = b(1), E = b(""), W = b("");
|
|
764
|
+
fe(A.restaurants, (e) => {
|
|
764
765
|
if (e.length > 0 && j.value.length > 0) {
|
|
765
|
-
const t = new Map(e.map((P) => [P._id, P.profile.name])),
|
|
766
|
+
const t = new Map(e.map((P) => [P._id, P.profile.name])), U = e.map((P) => P.profile.name).sort();
|
|
766
767
|
j.value = j.value.map((P) => ({
|
|
767
768
|
...P,
|
|
768
|
-
restaurants: P.managableRestaurantIds === null ?
|
|
769
|
+
restaurants: P.managableRestaurantIds === null ? U : P.managableRestaurantIds.map((ne) => t.get(ne) ?? "").filter(Boolean).sort()
|
|
769
770
|
}));
|
|
770
771
|
}
|
|
771
772
|
});
|
|
772
|
-
const te =
|
|
773
|
+
const te = I(() => [{
|
|
773
774
|
label: a("team.filter.unassigned_label"),
|
|
774
|
-
value:
|
|
775
|
-
}, ...
|
|
775
|
+
value: we
|
|
776
|
+
}, ...A.restaurants.value.map((e) => ({
|
|
776
777
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
777
778
|
value: e._id
|
|
778
779
|
}))]), o = ({
|
|
779
780
|
member: e,
|
|
780
781
|
className: t = ""
|
|
781
782
|
}) => {
|
|
782
|
-
const
|
|
783
|
+
const U = {
|
|
783
784
|
label: a("team.actions.updateMember"),
|
|
784
785
|
onClick: () => B(ge.Update, e)
|
|
785
786
|
}, P = {
|
|
786
787
|
label: a("team.actions.removeMember"),
|
|
787
788
|
onClick: () => B(ge.Remove, e),
|
|
788
789
|
itemClass: "text-fm-color-typo-error"
|
|
789
|
-
}, ne = e.doc.isOwner ? [
|
|
790
|
+
}, ne = e.doc.isOwner ? [U] : [U, P];
|
|
790
791
|
return d(xs, {
|
|
791
792
|
class: t,
|
|
792
793
|
items: ne
|
|
@@ -799,7 +800,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
799
800
|
const t = e.row.original;
|
|
800
801
|
return d("div", {
|
|
801
802
|
class: "flex items-center gap-8"
|
|
802
|
-
}, [d(
|
|
803
|
+
}, [d(je.FmAvatar, {
|
|
803
804
|
name: t.name,
|
|
804
805
|
size: "sm",
|
|
805
806
|
class: "shrink-0"
|
|
@@ -817,7 +818,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
817
818
|
enableSorting: !1,
|
|
818
819
|
cell(e) {
|
|
819
820
|
if (me.value)
|
|
820
|
-
return cs(
|
|
821
|
+
return cs(Ss);
|
|
821
822
|
const t = e.row.original;
|
|
822
823
|
return l(t);
|
|
823
824
|
}
|
|
@@ -826,7 +827,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
826
827
|
header: () => a("team.table.columns.assignedRoles"),
|
|
827
828
|
enableSorting: !1,
|
|
828
829
|
cell(e) {
|
|
829
|
-
const t = e.row.original,
|
|
830
|
+
const t = e.row.original, U = S.getPermissionAssignmentByUserId(t.id), P = (U == null ? void 0 : U.permissionSetIds) || t.doc.permissionSetIds || [];
|
|
830
831
|
return g.permissionSets.value.filter((ie) => P.includes(ie.id)).map((ie) => ie.name).join(", ");
|
|
831
832
|
}
|
|
832
833
|
}, {
|
|
@@ -835,7 +836,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
835
836
|
enableSorting: !1,
|
|
836
837
|
cell(e) {
|
|
837
838
|
const t = e.row.original;
|
|
838
|
-
return
|
|
839
|
+
return x(t);
|
|
839
840
|
},
|
|
840
841
|
meta: {
|
|
841
842
|
width: "200px"
|
|
@@ -855,18 +856,18 @@ const ea = /* @__PURE__ */ we({
|
|
|
855
856
|
},
|
|
856
857
|
enableSorting: !1
|
|
857
858
|
}];
|
|
858
|
-
function
|
|
859
|
+
function x(e) {
|
|
859
860
|
if (e.doc.isOwner)
|
|
860
861
|
return a("team.labels.businessOwner");
|
|
861
|
-
const t = d(
|
|
862
|
+
const t = d(je.FmTooltip, {
|
|
862
863
|
variant: "plain",
|
|
863
864
|
placement: "top"
|
|
864
865
|
}, {
|
|
865
|
-
default: () => d(
|
|
866
|
+
default: () => d(je.FmIcon, {
|
|
866
867
|
name: "info",
|
|
867
868
|
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
868
869
|
}, null),
|
|
869
|
-
content: () => d("div", null, [a("team.labels.permission"), e.permissionLabels.map((
|
|
870
|
+
content: () => d("div", null, [a("team.labels.permission"), e.permissionLabels.map((U) => d("div", null, [ps("- "), U]))])
|
|
870
871
|
});
|
|
871
872
|
return d("div", {
|
|
872
873
|
class: "flex flex-row items-center gap-8"
|
|
@@ -875,81 +876,81 @@ const ea = /* @__PURE__ */ we({
|
|
|
875
876
|
})]), e.permissionLabels.length > 0 && t]);
|
|
876
877
|
}
|
|
877
878
|
function J(e) {
|
|
878
|
-
var ne, ie, Ce,
|
|
879
|
-
const t = S.getPermissionAssignmentByUserId(e.id),
|
|
879
|
+
var ne, ie, Ce, Ue;
|
|
880
|
+
const t = S.getPermissionAssignmentByUserId(e.id), U = (t == null ? void 0 : t.customPermissions) ?? e.permissions ?? [], P = (t == null ? void 0 : t.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
880
881
|
return {
|
|
881
882
|
id: e.id,
|
|
882
883
|
isOwner: e.doc.isOwner,
|
|
883
884
|
name: e.name,
|
|
884
885
|
phoneNumber: e.phoneNumber,
|
|
885
886
|
email: e.email,
|
|
886
|
-
permissions:
|
|
887
|
+
permissions: U,
|
|
887
888
|
permissionSetIds: P,
|
|
888
889
|
posUser: e.doc.posUser ? {
|
|
889
890
|
code: ((ne = e.doc.posUser) == null ? void 0 : ne.code) ?? "",
|
|
890
891
|
name: ((ie = e.doc.posUser) == null ? void 0 : ie.name) ?? e.name,
|
|
891
892
|
passcode: ((Ce = e.doc.posUser) == null ? void 0 : Ce.passcode) ?? "",
|
|
892
|
-
roles: ((
|
|
893
|
+
roles: ((Ue = e.doc.posUser) == null ? void 0 : Ue.roles) ?? []
|
|
893
894
|
} : void 0
|
|
894
895
|
};
|
|
895
896
|
}
|
|
896
897
|
function X(e) {
|
|
897
|
-
const t = S.getPermissionAssignmentByUserId(e.id),
|
|
898
|
+
const t = S.getPermissionAssignmentByUserId(e.id), U = (t == null ? void 0 : t.customPermissions) ?? e.permissions ?? [], P = (t == null ? void 0 : t.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
898
899
|
return {
|
|
899
900
|
id: e.id,
|
|
900
901
|
isOwner: e.doc.isOwner,
|
|
901
902
|
name: e.name,
|
|
902
903
|
phoneNumber: e.phoneNumber,
|
|
903
904
|
email: e.email,
|
|
904
|
-
permissions:
|
|
905
|
+
permissions: U,
|
|
905
906
|
permissionSetIds: P,
|
|
906
907
|
posUser: void 0
|
|
907
908
|
};
|
|
908
909
|
}
|
|
909
910
|
const O = b(!1);
|
|
910
|
-
let
|
|
911
|
+
let D = 0;
|
|
911
912
|
const B = async (e, t) => {
|
|
912
913
|
if (e == ge.Update) {
|
|
913
|
-
const
|
|
914
|
+
const U = ++D;
|
|
914
915
|
ae.value = X(t), _.value = ee.UPDATE, O.value = t.doc.hasPosUser === !0;
|
|
915
916
|
try {
|
|
916
917
|
const P = await Fe.readTeamMember(t.id);
|
|
917
|
-
if (
|
|
918
|
+
if (U !== D) return;
|
|
918
919
|
ae.value = J(P);
|
|
919
920
|
} catch {
|
|
920
|
-
if (
|
|
921
|
-
|
|
921
|
+
if (U !== D) return;
|
|
922
|
+
$.open({
|
|
922
923
|
message: a("common.error"),
|
|
923
924
|
type: "error"
|
|
924
925
|
}), de();
|
|
925
926
|
} finally {
|
|
926
|
-
|
|
927
|
+
U === D && (O.value = !1);
|
|
927
928
|
}
|
|
928
929
|
}
|
|
929
|
-
e == ge.Remove &&
|
|
930
|
-
}, m = es(), _ = b(ee.CLOSED),
|
|
930
|
+
e == ge.Remove && Oe(t);
|
|
931
|
+
}, m = es(), _ = b(ee.CLOSED), w = I(() => _.value !== ee.CLOSED), Ee = I(() => _.value === ee.ADD ? a("common.add") : a("common.update")), ke = I(() => _.value === ee.ADD ? a("team.actions.addMember") : a("team.actions.updateMember")), ae = b();
|
|
931
932
|
function ve() {
|
|
932
|
-
|
|
933
|
+
D++, O.value = !1, _.value = ee.CLOSED;
|
|
933
934
|
}
|
|
934
|
-
const be =
|
|
935
|
+
const be = gs(() => {
|
|
935
936
|
var e;
|
|
936
937
|
return ((e = Y.value) == null ? void 0 : e.isModified()) ?? !1;
|
|
937
938
|
}, ve);
|
|
938
939
|
function de() {
|
|
939
940
|
be();
|
|
940
941
|
}
|
|
941
|
-
function
|
|
942
|
+
function De(e) {
|
|
942
943
|
e || de();
|
|
943
944
|
}
|
|
944
945
|
const {
|
|
945
|
-
breakpoints:
|
|
946
|
-
} = ss(),
|
|
946
|
+
breakpoints: xe
|
|
947
|
+
} = ss(), Oe = (e) => {
|
|
947
948
|
m.open({
|
|
948
949
|
title: a("team.actions.removeMember"),
|
|
949
950
|
message: a("team.removeMember.confirmationMessage", {
|
|
950
951
|
memberName: e.name
|
|
951
952
|
}),
|
|
952
|
-
minWidth:
|
|
953
|
+
minWidth: xe.value.lg ? 588 : 0,
|
|
953
954
|
primaryActions: {
|
|
954
955
|
text: "Remove",
|
|
955
956
|
close: !1,
|
|
@@ -972,7 +973,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
972
973
|
});
|
|
973
974
|
}, Re = () => {
|
|
974
975
|
ae.value = null, _.value = ee.ADD;
|
|
975
|
-
}, le = b(), Z = b(), s = b(), c =
|
|
976
|
+
}, le = b(), Z = b(), s = b(), c = I(() => {
|
|
976
977
|
var e;
|
|
977
978
|
return JSON.stringify({
|
|
978
979
|
businessId: ((e = f.currentBusiness.value) == null ? void 0 : e._id) ?? "",
|
|
@@ -981,12 +982,12 @@ const ea = /* @__PURE__ */ we({
|
|
|
981
982
|
permissionSubjects: [...Z.value ?? []].sort(),
|
|
982
983
|
permissionSetIds: [...s.value ?? []].sort()
|
|
983
984
|
});
|
|
984
|
-
}), T =
|
|
985
|
+
}), T = I(() => Object.values(hs).map((e) => ({
|
|
985
986
|
label: e.label,
|
|
986
987
|
value: e.subject
|
|
987
|
-
}))), G =
|
|
988
|
+
}))), G = I(() => [{
|
|
988
989
|
label: a("team.filter.unassigned_label"),
|
|
989
|
-
value:
|
|
990
|
+
value: we
|
|
990
991
|
}, ...g.permissionSets.value.map((e) => ({
|
|
991
992
|
label: e.name,
|
|
992
993
|
value: e.id
|
|
@@ -994,19 +995,19 @@ const ea = /* @__PURE__ */ we({
|
|
|
994
995
|
async function Q() {
|
|
995
996
|
await V.readRoles();
|
|
996
997
|
}
|
|
997
|
-
async function q(e =
|
|
998
|
+
async function q(e = C.value) {
|
|
998
999
|
var t;
|
|
999
1000
|
p.value = !0;
|
|
1000
1001
|
try {
|
|
1001
|
-
const
|
|
1002
|
+
const U = await Fe.readTeamMembersPage({
|
|
1002
1003
|
limit: _e,
|
|
1003
1004
|
offset: (e - 1) * _e,
|
|
1004
1005
|
search: W.value.trim() || void 0,
|
|
1005
|
-
restaurantIds:
|
|
1006
|
+
restaurantIds: Qe(le.value),
|
|
1006
1007
|
permissionSubjects: (t = Z.value) != null && t.length ? Z.value : void 0,
|
|
1007
|
-
permissionSetIds:
|
|
1008
|
+
permissionSetIds: Qe(s.value)
|
|
1008
1009
|
});
|
|
1009
|
-
j.value =
|
|
1010
|
+
j.value = U.items, L.value = U.total;
|
|
1010
1011
|
} finally {
|
|
1011
1012
|
p.value = !1;
|
|
1012
1013
|
}
|
|
@@ -1014,9 +1015,9 @@ const ea = /* @__PURE__ */ we({
|
|
|
1014
1015
|
async function ce() {
|
|
1015
1016
|
var t;
|
|
1016
1017
|
if (!((t = f.currentBusiness.value) != null && t._id)) return;
|
|
1017
|
-
await q(
|
|
1018
|
+
await q(C.value);
|
|
1018
1019
|
const e = Math.max(1, Math.ceil(L.value / _e));
|
|
1019
|
-
|
|
1020
|
+
C.value > e && (C.value = e, await q(C.value));
|
|
1020
1021
|
}
|
|
1021
1022
|
const Y = b(), H = b(!1), oe = b(!1);
|
|
1022
1023
|
async function pe() {
|
|
@@ -1041,54 +1042,54 @@ const ea = /* @__PURE__ */ we({
|
|
|
1041
1042
|
async function re() {
|
|
1042
1043
|
await S.readPermissionAssignments();
|
|
1043
1044
|
}
|
|
1044
|
-
let
|
|
1045
|
+
let Be = !1;
|
|
1045
1046
|
async function ns({
|
|
1046
1047
|
pageIndex: e
|
|
1047
1048
|
}) {
|
|
1048
1049
|
var t;
|
|
1049
|
-
if ((t = f.currentBusiness.value) != null && t._id && !
|
|
1050
|
-
|
|
1050
|
+
if ((t = f.currentBusiness.value) != null && t._id && !Be && !(e === 0 && C.value === 1 && j.value.length > 0)) {
|
|
1051
|
+
Be = !0, C.value = e + 1;
|
|
1051
1052
|
try {
|
|
1052
|
-
await q(
|
|
1053
|
+
await q(C.value);
|
|
1053
1054
|
} finally {
|
|
1054
|
-
|
|
1055
|
+
Be = !1;
|
|
1055
1056
|
}
|
|
1056
1057
|
}
|
|
1057
1058
|
}
|
|
1058
|
-
const is = fs(
|
|
1059
|
-
W.value =
|
|
1059
|
+
const is = fs(E, () => {
|
|
1060
|
+
W.value = E.value;
|
|
1060
1061
|
});
|
|
1061
1062
|
return ds(is), fe(c, async () => {
|
|
1062
1063
|
var e;
|
|
1063
|
-
|
|
1064
|
+
C.value = 1, h.value = !1, (e = f.currentBusiness.value) != null && e._id && (await q(1), h.value = !0);
|
|
1064
1065
|
}, {
|
|
1065
1066
|
immediate: !0
|
|
1066
1067
|
}), fe(f.currentBusiness, async () => {
|
|
1067
1068
|
var e;
|
|
1068
1069
|
if ((e = f.currentBusiness.value) != null && e._id)
|
|
1069
1070
|
try {
|
|
1070
|
-
await Promise.all([
|
|
1071
|
+
await Promise.all([A.readRestaurants(), $e(), re(), n(), Q()]);
|
|
1071
1072
|
} catch (t) {
|
|
1072
|
-
console.error("Failed to load team member dependencies:", t),
|
|
1073
|
+
console.error("Failed to load team member dependencies:", t), $.open({
|
|
1073
1074
|
message: t instanceof Error ? t.message : String(t),
|
|
1074
1075
|
type: "error"
|
|
1075
1076
|
});
|
|
1076
1077
|
}
|
|
1077
1078
|
}, {
|
|
1078
1079
|
immediate: !0
|
|
1079
|
-
}),
|
|
1080
|
+
}), R({
|
|
1080
1081
|
create: Re
|
|
1081
1082
|
}), (e, t) => {
|
|
1082
|
-
var
|
|
1083
|
-
const
|
|
1084
|
-
return y(),
|
|
1085
|
-
modelValue:
|
|
1086
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
1083
|
+
var Ue;
|
|
1084
|
+
const U = F("FmSearch"), P = F("FmTable"), ne = F("FmIcon"), ie = F("FmButton"), Ce = F("FmSideSheet");
|
|
1085
|
+
return y(), N(Ne, null, [u("div", Pt, [u("div", kt, [r(xe).xs ? (y(), N("div", Ct, [d(U, {
|
|
1086
|
+
modelValue: E.value,
|
|
1087
|
+
"onUpdate:modelValue": t[4] || (t[4] = (M) => E.value = M),
|
|
1087
1088
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1088
1089
|
placeholder: r(a)("team.search.placeholder")
|
|
1089
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
1090
|
+
}, null, 8, ["modelValue", "placeholder"]), u("div", Mt, [d(ye, {
|
|
1090
1091
|
modelValue: le.value,
|
|
1091
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
1092
|
+
"onUpdate:modelValue": t[5] || (t[5] = (M) => le.value = M),
|
|
1092
1093
|
multiple: "",
|
|
1093
1094
|
items: te.value,
|
|
1094
1095
|
variant: "dark",
|
|
@@ -1097,7 +1098,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
1097
1098
|
class: "!w-auto"
|
|
1098
1099
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1099
1100
|
modelValue: Z.value,
|
|
1100
|
-
"onUpdate:modelValue": t[6] || (t[6] = (
|
|
1101
|
+
"onUpdate:modelValue": t[6] || (t[6] = (M) => Z.value = M),
|
|
1101
1102
|
multiple: "",
|
|
1102
1103
|
variant: "dark",
|
|
1103
1104
|
items: T.value,
|
|
@@ -1105,15 +1106,15 @@ const ea = /* @__PURE__ */ we({
|
|
|
1105
1106
|
placeholder: r(a)("team.filter.permission_placeholder")
|
|
1106
1107
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1107
1108
|
modelValue: s.value,
|
|
1108
|
-
"onUpdate:modelValue": t[7] || (t[7] = (
|
|
1109
|
+
"onUpdate:modelValue": t[7] || (t[7] = (M) => s.value = M),
|
|
1109
1110
|
multiple: "",
|
|
1110
1111
|
variant: "dark",
|
|
1111
1112
|
items: G.value,
|
|
1112
1113
|
"selected-prefix": r(a)("team.filter.selected_assigned_role_prefix"),
|
|
1113
1114
|
placeholder: r(a)("team.filter.assigned_role_placeholder")
|
|
1114
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (y(),
|
|
1115
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (y(), N("div", Rt, [u("div", $t, [d(ye, {
|
|
1115
1116
|
modelValue: le.value,
|
|
1116
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1117
|
+
"onUpdate:modelValue": t[0] || (t[0] = (M) => le.value = M),
|
|
1117
1118
|
multiple: "",
|
|
1118
1119
|
items: te.value,
|
|
1119
1120
|
variant: "dark",
|
|
@@ -1122,7 +1123,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
1122
1123
|
class: "!w-auto"
|
|
1123
1124
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1124
1125
|
modelValue: Z.value,
|
|
1125
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
1126
|
+
"onUpdate:modelValue": t[1] || (t[1] = (M) => Z.value = M),
|
|
1126
1127
|
multiple: "",
|
|
1127
1128
|
variant: "dark",
|
|
1128
1129
|
items: T.value,
|
|
@@ -1130,24 +1131,24 @@ const ea = /* @__PURE__ */ we({
|
|
|
1130
1131
|
placeholder: r(a)("team.filter.permission_placeholder")
|
|
1131
1132
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1132
1133
|
modelValue: s.value,
|
|
1133
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
1134
|
+
"onUpdate:modelValue": t[2] || (t[2] = (M) => s.value = M),
|
|
1134
1135
|
multiple: "",
|
|
1135
1136
|
variant: "dark",
|
|
1136
1137
|
items: G.value,
|
|
1137
1138
|
"selected-prefix": r(a)("team.filter.selected_assigned_role_prefix"),
|
|
1138
1139
|
placeholder: r(a)("team.filter.assigned_role_placeholder")
|
|
1139
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), d(
|
|
1140
|
-
modelValue:
|
|
1141
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
1140
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), d(U, {
|
|
1141
|
+
modelValue: E.value,
|
|
1142
|
+
"onUpdate:modelValue": t[3] || (t[3] = (M) => E.value = M),
|
|
1142
1143
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1143
1144
|
autofocus: "",
|
|
1144
1145
|
placeholder: r(a)("team.search.placeholder")
|
|
1145
|
-
}, null, 8, ["modelValue", "placeholder"])])), (
|
|
1146
|
+
}, null, 8, ["modelValue", "placeholder"])])), (Ue = r(f).currentBusiness.value) != null && Ue._id ? (y(), z(ys, {
|
|
1146
1147
|
key: 2
|
|
1147
1148
|
}, {
|
|
1148
|
-
default: ue(() => [
|
|
1149
|
+
default: ue(() => [u("div", Nt, [h.value ? K("", !0) : (y(), z(_s, {
|
|
1149
1150
|
key: 0
|
|
1150
|
-
})), h.value ? (y(), z(
|
|
1151
|
+
})), h.value ? (y(), z(Us, {
|
|
1151
1152
|
key: 1,
|
|
1152
1153
|
"is-loading": p.value,
|
|
1153
1154
|
"is-empty": L.value === 0,
|
|
@@ -1165,26 +1166,26 @@ const ea = /* @__PURE__ */ we({
|
|
|
1165
1166
|
"hide-footer": L.value <= _e,
|
|
1166
1167
|
loading: p.value,
|
|
1167
1168
|
"pin-header-row": "",
|
|
1168
|
-
onRowClick: t[8] || (t[8] = (
|
|
1169
|
+
onRowClick: t[8] || (t[8] = (M) => B(r(ge).Update, M.original))
|
|
1169
1170
|
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
|
|
1170
1171
|
_: 1
|
|
1171
1172
|
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) : K("", !0)])]),
|
|
1172
1173
|
_: 1
|
|
1173
1174
|
})) : K("", !0)])]), d(Ce, {
|
|
1174
|
-
"model-value":
|
|
1175
|
+
"model-value": w.value,
|
|
1175
1176
|
"max-width": 960,
|
|
1176
1177
|
"close-button": !1,
|
|
1177
|
-
"onUpdate:modelValue":
|
|
1178
|
+
"onUpdate:modelValue": De,
|
|
1178
1179
|
"onOn:clickedAway": r(be)
|
|
1179
1180
|
}, {
|
|
1180
|
-
"side-sheet-header": ue(() => [
|
|
1181
|
+
"side-sheet-header": ue(() => [u("div", At, [u("p", Et, k(ke.value), 1), d(ne, {
|
|
1181
1182
|
name: "close",
|
|
1182
1183
|
size: "md",
|
|
1183
1184
|
class: "cursor-pointer",
|
|
1184
1185
|
onClick: r(be)
|
|
1185
1186
|
}, null, 8, ["onClick"])])]),
|
|
1186
|
-
"side-sheet-footer": ue(() => [
|
|
1187
|
-
label:
|
|
1187
|
+
"side-sheet-footer": ue(() => [u("div", Dt, [d(ie, {
|
|
1188
|
+
label: Ee.value,
|
|
1188
1189
|
size: "md",
|
|
1189
1190
|
variant: "primary",
|
|
1190
1191
|
"is-loading": H.value,
|
|
@@ -1197,7 +1198,7 @@ const ea = /* @__PURE__ */ we({
|
|
|
1197
1198
|
disabled: H.value,
|
|
1198
1199
|
onClick: de
|
|
1199
1200
|
}, null, 8, ["label", "disabled"])])]),
|
|
1200
|
-
default: ue(() => [
|
|
1201
|
+
default: ue(() => [w.value ? (y(), z(It, {
|
|
1201
1202
|
key: 0,
|
|
1202
1203
|
ref_key: "memberForm",
|
|
1203
1204
|
ref: Y,
|
|
@@ -1211,5 +1212,5 @@ const ea = /* @__PURE__ */ we({
|
|
|
1211
1212
|
}
|
|
1212
1213
|
});
|
|
1213
1214
|
export {
|
|
1214
|
-
|
|
1215
|
+
sa as default
|
|
1215
1216
|
};
|