@feedmepos/mf-hrm-portal 2.3.3-dev → 2.3.4-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-D8ZVkmrF.js → ApprovalCodeList-C_F98cwM.js} +5 -5
- package/dist/{AuditLogList-Fby1fcGU.js → AuditLogList-CRQjG28b.js} +3 -3
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B1uS6T3r.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BA4pgKNh.js} +2 -2
- package/dist/{EmployeeList-DY2Y-FtT.js → EmployeeList-DurHeTfl.js} +6 -6
- package/dist/{GrantUserList-RK38DjjY.js → GrantUserList-BZGwZLsp.js} +6 -6
- package/dist/{Main-424HHE7m.js → Main-CvVhcEJ-.js} +5 -5
- package/dist/{Main-BuJe2QNl.js → Main-DZ_LJKco.js} +10 -10
- package/dist/{Main-Pv9x678t.js → Main-iG516Bly.js} +11 -11
- package/dist/{MyPosProfile-Rc2ZTeQR.js → MyPosProfile-C8iBUFAt.js} +1 -1
- package/dist/{PermissionSetList-BT1oUm8M.js → PermissionSetList-COn_Nrzd.js} +6 -6
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BRrhFF3y.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C1k42T7U.js} +870 -870
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DAbgu49T.js +1831 -0
- package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-DS4eMJ6w.js → RoleForm.vue_vue_type_script_setup_true_lang-CoWKz1qm.js} +9 -9
- package/dist/{RoleList-CrLxn4_K.js → RoleList-C5f_ulk9.js} +7 -7
- package/dist/{TeamMemberList-D32ZtSLP.js → TeamMemberList-DCSbXFdg.js} +530 -505
- package/dist/{TimesheetList-ByUp0yfA.js → TimesheetList-DoNzT6xQ.js} +7 -7
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-9x0jnL2P.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-n8cnb0Zw.js} +3 -3
- package/dist/{app-BsAwRWj0.js → app-BYPvZve5.js} +7 -7
- package/dist/app.js +1 -1
- package/dist/{approval-code-BUuYtJAO.js → approval-code-CeijALXj.js} +1 -1
- package/dist/{dayjs.min-C9xnIrg1.js → dayjs.min-CS0wjvq4.js} +1 -1
- package/dist/{employee-DAwBQ0bc.js → employee-DH4Wibqh.js} +5 -5
- package/dist/{grant-user-D-PdX5g-.js → grant-user-C0ko4LW8.js} +1 -1
- package/dist/{iteration-Dat4Ismm.js → iteration-Cnj0KTDr.js} +1 -1
- package/dist/{lodash-DjYVoggD.js → lodash-DAd2V4v-.js} +1 -1
- package/dist/{member-grant-CQHFGo-k.js → member-grant-BaABegLK.js} +2 -2
- package/dist/{restaurant-dbllb9m8.js → restaurant-CNsV-2OE.js} +1 -1
- package/dist/{role-DN-jiQnS.js → role-DSu9cpI6.js} +3 -3
- package/dist/{rule-Bgcb9R7I.js → rule-BmRzz26L.js} +3 -3
- package/dist/src/api/sso-provider/index.d.ts +5 -0
- package/dist/src/api/staff-invite/index.d.ts +1 -2
- package/dist/src/composables/useSsoProviders.d.ts +19 -0
- package/dist/src/composables/useStaffInviteProviders.d.ts +1 -12
- package/dist/src/helpers/staff-invite.d.ts +3 -0
- package/dist/src/types/sso-provider.d.ts +10 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-BABlZnfR.js → useAppStore-BL4Iv-0s.js} +1 -1
- package/dist/{useLoading-B47q5dVg.js → useLoading-BEIlprgm.js} +1 -1
- package/dist/{useReportPermissions-D-nbQAm5.js → useReportPermissions-BhiSxQCh.js} +3 -3
- package/package.json +1 -1
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CD3d4RX6.js +0 -1840
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as oe, mergeModels as Qt, useModel as es, createElementBlock as M, openBlock as m, Fragment as de, renderList as Vt, normalizeClass as
|
|
2
|
-
import { useI18n as ce, useCoreStore as
|
|
3
|
-
import { useSnackbar as
|
|
1
|
+
import { defineComponent as oe, mergeModels as Qt, useModel as es, createElementBlock as M, openBlock as m, Fragment as de, renderList as Vt, normalizeClass as lt, toDisplayString as E, unref as s, computed as I, resolveComponent as G, createElementVNode as p, createBlock as q, createCommentVNode as T, createVNode as i, ref as c, watch as ue, onUnmounted as Pt, createSlots as vt, withCtx as te, renderSlot as ts, withModifiers as Rt, nextTick as Mt, h as ss, createTextVNode as as } from "vue";
|
|
2
|
+
import { useI18n as ce, useCoreStore as He } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as ot, useDialog as Ft, useBreakpoints as $t, components as Qe, SnackbarPosition as et } from "@feedmepos/ui-library";
|
|
4
4
|
import { u as ls } from "./useDebounce-B8ZPVS5C.js";
|
|
5
5
|
import { _ as Ct, S as ie } from "./SelectFilter-ATOm0hdn.js";
|
|
6
|
-
import {
|
|
6
|
+
import { g as be, b as ye, k as ft, O as os, _ as rs, a as ns } from "./app-BYPvZve5.js";
|
|
7
7
|
import { u as is, _ as bt } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
8
|
import { _ as us } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
9
9
|
import { s as ms, _ as ds, d as cs, e as ps } from "./PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js";
|
|
10
|
-
import { u as Dt } from "./useLoading-
|
|
11
|
-
import { w as vs, h as fs, b as bs, E as ys, t as gs } from "./member-grant-
|
|
12
|
-
import { a as
|
|
13
|
-
import { n as
|
|
14
|
-
import { c as
|
|
15
|
-
import { l as
|
|
16
|
-
import { _ as ht } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as Is, s as
|
|
19
|
-
import { u as Lt } from "./restaurant-
|
|
20
|
-
import { u as Tt } from "./role-
|
|
21
|
-
var
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
if (!(
|
|
25
|
-
const
|
|
26
|
-
return
|
|
10
|
+
import { u as Dt } from "./useLoading-BEIlprgm.js";
|
|
11
|
+
import { w as vs, h as fs, b as bs, E as ys, t as gs } from "./member-grant-BaABegLK.js";
|
|
12
|
+
import { a as Ye, i as rt, t as Re, b as Xe, D as Nt, E as Et, h as Te, u as hs, s as yt, c as ze, d as xs, e as gt } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DAbgu49T.js";
|
|
13
|
+
import { n as nt } from "./string-DZQ1uNjn.js";
|
|
14
|
+
import { c as Ve } from "./iteration-Cnj0KTDr.js";
|
|
15
|
+
import { l as Le } from "./lodash-DAd2V4v-.js";
|
|
16
|
+
import { _ as ht } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C1k42T7U.js";
|
|
17
|
+
import { t as Pe, u as At, c as tt, g as xt, m as st, a as Ot, p as _t, R as _s, b as Ut, d as Us } from "./rule-BmRzz26L.js";
|
|
18
|
+
import { t as Is, s as ws, a as It, c as ks, r as Ss, b as Vs, d as wt, _ as Ps, p as Rs } from "./RoleForm.vue_vue_type_script_setup_true_lang-CoWKz1qm.js";
|
|
19
|
+
import { u as Lt } from "./restaurant-CNsV-2OE.js";
|
|
20
|
+
import { u as Tt } from "./role-DSu9cpI6.js";
|
|
21
|
+
var Ee = /* @__PURE__ */ ((l) => (l.Update = "Update", l.Remove = "Remove", l))(Ee || {});
|
|
22
|
+
const Be = "__unassigned__";
|
|
23
|
+
function kt(l) {
|
|
24
|
+
if (!(l != null && l.length) || l[0] === Be) return l;
|
|
25
|
+
const A = l.filter((v) => v !== Be);
|
|
26
|
+
return A.length === l.length ? l : [Be, ...A];
|
|
27
27
|
}
|
|
28
28
|
const Ms = {
|
|
29
29
|
role: "tablist",
|
|
@@ -38,36 +38,36 @@ const Ms = {
|
|
|
38
38
|
modelModifiers: {}
|
|
39
39
|
}),
|
|
40
40
|
emits: ["update:modelValue"],
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
return (
|
|
44
|
-
(m(!0), M(de, null, Vt(
|
|
45
|
-
key:
|
|
41
|
+
setup(l) {
|
|
42
|
+
const A = es(l, "modelValue");
|
|
43
|
+
return (v, t) => (m(), M("div", Ms, [
|
|
44
|
+
(m(!0), M(de, null, Vt(l.items, (f) => (m(), M("button", {
|
|
45
|
+
key: f.value,
|
|
46
46
|
type: "button",
|
|
47
47
|
role: "tab",
|
|
48
|
-
"aria-selected":
|
|
49
|
-
disabled:
|
|
50
|
-
class:
|
|
48
|
+
"aria-selected": A.value === f.value,
|
|
49
|
+
disabled: l.disabled,
|
|
50
|
+
class: lt([
|
|
51
51
|
"flex-1 rounded-[8px] px-12 py-8 text-center text-[16px] leading-[24px] tracking-[0.04px] transition-colors disabled:cursor-not-allowed",
|
|
52
|
-
|
|
52
|
+
A.value === f.value ? "border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white font-semibold text-fm-color-typo-primary shadow-[0px_1px_2px_0px_rgba(28,28,30,0.04)]" : "border border-transparent font-medium text-fm-color-typo-tertiary hover:bg-fm-color-opacity-sm"
|
|
53
53
|
]),
|
|
54
|
-
onClick: (u) =>
|
|
55
|
-
}, E(
|
|
54
|
+
onClick: (u) => A.value = f.value
|
|
55
|
+
}, E(f.label), 11, Fs))), 128))
|
|
56
56
|
]));
|
|
57
57
|
}
|
|
58
|
-
}),
|
|
58
|
+
}), it = /* @__PURE__ */ oe({
|
|
59
59
|
__name: "MemberStatusBadge",
|
|
60
60
|
props: {
|
|
61
61
|
status: {}
|
|
62
62
|
},
|
|
63
|
-
setup(
|
|
64
|
-
const { t:
|
|
65
|
-
return (
|
|
66
|
-
class:
|
|
63
|
+
setup(l) {
|
|
64
|
+
const { t: A } = ce();
|
|
65
|
+
return (v, t) => (m(), M("span", {
|
|
66
|
+
class: lt([
|
|
67
67
|
"inline-flex items-center rounded-[4px] px-4 py-[2px] text-[10px] font-medium leading-[14px] tracking-[0.2px] whitespace-nowrap",
|
|
68
|
-
|
|
68
|
+
l.status === "active" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-system-warning-100 text-fm-color-typo-warning"
|
|
69
69
|
])
|
|
70
|
-
}, E(s(
|
|
70
|
+
}, E(s(A)(`team.status.${l.status}`)), 3));
|
|
71
71
|
}
|
|
72
72
|
}), Cs = {
|
|
73
73
|
class: "flex items-center gap-12 rounded-[16px] border border-[#995900] bg-fm-color-system-warning-100 p-16",
|
|
@@ -80,34 +80,59 @@ const Ms = {
|
|
|
80
80
|
match: {}
|
|
81
81
|
},
|
|
82
82
|
emits: ["update"],
|
|
83
|
-
setup(
|
|
84
|
-
const
|
|
85
|
-
() =>
|
|
86
|
-
), K = I(() =>
|
|
87
|
-
return (R,
|
|
88
|
-
const
|
|
83
|
+
setup(l, { emit: A }) {
|
|
84
|
+
const v = l, t = A, { t: f } = ce(), u = I(() => v.existing.kind === "member" ? "active" : "invited"), $ = I(
|
|
85
|
+
() => v.existing.restaurantCount === 1 ? f("team.existingMember.restaurantCount.one") : f("team.existingMember.restaurantCount.other", { count: v.existing.restaurantCount })
|
|
86
|
+
), K = I(() => v.existing.kind !== "member" || !v.existing.isOwner);
|
|
87
|
+
return (R, O) => {
|
|
88
|
+
const k = G("FmButton");
|
|
89
89
|
return m(), M("div", Cs, [
|
|
90
|
-
p("div", Ds, E(s(
|
|
90
|
+
p("div", Ds, E(s(nt)(l.existing.name)), 1),
|
|
91
91
|
p("div", Ns, [
|
|
92
92
|
p("div", Es, [
|
|
93
|
-
p("p", As, E(
|
|
94
|
-
i(
|
|
93
|
+
p("p", As, E(l.existing.name), 1),
|
|
94
|
+
i(it, { status: u.value }, null, 8, ["status"])
|
|
95
95
|
]),
|
|
96
|
-
p("p", Os, E(s(
|
|
97
|
-
p("p", Ls, E(K.value ? s(
|
|
96
|
+
p("p", Os, E(s(f)(`team.existingMember.alreadyUses.${l.match}`, { restaurants: $.value })), 1),
|
|
97
|
+
p("p", Ls, E(K.value ? s(f)("team.existingMember.updateInstead") : s(f)("team.existingMember.isOwner")), 1)
|
|
98
98
|
]),
|
|
99
|
-
K.value ? (m(), q(
|
|
99
|
+
K.value ? (m(), q(k, {
|
|
100
100
|
key: 0,
|
|
101
|
-
label: s(
|
|
101
|
+
label: s(f)("team.existingMember.updateAccess"),
|
|
102
102
|
size: "md",
|
|
103
103
|
variant: "primary",
|
|
104
104
|
class: "shrink-0",
|
|
105
|
-
onClick:
|
|
106
|
-
}, null, 8, ["label"])) :
|
|
105
|
+
onClick: O[0] || (O[0] = (P) => t("update"))
|
|
106
|
+
}, null, 8, ["label"])) : T("", !0)
|
|
107
107
|
]);
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
}),
|
|
110
|
+
}), Ae = {
|
|
111
|
+
async readInvites(l = "pending") {
|
|
112
|
+
return be(
|
|
113
|
+
await ye("staff-invites").get("", { params: { status: l } })
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
async lookup(l, A) {
|
|
117
|
+
return be(
|
|
118
|
+
await ye("staff-invites").get("/lookup", {
|
|
119
|
+
params: { ...l, provider: A }
|
|
120
|
+
})
|
|
121
|
+
) || null;
|
|
122
|
+
},
|
|
123
|
+
async createInvite(l) {
|
|
124
|
+
return be(await ye("staff-invites").post("", l));
|
|
125
|
+
},
|
|
126
|
+
async updateInvite(l, A) {
|
|
127
|
+
return be(await ye("staff-invites").put(`/${l}`, A));
|
|
128
|
+
},
|
|
129
|
+
async revokeInvite(l) {
|
|
130
|
+
return be(await ye("staff-invites").delete(`/${l}`));
|
|
131
|
+
},
|
|
132
|
+
async resendInvite(l) {
|
|
133
|
+
return be(await ye("staff-invites").post(`/${l}/resend`));
|
|
134
|
+
}
|
|
135
|
+
}, Bs = {
|
|
111
136
|
class: "flex flex-col gap-16 rounded-[16px] border border-fm-color-neutral-gray-300 bg-fm-color-neutral-white p-16",
|
|
112
137
|
"data-testid": "member-details-card"
|
|
113
138
|
}, js = { class: "flex flex-col gap-8" }, qs = { class: "fm-typo-en-title-sm-600" }, Gs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ks = { class: "flex flex-col gap-[6px]" }, Ws = { class: "fm-typo-en-body-sm-600" }, zs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Hs = { class: "grid grid-cols-2 gap-[14px] xs:grid-cols-1" }, Ys = { class: "grid grid-cols-2 gap-[14px] xs:grid-cols-1" }, Js = 400, Zs = /* @__PURE__ */ oe({
|
|
@@ -119,13 +144,13 @@ const Ms = {
|
|
|
119
144
|
}
|
|
120
145
|
},
|
|
121
146
|
emits: ["update-existing"],
|
|
122
|
-
setup(
|
|
147
|
+
setup(l, { expose: A, emit: v }) {
|
|
123
148
|
var ne, Q;
|
|
124
|
-
const t =
|
|
125
|
-
var
|
|
126
|
-
const D = (
|
|
127
|
-
return D &&
|
|
128
|
-
}),
|
|
149
|
+
const t = l, f = v, { t: u } = ce(), $ = He(), { supportedCountries: K, ready: R } = Ye(), O = I(() => {
|
|
150
|
+
var o;
|
|
151
|
+
const D = (o = $.currentCountry.value) == null ? void 0 : o.toUpperCase();
|
|
152
|
+
return D && rt(D) ? D : void 0;
|
|
153
|
+
}), k = c(((ne = t.providers[0]) == null ? void 0 : ne.slug) ?? ""), P = I(() => t.providers.find((D) => D.slug === k.value)), _ = I(() => {
|
|
129
154
|
var D;
|
|
130
155
|
return ((D = P.value) == null ? void 0 : D.label) ?? "";
|
|
131
156
|
}), X = I(
|
|
@@ -135,21 +160,21 @@ const Ms = {
|
|
|
135
160
|
{ label: u("team.memberDetails.emailAddress"), value: "email" }
|
|
136
161
|
]), b = I(() => {
|
|
137
162
|
if (C.value === "mobile") {
|
|
138
|
-
const D =
|
|
163
|
+
const D = Re(V.value);
|
|
139
164
|
return D ? { mobile: D } : null;
|
|
140
165
|
}
|
|
141
|
-
return
|
|
166
|
+
return Xe(B.value) ? { email: B.value.trim().toLowerCase() } : null;
|
|
142
167
|
}), r = c(null);
|
|
143
168
|
let U, j = 0;
|
|
144
169
|
ue(
|
|
145
|
-
[b,
|
|
170
|
+
[b, k],
|
|
146
171
|
([D]) => {
|
|
147
172
|
clearTimeout(U);
|
|
148
|
-
const
|
|
173
|
+
const o = ++j;
|
|
149
174
|
r.value = null, D && (U = setTimeout(async () => {
|
|
150
175
|
try {
|
|
151
|
-
const S = await
|
|
152
|
-
|
|
176
|
+
const S = await Ae.lookup(D, k.value || void 0);
|
|
177
|
+
o === j && (r.value = S);
|
|
153
178
|
} catch {
|
|
154
179
|
}
|
|
155
180
|
}, Js));
|
|
@@ -157,43 +182,43 @@ const Ms = {
|
|
|
157
182
|
{ deep: !0 }
|
|
158
183
|
), Pt(() => clearTimeout(U));
|
|
159
184
|
function W() {
|
|
160
|
-
const D =
|
|
185
|
+
const D = Te(V.value) ? Re(V.value) ?? "" : "", o = B.value.trim().toLowerCase();
|
|
161
186
|
return {
|
|
162
|
-
provider:
|
|
187
|
+
provider: k.value,
|
|
163
188
|
match: C.value,
|
|
164
|
-
...C.value === "mobile" ? { mobile:
|
|
189
|
+
...C.value === "mobile" ? { mobile: Re(V.value) ?? "", ...o ? { email: o } : {} } : { email: o, ...D ? { mobile: D } : {} },
|
|
165
190
|
displayName: y.value.trim(),
|
|
166
191
|
...d.value.trim() ? { employeeId: d.value.trim() } : {}
|
|
167
192
|
};
|
|
168
193
|
}
|
|
169
194
|
function re() {
|
|
170
|
-
return
|
|
195
|
+
return Te(V.value) || !!B.value.trim() || !!y.value.trim() || !!d.value.trim();
|
|
171
196
|
}
|
|
172
|
-
return
|
|
197
|
+
return A({
|
|
173
198
|
readDetails: W,
|
|
174
199
|
isModified: re,
|
|
175
200
|
/** Add is blocked while the key belongs to someone already. */
|
|
176
201
|
hasExisting: I(() => !!r.value),
|
|
177
202
|
providerLabel: _
|
|
178
|
-
}), (D,
|
|
203
|
+
}), (D, o) => {
|
|
179
204
|
const S = G("FmSelect"), z = G("FmPhoneNumber"), se = G("FmCircularProgress"), H = G("FmTextField");
|
|
180
205
|
return m(), M("div", Bs, [
|
|
181
206
|
p("div", js, [
|
|
182
207
|
p("p", qs, E(s(u)("team.memberDetails.title")), 1),
|
|
183
208
|
p("p", Gs, E(s(u)("team.memberDetails.ssoNotice", { label: _.value })), 1)
|
|
184
209
|
]),
|
|
185
|
-
|
|
210
|
+
l.providers.length > 1 ? (m(), q(S, {
|
|
186
211
|
key: 0,
|
|
187
|
-
modelValue:
|
|
188
|
-
"onUpdate:modelValue":
|
|
212
|
+
modelValue: k.value,
|
|
213
|
+
"onUpdate:modelValue": o[0] || (o[0] = (x) => k.value = x),
|
|
189
214
|
label: s(u)("team.memberDetails.provider"),
|
|
190
215
|
items: X.value
|
|
191
|
-
}, null, 8, ["modelValue", "label", "items"])) :
|
|
216
|
+
}, null, 8, ["modelValue", "label", "items"])) : T("", !0),
|
|
192
217
|
p("div", Ks, [
|
|
193
218
|
p("p", Ws, E(s(u)("team.memberDetails.signInUsing")), 1),
|
|
194
219
|
i($s, {
|
|
195
220
|
modelValue: C.value,
|
|
196
|
-
"onUpdate:modelValue":
|
|
221
|
+
"onUpdate:modelValue": o[1] || (o[1] = (x) => C.value = x),
|
|
197
222
|
items: h.value
|
|
198
223
|
}, null, 8, ["modelValue", "items"])
|
|
199
224
|
]),
|
|
@@ -201,12 +226,12 @@ const Ms = {
|
|
|
201
226
|
s(R) ? (m(), q(z, {
|
|
202
227
|
key: 0,
|
|
203
228
|
modelValue: V.value,
|
|
204
|
-
"onUpdate:modelValue":
|
|
229
|
+
"onUpdate:modelValue": o[2] || (o[2] = (x) => V.value = x),
|
|
205
230
|
label: s(u)("team.memberDetails.phoneNumber"),
|
|
206
|
-
"default-country":
|
|
231
|
+
"default-country": O.value,
|
|
207
232
|
"extra-country-codes": s(K),
|
|
208
|
-
rules: [(x) => !!s(
|
|
209
|
-
},
|
|
233
|
+
rules: [(x) => !!s(Re)(x) || s(u)("team.memberDetails.errors.mobileInvalid")]
|
|
234
|
+
}, vt({ _: 2 }, [
|
|
210
235
|
b.value ? {
|
|
211
236
|
name: "helper-text",
|
|
212
237
|
fn: te(() => [
|
|
@@ -218,11 +243,11 @@ const Ms = {
|
|
|
218
243
|
], 64)) : (m(), q(H, {
|
|
219
244
|
key: 2,
|
|
220
245
|
modelValue: B.value,
|
|
221
|
-
"onUpdate:modelValue":
|
|
246
|
+
"onUpdate:modelValue": o[3] || (o[3] = (x) => B.value = x),
|
|
222
247
|
label: s(u)("team.memberDetails.emailAddress"),
|
|
223
248
|
placeholder: s(u)("team.memberDetails.emailPlaceholder"),
|
|
224
|
-
rules: [(x) => s(
|
|
225
|
-
},
|
|
249
|
+
rules: [(x) => s(Xe)(x) || s(u)("team.memberDetails.errors.emailInvalid")]
|
|
250
|
+
}, vt({ _: 2 }, [
|
|
226
251
|
b.value ? {
|
|
227
252
|
name: "helper-text",
|
|
228
253
|
fn: te(() => [
|
|
@@ -235,12 +260,12 @@ const Ms = {
|
|
|
235
260
|
key: 3,
|
|
236
261
|
existing: r.value,
|
|
237
262
|
match: C.value,
|
|
238
|
-
onUpdate:
|
|
239
|
-
}, null, 8, ["existing", "match"])) :
|
|
263
|
+
onUpdate: o[4] || (o[4] = (x) => f("update-existing", r.value))
|
|
264
|
+
}, null, 8, ["existing", "match"])) : T("", !0),
|
|
240
265
|
p("div", Hs, [
|
|
241
266
|
i(H, {
|
|
242
267
|
modelValue: y.value,
|
|
243
|
-
"onUpdate:modelValue":
|
|
268
|
+
"onUpdate:modelValue": o[5] || (o[5] = (x) => y.value = x),
|
|
244
269
|
label: s(u)("team.memberDetails.name"),
|
|
245
270
|
placeholder: s(u)("team.memberDetails.namePlaceholder"),
|
|
246
271
|
rules: [
|
|
@@ -250,7 +275,7 @@ const Ms = {
|
|
|
250
275
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"]),
|
|
251
276
|
i(H, {
|
|
252
277
|
modelValue: d.value,
|
|
253
|
-
"onUpdate:modelValue":
|
|
278
|
+
"onUpdate:modelValue": o[6] || (o[6] = (x) => d.value = x),
|
|
254
279
|
label: s(u)("team.memberDetails.employeeId"),
|
|
255
280
|
"label-mark": "optional",
|
|
256
281
|
placeholder: s(u)("team.memberDetails.employeeIdPlaceholder"),
|
|
@@ -263,26 +288,26 @@ const Ms = {
|
|
|
263
288
|
C.value === "mobile" ? (m(), q(H, {
|
|
264
289
|
key: 0,
|
|
265
290
|
modelValue: B.value,
|
|
266
|
-
"onUpdate:modelValue":
|
|
291
|
+
"onUpdate:modelValue": o[7] || (o[7] = (x) => B.value = x),
|
|
267
292
|
label: s(u)("team.memberDetails.emailAddress"),
|
|
268
293
|
"label-mark": "optional",
|
|
269
294
|
placeholder: s(u)("team.memberDetails.emailPlaceholder"),
|
|
270
295
|
rules: [
|
|
271
|
-
(x) => !x.trim() || s(
|
|
296
|
+
(x) => !x.trim() || s(Xe)(x) || s(u)("team.memberDetails.errors.emailInvalid")
|
|
272
297
|
]
|
|
273
298
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : (m(), M(de, { key: 1 }, [
|
|
274
299
|
s(R) ? (m(), q(z, {
|
|
275
300
|
key: 0,
|
|
276
301
|
modelValue: V.value,
|
|
277
|
-
"onUpdate:modelValue":
|
|
302
|
+
"onUpdate:modelValue": o[8] || (o[8] = (x) => V.value = x),
|
|
278
303
|
label: s(u)("team.memberDetails.phoneNumber"),
|
|
279
304
|
"label-mark": "optional",
|
|
280
|
-
"default-country":
|
|
305
|
+
"default-country": O.value,
|
|
281
306
|
"extra-country-codes": s(K),
|
|
282
307
|
rules: [
|
|
283
|
-
(x) => !s(
|
|
308
|
+
(x) => !s(Te)(x) || !!s(Re)(x) || s(u)("team.memberDetails.errors.mobileInvalid")
|
|
284
309
|
]
|
|
285
|
-
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) :
|
|
310
|
+
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) : T("", !0)
|
|
286
311
|
], 64))
|
|
287
312
|
])
|
|
288
313
|
]);
|
|
@@ -305,18 +330,18 @@ const Ms = {
|
|
|
305
330
|
email: {},
|
|
306
331
|
phoneNumber: {}
|
|
307
332
|
},
|
|
308
|
-
setup(
|
|
309
|
-
const
|
|
310
|
-
return (t,
|
|
333
|
+
setup(l) {
|
|
334
|
+
const A = l, v = I(() => nt(A.name));
|
|
335
|
+
return (t, f) => (m(), M("div", Qs, [
|
|
311
336
|
p("div", ea, [
|
|
312
|
-
p("div", ta, E(
|
|
337
|
+
p("div", ta, E(v.value), 1),
|
|
313
338
|
p("div", sa, [
|
|
314
339
|
p("div", aa, [
|
|
315
|
-
p("p", la, E(
|
|
316
|
-
i(
|
|
340
|
+
p("p", la, E(l.name), 1),
|
|
341
|
+
i(it, { status: l.status }, null, 8, ["status"])
|
|
317
342
|
]),
|
|
318
|
-
|
|
319
|
-
|
|
343
|
+
l.email ? (m(), M("p", oa, E(l.email), 1)) : T("", !0),
|
|
344
|
+
l.phoneNumber ? (m(), M("p", ra, E(l.phoneNumber), 1)) : T("", !0)
|
|
320
345
|
])
|
|
321
346
|
]),
|
|
322
347
|
ts(t.$slots, "default")
|
|
@@ -343,16 +368,16 @@ const Ms = {
|
|
|
343
368
|
}
|
|
344
369
|
},
|
|
345
370
|
emits: ["update:modelValue"],
|
|
346
|
-
setup(
|
|
347
|
-
const
|
|
371
|
+
setup(l, { emit: A }) {
|
|
372
|
+
const v = l, t = A, { t: f } = ce(), u = c($(v.modelValue));
|
|
348
373
|
function $(d) {
|
|
349
374
|
const h = Is(d);
|
|
350
375
|
return h.length > 0 ? h : [{ restaurantIds: [], roleId: "" }];
|
|
351
376
|
}
|
|
352
377
|
ue(
|
|
353
|
-
() =>
|
|
378
|
+
() => v.modelValue,
|
|
354
379
|
(d) => {
|
|
355
|
-
|
|
380
|
+
ws(d, It(u.value)) || (u.value = $(d));
|
|
356
381
|
},
|
|
357
382
|
{ deep: !0 }
|
|
358
383
|
);
|
|
@@ -363,21 +388,21 @@ const Ms = {
|
|
|
363
388
|
const b = u.value.map((r, U) => {
|
|
364
389
|
if (U !== d) return r;
|
|
365
390
|
const j = { ...r, restaurantIds: h };
|
|
366
|
-
return { ...j, roleId: Rs(
|
|
391
|
+
return { ...j, roleId: Rs(v.roles, j, v.isRoleUsable) };
|
|
367
392
|
});
|
|
368
393
|
K(b);
|
|
369
394
|
}
|
|
370
|
-
function
|
|
395
|
+
function O(d, h) {
|
|
371
396
|
K(u.value.map((b, r) => r === d ? { ...b, roleId: h } : b));
|
|
372
397
|
}
|
|
373
|
-
function
|
|
398
|
+
function k() {
|
|
374
399
|
K([...u.value, { restaurantIds: [], roleId: "" }]);
|
|
375
400
|
}
|
|
376
401
|
function P(d, h) {
|
|
377
402
|
var b;
|
|
378
403
|
h || u.value.length < 2 || (b = u.value[d]) != null && b.restaurantIds.length || K(u.value.filter((r, U) => U !== d));
|
|
379
404
|
}
|
|
380
|
-
const _ = I(() =>
|
|
405
|
+
const _ = I(() => ks(v.restaurants, u.value)), X = c(), C = c(!1), V = c(null);
|
|
381
406
|
async function B(d) {
|
|
382
407
|
var h;
|
|
383
408
|
V.value = d, C.value = !0, await Mt(), (h = X.value) == null || h.trigger();
|
|
@@ -387,17 +412,17 @@ const Ms = {
|
|
|
387
412
|
V.value = null;
|
|
388
413
|
const b = h === null ? void 0 : u.value[h];
|
|
389
414
|
if (h === null || !b) return;
|
|
390
|
-
|
|
415
|
+
wt(v.roles, b, v.isRoleUsable).some(
|
|
391
416
|
(U) => U.value === d && !U.disabled
|
|
392
|
-
) &&
|
|
417
|
+
) && O(h, d);
|
|
393
418
|
}
|
|
394
419
|
return (d, h) => {
|
|
395
420
|
var r;
|
|
396
421
|
const b = G("FmSelect");
|
|
397
422
|
return m(), M("div", ia, [
|
|
398
423
|
p("div", ua, [
|
|
399
|
-
p("p", ma, E(s(
|
|
400
|
-
p("p", da, E(s(
|
|
424
|
+
p("p", ma, E(s(f)("team.posAccess.restaurants")), 1),
|
|
425
|
+
p("p", da, E(s(f)("team.posAccess.posRole")), 1)
|
|
401
426
|
]),
|
|
402
427
|
(m(!0), M(de, null, Vt(u.value, (U, j) => (m(), M("div", {
|
|
403
428
|
key: j,
|
|
@@ -405,24 +430,24 @@ const Ms = {
|
|
|
405
430
|
"data-testid": "pos-assignment-row"
|
|
406
431
|
}, [
|
|
407
432
|
i(b, {
|
|
408
|
-
class:
|
|
433
|
+
class: lt(["min-w-0 pos-restaurant-select", { "pos-restaurant-select--filled": U.restaurantIds.length > 0 }]),
|
|
409
434
|
"model-value": U.restaurantIds,
|
|
410
|
-
items: s(Vs)(
|
|
435
|
+
items: s(Vs)(l.restaurants, u.value, j),
|
|
411
436
|
multiselect: "",
|
|
412
437
|
searchable: "",
|
|
413
438
|
"hide-chips": "",
|
|
414
439
|
"search-debounce": 300,
|
|
415
|
-
placeholder: s(Ss)(
|
|
440
|
+
placeholder: s(Ss)(l.restaurants, U) || s(f)("team.posAccess.selectRestaurants"),
|
|
416
441
|
"onUpdate:modelValue": (W) => R(j, W),
|
|
417
442
|
onDropdownChanged: (W) => P(j, W)
|
|
418
443
|
}, null, 8, ["class", "model-value", "items", "placeholder", "onUpdate:modelValue", "onDropdownChanged"]),
|
|
419
444
|
i(b, {
|
|
420
445
|
class: "min-w-0",
|
|
421
446
|
"model-value": U.roleId,
|
|
422
|
-
items: s(
|
|
423
|
-
placeholder: s(
|
|
447
|
+
items: s(wt)(l.roles, U, l.isRoleUsable),
|
|
448
|
+
placeholder: s(f)("team.posAccess.selectRole"),
|
|
424
449
|
disabled: U.restaurantIds.length === 0,
|
|
425
|
-
"onUpdate:modelValue": (W) =>
|
|
450
|
+
"onUpdate:modelValue": (W) => O(j, W)
|
|
426
451
|
}, {
|
|
427
452
|
"append-menu": te(() => [
|
|
428
453
|
p("button", {
|
|
@@ -430,7 +455,7 @@ const Ms = {
|
|
|
430
455
|
class: "w-full px-12 py-8 text-left text-[12px] font-semibold text-fm-color-primary",
|
|
431
456
|
"data-testid": "create-pos-role",
|
|
432
457
|
onClick: (W) => B(j)
|
|
433
|
-
}, " + " + E(s(
|
|
458
|
+
}, " + " + E(s(f)("team.posAccess.createRole")), 9, ca)
|
|
434
459
|
]),
|
|
435
460
|
_: 2
|
|
436
461
|
}, 1032, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"])
|
|
@@ -440,8 +465,8 @@ const Ms = {
|
|
|
440
465
|
class: "self-start fm-typo-en-body-md-600 text-fm-color-primary disabled:cursor-not-allowed disabled:text-fm-color-typo-disabled",
|
|
441
466
|
disabled: !_.value,
|
|
442
467
|
"data-testid": "add-pos-row",
|
|
443
|
-
onClick: Rt(
|
|
444
|
-
}, " + " + E(s(
|
|
468
|
+
onClick: Rt(k, ["stop"])
|
|
469
|
+
}, " + " + E(s(f)("team.posAccess.addRestaurant")), 9, pa),
|
|
445
470
|
C.value ? (m(), q(Ps, {
|
|
446
471
|
key: 0,
|
|
447
472
|
ref_key: "roleFormRef",
|
|
@@ -449,7 +474,7 @@ const Ms = {
|
|
|
449
474
|
"show-back": "",
|
|
450
475
|
"restaurant-ids": V.value === null ? [] : ((r = u.value[V.value]) == null ? void 0 : r.restaurantIds) ?? [],
|
|
451
476
|
onCreated: y
|
|
452
|
-
}, null, 8, ["restaurant-ids"])) :
|
|
477
|
+
}, null, 8, ["restaurant-ids"])) : T("", !0)
|
|
453
478
|
]);
|
|
454
479
|
};
|
|
455
480
|
}
|
|
@@ -459,7 +484,7 @@ const Ms = {
|
|
|
459
484
|
}, ya = { class: "flex items-center gap-8" }, ga = { class: "flex flex-1 flex-col gap-8" }, ha = { class: "fm-typo-en-title-sm-600" }, xa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _a = {
|
|
460
485
|
key: 0,
|
|
461
486
|
class: "flex flex-col gap-24"
|
|
462
|
-
}, Ua = { class: "flex flex-col gap-12" }, Ia = { class: "fm-typo-en-body-lg-600" },
|
|
487
|
+
}, Ua = { class: "flex flex-col gap-12" }, Ia = { class: "fm-typo-en-body-lg-600" }, wa = { class: "flex flex-col items-start gap-16" }, at = 4, ka = /* @__PURE__ */ oe({
|
|
463
488
|
__name: "TeamMemberMasterUser",
|
|
464
489
|
props: {
|
|
465
490
|
modelValue: {
|
|
@@ -492,35 +517,35 @@ const Ms = {
|
|
|
492
517
|
}
|
|
493
518
|
},
|
|
494
519
|
emits: ["update:model-value"],
|
|
495
|
-
setup(
|
|
496
|
-
const
|
|
520
|
+
setup(l, { emit: A }) {
|
|
521
|
+
const v = l, t = A, { t: f } = ce(), u = ot(), $ = Dt(u), K = c(!1), R = c([]), O = I(() => {
|
|
497
522
|
var y;
|
|
498
|
-
return ms(((y =
|
|
523
|
+
return ms(((y = v.modelValue) == null ? void 0 : y.roles) ?? []);
|
|
499
524
|
});
|
|
500
|
-
function
|
|
501
|
-
return
|
|
525
|
+
function k(y) {
|
|
526
|
+
return v.usableRoleIds === null || v.usableRoleIds.includes(y._id);
|
|
502
527
|
}
|
|
503
528
|
function P(y) {
|
|
504
|
-
y ?
|
|
529
|
+
y ? v.modelValue || t("update:model-value", {
|
|
505
530
|
code: "",
|
|
506
|
-
name:
|
|
531
|
+
name: v.fallbackName,
|
|
507
532
|
roles: [],
|
|
508
|
-
passcode:
|
|
533
|
+
passcode: v.fallbackPasscode || ""
|
|
509
534
|
}) : t("update:model-value", null);
|
|
510
535
|
}
|
|
511
536
|
function _(y, d) {
|
|
512
|
-
if (!
|
|
513
|
-
const h =
|
|
537
|
+
if (!v.modelValue || y === "passcode" && v.modelValue.passcode === d) return;
|
|
538
|
+
const h = Ve(v.modelValue);
|
|
514
539
|
h[y] = d, t("update:model-value", h);
|
|
515
540
|
}
|
|
516
|
-
const X = c(!1), C = I(() =>
|
|
541
|
+
const X = c(!1), C = I(() => O.value.length > 0);
|
|
517
542
|
async function V() {
|
|
518
543
|
if (C.value)
|
|
519
544
|
try {
|
|
520
545
|
const y = await $.custom(
|
|
521
|
-
() =>
|
|
522
|
-
restaurantIds:
|
|
523
|
-
excludePosUserId:
|
|
546
|
+
() => Pe.generateMasterUserPasscode({
|
|
547
|
+
restaurantIds: O.value,
|
|
548
|
+
excludePosUserId: v.posUserId
|
|
524
549
|
}),
|
|
525
550
|
{ isLoading: X }
|
|
526
551
|
);
|
|
@@ -531,18 +556,18 @@ const Ms = {
|
|
|
531
556
|
ue(
|
|
532
557
|
() => {
|
|
533
558
|
var y;
|
|
534
|
-
return (y =
|
|
559
|
+
return (y = v.modelValue) == null ? void 0 : y.passcode;
|
|
535
560
|
},
|
|
536
561
|
(y) => {
|
|
537
562
|
const d = R.value.join("");
|
|
538
|
-
y !== d && (y && y.length ===
|
|
563
|
+
y !== d && (y && y.length === at ? (R.value = y.split(""), K.value = !0) : (R.value = [], K.value = !1));
|
|
539
564
|
},
|
|
540
565
|
{ immediate: !0 }
|
|
541
566
|
);
|
|
542
567
|
const B = I({
|
|
543
568
|
get: () => {
|
|
544
569
|
var y;
|
|
545
|
-
return ((y =
|
|
570
|
+
return ((y = v.modelValue) == null ? void 0 : y.roles) ?? [];
|
|
546
571
|
},
|
|
547
572
|
set: () => {
|
|
548
573
|
}
|
|
@@ -552,43 +577,43 @@ const Ms = {
|
|
|
552
577
|
return m(), M("div", ba, [
|
|
553
578
|
p("div", ya, [
|
|
554
579
|
p("div", ga, [
|
|
555
|
-
p("p", ha, E(s(
|
|
556
|
-
p("p", xa, E(s(
|
|
580
|
+
p("p", ha, E(s(f)("team.posAccess.title")), 1),
|
|
581
|
+
p("p", xa, E(s(f)("team.posAccess.subtitle")), 1)
|
|
557
582
|
]),
|
|
558
583
|
i(h, {
|
|
559
|
-
"model-value": !!
|
|
584
|
+
"model-value": !!l.modelValue,
|
|
560
585
|
value: "master-user",
|
|
561
586
|
"onUpdate:modelValue": P
|
|
562
587
|
}, null, 8, ["model-value"])
|
|
563
588
|
]),
|
|
564
|
-
|
|
589
|
+
l.modelValue ? (m(), M("div", _a, [
|
|
565
590
|
i(b, {
|
|
566
591
|
modelValue: B.value,
|
|
567
592
|
"onUpdate:modelValue": d[1] || (d[1] = (r) => B.value = r),
|
|
568
593
|
tag: "div",
|
|
569
594
|
rules: [
|
|
570
|
-
(r) => !r || r.length === 0 ? s(
|
|
595
|
+
(r) => !r || r.length === 0 ? s(f)("team.memberForm.masterUser.restaurantRequired") : r.some((U) => !U.roleId) ? s(f)("team.memberForm.masterUser.roleRequired") : !0
|
|
571
596
|
]
|
|
572
597
|
}, {
|
|
573
598
|
default: te(() => [
|
|
574
599
|
i(fa, {
|
|
575
|
-
"model-value":
|
|
576
|
-
restaurants:
|
|
577
|
-
roles:
|
|
578
|
-
"is-role-usable":
|
|
600
|
+
"model-value": l.modelValue.roles,
|
|
601
|
+
restaurants: l.restaurants,
|
|
602
|
+
roles: l.roles,
|
|
603
|
+
"is-role-usable": k,
|
|
579
604
|
"onUpdate:modelValue": d[0] || (d[0] = (r) => _("roles", r))
|
|
580
605
|
}, null, 8, ["model-value", "restaurants", "roles"])
|
|
581
606
|
]),
|
|
582
607
|
_: 1
|
|
583
608
|
}, 8, ["modelValue", "rules"]),
|
|
584
609
|
p("div", Ua, [
|
|
585
|
-
p("p", Ia, E(s(
|
|
586
|
-
p("div",
|
|
610
|
+
p("p", Ia, E(s(f)("team.posAccess.passcode")), 1),
|
|
611
|
+
p("div", wa, [
|
|
587
612
|
i(b, {
|
|
588
613
|
modelValue: R.value,
|
|
589
614
|
"onUpdate:modelValue": d[5] || (d[5] = (r) => R.value = r),
|
|
590
615
|
rules: [
|
|
591
|
-
(r) => (r == null ? void 0 : r.filter((U) => !!U).length) !==
|
|
616
|
+
(r) => (r == null ? void 0 : r.filter((U) => !!U).length) !== at ? s(f)("team.memberForm.masterUser.passcodeRequired") : !0
|
|
592
617
|
]
|
|
593
618
|
}, {
|
|
594
619
|
default: te(() => [
|
|
@@ -597,23 +622,23 @@ const Ms = {
|
|
|
597
622
|
"onUpdate:modelValue": d[2] || (d[2] = (r) => R.value = r),
|
|
598
623
|
masked: K.value,
|
|
599
624
|
"onUpdate:masked": d[3] || (d[3] = (r) => K.value = r),
|
|
600
|
-
length:
|
|
601
|
-
"toggle-label": s(
|
|
625
|
+
length: at,
|
|
626
|
+
"toggle-label": s(f)("team.memberForm.masterUser.passcodeToggleVisibility"),
|
|
602
627
|
onComplete: d[4] || (d[4] = (r) => _("passcode", r))
|
|
603
628
|
}, null, 8, ["modelValue", "masked", "toggle-label"])
|
|
604
629
|
]),
|
|
605
630
|
_: 1
|
|
606
631
|
}, 8, ["modelValue", "rules"]),
|
|
607
632
|
i(cs, {
|
|
608
|
-
label: s(
|
|
609
|
-
hint: s(
|
|
633
|
+
label: s(f)("team.memberForm.masterUser.passcodeGenerate"),
|
|
634
|
+
hint: s(f)("team.memberForm.masterUser.passcodeSelectOutletFirst"),
|
|
610
635
|
loading: X.value,
|
|
611
636
|
disabled: !C.value,
|
|
612
637
|
onClick: V
|
|
613
638
|
}, null, 8, ["label", "hint", "loading", "disabled"])
|
|
614
639
|
])
|
|
615
640
|
])
|
|
616
|
-
])) :
|
|
641
|
+
])) : T("", !0)
|
|
617
642
|
]);
|
|
618
643
|
};
|
|
619
644
|
}
|
|
@@ -644,19 +669,19 @@ const Ms = {
|
|
|
644
669
|
default: !1
|
|
645
670
|
}
|
|
646
671
|
},
|
|
647
|
-
setup(
|
|
648
|
-
var
|
|
649
|
-
const
|
|
672
|
+
setup(l, { expose: A }) {
|
|
673
|
+
var qe, ge, ee;
|
|
674
|
+
const v = l, { t } = ce(), f = Ft(), { breakpoints: u } = $t(), $ = At(), K = I(
|
|
650
675
|
() => $.permissionSets.value.map((n) => ({
|
|
651
676
|
label: n.name,
|
|
652
677
|
value: n.id
|
|
653
678
|
}))
|
|
654
|
-
), R = c(((
|
|
655
|
-
() =>
|
|
656
|
-
),
|
|
679
|
+
), R = c(((qe = v.initialValue) == null ? void 0 : qe.permissionSetIds) || []), O = I(
|
|
680
|
+
() => tt(R.value, $.permissionSets.value)
|
|
681
|
+
), k = c((ge = v.initialValue) == null ? void 0 : ge.posUser), P = c(
|
|
657
682
|
xt(
|
|
658
|
-
|
|
659
|
-
((ee =
|
|
683
|
+
st(O.value),
|
|
684
|
+
((ee = v.initialValue) == null ? void 0 : ee.permissions) || []
|
|
660
685
|
)
|
|
661
686
|
), { customReportPermissions: _, isLoaded: X } = Ot(), C = new Set(
|
|
662
687
|
_t.filter((n) => n.subject.startsWith(_s)).map((n) => n.subject)
|
|
@@ -667,13 +692,13 @@ const Ms = {
|
|
|
667
692
|
}), B = I(() => {
|
|
668
693
|
const n = /* @__PURE__ */ new Set();
|
|
669
694
|
for (const F of _t)
|
|
670
|
-
F.category ===
|
|
695
|
+
F.category === ft.reports && n.add(F.subject);
|
|
671
696
|
for (const F of _.value)
|
|
672
|
-
F.category ===
|
|
697
|
+
F.category === ft.reports && n.add(F.subject);
|
|
673
698
|
return n;
|
|
674
699
|
}), y = I(() => {
|
|
675
700
|
var n;
|
|
676
|
-
return !!((n =
|
|
701
|
+
return !!((n = v.initialValue) != null && n.isOwner);
|
|
677
702
|
}), d = I(
|
|
678
703
|
() => Ut(P.value, { isOwner: y.value })
|
|
679
704
|
), h = Lt(), b = Tt().roles, r = I(() => {
|
|
@@ -686,45 +711,45 @@ const Ms = {
|
|
|
686
711
|
const W = c({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
|
|
687
712
|
function re(n) {
|
|
688
713
|
R.value = [...(n == null ? void 0 : n.permissionSetIds) ?? []], P.value = xt(
|
|
689
|
-
|
|
690
|
-
|
|
714
|
+
st(
|
|
715
|
+
tt(
|
|
691
716
|
R.value,
|
|
692
717
|
$.permissionSets.value
|
|
693
718
|
)
|
|
694
719
|
),
|
|
695
720
|
(n == null ? void 0 : n.permissions) || []
|
|
696
|
-
),
|
|
721
|
+
), k.value = n != null && n.posUser ? H(Ve(n.posUser), P.value) : void 0, x.value = !!k.value, U.value = fs(P.value, R.value), W.value = {
|
|
697
722
|
permissionSetIds: [...R.value],
|
|
698
|
-
userPermissions:
|
|
699
|
-
posUser:
|
|
723
|
+
userPermissions: Ve(P.value),
|
|
724
|
+
posUser: k.value ? Ve(k.value) : void 0
|
|
700
725
|
};
|
|
701
726
|
}
|
|
702
727
|
function ne() {
|
|
703
|
-
return !
|
|
728
|
+
return !Le.isEqual(R.value, W.value.permissionSetIds) || !Le.isEqual(P.value, W.value.userPermissions) || !Le.isEqual(k.value, W.value.posUser);
|
|
704
729
|
}
|
|
705
730
|
function Q(n) {
|
|
706
|
-
|
|
731
|
+
k.value = H(k.value, n);
|
|
707
732
|
}
|
|
708
733
|
function D(n) {
|
|
709
|
-
return
|
|
710
|
-
|
|
734
|
+
return st(
|
|
735
|
+
tt(n, $.permissionSets.value)
|
|
711
736
|
);
|
|
712
737
|
}
|
|
713
|
-
function
|
|
738
|
+
function o(n) {
|
|
714
739
|
P.value = D(n);
|
|
715
740
|
}
|
|
716
741
|
function S(n) {
|
|
717
742
|
const F = [...n ?? []];
|
|
718
|
-
if (
|
|
719
|
-
const J = !
|
|
743
|
+
if (Le.isEqual(F, R.value)) return;
|
|
744
|
+
const J = !Le.isEqual(
|
|
720
745
|
P.value,
|
|
721
746
|
D(R.value)
|
|
722
747
|
);
|
|
723
748
|
if (R.value = F, !J) {
|
|
724
|
-
|
|
749
|
+
o(F);
|
|
725
750
|
return;
|
|
726
751
|
}
|
|
727
|
-
|
|
752
|
+
f.open({
|
|
728
753
|
title: t("permissionSet.form.overrideInherited.title"),
|
|
729
754
|
message: t("permissionSet.form.overrideInherited.message"),
|
|
730
755
|
minWidth: u.value.lg ? 588 : 0,
|
|
@@ -737,96 +762,96 @@ const Ms = {
|
|
|
737
762
|
close: !0
|
|
738
763
|
}
|
|
739
764
|
}).onPrimary(() => {
|
|
740
|
-
|
|
765
|
+
o(F), f.close();
|
|
741
766
|
});
|
|
742
767
|
}
|
|
743
768
|
function z() {
|
|
744
769
|
var n, F;
|
|
745
770
|
return bs({
|
|
746
771
|
userPermissions: P.value,
|
|
747
|
-
inheritedPermissions:
|
|
772
|
+
inheritedPermissions: O.value,
|
|
748
773
|
permissionSetIds: R.value,
|
|
749
|
-
posUser:
|
|
774
|
+
posUser: k.value,
|
|
750
775
|
reportSubjects: X.value ? V.value : C,
|
|
751
776
|
defaultReportSubjects: B.value,
|
|
752
|
-
savedPosUser: (n =
|
|
753
|
-
fallbackName: ((F =
|
|
777
|
+
savedPosUser: (n = v.initialValue) == null ? void 0 : n.posUser,
|
|
778
|
+
fallbackName: ((F = v.initialValue) == null ? void 0 : F.name) || v.fallbackName
|
|
754
779
|
});
|
|
755
780
|
}
|
|
756
781
|
const se = c();
|
|
757
782
|
function H(n, F) {
|
|
758
783
|
if (!n) return n;
|
|
759
|
-
const J = Ut(F, { isOwner: y.value }), { roleIds: pe, restaurantIds:
|
|
760
|
-
if (pe === null &&
|
|
761
|
-
const ve =
|
|
784
|
+
const J = Ut(F, { isOwner: y.value }), { roleIds: pe, restaurantIds: he } = J;
|
|
785
|
+
if (pe === null && he === null) return n;
|
|
786
|
+
const ve = Ve(n);
|
|
762
787
|
return ve.roles = ve.roles.filter(
|
|
763
|
-
(Z) => (pe === null || pe.includes(Z.roleId)) && (
|
|
788
|
+
(Z) => (pe === null || pe.includes(Z.roleId)) && (he === null || he.includes(Z.restaurantId))
|
|
764
789
|
), ve;
|
|
765
790
|
}
|
|
766
|
-
const x = c(!!
|
|
767
|
-
function
|
|
768
|
-
|
|
791
|
+
const x = c(!!k.value), N = c(!1);
|
|
792
|
+
function je(n) {
|
|
793
|
+
k.value = n, N.value = !0;
|
|
769
794
|
}
|
|
770
795
|
return ue(
|
|
771
|
-
() => !!
|
|
796
|
+
() => !!k.value,
|
|
772
797
|
async (n) => {
|
|
773
798
|
n && !x.value && N.value && (await Mt(), se.value && se.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), x.value = n;
|
|
774
799
|
}
|
|
775
800
|
), ue(
|
|
776
|
-
() =>
|
|
801
|
+
() => v.initialValue,
|
|
777
802
|
(n, F) => {
|
|
778
803
|
if (!F || !n || F.id !== n.id) {
|
|
779
804
|
N.value = !1, re(n);
|
|
780
805
|
return;
|
|
781
806
|
}
|
|
782
|
-
n.posUser !== void 0 && !N.value && (
|
|
807
|
+
n.posUser !== void 0 && !N.value && (k.value = n.posUser ? H(Ve(n.posUser), P.value) : void 0, W.value = {
|
|
783
808
|
...W.value,
|
|
784
|
-
posUser:
|
|
809
|
+
posUser: k.value ? Ve(k.value) : void 0
|
|
785
810
|
});
|
|
786
811
|
},
|
|
787
812
|
{ immediate: !0 }
|
|
788
813
|
), ue(
|
|
789
814
|
P,
|
|
790
815
|
(n) => {
|
|
791
|
-
|
|
816
|
+
k.value = H(k.value, n);
|
|
792
817
|
},
|
|
793
818
|
{ deep: !0 }
|
|
794
|
-
),
|
|
819
|
+
), A({
|
|
795
820
|
readGrantData: z,
|
|
796
821
|
isModified: ne
|
|
797
822
|
}), (n, F) => {
|
|
798
|
-
var ve, Z,
|
|
799
|
-
const J = G("FmCircularProgress"), pe = G("FmSwitch"),
|
|
823
|
+
var ve, Z, xe, Me, Fe, Ge;
|
|
824
|
+
const J = G("FmCircularProgress"), pe = G("FmSwitch"), he = G("FmSelect");
|
|
800
825
|
return m(), M("div", Sa, [
|
|
801
|
-
(ve =
|
|
826
|
+
(ve = l.initialValue) != null && ve.isOwner ? T("", !0) : (m(), M("section", Va, [
|
|
802
827
|
p("div", Pa, [
|
|
803
828
|
p("p", Ra, E(s(t)("team.whereTheyWork.title")), 1),
|
|
804
829
|
p("p", Ma, E(s(t)("team.whereTheyWork.subtitle")), 1)
|
|
805
830
|
]),
|
|
806
831
|
i(ht, {
|
|
807
832
|
modelValue: P.value,
|
|
808
|
-
"onUpdate:modelValue": F[0] || (F[0] = (
|
|
833
|
+
"onUpdate:modelValue": F[0] || (F[0] = (_e) => P.value = _e),
|
|
809
834
|
part: "workplace",
|
|
810
|
-
"inherit-permissions":
|
|
835
|
+
"inherit-permissions": O.value,
|
|
811
836
|
onPermissionChanged: Q
|
|
812
837
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
813
838
|
])),
|
|
814
|
-
|
|
839
|
+
l.loading ? (m(), M("div", Fa, [
|
|
815
840
|
i(J, { size: "xl" })
|
|
816
|
-
])) : (m(), q(
|
|
841
|
+
])) : (m(), q(ka, {
|
|
817
842
|
key: 2,
|
|
818
843
|
ref_key: "masterUserContentRef",
|
|
819
844
|
ref: se,
|
|
820
|
-
"model-value":
|
|
821
|
-
"fallback-name": ((Z =
|
|
822
|
-
"fallback-passcode": (
|
|
845
|
+
"model-value": k.value,
|
|
846
|
+
"fallback-name": ((Z = l.initialValue) == null ? void 0 : Z.name) || l.fallbackName,
|
|
847
|
+
"fallback-passcode": (Me = (xe = l.initialValue) == null ? void 0 : xe.posUser) == null ? void 0 : Me.passcode,
|
|
823
848
|
roles: s(b),
|
|
824
849
|
"usable-role-ids": d.value.roleIds,
|
|
825
850
|
restaurants: r.value,
|
|
826
|
-
"pos-user-id": (
|
|
827
|
-
"onUpdate:modelValue":
|
|
851
|
+
"pos-user-id": (Fe = l.initialValue) == null ? void 0 : Fe.posUserId,
|
|
852
|
+
"onUpdate:modelValue": je
|
|
828
853
|
}, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "usable-role-ids", "restaurants", "pos-user-id"])),
|
|
829
|
-
(
|
|
854
|
+
(Ge = l.initialValue) != null && Ge.isOwner ? T("", !0) : (m(), M("section", $a, [
|
|
830
855
|
p("div", Ca, [
|
|
831
856
|
p("div", Da, [
|
|
832
857
|
p("p", Na, E(s(t)("team.portalAccess.title")), 1),
|
|
@@ -839,7 +864,7 @@ const Ms = {
|
|
|
839
864
|
}, null, 8, ["model-value"])
|
|
840
865
|
]),
|
|
841
866
|
U.value ? (m(), M(de, { key: 0 }, [
|
|
842
|
-
i(
|
|
867
|
+
i(he, {
|
|
843
868
|
"model-value": R.value,
|
|
844
869
|
multiselect: "",
|
|
845
870
|
searchable: "",
|
|
@@ -851,28 +876,28 @@ const Ms = {
|
|
|
851
876
|
}, null, 8, ["model-value", "label", "items", "placeholder"]),
|
|
852
877
|
i(ht, {
|
|
853
878
|
modelValue: P.value,
|
|
854
|
-
"onUpdate:modelValue": F[1] || (F[1] = (
|
|
879
|
+
"onUpdate:modelValue": F[1] || (F[1] = (_e) => P.value = _e),
|
|
855
880
|
part: "portal",
|
|
856
|
-
"inherit-permissions":
|
|
881
|
+
"inherit-permissions": O.value,
|
|
857
882
|
onPermissionChanged: Q
|
|
858
883
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
859
|
-
], 64)) :
|
|
884
|
+
], 64)) : T("", !0)
|
|
860
885
|
]))
|
|
861
886
|
]);
|
|
862
887
|
};
|
|
863
888
|
}
|
|
864
889
|
}), St = {
|
|
865
|
-
async readPermissionUserByPhoneNo(
|
|
866
|
-
return
|
|
867
|
-
await
|
|
868
|
-
`/portal-users/search-by-phone/${encodeURIComponent(
|
|
890
|
+
async readPermissionUserByPhoneNo(l) {
|
|
891
|
+
return be(
|
|
892
|
+
await ye().get(
|
|
893
|
+
`/portal-users/search-by-phone/${encodeURIComponent(l)}`
|
|
869
894
|
)
|
|
870
895
|
);
|
|
871
896
|
},
|
|
872
|
-
async readPermissionUserByEmail(
|
|
873
|
-
return
|
|
874
|
-
await
|
|
875
|
-
`/portal-users/search-by-email/${encodeURIComponent(
|
|
897
|
+
async readPermissionUserByEmail(l) {
|
|
898
|
+
return be(
|
|
899
|
+
await ye().get(
|
|
900
|
+
`/portal-users/search-by-email/${encodeURIComponent(l)}`
|
|
876
901
|
)
|
|
877
902
|
);
|
|
878
903
|
}
|
|
@@ -882,43 +907,43 @@ const Ms = {
|
|
|
882
907
|
}, Ta = { class: "user-info-icon user-info-icon--lg" }, Ba = { class: "flex-1 overflow-hidden" }, ja = { class: "profile-displayName" }, qa = { class: "profile-email" }, Ga = { class: "profile-phone" }, Ka = { key: 2 }, Wa = /* @__PURE__ */ oe({
|
|
883
908
|
__name: "PortalUserSearcher",
|
|
884
909
|
emits: ["invite"],
|
|
885
|
-
setup(
|
|
886
|
-
const
|
|
910
|
+
setup(l, { emit: A }) {
|
|
911
|
+
const v = A, { t } = ce(), f = ot(), u = He(), { supportedCountries: $, ready: K } = Ye(), R = I(() => {
|
|
887
912
|
var r;
|
|
888
913
|
const b = (r = u.currentCountry.value) == null ? void 0 : r.toUpperCase();
|
|
889
|
-
return b &&
|
|
890
|
-
}),
|
|
914
|
+
return b && rt(b) ? b : void 0;
|
|
915
|
+
}), O = c("phone"), k = c(""), P = c(""), _ = c(), X = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, C = I(() => X.test(P.value.trim()));
|
|
891
916
|
async function V() {
|
|
892
|
-
const b =
|
|
917
|
+
const b = O.value === "phone" ? k.value.replace(/ /g, "") : P.value.trim();
|
|
893
918
|
if (!b) {
|
|
894
|
-
|
|
919
|
+
f.open({
|
|
895
920
|
type: "error",
|
|
896
921
|
title: t("team.memberForm.searchUser.emptyError")
|
|
897
922
|
});
|
|
898
923
|
return;
|
|
899
924
|
}
|
|
900
|
-
if (
|
|
901
|
-
|
|
925
|
+
if (O.value === "email" && !C.value) {
|
|
926
|
+
f.open({
|
|
902
927
|
type: "error",
|
|
903
928
|
title: t("team.memberForm.searchUser.invalidEmail")
|
|
904
929
|
});
|
|
905
930
|
return;
|
|
906
931
|
}
|
|
907
932
|
const r = () => {
|
|
908
|
-
_.value = void 0,
|
|
933
|
+
_.value = void 0, f.open({
|
|
909
934
|
type: "error",
|
|
910
935
|
title: t("team.memberForm.searchUser.userNotFound")
|
|
911
936
|
});
|
|
912
937
|
};
|
|
913
938
|
try {
|
|
914
|
-
const U =
|
|
939
|
+
const U = O.value === "phone" ? await St.readPermissionUserByPhoneNo(b) : await St.readPermissionUserByEmail(b);
|
|
915
940
|
if (!U) {
|
|
916
941
|
r();
|
|
917
942
|
return;
|
|
918
943
|
}
|
|
919
944
|
_.value = U;
|
|
920
945
|
} catch {
|
|
921
|
-
_.value = void 0,
|
|
946
|
+
_.value = void 0, f.open({
|
|
922
947
|
type: "error",
|
|
923
948
|
title: t("team.memberForm.searchUser.searchFailed")
|
|
924
949
|
});
|
|
@@ -932,41 +957,41 @@ const Ms = {
|
|
|
932
957
|
return U ? `${r[0]}${U[0]}` : r.slice(0, 2);
|
|
933
958
|
}), y = c(!1);
|
|
934
959
|
function d(b) {
|
|
935
|
-
|
|
960
|
+
v("invite", b), y.value = !0;
|
|
936
961
|
}
|
|
937
962
|
function h() {
|
|
938
963
|
y.value = !1;
|
|
939
964
|
}
|
|
940
965
|
return (b, r) => {
|
|
941
|
-
var D,
|
|
966
|
+
var D, o, S;
|
|
942
967
|
const U = G("FmRadio"), j = G("FmPhoneNumber"), W = G("FmCircularProgress"), re = G("FmTextField"), ne = G("FmRadioGroup"), Q = G("FmButton");
|
|
943
968
|
return m(), M("div", Oa, [
|
|
944
|
-
y.value ?
|
|
969
|
+
y.value ? T("", !0) : (m(), M("div", La, [
|
|
945
970
|
i(ne, {
|
|
946
|
-
modelValue:
|
|
947
|
-
"onUpdate:modelValue": r[2] || (r[2] = (z) =>
|
|
971
|
+
modelValue: O.value,
|
|
972
|
+
"onUpdate:modelValue": r[2] || (r[2] = (z) => O.value = z)
|
|
948
973
|
}, {
|
|
949
974
|
default: te(() => [
|
|
950
975
|
i(U, {
|
|
951
976
|
value: "phone",
|
|
952
977
|
label: s(t)("team.memberForm.searchUser.phoneNumber")
|
|
953
978
|
}, null, 8, ["label"]),
|
|
954
|
-
|
|
979
|
+
O.value === "phone" && s(K) ? (m(), q(j, {
|
|
955
980
|
key: 0,
|
|
956
|
-
modelValue:
|
|
957
|
-
"onUpdate:modelValue": r[0] || (r[0] = (z) =>
|
|
981
|
+
modelValue: k.value,
|
|
982
|
+
"onUpdate:modelValue": r[0] || (r[0] = (z) => k.value = z),
|
|
958
983
|
"default-country": R.value,
|
|
959
984
|
"extra-country-codes": s($),
|
|
960
985
|
class: "ml-8"
|
|
961
|
-
}, null, 8, ["modelValue", "default-country", "extra-country-codes"])) :
|
|
986
|
+
}, null, 8, ["modelValue", "default-country", "extra-country-codes"])) : O.value === "phone" ? (m(), q(W, {
|
|
962
987
|
key: 1,
|
|
963
988
|
class: "ml-8"
|
|
964
|
-
})) :
|
|
989
|
+
})) : T("", !0),
|
|
965
990
|
i(U, {
|
|
966
991
|
value: "email",
|
|
967
992
|
label: s(t)("team.memberForm.searchUser.email")
|
|
968
993
|
}, null, 8, ["label"]),
|
|
969
|
-
|
|
994
|
+
O.value === "email" ? (m(), q(re, {
|
|
970
995
|
key: 2,
|
|
971
996
|
modelValue: P.value,
|
|
972
997
|
"onUpdate:modelValue": r[1] || (r[1] = (z) => P.value = z),
|
|
@@ -975,7 +1000,7 @@ const Ms = {
|
|
|
975
1000
|
(z) => !z || C.value || s(t)("team.memberForm.searchUser.invalidEmail")
|
|
976
1001
|
],
|
|
977
1002
|
class: "ml-8"
|
|
978
|
-
}, null, 8, ["modelValue", "placeholder", "rules"])) :
|
|
1003
|
+
}, null, 8, ["modelValue", "placeholder", "rules"])) : T("", !0)
|
|
979
1004
|
]),
|
|
980
1005
|
_: 1
|
|
981
1006
|
}, 8, ["modelValue"]),
|
|
@@ -993,17 +1018,17 @@ const Ms = {
|
|
|
993
1018
|
p("div", Ta, E(B.value), 1),
|
|
994
1019
|
p("div", Ba, [
|
|
995
1020
|
p("p", ja, E((D = _.value) == null ? void 0 : D.displayName), 1),
|
|
996
|
-
p("p", qa, E((
|
|
1021
|
+
p("p", qa, E((o = _.value) == null ? void 0 : o.email), 1),
|
|
997
1022
|
p("p", Ga, E((S = _.value) == null ? void 0 : S.phoneNumber), 1)
|
|
998
1023
|
])
|
|
999
|
-
])) :
|
|
1024
|
+
])) : T("", !0),
|
|
1000
1025
|
y.value ? (m(), M("div", Ka, [
|
|
1001
1026
|
i(Q, {
|
|
1002
1027
|
label: s(t)("team.memberForm.searchUser.changeUser"),
|
|
1003
1028
|
variant: "secondary",
|
|
1004
1029
|
onClick: h
|
|
1005
1030
|
}, null, 8, ["label"])
|
|
1006
|
-
])) :
|
|
1031
|
+
])) : T("", !0)
|
|
1007
1032
|
]);
|
|
1008
1033
|
};
|
|
1009
1034
|
}
|
|
@@ -1038,60 +1063,60 @@ const Ms = {
|
|
|
1038
1063
|
}
|
|
1039
1064
|
},
|
|
1040
1065
|
emits: ["update-existing"],
|
|
1041
|
-
setup(
|
|
1042
|
-
const t =
|
|
1066
|
+
setup(l, { expose: A, emit: v }) {
|
|
1067
|
+
const t = l, f = v, u = I(() => !t.initialValue && t.providers.length > 0), { t: $ } = ce(), K = He(), { supportedCountries: R, ready: O } = Ye(), k = I(() => {
|
|
1043
1068
|
var S;
|
|
1044
|
-
const
|
|
1045
|
-
return
|
|
1069
|
+
const o = (S = K.currentCountry.value) == null ? void 0 : S.toUpperCase();
|
|
1070
|
+
return o && rt(o) ? o : void 0;
|
|
1046
1071
|
}), P = I(() => {
|
|
1047
|
-
var
|
|
1048
|
-
return ((
|
|
1072
|
+
var o;
|
|
1073
|
+
return ((o = t.initialValue) == null ? void 0 : o.status) === "invited";
|
|
1049
1074
|
}), _ = I(() => !!t.initialValue && !t.initialValue.isOwner), X = c(""), C = c(""), V = c("");
|
|
1050
|
-
function B(
|
|
1051
|
-
X.value = (
|
|
1075
|
+
function B(o) {
|
|
1076
|
+
X.value = (o == null ? void 0 : o.displayName) ?? (o == null ? void 0 : o.name) ?? "", C.value = (o == null ? void 0 : o.employeeId) ?? "", V.value = (o == null ? void 0 : o.contact) ?? "";
|
|
1052
1077
|
}
|
|
1053
1078
|
B(t.initialValue);
|
|
1054
1079
|
function y() {
|
|
1055
1080
|
var S;
|
|
1056
1081
|
if (!_.value) return null;
|
|
1057
|
-
const
|
|
1082
|
+
const o = ((S = t.initialValue) == null ? void 0 : S.match) === "email" ? Te(V.value) ? Re(V.value) ?? "" : "" : V.value.trim().toLowerCase();
|
|
1058
1083
|
return {
|
|
1059
1084
|
displayName: X.value.trim(),
|
|
1060
1085
|
employeeId: C.value.trim(),
|
|
1061
|
-
contact:
|
|
1086
|
+
contact: o
|
|
1062
1087
|
};
|
|
1063
1088
|
}
|
|
1064
1089
|
function d() {
|
|
1065
|
-
const
|
|
1066
|
-
return !
|
|
1090
|
+
const o = t.initialValue;
|
|
1091
|
+
return !o || !_.value ? !1 : C.value.trim() !== (o.employeeId ?? "") || P.value && (X.value.trim() !== (o.displayName ?? o.name) || V.value.trim() !== (o.contact ?? ""));
|
|
1067
1092
|
}
|
|
1068
1093
|
const h = c(), b = c(), r = c();
|
|
1069
1094
|
function U() {
|
|
1070
|
-
var
|
|
1071
|
-
return u.value && ((
|
|
1095
|
+
var o, S;
|
|
1096
|
+
return u.value && ((o = r.value) != null && o.isModified()) || d() || !t.initialValue && h.value ? !0 : ((S = b.value) == null ? void 0 : S.isModified()) ?? !1;
|
|
1072
1097
|
}
|
|
1073
|
-
function j(
|
|
1074
|
-
h.value =
|
|
1098
|
+
function j(o) {
|
|
1099
|
+
h.value = o;
|
|
1075
1100
|
}
|
|
1076
|
-
function W(
|
|
1077
|
-
return X.value === (
|
|
1101
|
+
function W(o) {
|
|
1102
|
+
return X.value === (o.displayName ?? o.name) && C.value === (o.employeeId ?? "") && V.value === (o.contact ?? "");
|
|
1078
1103
|
}
|
|
1079
1104
|
function re() {
|
|
1080
1105
|
var S, z, se, H, x;
|
|
1081
|
-
const
|
|
1106
|
+
const o = ((S = b.value) == null ? void 0 : S.readGrantData()) ?? ys;
|
|
1082
1107
|
return {
|
|
1083
1108
|
email: ((z = h.value) == null ? void 0 : z.email) ?? void 0,
|
|
1084
1109
|
phoneNumber: ((se = h.value) == null ? void 0 : se.phoneNumber) ?? void 0,
|
|
1085
|
-
customPermissions:
|
|
1086
|
-
permissions:
|
|
1087
|
-
permissionSetIds:
|
|
1110
|
+
customPermissions: o.customPermissions,
|
|
1111
|
+
permissions: o.permissions,
|
|
1112
|
+
permissionSetIds: o.permissionSetIds,
|
|
1088
1113
|
name: ((H = h.value) == null ? void 0 : H.displayName) || ((x = t.initialValue) == null ? void 0 : x.name) || "",
|
|
1089
|
-
posUser:
|
|
1114
|
+
posUser: o.posUser
|
|
1090
1115
|
};
|
|
1091
1116
|
}
|
|
1092
1117
|
function ne() {
|
|
1093
|
-
var
|
|
1094
|
-
return u.value ? ((
|
|
1118
|
+
var o;
|
|
1119
|
+
return u.value ? ((o = r.value) == null ? void 0 : o.readDetails()) ?? null : null;
|
|
1095
1120
|
}
|
|
1096
1121
|
const Q = c();
|
|
1097
1122
|
async function D() {
|
|
@@ -1099,10 +1124,10 @@ const Ms = {
|
|
|
1099
1124
|
}
|
|
1100
1125
|
return ue(
|
|
1101
1126
|
() => t.initialValue,
|
|
1102
|
-
(
|
|
1103
|
-
(!S || !
|
|
1127
|
+
(o, S) => {
|
|
1128
|
+
(!S || !o || S.id !== o.id) && (h.value = void 0), (!S || !o || S.id !== o.id || W(S)) && B(o);
|
|
1104
1129
|
}
|
|
1105
|
-
),
|
|
1130
|
+
), A({
|
|
1106
1131
|
readFormData: re,
|
|
1107
1132
|
readDetails: ne,
|
|
1108
1133
|
readEdits: y,
|
|
@@ -1110,14 +1135,14 @@ const Ms = {
|
|
|
1110
1135
|
isModified: U,
|
|
1111
1136
|
/** Add stays disabled while the sign-in key belongs to someone already (AC4). */
|
|
1112
1137
|
hasExisting: I(() => {
|
|
1113
|
-
var
|
|
1114
|
-
return !!((
|
|
1138
|
+
var o;
|
|
1139
|
+
return !!((o = r.value) != null && o.hasExisting);
|
|
1115
1140
|
}),
|
|
1116
1141
|
providerLabel: I(() => {
|
|
1117
|
-
var
|
|
1118
|
-
return ((
|
|
1142
|
+
var o;
|
|
1143
|
+
return ((o = r.value) == null ? void 0 : o.providerLabel) ?? "";
|
|
1119
1144
|
})
|
|
1120
|
-
}), (
|
|
1145
|
+
}), (o, S) => {
|
|
1121
1146
|
const z = G("FmTextField"), se = G("FmPhoneNumber"), H = G("FmForm");
|
|
1122
1147
|
return m(), q(H, {
|
|
1123
1148
|
ref_key: "formRef",
|
|
@@ -1132,14 +1157,14 @@ const Ms = {
|
|
|
1132
1157
|
key: 0,
|
|
1133
1158
|
ref_key: "detailsRef",
|
|
1134
1159
|
ref: r,
|
|
1135
|
-
providers:
|
|
1136
|
-
onUpdateExisting: S[0] || (S[0] = (N) =>
|
|
1137
|
-
}, null, 8, ["providers"])) :
|
|
1160
|
+
providers: l.providers,
|
|
1161
|
+
onUpdateExisting: S[0] || (S[0] = (N) => f("update-existing", N))
|
|
1162
|
+
}, null, 8, ["providers"])) : l.initialValue ? (m(), q(na, {
|
|
1138
1163
|
key: 2,
|
|
1139
|
-
name:
|
|
1140
|
-
status:
|
|
1141
|
-
email:
|
|
1142
|
-
"phone-number":
|
|
1164
|
+
name: l.initialValue.name,
|
|
1165
|
+
status: l.initialValue.status ?? "active",
|
|
1166
|
+
email: l.initialValue.email,
|
|
1167
|
+
"phone-number": l.initialValue.phoneNumber
|
|
1143
1168
|
}, {
|
|
1144
1169
|
default: te(() => [
|
|
1145
1170
|
_.value ? (m(), M("div", Ya, [
|
|
@@ -1153,7 +1178,7 @@ const Ms = {
|
|
|
1153
1178
|
(N) => !!N.trim() || s($)("team.memberDetails.errors.nameRequired"),
|
|
1154
1179
|
(N) => N.trim().length <= s(Nt) || s($)("team.memberDetails.errors.nameTooLong")
|
|
1155
1180
|
]
|
|
1156
|
-
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) :
|
|
1181
|
+
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : T("", !0),
|
|
1157
1182
|
i(z, {
|
|
1158
1183
|
modelValue: C.value,
|
|
1159
1184
|
"onUpdate:modelValue": S[3] || (S[3] = (N) => C.value = N),
|
|
@@ -1165,7 +1190,7 @@ const Ms = {
|
|
|
1165
1190
|
]
|
|
1166
1191
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"]),
|
|
1167
1192
|
P.value ? (m(), M(de, { key: 1 }, [
|
|
1168
|
-
|
|
1193
|
+
l.initialValue.match === "mobile" ? (m(), q(z, {
|
|
1169
1194
|
key: 0,
|
|
1170
1195
|
modelValue: V.value,
|
|
1171
1196
|
"onUpdate:modelValue": S[4] || (S[4] = (N) => V.value = N),
|
|
@@ -1173,22 +1198,22 @@ const Ms = {
|
|
|
1173
1198
|
"label-mark": "optional",
|
|
1174
1199
|
placeholder: s($)("team.memberDetails.emailPlaceholder"),
|
|
1175
1200
|
rules: [
|
|
1176
|
-
(N) => !N.trim() || s(
|
|
1201
|
+
(N) => !N.trim() || s(Xe)(N) || s($)("team.memberDetails.errors.emailInvalid")
|
|
1177
1202
|
]
|
|
1178
|
-
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : s(
|
|
1203
|
+
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : s(O) ? (m(), q(se, {
|
|
1179
1204
|
key: 1,
|
|
1180
1205
|
modelValue: V.value,
|
|
1181
1206
|
"onUpdate:modelValue": S[5] || (S[5] = (N) => V.value = N),
|
|
1182
1207
|
label: s($)("team.memberDetails.phoneNumber"),
|
|
1183
1208
|
"label-mark": "optional",
|
|
1184
|
-
"default-country":
|
|
1209
|
+
"default-country": k.value,
|
|
1185
1210
|
"extra-country-codes": s(R),
|
|
1186
1211
|
rules: [
|
|
1187
|
-
(N) => !s(
|
|
1212
|
+
(N) => !s(Te)(N) || !!s(Re)(N) || s($)("team.memberDetails.errors.mobileInvalid")
|
|
1188
1213
|
]
|
|
1189
|
-
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) :
|
|
1190
|
-
], 64)) :
|
|
1191
|
-
])) :
|
|
1214
|
+
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) : T("", !0)
|
|
1215
|
+
], 64)) : T("", !0)
|
|
1216
|
+
])) : T("", !0)
|
|
1192
1217
|
]),
|
|
1193
1218
|
_: 1
|
|
1194
1219
|
}, 8, ["name", "status", "email", "phone-number"])) : (m(), M("div", Ha, [
|
|
@@ -1196,14 +1221,14 @@ const Ms = {
|
|
|
1196
1221
|
onInvite: S[1] || (S[1] = (N) => j(N))
|
|
1197
1222
|
})
|
|
1198
1223
|
])),
|
|
1199
|
-
u.value || h.value ||
|
|
1224
|
+
u.value || h.value || l.initialValue ? (m(), q(Aa, {
|
|
1200
1225
|
key: 3,
|
|
1201
1226
|
ref_key: "grantFieldsRef",
|
|
1202
1227
|
ref: b,
|
|
1203
|
-
"initial-value":
|
|
1228
|
+
"initial-value": l.initialValue,
|
|
1204
1229
|
"fallback-name": ((x = h.value) == null ? void 0 : x.displayName) || "",
|
|
1205
|
-
loading:
|
|
1206
|
-
}, null, 8, ["initial-value", "fallback-name", "loading"])) :
|
|
1230
|
+
loading: l.loading
|
|
1231
|
+
}, null, 8, ["initial-value", "fallback-name", "loading"])) : T("", !0)
|
|
1207
1232
|
])
|
|
1208
1233
|
];
|
|
1209
1234
|
}),
|
|
@@ -1233,40 +1258,40 @@ const Ms = {
|
|
|
1233
1258
|
class: "fm-typo-en-title-md-600"
|
|
1234
1259
|
}, nl = {
|
|
1235
1260
|
class: "flex items-center justify-start gap-8"
|
|
1236
|
-
},
|
|
1237
|
-
var ae = /* @__PURE__ */ function(
|
|
1238
|
-
return
|
|
1261
|
+
}, Ne = 100, il = 2;
|
|
1262
|
+
var ae = /* @__PURE__ */ function(l) {
|
|
1263
|
+
return l[l.ADD = 0] = "ADD", l[l.UPDATE = 1] = "UPDATE", l[l.CLOSED = 2] = "CLOSED", l;
|
|
1239
1264
|
}(ae || {});
|
|
1240
1265
|
const Rl = /* @__PURE__ */ oe({
|
|
1241
1266
|
__name: "TeamMemberList",
|
|
1242
|
-
setup(
|
|
1243
|
-
expose:
|
|
1267
|
+
setup(l, {
|
|
1268
|
+
expose: A
|
|
1244
1269
|
}) {
|
|
1245
1270
|
const {
|
|
1246
|
-
fetchCustomReportPermissions:
|
|
1271
|
+
fetchCustomReportPermissions: v
|
|
1247
1272
|
} = Ot();
|
|
1248
|
-
|
|
1273
|
+
Ye();
|
|
1249
1274
|
const {
|
|
1250
1275
|
t
|
|
1251
|
-
} = ce(),
|
|
1276
|
+
} = ce(), f = He(), {
|
|
1252
1277
|
providers: u,
|
|
1253
1278
|
hasProviders: $,
|
|
1254
1279
|
canInvite: K,
|
|
1255
1280
|
providerLabel: R
|
|
1256
|
-
} = hs(),
|
|
1257
|
-
ue(
|
|
1281
|
+
} = hs(), O = I(() => K.value ? u.value : []), k = Lt(), P = Tt(), _ = ot(), X = Dt(_), C = At(), V = Us(), B = c(!0), y = c(!1), d = I(() => k.isLoading.value), h = c([]), b = c(0), r = c(1), U = c(""), j = c("");
|
|
1282
|
+
ue(k.restaurants, (e) => {
|
|
1258
1283
|
if (e.length > 0 && h.value.length > 0) {
|
|
1259
|
-
const a = new Map(e.map((
|
|
1260
|
-
h.value = h.value.map((
|
|
1261
|
-
...
|
|
1262
|
-
restaurants:
|
|
1284
|
+
const a = new Map(e.map((w) => [w._id, w.profile.name])), g = e.map((w) => w.profile.name).sort();
|
|
1285
|
+
h.value = h.value.map((w) => ({
|
|
1286
|
+
...w,
|
|
1287
|
+
restaurants: w.managableRestaurantIds === null ? g : w.managableRestaurantIds.map((Y) => a.get(Y) ?? "").filter(Boolean).sort()
|
|
1263
1288
|
}));
|
|
1264
1289
|
}
|
|
1265
1290
|
});
|
|
1266
1291
|
const W = I(() => [{
|
|
1267
1292
|
label: t("team.filter.unassigned_label"),
|
|
1268
|
-
value:
|
|
1269
|
-
}, ...
|
|
1293
|
+
value: Be
|
|
1294
|
+
}, ...k.restaurants.value.map((e) => ({
|
|
1270
1295
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
1271
1296
|
value: e._id
|
|
1272
1297
|
}))]), re = ({
|
|
@@ -1275,27 +1300,27 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1275
1300
|
}) => {
|
|
1276
1301
|
const g = {
|
|
1277
1302
|
label: t("team.actions.updateMember"),
|
|
1278
|
-
onClick: () => n(
|
|
1279
|
-
},
|
|
1303
|
+
onClick: () => n(Ee.Update, e)
|
|
1304
|
+
}, w = {
|
|
1280
1305
|
label: t("team.actions.removeMember"),
|
|
1281
|
-
onClick: () => n(
|
|
1306
|
+
onClick: () => n(Ee.Remove, e),
|
|
1282
1307
|
itemClass: "text-fm-color-typo-error"
|
|
1283
1308
|
};
|
|
1284
1309
|
if (e.status === "invited") {
|
|
1285
1310
|
const le = {
|
|
1286
1311
|
label: t("team.staffInvite.actions.resend"),
|
|
1287
1312
|
onClick: () => qt(e)
|
|
1288
|
-
},
|
|
1313
|
+
}, De = {
|
|
1289
1314
|
label: t("team.staffInvite.actions.revoke"),
|
|
1290
1315
|
onClick: () => jt(e),
|
|
1291
1316
|
itemClass: "text-fm-color-typo-error"
|
|
1292
1317
|
};
|
|
1293
1318
|
return i(bt, {
|
|
1294
1319
|
class: a,
|
|
1295
|
-
items: [g, le,
|
|
1320
|
+
items: [g, le, De]
|
|
1296
1321
|
}, null);
|
|
1297
1322
|
}
|
|
1298
|
-
const Y = e.doc.isOwner ? [g] : [g,
|
|
1323
|
+
const Y = e.doc.isOwner ? [g] : [g, w];
|
|
1299
1324
|
return i(bt, {
|
|
1300
1325
|
class: a,
|
|
1301
1326
|
items: Y
|
|
@@ -1305,9 +1330,9 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1305
1330
|
const a = e.restaurants.slice(0, il), g = e.restaurants.length - a.length;
|
|
1306
1331
|
return i("div", {
|
|
1307
1332
|
class: "flex flex-col gap-4 py-4"
|
|
1308
|
-
}, [a.map((
|
|
1333
|
+
}, [a.map((w) => i("span", {
|
|
1309
1334
|
class: "truncate"
|
|
1310
|
-
}, [
|
|
1335
|
+
}, [w])), g > 0 && i("span", {
|
|
1311
1336
|
class: "text-fm-color-primary"
|
|
1312
1337
|
}, [t("team.labels.moreRestaurants", {
|
|
1313
1338
|
count: g
|
|
@@ -1320,9 +1345,9 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1320
1345
|
const a = e.row.original;
|
|
1321
1346
|
return i("div", {
|
|
1322
1347
|
class: "flex items-center gap-8"
|
|
1323
|
-
}, [i(
|
|
1348
|
+
}, [i(Qe.FmAvatar, {
|
|
1324
1349
|
name: a.name,
|
|
1325
|
-
initials:
|
|
1350
|
+
initials: nt(a.name),
|
|
1326
1351
|
size: "sm",
|
|
1327
1352
|
class: "shrink-0"
|
|
1328
1353
|
}, null), i("span", {
|
|
@@ -1358,8 +1383,8 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1358
1383
|
header: () => t("team.table.columns.assignedRoles"),
|
|
1359
1384
|
enableSorting: !1,
|
|
1360
1385
|
cell(e) {
|
|
1361
|
-
const a = e.row.original, g = V.getPermissionAssignmentByUserId(a.id),
|
|
1362
|
-
return C.permissionSets.value.filter((le) =>
|
|
1386
|
+
const a = e.row.original, g = V.getPermissionAssignmentByUserId(a.id), w = (g == null ? void 0 : g.permissionSetIds) || a.doc.permissionSetIds || [];
|
|
1387
|
+
return C.permissionSets.value.filter((le) => w.includes(le.id)).map((le) => le.name).join(", ");
|
|
1363
1388
|
}
|
|
1364
1389
|
}, {
|
|
1365
1390
|
accessorKey: "permission",
|
|
@@ -1367,7 +1392,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1367
1392
|
enableSorting: !1,
|
|
1368
1393
|
cell(e) {
|
|
1369
1394
|
const a = e.row.original;
|
|
1370
|
-
return
|
|
1395
|
+
return o(a);
|
|
1371
1396
|
},
|
|
1372
1397
|
meta: {
|
|
1373
1398
|
width: "200px"
|
|
@@ -1384,7 +1409,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1384
1409
|
header: () => t("team.table.columns.status"),
|
|
1385
1410
|
enableSorting: !1,
|
|
1386
1411
|
cell(e) {
|
|
1387
|
-
return i(
|
|
1412
|
+
return i(it, {
|
|
1388
1413
|
status: e.row.original.status
|
|
1389
1414
|
}, null);
|
|
1390
1415
|
}
|
|
@@ -1403,14 +1428,14 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1403
1428
|
},
|
|
1404
1429
|
enableSorting: !1
|
|
1405
1430
|
}];
|
|
1406
|
-
function
|
|
1431
|
+
function o(e) {
|
|
1407
1432
|
if (e.doc.isOwner)
|
|
1408
1433
|
return t("team.labels.businessOwner");
|
|
1409
|
-
const a = i(
|
|
1434
|
+
const a = i(Qe.FmTooltip, {
|
|
1410
1435
|
variant: "plain",
|
|
1411
1436
|
placement: "top"
|
|
1412
1437
|
}, {
|
|
1413
|
-
default: () => i(
|
|
1438
|
+
default: () => i(Qe.FmIcon, {
|
|
1414
1439
|
name: "info",
|
|
1415
1440
|
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
1416
1441
|
}, null),
|
|
@@ -1423,8 +1448,8 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1423
1448
|
})]), e.permissionLabels.length > 0 && a]);
|
|
1424
1449
|
}
|
|
1425
1450
|
function S(e) {
|
|
1426
|
-
var Y, le,
|
|
1427
|
-
const a = V.getPermissionAssignmentByUserId(e.id), g = (a == null ? void 0 : a.customPermissions) ?? e.permissions ?? [],
|
|
1451
|
+
var Y, le, De, Oe;
|
|
1452
|
+
const a = V.getPermissionAssignmentByUserId(e.id), g = (a == null ? void 0 : a.customPermissions) ?? e.permissions ?? [], w = (a == null ? void 0 : a.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
1428
1453
|
return {
|
|
1429
1454
|
id: e.id,
|
|
1430
1455
|
isOwner: e.doc.isOwner,
|
|
@@ -1432,12 +1457,12 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1432
1457
|
phoneNumber: e.phoneNumber,
|
|
1433
1458
|
email: e.email,
|
|
1434
1459
|
permissions: g,
|
|
1435
|
-
permissionSetIds:
|
|
1460
|
+
permissionSetIds: w,
|
|
1436
1461
|
posUser: e.doc.posUser ? {
|
|
1437
1462
|
code: ((Y = e.doc.posUser) == null ? void 0 : Y.code) ?? "",
|
|
1438
1463
|
name: ((le = e.doc.posUser) == null ? void 0 : le.name) ?? e.name,
|
|
1439
|
-
passcode: ((
|
|
1440
|
-
roles: ((
|
|
1464
|
+
passcode: ((De = e.doc.posUser) == null ? void 0 : De.passcode) ?? "",
|
|
1465
|
+
roles: ((Oe = e.doc.posUser) == null ? void 0 : Oe.roles) ?? []
|
|
1441
1466
|
} : void 0,
|
|
1442
1467
|
posUserId: e.doc.posUserId,
|
|
1443
1468
|
status: e.status,
|
|
@@ -1445,7 +1470,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1445
1470
|
};
|
|
1446
1471
|
}
|
|
1447
1472
|
function z(e) {
|
|
1448
|
-
const a = V.getPermissionAssignmentByUserId(e.id), g = (a == null ? void 0 : a.customPermissions) ?? e.permissions ?? [],
|
|
1473
|
+
const a = V.getPermissionAssignmentByUserId(e.id), g = (a == null ? void 0 : a.customPermissions) ?? e.permissions ?? [], w = (a == null ? void 0 : a.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
1449
1474
|
return {
|
|
1450
1475
|
id: e.id,
|
|
1451
1476
|
isOwner: e.doc.isOwner,
|
|
@@ -1453,7 +1478,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1453
1478
|
phoneNumber: e.phoneNumber,
|
|
1454
1479
|
email: e.email,
|
|
1455
1480
|
permissions: g,
|
|
1456
|
-
permissionSetIds:
|
|
1481
|
+
permissionSetIds: w,
|
|
1457
1482
|
posUser: void 0,
|
|
1458
1483
|
posUserId: e.doc.posUserId,
|
|
1459
1484
|
status: e.status,
|
|
@@ -1461,7 +1486,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1461
1486
|
};
|
|
1462
1487
|
}
|
|
1463
1488
|
function se(e) {
|
|
1464
|
-
var a, g,
|
|
1489
|
+
var a, g, w, Y;
|
|
1465
1490
|
return {
|
|
1466
1491
|
id: e._id,
|
|
1467
1492
|
isOwner: !1,
|
|
@@ -1476,7 +1501,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1476
1501
|
displayName: e.displayName ?? "",
|
|
1477
1502
|
employeeId: e.employeeId ?? null,
|
|
1478
1503
|
match: e.match,
|
|
1479
|
-
contact: (e.match === "mobile" ? (
|
|
1504
|
+
contact: (e.match === "mobile" ? (w = e.contact) == null ? void 0 : w.email : (Y = e.contact) == null ? void 0 : Y.mobile) ?? ""
|
|
1480
1505
|
};
|
|
1481
1506
|
}
|
|
1482
1507
|
const H = c(null);
|
|
@@ -1489,13 +1514,13 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1489
1514
|
async function N(e) {
|
|
1490
1515
|
const a = ++ee;
|
|
1491
1516
|
try {
|
|
1492
|
-
const g = typeof e == "string" ? (await
|
|
1517
|
+
const g = typeof e == "string" ? (await Ae.readInvites()).find((w) => w._id === e) : e;
|
|
1493
1518
|
if (a !== ee) return;
|
|
1494
1519
|
if (!g) {
|
|
1495
1520
|
_.open({
|
|
1496
1521
|
type: "error",
|
|
1497
1522
|
title: t("team.staffInvite.errors.not_pending")
|
|
1498
|
-
}), await
|
|
1523
|
+
}), await ke();
|
|
1499
1524
|
return;
|
|
1500
1525
|
}
|
|
1501
1526
|
H.value = g, Z.value = se(g), J.value = ae.UPDATE;
|
|
@@ -1507,11 +1532,11 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1507
1532
|
});
|
|
1508
1533
|
}
|
|
1509
1534
|
}
|
|
1510
|
-
async function
|
|
1535
|
+
async function je(e) {
|
|
1511
1536
|
const a = ++ee;
|
|
1512
|
-
H.value = null, Z.value = z(e), J.value = ae.UPDATE,
|
|
1537
|
+
H.value = null, Z.value = z(e), J.value = ae.UPDATE, ge.value = e.doc.hasPosUser === !0;
|
|
1513
1538
|
try {
|
|
1514
|
-
const g = await
|
|
1539
|
+
const g = await Pe.readTeamMember(e.id);
|
|
1515
1540
|
if (a !== ee) return;
|
|
1516
1541
|
Z.value = S(g);
|
|
1517
1542
|
} catch {
|
|
@@ -1519,21 +1544,21 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1519
1544
|
_.open({
|
|
1520
1545
|
message: t("common.error"),
|
|
1521
1546
|
type: "error"
|
|
1522
|
-
}),
|
|
1547
|
+
}), Fe();
|
|
1523
1548
|
} finally {
|
|
1524
|
-
a === ee && (
|
|
1549
|
+
a === ee && (ge.value = !1);
|
|
1525
1550
|
}
|
|
1526
1551
|
}
|
|
1527
|
-
async function
|
|
1528
|
-
if (
|
|
1552
|
+
async function qe(e) {
|
|
1553
|
+
if (xe(), e.kind === "invite") {
|
|
1529
1554
|
await N(e.invite);
|
|
1530
1555
|
return;
|
|
1531
1556
|
}
|
|
1532
1557
|
const a = ++ee;
|
|
1533
1558
|
try {
|
|
1534
|
-
const g = await
|
|
1559
|
+
const g = await Pe.readTeamMember(e.id);
|
|
1535
1560
|
if (a !== ee) return;
|
|
1536
|
-
await
|
|
1561
|
+
await je(g);
|
|
1537
1562
|
} catch {
|
|
1538
1563
|
_.open({
|
|
1539
1564
|
message: t("common.error"),
|
|
@@ -1541,48 +1566,48 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1541
1566
|
});
|
|
1542
1567
|
}
|
|
1543
1568
|
}
|
|
1544
|
-
const
|
|
1569
|
+
const ge = c(!1);
|
|
1545
1570
|
let ee = 0;
|
|
1546
1571
|
const n = async (e, a) => {
|
|
1547
|
-
e ==
|
|
1548
|
-
}, F = Ft(), J = c(ae.CLOSED), pe = I(() => J.value !== ae.CLOSED),
|
|
1549
|
-
function
|
|
1550
|
-
ee++,
|
|
1572
|
+
e == Ee.Update && (a.status === "invited" ? await N(a.id) : await je(a)), e == Ee.Remove && Bt(a);
|
|
1573
|
+
}, F = Ft(), J = c(ae.CLOSED), pe = I(() => J.value !== ae.CLOSED), he = I(() => J.value === ae.ADD ? t("common.add") : t("common.update")), ve = I(() => J.value === ae.ADD ? t("team.actions.addMember") : t("team.actions.updateMember")), Z = c();
|
|
1574
|
+
function xe() {
|
|
1575
|
+
ee++, ge.value = !1, H.value = null, J.value = ae.CLOSED;
|
|
1551
1576
|
}
|
|
1552
|
-
const
|
|
1577
|
+
const Me = is(() => {
|
|
1553
1578
|
var e;
|
|
1554
1579
|
return ((e = me.value) == null ? void 0 : e.isModified()) ?? !1;
|
|
1555
|
-
},
|
|
1556
|
-
function
|
|
1557
|
-
|
|
1580
|
+
}, xe);
|
|
1581
|
+
function Fe() {
|
|
1582
|
+
Me();
|
|
1558
1583
|
}
|
|
1559
|
-
function
|
|
1560
|
-
e ||
|
|
1584
|
+
function Ge(e) {
|
|
1585
|
+
e || Fe();
|
|
1561
1586
|
}
|
|
1562
1587
|
const {
|
|
1563
|
-
breakpoints:
|
|
1588
|
+
breakpoints: _e
|
|
1564
1589
|
} = $t(), Bt = (e) => {
|
|
1565
1590
|
F.open({
|
|
1566
1591
|
title: t("team.actions.removeMember"),
|
|
1567
1592
|
message: t("team.removeMember.confirmationMessage", {
|
|
1568
1593
|
memberName: e.name
|
|
1569
1594
|
}),
|
|
1570
|
-
minWidth:
|
|
1595
|
+
minWidth: _e.value.lg ? 588 : 0,
|
|
1571
1596
|
primaryActions: {
|
|
1572
1597
|
text: "Remove",
|
|
1573
1598
|
close: !1,
|
|
1574
1599
|
variant: "destructive",
|
|
1575
|
-
isLoading:
|
|
1600
|
+
isLoading: Se
|
|
1576
1601
|
},
|
|
1577
1602
|
secondaryActions: {
|
|
1578
1603
|
text: "Cancel",
|
|
1579
1604
|
close: !0
|
|
1580
1605
|
}
|
|
1581
1606
|
}).onPrimary(async () => {
|
|
1582
|
-
|
|
1583
|
-
await
|
|
1607
|
+
Se.value || (await X.minor(async () => {
|
|
1608
|
+
await Pe.deleteTeamMember(e.id), await ke();
|
|
1584
1609
|
}, {
|
|
1585
|
-
isLoading:
|
|
1610
|
+
isLoading: Se,
|
|
1586
1611
|
successMessage: t("team.removeMember.successMessage", {
|
|
1587
1612
|
memberName: e.name
|
|
1588
1613
|
})
|
|
@@ -1595,35 +1620,35 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1595
1620
|
message: t("team.staffInvite.revoke.message", {
|
|
1596
1621
|
name: e.name
|
|
1597
1622
|
}),
|
|
1598
|
-
minWidth:
|
|
1623
|
+
minWidth: _e.value.lg ? 588 : 0,
|
|
1599
1624
|
primaryActions: {
|
|
1600
1625
|
text: t("team.staffInvite.actions.revoke"),
|
|
1601
1626
|
close: !1,
|
|
1602
1627
|
variant: "destructive",
|
|
1603
|
-
isLoading:
|
|
1628
|
+
isLoading: Se
|
|
1604
1629
|
},
|
|
1605
1630
|
secondaryActions: {
|
|
1606
1631
|
text: t("common.cancel"),
|
|
1607
1632
|
close: !0
|
|
1608
1633
|
}
|
|
1609
1634
|
}).onPrimary(async () => {
|
|
1610
|
-
if (!
|
|
1611
|
-
|
|
1635
|
+
if (!Se.value) {
|
|
1636
|
+
Se.value = !0;
|
|
1612
1637
|
try {
|
|
1613
|
-
await
|
|
1638
|
+
await Ae.revokeInvite(e.id), _.open({
|
|
1614
1639
|
type: "success",
|
|
1615
1640
|
title: t("team.staffInvite.revoke.successMessage")
|
|
1616
1641
|
});
|
|
1617
1642
|
} catch (a) {
|
|
1618
1643
|
_.open({
|
|
1619
1644
|
type: "error",
|
|
1620
|
-
title:
|
|
1645
|
+
title: ze(a, {
|
|
1621
1646
|
label: "",
|
|
1622
1647
|
match: "mobile"
|
|
1623
1648
|
}, t)
|
|
1624
1649
|
});
|
|
1625
1650
|
} finally {
|
|
1626
|
-
|
|
1651
|
+
Se.value = !1, F.close(), await ke();
|
|
1627
1652
|
}
|
|
1628
1653
|
}
|
|
1629
1654
|
});
|
|
@@ -1635,29 +1660,29 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1635
1660
|
match: e.phoneNumber ? "mobile" : "email"
|
|
1636
1661
|
};
|
|
1637
1662
|
try {
|
|
1638
|
-
const
|
|
1639
|
-
|
|
1663
|
+
const w = await Ae.resendInvite(e.id);
|
|
1664
|
+
w.warnings.length === 0 && _.open({
|
|
1640
1665
|
type: "success",
|
|
1641
1666
|
title: t("team.staffInvite.resend.sent", {
|
|
1642
1667
|
label: a.label
|
|
1643
1668
|
})
|
|
1644
1669
|
});
|
|
1645
|
-
for (const Y of yt(
|
|
1670
|
+
for (const Y of yt(w.warnings, a, t))
|
|
1646
1671
|
_.open({
|
|
1647
1672
|
type: "warning",
|
|
1648
1673
|
message: Y,
|
|
1649
|
-
position:
|
|
1674
|
+
position: et.BOTTOM
|
|
1650
1675
|
});
|
|
1651
|
-
} catch (
|
|
1676
|
+
} catch (w) {
|
|
1652
1677
|
_.open({
|
|
1653
1678
|
type: "error",
|
|
1654
|
-
title:
|
|
1655
|
-
}), gt(
|
|
1679
|
+
title: ze(w, a, t)
|
|
1680
|
+
}), gt(w) && await ke();
|
|
1656
1681
|
}
|
|
1657
1682
|
}
|
|
1658
1683
|
const Gt = () => {
|
|
1659
1684
|
H.value = null, Z.value = null, J.value = ae.ADD;
|
|
1660
|
-
},
|
|
1685
|
+
}, $e = c(), Ue = c(), Ce = c(), Ie = c(), we = c(), ut = I(() => [{
|
|
1661
1686
|
label: t("team.status.active"),
|
|
1662
1687
|
value: "active"
|
|
1663
1688
|
}, {
|
|
@@ -1669,29 +1694,29 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1669
1694
|
return e ? /\bSSO\b/i.test(e) ? e : t("team.loginMethod.ssoProvider", {
|
|
1670
1695
|
label: e
|
|
1671
1696
|
}) : t("team.loginMethod.sso");
|
|
1672
|
-
}),
|
|
1697
|
+
}), mt = I(() => [{
|
|
1673
1698
|
label: Kt.value,
|
|
1674
1699
|
value: "sso"
|
|
1675
1700
|
}, {
|
|
1676
1701
|
label: t("team.loginMethod.feedme"),
|
|
1677
1702
|
value: "feedme"
|
|
1678
|
-
}]),
|
|
1703
|
+
}]), dt = I(() => {
|
|
1679
1704
|
var e;
|
|
1680
1705
|
return JSON.stringify({
|
|
1681
|
-
businessId: ((e =
|
|
1706
|
+
businessId: ((e = f.currentBusiness.value) == null ? void 0 : e._id) ?? "",
|
|
1682
1707
|
search: j.value.trim(),
|
|
1683
|
-
restaurantIds: [
|
|
1684
|
-
permissionSubjects: [...
|
|
1685
|
-
permissionSetIds: [...
|
|
1686
|
-
statuses: [...
|
|
1687
|
-
loginMethods: [...
|
|
1708
|
+
restaurantIds: [...$e.value ?? []].sort(),
|
|
1709
|
+
permissionSubjects: [...Ue.value ?? []].sort(),
|
|
1710
|
+
permissionSetIds: [...Ce.value ?? []].sort(),
|
|
1711
|
+
statuses: [...Ie.value ?? []].sort(),
|
|
1712
|
+
loginMethods: [...we.value ?? []].sort()
|
|
1688
1713
|
});
|
|
1689
|
-
}),
|
|
1714
|
+
}), ct = I(() => Object.values(os).map((e) => ({
|
|
1690
1715
|
label: e.label,
|
|
1691
1716
|
value: e.subject
|
|
1692
|
-
}))),
|
|
1717
|
+
}))), pt = I(() => [{
|
|
1693
1718
|
label: t("team.filter.unassigned_label"),
|
|
1694
|
-
value:
|
|
1719
|
+
value: Be
|
|
1695
1720
|
}, ...C.permissionSets.value.map((e) => ({
|
|
1696
1721
|
label: e.name,
|
|
1697
1722
|
value: e.id
|
|
@@ -1699,41 +1724,41 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1699
1724
|
async function Wt() {
|
|
1700
1725
|
await P.readRoles();
|
|
1701
1726
|
}
|
|
1702
|
-
async function
|
|
1703
|
-
var a, g,
|
|
1727
|
+
async function Ke(e = r.value) {
|
|
1728
|
+
var a, g, w;
|
|
1704
1729
|
B.value = !0;
|
|
1705
1730
|
try {
|
|
1706
|
-
const Y = await
|
|
1707
|
-
limit:
|
|
1708
|
-
offset: (e - 1) *
|
|
1731
|
+
const Y = await Pe.readTeamMembersPage({
|
|
1732
|
+
limit: Ne,
|
|
1733
|
+
offset: (e - 1) * Ne,
|
|
1709
1734
|
search: j.value.trim() || void 0,
|
|
1710
|
-
restaurantIds:
|
|
1711
|
-
permissionSubjects: (a =
|
|
1712
|
-
permissionSetIds:
|
|
1713
|
-
statuses: (g =
|
|
1714
|
-
loginMethods: (
|
|
1735
|
+
restaurantIds: kt($e.value),
|
|
1736
|
+
permissionSubjects: (a = Ue.value) != null && a.length ? Ue.value : void 0,
|
|
1737
|
+
permissionSetIds: kt(Ce.value),
|
|
1738
|
+
statuses: (g = Ie.value) != null && g.length ? Ie.value : void 0,
|
|
1739
|
+
loginMethods: (w = we.value) != null && w.length ? we.value : void 0
|
|
1715
1740
|
});
|
|
1716
1741
|
h.value = Y.items, b.value = Y.total;
|
|
1717
1742
|
} finally {
|
|
1718
1743
|
B.value = !1;
|
|
1719
1744
|
}
|
|
1720
1745
|
}
|
|
1721
|
-
async function
|
|
1746
|
+
async function ke() {
|
|
1722
1747
|
var a;
|
|
1723
|
-
if (!((a =
|
|
1724
|
-
await
|
|
1725
|
-
const e = Math.max(1, Math.ceil(b.value /
|
|
1726
|
-
r.value > e && (r.value = e, await
|
|
1748
|
+
if (!((a = f.currentBusiness.value) != null && a._id)) return;
|
|
1749
|
+
await Ke(r.value);
|
|
1750
|
+
const e = Math.max(1, Math.ceil(b.value / Ne));
|
|
1751
|
+
r.value > e && (r.value = e, await Ke(r.value));
|
|
1727
1752
|
}
|
|
1728
|
-
const me = c(), fe = c(!1),
|
|
1729
|
-
async function
|
|
1730
|
-
|
|
1753
|
+
const me = c(), fe = c(!1), Se = c(!1);
|
|
1754
|
+
async function Je() {
|
|
1755
|
+
xe(), await We(), await ke();
|
|
1731
1756
|
}
|
|
1732
1757
|
async function zt(e) {
|
|
1733
1758
|
const a = me.value.readDetails(), g = x(a);
|
|
1734
1759
|
fe.value = !0;
|
|
1735
1760
|
try {
|
|
1736
|
-
const
|
|
1761
|
+
const w = await Ae.createInvite({
|
|
1737
1762
|
...a,
|
|
1738
1763
|
permissions: e.permissions ?? [],
|
|
1739
1764
|
customPermissions: e.customPermissions,
|
|
@@ -1749,19 +1774,19 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1749
1774
|
title: t("team.addMember.successMessage", {
|
|
1750
1775
|
memberName: a.displayName
|
|
1751
1776
|
}),
|
|
1752
|
-
position:
|
|
1777
|
+
position: et.BOTTOM
|
|
1753
1778
|
});
|
|
1754
|
-
for (const Y of yt(
|
|
1779
|
+
for (const Y of yt(w.warnings, g, t, w.result))
|
|
1755
1780
|
_.open({
|
|
1756
1781
|
type: "warning",
|
|
1757
1782
|
message: Y,
|
|
1758
|
-
position:
|
|
1783
|
+
position: et.BOTTOM
|
|
1759
1784
|
});
|
|
1760
|
-
await
|
|
1761
|
-
} catch (
|
|
1785
|
+
await Je();
|
|
1786
|
+
} catch (w) {
|
|
1762
1787
|
_.open({
|
|
1763
1788
|
type: "error",
|
|
1764
|
-
title:
|
|
1789
|
+
title: ze(w, g, t)
|
|
1765
1790
|
});
|
|
1766
1791
|
} finally {
|
|
1767
1792
|
fe.value = !1;
|
|
@@ -1771,7 +1796,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1771
1796
|
const g = x(e);
|
|
1772
1797
|
fe.value = !0;
|
|
1773
1798
|
try {
|
|
1774
|
-
await
|
|
1799
|
+
await Ae.updateInvite(e._id, xs(e, {
|
|
1775
1800
|
permissions: a.permissions ?? [],
|
|
1776
1801
|
customPermissions: a.customPermissions,
|
|
1777
1802
|
permissionSetIds: a.permissionSetIds,
|
|
@@ -1781,12 +1806,12 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1781
1806
|
title: t("team.updateMember.successMessage", {
|
|
1782
1807
|
memberName: Z.value.name
|
|
1783
1808
|
})
|
|
1784
|
-
}), await
|
|
1785
|
-
} catch (
|
|
1809
|
+
}), await Je();
|
|
1810
|
+
} catch (w) {
|
|
1786
1811
|
_.open({
|
|
1787
1812
|
type: "error",
|
|
1788
|
-
title:
|
|
1789
|
-
}), gt(
|
|
1813
|
+
title: ze(w, g, t)
|
|
1814
|
+
}), gt(w) && await Je();
|
|
1790
1815
|
} finally {
|
|
1791
1816
|
fe.value = !1;
|
|
1792
1817
|
}
|
|
@@ -1796,7 +1821,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1796
1821
|
const e = await me.value.validate();
|
|
1797
1822
|
if (!e) return;
|
|
1798
1823
|
const a = J.value === ae.ADD;
|
|
1799
|
-
if (a &&
|
|
1824
|
+
if (a && O.value.length > 0) {
|
|
1800
1825
|
me.value.hasExisting || await zt(e);
|
|
1801
1826
|
return;
|
|
1802
1827
|
}
|
|
@@ -1806,13 +1831,13 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1806
1831
|
}
|
|
1807
1832
|
const g = a ? null : me.value.readEdits();
|
|
1808
1833
|
await X.minor(async () => {
|
|
1809
|
-
await (a ?
|
|
1834
|
+
await (a ? Pe.createTeamMember(e) : Pe.updateTeamMember(Z.value.id, {
|
|
1810
1835
|
...gs(e, Z.value.posUser),
|
|
1811
1836
|
// '' clears it; the owner's sheet has no field, so it is left out
|
|
1812
1837
|
...g ? {
|
|
1813
1838
|
employeeId: g.employeeId
|
|
1814
1839
|
} : {}
|
|
1815
|
-
})),
|
|
1840
|
+
})), xe(), await We(), await ke();
|
|
1816
1841
|
}, {
|
|
1817
1842
|
successMessage: a ? t("team.addMember.successMessage", {
|
|
1818
1843
|
memberName: e.name
|
|
@@ -1825,36 +1850,36 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1825
1850
|
async function Yt() {
|
|
1826
1851
|
await C.readPermissionSets();
|
|
1827
1852
|
}
|
|
1828
|
-
async function
|
|
1853
|
+
async function We() {
|
|
1829
1854
|
await V.readPermissionAssignments();
|
|
1830
1855
|
}
|
|
1831
|
-
let
|
|
1856
|
+
let Ze = !1;
|
|
1832
1857
|
async function Jt({
|
|
1833
1858
|
pageIndex: e
|
|
1834
1859
|
}) {
|
|
1835
1860
|
var a;
|
|
1836
|
-
if ((a =
|
|
1837
|
-
|
|
1861
|
+
if ((a = f.currentBusiness.value) != null && a._id && !Ze && !(e === 0 && r.value === 1 && h.value.length > 0)) {
|
|
1862
|
+
Ze = !0, r.value = e + 1;
|
|
1838
1863
|
try {
|
|
1839
|
-
await
|
|
1864
|
+
await Ke(r.value);
|
|
1840
1865
|
} finally {
|
|
1841
|
-
|
|
1866
|
+
Ze = !1;
|
|
1842
1867
|
}
|
|
1843
1868
|
}
|
|
1844
1869
|
}
|
|
1845
1870
|
const Zt = ls(U, () => {
|
|
1846
1871
|
j.value = U.value;
|
|
1847
1872
|
});
|
|
1848
|
-
return Pt(Zt), ue(
|
|
1873
|
+
return Pt(Zt), ue(dt, async () => {
|
|
1849
1874
|
var e;
|
|
1850
|
-
r.value = 1, y.value = !1, (e =
|
|
1875
|
+
r.value = 1, y.value = !1, (e = f.currentBusiness.value) != null && e._id && (await Ke(1), y.value = !0);
|
|
1851
1876
|
}, {
|
|
1852
1877
|
immediate: !0
|
|
1853
|
-
}), ue(
|
|
1878
|
+
}), ue(f.currentBusiness, async () => {
|
|
1854
1879
|
var e;
|
|
1855
|
-
if ((e =
|
|
1880
|
+
if ((e = f.currentBusiness.value) != null && e._id)
|
|
1856
1881
|
try {
|
|
1857
|
-
await Promise.all([
|
|
1882
|
+
await Promise.all([k.readRestaurants(), Yt(), We(), v(), Wt()]);
|
|
1858
1883
|
} catch (a) {
|
|
1859
1884
|
console.error("Failed to load team member dependencies:", a), _.open({
|
|
1860
1885
|
message: a instanceof Error ? a.message : String(a),
|
|
@@ -1863,22 +1888,22 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1863
1888
|
}
|
|
1864
1889
|
}, {
|
|
1865
1890
|
immediate: !0
|
|
1866
|
-
}),
|
|
1891
|
+
}), A({
|
|
1867
1892
|
create: Gt,
|
|
1868
1893
|
refresh: async () => {
|
|
1869
|
-
await
|
|
1894
|
+
await We(), await ke();
|
|
1870
1895
|
}
|
|
1871
1896
|
}), (e, a) => {
|
|
1872
|
-
var
|
|
1873
|
-
const g = G("FmSearch"),
|
|
1874
|
-
return m(), M(de, null, [p("div", Za, [p("div", Qa, [s(
|
|
1897
|
+
var Oe;
|
|
1898
|
+
const g = G("FmSearch"), w = G("FmTable"), Y = G("FmIcon"), le = G("FmButton"), De = G("FmSideSheet");
|
|
1899
|
+
return m(), M(de, null, [p("div", Za, [p("div", Qa, [s(_e).xs ? (m(), M("div", sl, [i(g, {
|
|
1875
1900
|
modelValue: U.value,
|
|
1876
|
-
"onUpdate:modelValue": a[6] || (a[6] = (
|
|
1901
|
+
"onUpdate:modelValue": a[6] || (a[6] = (L) => U.value = L),
|
|
1877
1902
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1878
1903
|
placeholder: s(t)("team.search.placeholder")
|
|
1879
1904
|
}, null, 8, ["modelValue", "placeholder"]), p("div", al, [i(ie, {
|
|
1880
|
-
modelValue:
|
|
1881
|
-
"onUpdate:modelValue": a[7] || (a[7] = (
|
|
1905
|
+
modelValue: $e.value,
|
|
1906
|
+
"onUpdate:modelValue": a[7] || (a[7] = (L) => $e.value = L),
|
|
1882
1907
|
multiple: "",
|
|
1883
1908
|
items: W.value,
|
|
1884
1909
|
variant: "dark",
|
|
@@ -1887,48 +1912,48 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1887
1912
|
placeholder: s(t)("team.table.columns.restaurant"),
|
|
1888
1913
|
class: "!w-auto"
|
|
1889
1914
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
1890
|
-
modelValue:
|
|
1891
|
-
"onUpdate:modelValue": a[8] || (a[8] = (
|
|
1915
|
+
modelValue: Ce.value,
|
|
1916
|
+
"onUpdate:modelValue": a[8] || (a[8] = (L) => Ce.value = L),
|
|
1892
1917
|
multiple: "",
|
|
1893
1918
|
variant: "dark",
|
|
1894
1919
|
"chip-icon": "account_circle",
|
|
1895
|
-
items:
|
|
1920
|
+
items: pt.value,
|
|
1896
1921
|
"selected-prefix": s(t)("team.filter.selected_assigned_role_prefix"),
|
|
1897
1922
|
placeholder: s(t)("team.filter.assigned_role_placeholder")
|
|
1898
1923
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
1899
|
-
modelValue:
|
|
1900
|
-
"onUpdate:modelValue": a[9] || (a[9] = (
|
|
1924
|
+
modelValue: Ue.value,
|
|
1925
|
+
"onUpdate:modelValue": a[9] || (a[9] = (L) => Ue.value = L),
|
|
1901
1926
|
multiple: "",
|
|
1902
1927
|
variant: "dark",
|
|
1903
1928
|
"chip-icon": "settings_account_box",
|
|
1904
|
-
items:
|
|
1929
|
+
items: ct.value,
|
|
1905
1930
|
"selected-prefix": s(t)("team.filter.selected_permission_prefix"),
|
|
1906
1931
|
placeholder: s(t)("team.filter.permission_placeholder")
|
|
1907
1932
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), s($) ? (m(), M(de, {
|
|
1908
1933
|
key: 0
|
|
1909
1934
|
}, [i(ie, {
|
|
1910
|
-
modelValue:
|
|
1911
|
-
"onUpdate:modelValue": a[10] || (a[10] = (
|
|
1935
|
+
modelValue: Ie.value,
|
|
1936
|
+
"onUpdate:modelValue": a[10] || (a[10] = (L) => Ie.value = L),
|
|
1912
1937
|
multiple: "",
|
|
1913
1938
|
variant: "dark",
|
|
1914
1939
|
"chip-icon": "check_circle",
|
|
1915
1940
|
searchable: !1,
|
|
1916
|
-
items:
|
|
1941
|
+
items: ut.value,
|
|
1917
1942
|
"selected-prefix": s(t)("team.filter.selected_status_prefix"),
|
|
1918
1943
|
placeholder: s(t)("team.filter.status_placeholder")
|
|
1919
1944
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
1920
|
-
modelValue:
|
|
1921
|
-
"onUpdate:modelValue": a[11] || (a[11] = (
|
|
1945
|
+
modelValue: we.value,
|
|
1946
|
+
"onUpdate:modelValue": a[11] || (a[11] = (L) => we.value = L),
|
|
1922
1947
|
multiple: "",
|
|
1923
1948
|
variant: "dark",
|
|
1924
1949
|
"chip-icon": "check_circle",
|
|
1925
1950
|
searchable: !1,
|
|
1926
|
-
items:
|
|
1951
|
+
items: mt.value,
|
|
1927
1952
|
"selected-prefix": s(t)("team.filter.selected_login_method_prefix"),
|
|
1928
1953
|
placeholder: s(t)("team.filter.login_method_placeholder")
|
|
1929
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) :
|
|
1930
|
-
modelValue:
|
|
1931
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
1954
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) : T("", !0)])])) : (m(), M("div", el, [p("div", tl, [i(ie, {
|
|
1955
|
+
modelValue: $e.value,
|
|
1956
|
+
"onUpdate:modelValue": a[0] || (a[0] = (L) => $e.value = L),
|
|
1932
1957
|
multiple: "",
|
|
1933
1958
|
items: W.value,
|
|
1934
1959
|
variant: "dark",
|
|
@@ -1937,55 +1962,55 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1937
1962
|
placeholder: s(t)("team.table.columns.restaurant"),
|
|
1938
1963
|
class: "!w-auto"
|
|
1939
1964
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
1940
|
-
modelValue:
|
|
1941
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
1965
|
+
modelValue: Ce.value,
|
|
1966
|
+
"onUpdate:modelValue": a[1] || (a[1] = (L) => Ce.value = L),
|
|
1942
1967
|
multiple: "",
|
|
1943
1968
|
variant: "dark",
|
|
1944
1969
|
"chip-icon": "account_circle",
|
|
1945
|
-
items:
|
|
1970
|
+
items: pt.value,
|
|
1946
1971
|
"selected-prefix": s(t)("team.filter.selected_assigned_role_prefix"),
|
|
1947
1972
|
placeholder: s(t)("team.filter.assigned_role_placeholder")
|
|
1948
1973
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
1949
|
-
modelValue:
|
|
1950
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
1974
|
+
modelValue: Ue.value,
|
|
1975
|
+
"onUpdate:modelValue": a[2] || (a[2] = (L) => Ue.value = L),
|
|
1951
1976
|
multiple: "",
|
|
1952
1977
|
variant: "dark",
|
|
1953
1978
|
"chip-icon": "settings_account_box",
|
|
1954
|
-
items:
|
|
1979
|
+
items: ct.value,
|
|
1955
1980
|
"selected-prefix": s(t)("team.filter.selected_permission_prefix"),
|
|
1956
1981
|
placeholder: s(t)("team.filter.permission_placeholder")
|
|
1957
1982
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), s($) ? (m(), M(de, {
|
|
1958
1983
|
key: 0
|
|
1959
1984
|
}, [i(ie, {
|
|
1960
|
-
modelValue:
|
|
1961
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
1985
|
+
modelValue: Ie.value,
|
|
1986
|
+
"onUpdate:modelValue": a[3] || (a[3] = (L) => Ie.value = L),
|
|
1962
1987
|
multiple: "",
|
|
1963
1988
|
variant: "dark",
|
|
1964
1989
|
"chip-icon": "check_circle",
|
|
1965
1990
|
searchable: !1,
|
|
1966
|
-
items:
|
|
1991
|
+
items: ut.value,
|
|
1967
1992
|
"selected-prefix": s(t)("team.filter.selected_status_prefix"),
|
|
1968
1993
|
placeholder: s(t)("team.filter.status_placeholder")
|
|
1969
1994
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
1970
|
-
modelValue:
|
|
1971
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
1995
|
+
modelValue: we.value,
|
|
1996
|
+
"onUpdate:modelValue": a[4] || (a[4] = (L) => we.value = L),
|
|
1972
1997
|
multiple: "",
|
|
1973
1998
|
variant: "dark",
|
|
1974
1999
|
"chip-icon": "check_circle",
|
|
1975
2000
|
searchable: !1,
|
|
1976
|
-
items:
|
|
2001
|
+
items: mt.value,
|
|
1977
2002
|
"selected-prefix": s(t)("team.filter.selected_login_method_prefix"),
|
|
1978
2003
|
placeholder: s(t)("team.filter.login_method_placeholder")
|
|
1979
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) :
|
|
2004
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) : T("", !0)]), i(g, {
|
|
1980
2005
|
modelValue: U.value,
|
|
1981
|
-
"onUpdate:modelValue": a[5] || (a[5] = (
|
|
2006
|
+
"onUpdate:modelValue": a[5] || (a[5] = (L) => U.value = L),
|
|
1982
2007
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1983
2008
|
autofocus: "",
|
|
1984
2009
|
placeholder: s(t)("team.search.placeholder")
|
|
1985
|
-
}, null, 8, ["modelValue", "placeholder"])])), (
|
|
2010
|
+
}, null, 8, ["modelValue", "placeholder"])])), (Oe = s(f).currentBusiness.value) != null && Oe._id ? (m(), q(rs, {
|
|
1986
2011
|
key: 2
|
|
1987
2012
|
}, {
|
|
1988
|
-
default: te(() => [p("div", ll, [y.value ?
|
|
2013
|
+
default: te(() => [p("div", ll, [y.value ? T("", !0) : (m(), q(ns, {
|
|
1989
2014
|
key: 0
|
|
1990
2015
|
})), y.value ? (m(), q(us, {
|
|
1991
2016
|
key: 1,
|
|
@@ -1994,50 +2019,50 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1994
2019
|
title: s(t)("team.emptyState.title"),
|
|
1995
2020
|
subtitle: s(t)("team.emptyState.description")
|
|
1996
2021
|
}, {
|
|
1997
|
-
default: te(() => [(m(), q(
|
|
1998
|
-
key:
|
|
2022
|
+
default: te(() => [(m(), q(w, {
|
|
2023
|
+
key: dt.value,
|
|
1999
2024
|
"column-defs": D,
|
|
2000
2025
|
"row-data": h.value,
|
|
2001
|
-
"page-size":
|
|
2002
|
-
"page-count": Math.ceil(b.value /
|
|
2026
|
+
"page-size": Ne,
|
|
2027
|
+
"page-count": Math.ceil(b.value / Ne),
|
|
2003
2028
|
"row-count": b.value,
|
|
2004
2029
|
"fetch-fn": Jt,
|
|
2005
|
-
"hide-footer": b.value <=
|
|
2030
|
+
"hide-footer": b.value <= Ne,
|
|
2006
2031
|
loading: B.value,
|
|
2007
2032
|
"pin-header-row": "",
|
|
2008
|
-
onRowClick: a[12] || (a[12] = (
|
|
2033
|
+
onRowClick: a[12] || (a[12] = (L) => n(s(Ee).Update, L.original))
|
|
2009
2034
|
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
|
|
2010
2035
|
_: 1
|
|
2011
|
-
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) :
|
|
2036
|
+
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) : T("", !0)])]),
|
|
2012
2037
|
_: 1
|
|
2013
|
-
})) :
|
|
2038
|
+
})) : T("", !0)])]), i(De, {
|
|
2014
2039
|
"model-value": pe.value,
|
|
2015
2040
|
"max-width": 960,
|
|
2016
2041
|
"close-button": !1,
|
|
2017
|
-
"onUpdate:modelValue":
|
|
2018
|
-
"onOn:clickedAway": s(
|
|
2042
|
+
"onUpdate:modelValue": Ge,
|
|
2043
|
+
"onOn:clickedAway": s(Me)
|
|
2019
2044
|
}, {
|
|
2020
2045
|
"side-sheet-header": te(() => [p("div", ol, [p("p", rl, E(ve.value), 1), i(Y, {
|
|
2021
2046
|
name: "close",
|
|
2022
2047
|
size: "md",
|
|
2023
2048
|
class: "cursor-pointer",
|
|
2024
|
-
onClick: s(
|
|
2049
|
+
onClick: s(Me)
|
|
2025
2050
|
}, null, 8, ["onClick"])])]),
|
|
2026
2051
|
"side-sheet-footer": te(() => {
|
|
2027
|
-
var
|
|
2052
|
+
var L;
|
|
2028
2053
|
return [p("div", nl, [i(le, {
|
|
2029
|
-
label:
|
|
2054
|
+
label: he.value,
|
|
2030
2055
|
size: "md",
|
|
2031
2056
|
variant: "primary",
|
|
2032
2057
|
"is-loading": fe.value,
|
|
2033
|
-
disabled: fe.value || J.value === ae.ADD && ((
|
|
2058
|
+
disabled: fe.value || J.value === ae.ADD && ((L = me.value) == null ? void 0 : L.hasExisting),
|
|
2034
2059
|
onClick: Rt(Ht, ["prevent"])
|
|
2035
2060
|
}, null, 8, ["label", "is-loading", "disabled"]), i(le, {
|
|
2036
2061
|
label: s(t)("common.cancel"),
|
|
2037
2062
|
size: "md",
|
|
2038
2063
|
variant: "secondary",
|
|
2039
2064
|
disabled: fe.value,
|
|
2040
|
-
onClick:
|
|
2065
|
+
onClick: Fe
|
|
2041
2066
|
}, null, 8, ["label", "disabled"])])];
|
|
2042
2067
|
}),
|
|
2043
2068
|
default: te(() => [pe.value ? (m(), q(Ja, {
|
|
@@ -2045,11 +2070,11 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
2045
2070
|
ref_key: "memberForm",
|
|
2046
2071
|
ref: me,
|
|
2047
2072
|
initialValue: Z.value,
|
|
2048
|
-
providers:
|
|
2049
|
-
loading:
|
|
2073
|
+
providers: O.value,
|
|
2074
|
+
loading: ge.value,
|
|
2050
2075
|
class: "gap-8",
|
|
2051
|
-
onUpdateExisting:
|
|
2052
|
-
}, null, 8, ["initialValue", "providers", "loading"])) :
|
|
2076
|
+
onUpdateExisting: qe
|
|
2077
|
+
}, null, 8, ["initialValue", "providers", "loading"])) : T("", !0)]),
|
|
2053
2078
|
_: 1
|
|
2054
2079
|
}, 8, ["model-value", "onOn:clickedAway"])], 64);
|
|
2055
2080
|
};
|