@feedmepos/mf-hrm-portal 2.1.1-dev.2 → 2.1.1-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApprovalCodeList-BH5sgVMU.js +638 -0
- package/dist/AuditLogList-Q4L5Te8O.js +1145 -0
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
- package/dist/EmployeeList-GtKmJZbf.js +899 -0
- package/dist/GrantUserList-CnLjOi5_.js +468 -0
- package/dist/Main-Cn7Dawg4.js +120 -0
- package/dist/{Main-B_L5flWT.js → Main-DLlpEU3j.js} +11 -9
- package/dist/{Main-DgemO-iy.js → Main-cskEZ3k_.js} +1033 -1035
- package/dist/PermissionSetList-C2fK2pTz.js +357 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMh0DL1_.js +3458 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_79737e32_lang-DbPzVpnG.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js} +1 -2
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
- package/dist/RoleList-CcuT1ERb.js +567 -0
- package/dist/TeamMemberList-Dfs2iNdC.js +1131 -0
- package/dist/{TimesheetList-C_IMtsTH.js → TimesheetList-B1H_6zfP.js} +136 -141
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-DGwteHIL.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js} +14 -13
- package/dist/{app-BW91YDke.js → app-DX-PG6wx.js} +2725 -5281
- package/dist/app.js +1 -1
- package/dist/approval-code-Q4666xp5.js +58 -0
- package/dist/{dayjs.min-DwQTpnVK.js → dayjs.min-BJrHE7oz.js} +1 -1
- package/dist/{employee-yM0kdY70.js → employee-BJcqtqLM.js} +27 -26
- package/dist/grant-user-CQZaTzVt.js +67 -0
- package/dist/{TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js → index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js} +19 -50
- package/dist/iteration-Cfaqt-0s.js +7682 -0
- package/dist/{lodash-DLReQyP0.js → lodash-ClKqCmlZ.js} +1 -1
- package/dist/restaurant-YOVMuuFY.js +1876 -0
- package/dist/role-CR_-nBDY.js +82 -0
- package/dist/rule-BB-3S-2R.js +996 -0
- package/dist/src/api/approval-code/index.d.ts +7 -0
- package/dist/src/api/audit-log/index.d.ts +0 -6
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +1 -7
- package/dist/src/components/table/TableEmptyState.vue.d.ts +15 -7
- package/dist/src/composables/useBasePermission.d.ts +1 -2
- package/dist/src/helpers/permission-set.d.ts +4 -8
- package/dist/src/helpers/rule.d.ts +1 -2
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/approval-code.d.ts +140 -0
- package/dist/src/stores/permission-set.d.ts +3 -12
- package/dist/src/types/approval-code.d.ts +99 -0
- package/dist/src/types/audit-log.d.ts +1 -1
- package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +26 -0
- package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +17 -0
- package/dist/src/views/approval-code/locales/index.d.ts +320 -0
- package/dist/src/views/audit-log/locales/index.d.ts +0 -296
- package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +0 -1
- package/dist/src/views/pos-access/locales/index.d.ts +48 -0
- package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -13
- package/dist/src/views/team/locales/index.d.ts +0 -72
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useAppStore-DNTlIeMv.js +93 -0
- package/dist/useDebounce-CWb5QR9G.js +28 -0
- package/dist/{useLoading-B89K5XKO.js → useLoading-BH02lYns.js} +1 -1
- package/dist/{useReportPermissions-Bjfhr6FD.js → useReportPermissions-ybHA26cJ.js} +3 -3
- package/package.json +2 -2
- package/dist/AuditLogList-DHiqs9G0.js +0 -1611
- package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-CWqNWNdD.js +0 -387
- package/dist/EmployeeList-CUd3VH5h.js +0 -884
- package/dist/Main-DUbLeLlK.js +0 -577
- package/dist/PermissionSetList-BaC4lKV5.js +0 -392
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DddOxcG_.js +0 -4121
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +0 -42
- package/dist/RoleList-CThb6VEd.js +0 -684
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-CAw4jr1b.js +0 -1186
- package/dist/iteration-Dj50K6I7.js +0 -9556
- package/dist/rule-BJ-o-PKi.js +0 -1057
- package/dist/src/composables/useConditionDraft.d.ts +0 -40
- package/dist/src/composables/useCoverConditionOverride.d.ts +0 -61
- package/dist/src/helpers/business-timezone.d.ts +0 -22
- package/dist/src/helpers/filter.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.test.d.ts +0 -1
- package/dist/src/views/audit-log/event-line.d.ts +0 -13
- package/dist/src/views/audit-log/snapshot-diff.d.ts +0 -11
- package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +0 -22
- package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +0 -23
- package/dist/src/views/team/condition-builders/component-map.d.ts +0 -4
- package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +0 -23
- package/dist/useAppStore-CHkGWiai.js +0 -169
- package/dist/useDebounce-B8ZPVS5C.js +0 -15
- /package/dist/src/views/{grant → pos-access}/Main.vue.d.ts +0 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { defineComponent as Z, ref as S, computed as g, watch as ue, resolveComponent as _, createElementBlock as z, openBlock as x, Fragment as P, renderSlot as de, createVNode as l, unref as s, withCtx as y, createElementVNode as o, toDisplayString as f, createBlock as j, isRef as J, renderList as me, createCommentVNode as pe, withModifiers as Q, createTextVNode as X, normalizeClass as ve, h as p } from "vue";
|
|
2
|
+
import { useI18n as ee } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as te, components as A, useDialog as fe, useBreakpoints as ge, FmButtonVariant as E } from "@feedmepos/ui-library";
|
|
4
|
+
import { S as L } from "./SelectFilter-ATOm0hdn.js";
|
|
5
|
+
import { _ as _e } from "./app-DX-PG6wx.js";
|
|
6
|
+
import { _ as Y, u as ye, H as Ue } from "./FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js";
|
|
7
|
+
import { _ as he } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
|
|
8
|
+
import { u as ae } from "./useLoading-BH02lYns.js";
|
|
9
|
+
import { u as se } from "./grant-user-CQZaTzVt.js";
|
|
10
|
+
import { u as re } from "./restaurant-YOVMuuFY.js";
|
|
11
|
+
import { u as le } from "./role-CR_-nBDY.js";
|
|
12
|
+
import { _ as xe } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
13
|
+
const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, Ve = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ Z({
|
|
14
|
+
__name: "GrantUserForm",
|
|
15
|
+
setup(oe, { expose: D }) {
|
|
16
|
+
const a = se(), U = le(), b = re(), F = te(), K = ae(F), { t: c } = ee(), v = S(!1), i = S({
|
|
17
|
+
name: "",
|
|
18
|
+
restaurantId: "",
|
|
19
|
+
roleId: ""
|
|
20
|
+
}), h = () => {
|
|
21
|
+
i.value = {
|
|
22
|
+
name: "",
|
|
23
|
+
restaurantId: "",
|
|
24
|
+
roleId: ""
|
|
25
|
+
}, v.value = !0;
|
|
26
|
+
}, k = g(() => c("grantUser.form.title")), V = g(() => c("common.create")), C = g(() => b.restaurants.value.map((n) => ({
|
|
27
|
+
label: `${n.profile.code ? n.profile.code + " - " : ""}${n.profile.name}`,
|
|
28
|
+
value: n._id
|
|
29
|
+
}))), B = g(() => i.value.restaurantId ? U.roles.value.filter((n) => n.restaurants.some((u) => u.id === i.value.restaurantId)).map((n) => ({
|
|
30
|
+
label: n.name,
|
|
31
|
+
value: n._id,
|
|
32
|
+
disabled: !n.isUsable
|
|
33
|
+
})) : []);
|
|
34
|
+
ue(
|
|
35
|
+
() => i.value.restaurantId,
|
|
36
|
+
() => {
|
|
37
|
+
i.value.roleId = "";
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
async function T() {
|
|
41
|
+
await K.minor(async () => {
|
|
42
|
+
const n = await a.createGrantUser(i.value);
|
|
43
|
+
F.open({
|
|
44
|
+
message: c("grantUser.create.successMessage", {
|
|
45
|
+
passcode: n.passcode
|
|
46
|
+
}),
|
|
47
|
+
type: "success"
|
|
48
|
+
});
|
|
49
|
+
}), v.value = !1;
|
|
50
|
+
}
|
|
51
|
+
return D({
|
|
52
|
+
show: v,
|
|
53
|
+
trigger: h
|
|
54
|
+
}), (n, u) => {
|
|
55
|
+
const G = _("FmTextField"), I = _("FmSelect"), $ = _("fm-button"), N = _("fm-side-sheet");
|
|
56
|
+
return x(), z(P, null, [
|
|
57
|
+
de(n.$slots, "default", { trigger: h }),
|
|
58
|
+
l(N, {
|
|
59
|
+
id: "grant-user-form",
|
|
60
|
+
modelValue: v.value,
|
|
61
|
+
"onUpdate:modelValue": u[4] || (u[4] = (d) => v.value = d),
|
|
62
|
+
"is-container": s(A).FmForm,
|
|
63
|
+
"is-container-props": {
|
|
64
|
+
onValidationSuccess: T,
|
|
65
|
+
blameFormChildOnValidationFailed: !0
|
|
66
|
+
},
|
|
67
|
+
"max-width": 560
|
|
68
|
+
}, {
|
|
69
|
+
"side-sheet-header": y(() => [
|
|
70
|
+
o("p", be, f(k.value), 1)
|
|
71
|
+
]),
|
|
72
|
+
"side-sheet-footer": y(() => [
|
|
73
|
+
o("div", Ve, [
|
|
74
|
+
l($, {
|
|
75
|
+
label: V.value,
|
|
76
|
+
size: "lg",
|
|
77
|
+
type: "submit",
|
|
78
|
+
variant: "primary"
|
|
79
|
+
}, null, 8, ["label"]),
|
|
80
|
+
l($, {
|
|
81
|
+
label: s(c)("common.cancel"),
|
|
82
|
+
size: "lg",
|
|
83
|
+
variant: "tertiary",
|
|
84
|
+
onClick: u[3] || (u[3] = () => v.value = !1)
|
|
85
|
+
}, null, 8, ["label"])
|
|
86
|
+
])
|
|
87
|
+
]),
|
|
88
|
+
default: y(() => [
|
|
89
|
+
o("div", ke, [
|
|
90
|
+
l(xe, {
|
|
91
|
+
title: s(c)("grantUser.form.section")
|
|
92
|
+
}, {
|
|
93
|
+
default: y(() => [
|
|
94
|
+
l(G, {
|
|
95
|
+
modelValue: i.value.name,
|
|
96
|
+
"onUpdate:modelValue": u[0] || (u[0] = (d) => i.value.name = d),
|
|
97
|
+
label: s(c)("grantUser.form.name"),
|
|
98
|
+
rules: [(d) => !!d || s(c)("grantUser.form.nameRequired")]
|
|
99
|
+
}, null, 8, ["modelValue", "label", "rules"]),
|
|
100
|
+
l(Y, {
|
|
101
|
+
label: s(c)("grantUser.form.restaurant")
|
|
102
|
+
}, {
|
|
103
|
+
default: y(() => [
|
|
104
|
+
l(I, {
|
|
105
|
+
modelValue: i.value.restaurantId,
|
|
106
|
+
"onUpdate:modelValue": u[1] || (u[1] = (d) => i.value.restaurantId = d),
|
|
107
|
+
items: C.value,
|
|
108
|
+
placeholder: s(c)("grantUser.form.selectRestaurant"),
|
|
109
|
+
rules: [(d) => !!d || s(c)("grantUser.form.restaurantRequired")]
|
|
110
|
+
}, null, 8, ["modelValue", "items", "placeholder", "rules"])
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 8, ["label"]),
|
|
114
|
+
l(Y, {
|
|
115
|
+
label: s(c)("grantUser.form.role")
|
|
116
|
+
}, {
|
|
117
|
+
default: y(() => [
|
|
118
|
+
l(I, {
|
|
119
|
+
modelValue: i.value.roleId,
|
|
120
|
+
"onUpdate:modelValue": u[2] || (u[2] = (d) => i.value.roleId = d),
|
|
121
|
+
items: B.value,
|
|
122
|
+
placeholder: s(c)("grantUser.form.selectRole"),
|
|
123
|
+
disabled: !i.value.restaurantId,
|
|
124
|
+
rules: [(d) => !!d || s(c)("grantUser.form.roleRequired")]
|
|
125
|
+
}, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
}, 8, ["label"])
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 8, ["title"])
|
|
132
|
+
])
|
|
133
|
+
]),
|
|
134
|
+
_: 1
|
|
135
|
+
}, 8, ["modelValue", "is-container", "is-container-props"])
|
|
136
|
+
], 64);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}), Fe = {
|
|
140
|
+
class: "space-y-8"
|
|
141
|
+
}, Ie = {
|
|
142
|
+
class: "xs:hidden flex w-full items-start justify-between"
|
|
143
|
+
}, Se = {
|
|
144
|
+
class: "flex items-start gap-8"
|
|
145
|
+
}, Ce = {
|
|
146
|
+
class: "space-y-4 hidden xs:block"
|
|
147
|
+
}, Be = {
|
|
148
|
+
class: "px-16"
|
|
149
|
+
}, $e = {
|
|
150
|
+
class: "px-16 flex items-start gap-8"
|
|
151
|
+
}, Ne = {
|
|
152
|
+
class: "pb-64 hidden xs:block"
|
|
153
|
+
}, Re = {
|
|
154
|
+
class: "space-y-4"
|
|
155
|
+
}, Le = {
|
|
156
|
+
class: "flex items-center gap-8"
|
|
157
|
+
}, ze = {
|
|
158
|
+
class: "fm-typo-en-body-lg-600"
|
|
159
|
+
}, Ae = {
|
|
160
|
+
class: "font-mono text-lg font-bold mr-4"
|
|
161
|
+
}, De = {
|
|
162
|
+
class: "text-fm-color-typo-secondary"
|
|
163
|
+
}, Ke = {
|
|
164
|
+
class: "text-xs"
|
|
165
|
+
}, Te = {
|
|
166
|
+
class: "mt-4 space-y-2"
|
|
167
|
+
}, Ge = {
|
|
168
|
+
class: "text-xs"
|
|
169
|
+
}, Me = {
|
|
170
|
+
class: "text-xs"
|
|
171
|
+
}, Oe = {
|
|
172
|
+
key: 0,
|
|
173
|
+
class: "flex flex-col gap-4"
|
|
174
|
+
}, tt = /* @__PURE__ */ Z({
|
|
175
|
+
__name: "GrantUserList",
|
|
176
|
+
setup(oe, {
|
|
177
|
+
expose: D
|
|
178
|
+
}) {
|
|
179
|
+
const {
|
|
180
|
+
t: a
|
|
181
|
+
} = ee(), U = S(), b = se(), {
|
|
182
|
+
restaurants: F
|
|
183
|
+
} = re(), {
|
|
184
|
+
roles: K
|
|
185
|
+
} = le(), c = g(() => b.grantUsers), {
|
|
186
|
+
searchKey: v,
|
|
187
|
+
filter: i
|
|
188
|
+
} = ye(), h = g(() => {
|
|
189
|
+
var e;
|
|
190
|
+
return (e = c.value) == null ? void 0 : e.filter((t) => {
|
|
191
|
+
const m = !U.value || U.value.includes(t.restaurantId), M = !w.value || w.value.includes(t.status), R = k.value[t.restaurantId] || "", O = V.value[t.roleId] || "";
|
|
192
|
+
return m && M && i([t.passcode, t.name, R, O, t.grantByName]);
|
|
193
|
+
});
|
|
194
|
+
}), k = g(() => {
|
|
195
|
+
const e = {};
|
|
196
|
+
return F.value.forEach((t) => {
|
|
197
|
+
e[t._id] = t.profile.name;
|
|
198
|
+
}), e;
|
|
199
|
+
}), V = g(() => {
|
|
200
|
+
const e = {};
|
|
201
|
+
return K.value.forEach((t) => {
|
|
202
|
+
e[t._id] = t.name;
|
|
203
|
+
}), e;
|
|
204
|
+
}), C = (e) => {
|
|
205
|
+
switch (e) {
|
|
206
|
+
case "active":
|
|
207
|
+
return "bg-fm-color-system-success-100 text-fm-color-typo-success";
|
|
208
|
+
case "used":
|
|
209
|
+
return "bg-fm-color-typo-tertiary text-fm-color-typo-primary";
|
|
210
|
+
case "revoked":
|
|
211
|
+
return "bg-fm-color-system-error-100 text-fm-color-typo-error";
|
|
212
|
+
default:
|
|
213
|
+
return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
|
|
214
|
+
}
|
|
215
|
+
}, B = (e) => a(`grantUser.status.${e}`), T = [{
|
|
216
|
+
accessorKey: "passcode",
|
|
217
|
+
size: 120,
|
|
218
|
+
maxSize: 120,
|
|
219
|
+
minSize: 120,
|
|
220
|
+
header: () => a("grantUser.columns.passcode"),
|
|
221
|
+
cell(e) {
|
|
222
|
+
const t = e.row.original.passcode;
|
|
223
|
+
return p("div", {
|
|
224
|
+
class: "flex items-center gap-8"
|
|
225
|
+
}, [p(A.FmButton, {
|
|
226
|
+
variant: E.Tertiary,
|
|
227
|
+
textColor: "neutral-gray-400",
|
|
228
|
+
icon: "content_copy",
|
|
229
|
+
onClick: (m) => {
|
|
230
|
+
m.stopPropagation(), W(t);
|
|
231
|
+
}
|
|
232
|
+
}), p("span", {
|
|
233
|
+
class: "font-mono text-lg font-bold"
|
|
234
|
+
}, t)]);
|
|
235
|
+
}
|
|
236
|
+
}, {
|
|
237
|
+
accessorKey: "name",
|
|
238
|
+
header: () => a("grantUser.columns.name")
|
|
239
|
+
}, {
|
|
240
|
+
accessorKey: "restaurantName",
|
|
241
|
+
accessorFn: (e) => k.value[e.restaurantId],
|
|
242
|
+
header: () => a("grantUser.columns.restaurant"),
|
|
243
|
+
meta: {
|
|
244
|
+
width: "250px"
|
|
245
|
+
},
|
|
246
|
+
cell(e) {
|
|
247
|
+
const t = e.row.original.restaurantId, m = k.value[t] || "-";
|
|
248
|
+
return p("div", [p("div", m), p("div", {
|
|
249
|
+
class: "text-fm-color-typo-secondary text-sm"
|
|
250
|
+
}, `${t}`)]);
|
|
251
|
+
}
|
|
252
|
+
}, {
|
|
253
|
+
accessorKey: "roleName",
|
|
254
|
+
accessorFn: (e) => V.value[e.roleId],
|
|
255
|
+
header: () => a("grantUser.columns.role"),
|
|
256
|
+
cell(e) {
|
|
257
|
+
const t = e.row.original.roleId, m = V.value[t] || "-";
|
|
258
|
+
return p("div", m);
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
accessorKey: "status",
|
|
262
|
+
header: () => a("grantUser.columns.status"),
|
|
263
|
+
meta: {
|
|
264
|
+
maxWidth: "120px"
|
|
265
|
+
},
|
|
266
|
+
cell(e) {
|
|
267
|
+
const t = e.row.original.status;
|
|
268
|
+
return p(A.FmChip, {
|
|
269
|
+
label: B(t),
|
|
270
|
+
class: C(t)
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}, {
|
|
274
|
+
accessorKey: "grantByName",
|
|
275
|
+
header: () => a("grantUser.columns.grantedBy"),
|
|
276
|
+
cell(e) {
|
|
277
|
+
const t = e.row.original.grantById, m = e.row.original.grantByName;
|
|
278
|
+
return p("div", [p("div", m), p("div", {
|
|
279
|
+
class: "text-fm-color-typo-secondary text-sm"
|
|
280
|
+
}, `${t}`)]);
|
|
281
|
+
}
|
|
282
|
+
}, {
|
|
283
|
+
accessorKey: "createdAt",
|
|
284
|
+
header: () => a("grantUser.columns.createdAt"),
|
|
285
|
+
cell(e) {
|
|
286
|
+
const t = e.row.original.createdAt;
|
|
287
|
+
return p("div", new Date(t).toLocaleString());
|
|
288
|
+
}
|
|
289
|
+
}, {
|
|
290
|
+
id: "action",
|
|
291
|
+
size: 180,
|
|
292
|
+
meta: {
|
|
293
|
+
cellClass: "p-16",
|
|
294
|
+
headerContentClass: "-mx-16"
|
|
295
|
+
},
|
|
296
|
+
cell: (e) => {
|
|
297
|
+
const t = e.row.original;
|
|
298
|
+
return t.status !== "active" ? null : p("div", {
|
|
299
|
+
class: "w-full flex justify-end items-center gap-4"
|
|
300
|
+
}, [p(A.FmButton, {
|
|
301
|
+
label: a("grantUser.actions.revoke"),
|
|
302
|
+
variant: E.Secondary,
|
|
303
|
+
onClick: (m) => {
|
|
304
|
+
m.stopPropagation(), N(t);
|
|
305
|
+
}
|
|
306
|
+
})]);
|
|
307
|
+
}
|
|
308
|
+
}], n = te(), u = fe(), G = ae(n), I = S(), {
|
|
309
|
+
breakpoints: $
|
|
310
|
+
} = ge(), N = (e) => {
|
|
311
|
+
u.open({
|
|
312
|
+
title: a("grantUser.revoke.title"),
|
|
313
|
+
message: a("grantUser.revoke.message", {
|
|
314
|
+
name: e.name
|
|
315
|
+
}),
|
|
316
|
+
minWidth: $.value.lg ? 588 : 0,
|
|
317
|
+
primaryActions: {
|
|
318
|
+
text: a("grantUser.actions.revoke"),
|
|
319
|
+
close: !1,
|
|
320
|
+
variant: "destructive"
|
|
321
|
+
},
|
|
322
|
+
secondaryActions: {
|
|
323
|
+
text: a("common.cancel"),
|
|
324
|
+
close: !0
|
|
325
|
+
}
|
|
326
|
+
}).onPrimary(async () => {
|
|
327
|
+
G.minor(async () => {
|
|
328
|
+
await b.revokeGrantUser(e._id, e.restaurantId);
|
|
329
|
+
}, {
|
|
330
|
+
successMessage: a("grantUser.revoke.successMessage", {
|
|
331
|
+
name: e.name
|
|
332
|
+
})
|
|
333
|
+
}), u.close();
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
function d() {
|
|
337
|
+
var e;
|
|
338
|
+
(e = I.value) == null || e.trigger();
|
|
339
|
+
}
|
|
340
|
+
const q = g(() => [{
|
|
341
|
+
label: a("grantUser.status.active"),
|
|
342
|
+
value: "active"
|
|
343
|
+
}, {
|
|
344
|
+
label: a("grantUser.status.used"),
|
|
345
|
+
value: "used"
|
|
346
|
+
}, {
|
|
347
|
+
label: a("grantUser.status.revoked"),
|
|
348
|
+
value: "revoked"
|
|
349
|
+
}]), H = g(() => F.value.map((e) => ({
|
|
350
|
+
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
351
|
+
value: e._id
|
|
352
|
+
}))), w = S();
|
|
353
|
+
async function W(e) {
|
|
354
|
+
try {
|
|
355
|
+
await navigator.clipboard.writeText(e), n.open({
|
|
356
|
+
message: a("grantUser.passcode.copied"),
|
|
357
|
+
type: "success"
|
|
358
|
+
});
|
|
359
|
+
} catch (t) {
|
|
360
|
+
n.open({
|
|
361
|
+
message: String(t),
|
|
362
|
+
type: "error"
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return D({
|
|
367
|
+
create: d,
|
|
368
|
+
filteredGrantUsers: h
|
|
369
|
+
}), (e, t) => {
|
|
370
|
+
const m = _("FmSearch"), M = _("FmTable"), R = _("FmButton"), O = _("FmChip"), ne = _("FmListItem"), ce = _("FmList");
|
|
371
|
+
return x(), z(P, null, [l(we, {
|
|
372
|
+
ref_key: "grantUserFormRef",
|
|
373
|
+
ref: I,
|
|
374
|
+
class: "gap-8"
|
|
375
|
+
}, null, 512), o("div", Fe, [o("div", Ie, [o("div", Se, [l(L, {
|
|
376
|
+
modelValue: U.value,
|
|
377
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => U.value = r),
|
|
378
|
+
multiple: "",
|
|
379
|
+
items: H.value,
|
|
380
|
+
variant: "dark",
|
|
381
|
+
"selected-prefix": s(a)("grantUser.columns.restaurant"),
|
|
382
|
+
placeholder: s(a)("grantUser.columns.restaurant"),
|
|
383
|
+
class: "!w-auto"
|
|
384
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(L, {
|
|
385
|
+
modelValue: w.value,
|
|
386
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => w.value = r),
|
|
387
|
+
multiple: "",
|
|
388
|
+
variant: "dark",
|
|
389
|
+
items: q.value,
|
|
390
|
+
"selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
|
|
391
|
+
placeholder: s(a)("grantUser.filter.status_placeholder")
|
|
392
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), l(m, {
|
|
393
|
+
modelValue: s(v),
|
|
394
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => J(v) ? v.value = r : null),
|
|
395
|
+
autofocus: "",
|
|
396
|
+
class: "pl-4 w-[320px]",
|
|
397
|
+
placeholder: s(a)("grantUser.search.placeholder")
|
|
398
|
+
}, null, 8, ["modelValue", "placeholder"])]), o("div", Ce, [o("div", Be, [l(m, {
|
|
399
|
+
modelValue: s(v),
|
|
400
|
+
"onUpdate:modelValue": t[3] || (t[3] = (r) => J(v) ? v.value = r : null),
|
|
401
|
+
autofocus: "",
|
|
402
|
+
placeholder: s(a)("grantUser.search.placeholder")
|
|
403
|
+
}, null, 8, ["modelValue", "placeholder"])]), l(Ue), o("div", $e, [l(L, {
|
|
404
|
+
modelValue: U.value,
|
|
405
|
+
"onUpdate:modelValue": t[4] || (t[4] = (r) => U.value = r),
|
|
406
|
+
multiple: "",
|
|
407
|
+
items: H.value,
|
|
408
|
+
variant: "dark",
|
|
409
|
+
"selected-prefix": s(a)("grantUser.columns.restaurant"),
|
|
410
|
+
placeholder: s(a)("grantUser.columns.restaurant"),
|
|
411
|
+
class: "!w-auto"
|
|
412
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(L, {
|
|
413
|
+
modelValue: w.value,
|
|
414
|
+
"onUpdate:modelValue": t[5] || (t[5] = (r) => w.value = r),
|
|
415
|
+
multiple: "",
|
|
416
|
+
items: q.value,
|
|
417
|
+
variant: "dark",
|
|
418
|
+
"selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
|
|
419
|
+
placeholder: s(a)("grantUser.filter.status_placeholder")
|
|
420
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), c.value.length > 0 || s(b).isLoading ? (x(), j(_e, {
|
|
421
|
+
key: 0,
|
|
422
|
+
class: "overflow-auto"
|
|
423
|
+
}, {
|
|
424
|
+
default: y(() => [l(M, {
|
|
425
|
+
class: "xs:hidden",
|
|
426
|
+
"column-defs": T,
|
|
427
|
+
"row-data": h.value,
|
|
428
|
+
"page-size": h.value.length,
|
|
429
|
+
loading: s(b).isLoading,
|
|
430
|
+
virtual: h.value.length > 0,
|
|
431
|
+
"pin-header-row": "",
|
|
432
|
+
"hide-footer": ""
|
|
433
|
+
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), o("div", Ne, [l(ce, {
|
|
434
|
+
separator: ""
|
|
435
|
+
}, {
|
|
436
|
+
default: y(() => [(x(!0), z(P, null, me(h.value, (r) => (x(), j(ne, {
|
|
437
|
+
key: r._id,
|
|
438
|
+
class: "py-12 px-16 items-center justify-between"
|
|
439
|
+
}, {
|
|
440
|
+
default: y(() => [o("div", Re, [o("div", Le, [l(R, {
|
|
441
|
+
variant: "tertiary",
|
|
442
|
+
"text-color": "neutral-gray-400",
|
|
443
|
+
icon: "content_copy",
|
|
444
|
+
onClick: Q((ie) => W(r.passcode), ["stop"])
|
|
445
|
+
}, null, 8, ["onClick"]), o("p", ze, [o("span", Ae, f(r.passcode), 1), X(" - " + f(r.name), 1)])]), o("div", De, [o("div", null, [X(f(k.value[r.restaurantId] || "-") + " ", 1), o("div", Ke, f(r.restaurantId), 1), o("div", null, f(V.value[r.roleId] || "-"), 1)]), o("div", Te, [o("div", Ge, f(s(a)("grantUser.columns.grantedBy")) + ": " + f(r.grantByName), 1), o("div", Me, f(s(a)("grantUser.columns.createdAt")) + ": " + f(new Date(r.createdAt).toLocaleString()), 1), l(O, {
|
|
446
|
+
label: B(r.status),
|
|
447
|
+
class: ve(C(r.status))
|
|
448
|
+
}, null, 8, ["label", "class"])])])]), r.status === "active" ? (x(), z("div", Oe, [l(R, {
|
|
449
|
+
label: s(a)("grantUser.actions.revoke"),
|
|
450
|
+
variant: s(E).Secondary,
|
|
451
|
+
onClick: Q((ie) => N(r), ["stop"])
|
|
452
|
+
}, null, 8, ["label", "variant", "onClick"])])) : pe("", !0)]),
|
|
453
|
+
_: 2
|
|
454
|
+
}, 1024))), 128))]),
|
|
455
|
+
_: 1
|
|
456
|
+
})])]),
|
|
457
|
+
_: 1
|
|
458
|
+
})) : (x(), j(s(he), {
|
|
459
|
+
key: 1,
|
|
460
|
+
title: s(a)("grantUser.noData.title"),
|
|
461
|
+
subtitle: s(a)("grantUser.noData.subtitle")
|
|
462
|
+
}, null, 8, ["title", "subtitle"]))])], 64);
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
export {
|
|
467
|
+
tt as default
|
|
468
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { defineComponent as U, computed as n, ref as R, watch as C, resolveComponent as _, createBlock as i, openBlock as m, withCtx as p, createElementVNode as w, createCommentVNode as S, createVNode as y, resolveDynamicComponent as F, createTextVNode as G, toDisplayString as q } from "vue";
|
|
2
|
+
import { useRoute as x, useRouter as E } from "vue-router";
|
|
3
|
+
import { useI18n as $, useCoreStore as I } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as M } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as j } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
6
|
+
import { _ as z } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
7
|
+
import { u as H } from "./restaurant-YOVMuuFY.js";
|
|
8
|
+
import { u as J } from "./role-CR_-nBDY.js";
|
|
9
|
+
import { u as K } from "./grant-user-CQZaTzVt.js";
|
|
10
|
+
import { u as Q } from "./approval-code-Q4666xp5.js";
|
|
11
|
+
import { R as u } from "./app-DX-PG6wx.js";
|
|
12
|
+
const W = { class: "space-y-24" }, le = /* @__PURE__ */ U({
|
|
13
|
+
__name: "Main",
|
|
14
|
+
setup(X) {
|
|
15
|
+
const { t: o } = $(), c = x(), d = E(), T = M(), { sessionUser: V, currentBusiness: b } = I(), { readRestaurants: h } = H(), { readRoles: B } = J(), { readGrantUsers: P } = K(), { readApprovalCodes: L } = Q(), s = n(() => {
|
|
16
|
+
var t;
|
|
17
|
+
return !!((t = V.value) != null && t.role.isAdmin);
|
|
18
|
+
}), A = R(), g = R(), r = n({
|
|
19
|
+
get: () => c.name === u.POS_GRANT ? "grants" : "codes",
|
|
20
|
+
set: (t) => {
|
|
21
|
+
d.push({
|
|
22
|
+
name: t === "grants" ? u.POS_GRANT : u.APPROVAL_CODE,
|
|
23
|
+
query: d.currentRoute.value.query
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}), v = n(() => {
|
|
27
|
+
const t = [];
|
|
28
|
+
return s.value && t.push({
|
|
29
|
+
label: o("posAccess.tabs.grants"),
|
|
30
|
+
subTitle: o("posAccess.tabs.grantsDescription"),
|
|
31
|
+
value: "grants",
|
|
32
|
+
createButtonLabel: o("grantUser.actions.create"),
|
|
33
|
+
createButtonAction: () => {
|
|
34
|
+
var e;
|
|
35
|
+
return (e = g.value) == null ? void 0 : e.create();
|
|
36
|
+
}
|
|
37
|
+
}), t.push({
|
|
38
|
+
label: o("posAccess.tabs.codes"),
|
|
39
|
+
subTitle: o("posAccess.tabs.codesDescription"),
|
|
40
|
+
value: "codes",
|
|
41
|
+
createButtonLabel: o("approvalCode.actions.create"),
|
|
42
|
+
createButtonAction: () => {
|
|
43
|
+
var e;
|
|
44
|
+
return (e = A.value) == null ? void 0 : e.create();
|
|
45
|
+
}
|
|
46
|
+
}), t;
|
|
47
|
+
}), l = n(
|
|
48
|
+
() => v.value.find((t) => t.value === r.value) ?? v.value[0]
|
|
49
|
+
), N = n(() => s.value ? o("posAccess.title") : o("approvalCode.title"));
|
|
50
|
+
return C(
|
|
51
|
+
[s, () => c.name],
|
|
52
|
+
() => {
|
|
53
|
+
!s.value && c.name === u.POS_GRANT && d.replace({ name: u.APPROVAL_CODE, query: c.query });
|
|
54
|
+
},
|
|
55
|
+
{ immediate: !0 }
|
|
56
|
+
), C(
|
|
57
|
+
[b, s],
|
|
58
|
+
async () => {
|
|
59
|
+
var t;
|
|
60
|
+
if ((t = b.value) != null && t._id)
|
|
61
|
+
try {
|
|
62
|
+
const e = [h(), L()];
|
|
63
|
+
s.value && e.push(B(), P()), await Promise.all(e);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
console.error("Failed to load POS access dependencies:", e), T.open({
|
|
66
|
+
message: e instanceof Error ? e.message : String(e),
|
|
67
|
+
type: "error"
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{ immediate: !0 }
|
|
72
|
+
), (t, e) => {
|
|
73
|
+
const O = _("FmSpacer"), k = _("FmTabs"), D = _("RouterView");
|
|
74
|
+
return m(), i(z, { heading: N.value }, {
|
|
75
|
+
"sub-heading": p(() => {
|
|
76
|
+
var a;
|
|
77
|
+
return [
|
|
78
|
+
G(q((a = l.value) == null ? void 0 : a.subTitle), 1)
|
|
79
|
+
];
|
|
80
|
+
}),
|
|
81
|
+
"append-heading": p(() => {
|
|
82
|
+
var a;
|
|
83
|
+
return [
|
|
84
|
+
y(O),
|
|
85
|
+
(a = l.value) != null && a.createButtonLabel ? (m(), i(j, {
|
|
86
|
+
key: 0,
|
|
87
|
+
icon: "add",
|
|
88
|
+
label: l.value.createButtonLabel,
|
|
89
|
+
onClick: e[0] || (e[0] = (f) => l.value.createButtonAction())
|
|
90
|
+
}, null, 8, ["label"])) : S("", !0)
|
|
91
|
+
];
|
|
92
|
+
}),
|
|
93
|
+
default: p(() => [
|
|
94
|
+
w("div", W, [
|
|
95
|
+
s.value ? (m(), i(k, {
|
|
96
|
+
key: 0,
|
|
97
|
+
modelValue: r.value,
|
|
98
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => r.value = a),
|
|
99
|
+
items: v.value
|
|
100
|
+
}, null, 8, ["modelValue", "items"])) : S("", !0),
|
|
101
|
+
y(D, null, {
|
|
102
|
+
default: p(({ Component: a }) => [
|
|
103
|
+
(m(), i(F(a), {
|
|
104
|
+
ref: (f) => {
|
|
105
|
+
r.value === "codes" && (A.value = f), r.value === "grants" && (g.value = f);
|
|
106
|
+
}
|
|
107
|
+
}, null, 512))
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
})
|
|
111
|
+
])
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 8, ["heading"]);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
le as default
|
|
120
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { defineComponent as M, ref as R, computed as s, resolveComponent as i, createBlock as c, openBlock as p, withCtx as l, createElementVNode as S, createVNode as d, resolveDynamicComponent as g, createCommentVNode as y, createTextVNode as A, toDisplayString as C } from "vue";
|
|
2
2
|
import { useRouter as N, useRoute as h } from "vue-router";
|
|
3
3
|
import { useI18n as k } from "@feedmepos/mf-common";
|
|
4
|
-
import { _ as x } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as x } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
5
|
import { _ as F } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
6
|
-
import { u as w } from "./
|
|
6
|
+
import { u as w } from "./restaurant-YOVMuuFY.js";
|
|
7
7
|
import "@feedmepos/ui-library";
|
|
8
|
-
import "./rule-
|
|
9
|
-
import "./lodash-
|
|
10
|
-
import "./
|
|
11
|
-
import
|
|
8
|
+
import "./rule-BB-3S-2R.js";
|
|
9
|
+
import "./lodash-ClKqCmlZ.js";
|
|
10
|
+
import "./iteration-Cfaqt-0s.js";
|
|
11
|
+
import "./useAppStore-DNTlIeMv.js";
|
|
12
|
+
import { R as v } from "./app-DX-PG6wx.js";
|
|
13
|
+
import "./role-CR_-nBDY.js";
|
|
12
14
|
/* empty css */
|
|
13
|
-
import "./PortalUserSearcher.
|
|
14
|
-
const $ = { class: "space-y-24" },
|
|
15
|
+
import "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js";
|
|
16
|
+
const $ = { class: "space-y-24" }, Z = /* @__PURE__ */ M({
|
|
15
17
|
__name: "Main",
|
|
16
18
|
setup(q) {
|
|
17
19
|
const { t: o } = k(), b = N(), B = h(), { readRestaurants: T } = w(), _ = R(), f = R(), a = s({
|
|
@@ -90,5 +92,5 @@ const $ = { class: "space-y-24" }, X = /* @__PURE__ */ M({
|
|
|
90
92
|
}
|
|
91
93
|
});
|
|
92
94
|
export {
|
|
93
|
-
|
|
95
|
+
Z as default
|
|
94
96
|
};
|