@feedmepos/mf-hrm-portal 2.3.2-dev.9 → 2.3.2
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-gb0bre9J.js → ApprovalCodeList-C9r8CGNH.js} +15 -14
- package/dist/{AuditLogList-9cwS6bL7.js → AuditLogList-Cu-KcQKa.js} +152 -147
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BQ-uIsTN.js +438 -0
- package/dist/EmployeeList-BaFqZnFM.js +776 -0
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-Be1OU1_r.js +45 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
- package/dist/{GrantUserList-yU2NqFVO.js → GrantUserList-Bjhx60M7.js} +16 -15
- package/dist/Main-CJQpjOgY.js +96 -0
- package/dist/{Main-4KwMqF3h.js → Main-DHiTgiDR.js} +5 -5
- package/dist/{Main-BS_Lk_eB.js → Main-LpfQqR_u.js} +999 -1005
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
- package/dist/{PermissionSetList-D7SS1iAr.js → PermissionSetList-C0OZ_dvE.js} +80 -80
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-T7dkd5Uv.js +4167 -0
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-EwU7gHP7.js +35 -0
- package/dist/RoleList-DpyW5XLs.js +740 -0
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang--dsZOhnv.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CqP-Dn1X.js} +1 -1
- package/dist/{ScheduleGeneralPage-Pq6ufiDu.js → ScheduleGeneralPage-BNHi5jGf.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DKFJLsTW.js → ScheduleModal.vue_vue_type_script_setup_true_lang-B609MZoP.js} +186 -187
- package/dist/{SchedulePage-8EAOfiJx.js → SchedulePage-CrP5_m3p.js} +13 -13
- package/dist/{SchedulePositionPage-CGXeUnju.js → SchedulePositionPage-ei_NKAUw.js} +3 -3
- package/dist/{SelectFilter-C-UEVLla.js → SelectFilter-CEYQ-ViE.js} +1 -1
- package/dist/TeamMemberList-rPiKKu2b.js +1154 -0
- package/dist/TimesheetList-B1L4WkNh.js +402 -0
- package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-By6YR-k2.js +58 -0
- package/dist/{app-BohKQtlz.js → app-BzlH-2cN.js} +4015 -7796
- package/dist/app.js +3 -3
- package/dist/{approval-code-Bfvxsg8h.js → approval-code-CWq2ce3u.js} +1 -1
- package/dist/{dayjs.min-C0MqTPg1.js → dayjs.min-D6T4JzVv.js} +21 -21
- package/dist/employee-Bw7kRokg.js +209 -0
- package/dist/{grant-user-LZ3b6siI.js → grant-user-q_mkj3Vh.js} +1 -1
- package/dist/{index-DDDG-LHm.js → iteration-Dz0e08VH.js} +726 -698
- package/dist/{lodash-BRqMda7F.js → lodash-DGG_-VgI.js} +1 -1
- package/dist/restaurant-DJBQY9N5.js +2688 -0
- package/dist/role-CiRbkZSm.js +92 -0
- package/dist/rule-DMgkHpva.js +783 -0
- package/dist/src/api/employee/index.d.ts +2 -1
- package/dist/src/api/timesheet/index.d.ts +1 -1
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
- package/dist/src/helpers/permission-set.d.ts +102 -1
- package/dist/src/helpers/rule.d.ts +2 -2
- package/dist/src/helpers/string.d.ts +1 -10
- package/dist/src/router/shared.d.ts +1 -3
- package/dist/src/stores/employee.d.ts +7 -1
- package/dist/src/stores/restaurant.d.ts +8 -68
- package/dist/src/stores/team.d.ts +0 -30
- package/dist/src/stores/timesheet.d.ts +51 -66
- package/dist/src/types/team.d.ts +1 -17
- package/dist/src/types/timesheet.d.ts +0 -3
- package/dist/src/views/audit-log/constants.d.ts +1 -1
- package/dist/src/views/audit-log/locales/index.d.ts +16 -12
- package/dist/src/views/hr/locales/index.d.ts +0 -20
- package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
- package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
- package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
- package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
- package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
- package/dist/src/views/team/locales/index.d.ts +0 -716
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
- package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
- package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
- package/dist/string-VNuQNweN.js +15 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-DV13z6oc.js → useAppStore-TRX-PQD4.js} +1 -1
- package/dist/{useLoading-Fcnnfywt.js → useLoading-W3YSF8OB.js} +1 -1
- package/dist/{useReportPermissions-BcyVoKVq.js → useReportPermissions-CCkCAaGO.js} +13 -13
- package/package.json +3 -3
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DR-c15gr.js +0 -459
- package/dist/EmployeeList-DjyoW1we.js +0 -896
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BBWlADve.js +0 -90
- package/dist/Main-BuG7SPnC.js +0 -101
- package/dist/MyPosProfile-CuDzRaRS.js +0 -360
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-u1UlV2Aw.js +0 -4208
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CYkv2x_y.js +0 -1831
- package/dist/RoleForm.vue_vue_type_script_setup_true_lang-hiMgwiya.js +0 -547
- package/dist/RoleList-B3P-LQYV.js +0 -265
- package/dist/TeamMemberList-Bd1O44Ur.js +0 -2087
- package/dist/TimesheetList-CSCmigCM.js +0 -437
- package/dist/employee-DWxT78W2.js +0 -172
- package/dist/iteration-CcXrOMQe.js +0 -30
- package/dist/member-grant-a3AGCWfT.js +0 -54
- package/dist/restaurant-pL7vHt-H.js +0 -52
- package/dist/role--EKCVqho.js +0 -98
- package/dist/rule-Db3gFVHx.js +0 -843
- package/dist/src/api/my-pos-profile/index.d.ts +0 -3
- package/dist/src/api/sso-provider/index.d.ts +0 -5
- package/dist/src/api/staff-invite/index.d.ts +0 -16
- package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
- package/dist/src/composables/useMenuAccess.d.ts +0 -56
- package/dist/src/composables/useSsoProviders.d.ts +0 -19
- package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
- package/dist/src/helpers/member-grant.d.ts +0 -36
- package/dist/src/helpers/my-pos-profile.d.ts +0 -37
- package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
- package/dist/src/helpers/staff-invite.d.ts +0 -54
- package/dist/src/router/menu-access-guard.d.ts +0 -17
- package/dist/src/types/my-pos-profile.d.ts +0 -24
- package/dist/src/types/sso-provider.d.ts +0 -10
- package/dist/src/types/staff-invite.d.ts +0 -100
- package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
- package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
- package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
- package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
- package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
- package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
- package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
- package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
- package/dist/string-DZQ1uNjn.js +0 -22
- package/dist/timesheet-NYW1P4rf.js +0 -76
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { defineComponent as I, createElementBlock as u, openBlock as m, normalizeStyle as P, computed as x, resolveComponent as k, createElementVNode as r, createVNode as p, toDisplayString as _, Fragment as L, renderList as S, createCommentVNode as $, withKeys as F, withModifiers as V, normalizeClass as j } from "vue";
|
|
2
|
+
const ee = /* @__PURE__ */ I({
|
|
3
|
+
__name: "Skeleton",
|
|
4
|
+
props: {
|
|
5
|
+
width: { default: "160px" }
|
|
6
|
+
},
|
|
7
|
+
setup(e) {
|
|
8
|
+
return (a, t) => (m(), u("div", {
|
|
9
|
+
class: "h-16 animate-pulse rounded bg-fm-color-neutral-gray-200",
|
|
10
|
+
style: P({ width: e.width })
|
|
11
|
+
}, null, 4));
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function B(e) {
|
|
15
|
+
return e.map((a) => a.restaurantId).filter(Boolean);
|
|
16
|
+
}
|
|
17
|
+
function w(e, a, t) {
|
|
18
|
+
const o = B(a);
|
|
19
|
+
return e.filter((l) => l.managable || l._id === t).map((l) => ({
|
|
20
|
+
label: `${l.profile.code ? `${l.profile.code} - ` : ""}${l.profile.name}`,
|
|
21
|
+
value: l._id,
|
|
22
|
+
disabled: o.includes(l._id) && l._id !== t
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
function C(e, a, t, o) {
|
|
26
|
+
return a ? e.filter((l) => l.restaurants.some((s) => s.id == a)).map((l) => ({
|
|
27
|
+
label: l.name,
|
|
28
|
+
value: l._id,
|
|
29
|
+
disabled: !o.isRoleUsable(l, a) && l._id !== t
|
|
30
|
+
})) : [];
|
|
31
|
+
}
|
|
32
|
+
function K(e, a, t, o) {
|
|
33
|
+
var s, c;
|
|
34
|
+
const l = C(e, a, t, o);
|
|
35
|
+
return ((s = l.find((n) => n.value === t && !n.disabled)) == null ? void 0 : s.value) ?? ((c = l.find((n) => !n.disabled)) == null ? void 0 : c.value) ?? "";
|
|
36
|
+
}
|
|
37
|
+
function N(e, a) {
|
|
38
|
+
const t = B(a), o = e.some(
|
|
39
|
+
(s) => s.managable && !t.includes(s._id)
|
|
40
|
+
), l = a.every((s) => s.restaurantId && s.roleId);
|
|
41
|
+
return o && l;
|
|
42
|
+
}
|
|
43
|
+
function E(e, a, t, o) {
|
|
44
|
+
var s;
|
|
45
|
+
const l = ((s = e[a]) == null ? void 0 : s.restaurantId) ?? "";
|
|
46
|
+
return o.isRestaurantLocked(l) ? e : e.length === 1 ? [t()] : e.filter((c, n) => n !== a);
|
|
47
|
+
}
|
|
48
|
+
const M = { class: "rounded-lg border border-fm-color-neutral-gray-200 p-16 space-y-16" }, D = { class: "fm-typo-en-title-sm-600" }, G = { class: "space-y-16" }, q = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, H = { class: "text-sm font-semibold text-fm-color-typo-primary" }, J = { class: "text-sm font-semibold text-fm-color-typo-primary" }, Q = { class: "flex justify-self-end" }, T = ["tabindex", "aria-disabled", "aria-label", "onClick", "onKeydown"], te = /* @__PURE__ */ I({
|
|
49
|
+
__name: "OutletRoleAssignment",
|
|
50
|
+
props: {
|
|
51
|
+
modelValue: {},
|
|
52
|
+
restaurants: {},
|
|
53
|
+
roles: {},
|
|
54
|
+
isRoleUsable: {},
|
|
55
|
+
isRestaurantLocked: { type: Function, default: () => !1 },
|
|
56
|
+
createRow: {},
|
|
57
|
+
title: {},
|
|
58
|
+
restaurantLabel: {},
|
|
59
|
+
roleLabel: {},
|
|
60
|
+
addLabel: {},
|
|
61
|
+
removeLabel: {}
|
|
62
|
+
},
|
|
63
|
+
emits: ["update:modelValue"],
|
|
64
|
+
setup(e, { emit: a }) {
|
|
65
|
+
const t = e, o = a, l = x(() => ({
|
|
66
|
+
isRoleUsable: t.isRoleUsable,
|
|
67
|
+
isRestaurantLocked: t.isRestaurantLocked
|
|
68
|
+
}));
|
|
69
|
+
function s(d) {
|
|
70
|
+
return w(t.restaurants, t.modelValue, d);
|
|
71
|
+
}
|
|
72
|
+
function c(d) {
|
|
73
|
+
return C(t.roles, d.restaurantId, d.roleId, l.value);
|
|
74
|
+
}
|
|
75
|
+
function n(d) {
|
|
76
|
+
return t.isRestaurantLocked(d);
|
|
77
|
+
}
|
|
78
|
+
function U(d, f) {
|
|
79
|
+
const b = t.modelValue[d], v = K(t.roles, f, b.roleId, l.value), h = [...t.modelValue];
|
|
80
|
+
h[d] = { ...b, restaurantId: f, roleId: v }, o("update:modelValue", h);
|
|
81
|
+
}
|
|
82
|
+
function z(d, f) {
|
|
83
|
+
const b = t.modelValue[d], v = [...t.modelValue];
|
|
84
|
+
v[d] = { ...b, roleId: f }, o("update:modelValue", v);
|
|
85
|
+
}
|
|
86
|
+
function O() {
|
|
87
|
+
o("update:modelValue", [...t.modelValue, t.createRow()]);
|
|
88
|
+
}
|
|
89
|
+
function R(d) {
|
|
90
|
+
o(
|
|
91
|
+
"update:modelValue",
|
|
92
|
+
E(t.modelValue, d, t.createRow, l.value)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
const A = x(() => N(t.restaurants, t.modelValue));
|
|
96
|
+
return (d, f) => {
|
|
97
|
+
const b = k("FmSelect"), v = k("FmIcon"), h = k("FmButton");
|
|
98
|
+
return m(), u("div", M, [
|
|
99
|
+
r("div", D, _(e.title), 1),
|
|
100
|
+
r("div", G, [
|
|
101
|
+
r("div", q, [
|
|
102
|
+
r("div", H, _(e.restaurantLabel), 1),
|
|
103
|
+
r("div", J, _(e.roleLabel), 1),
|
|
104
|
+
f[0] || (f[0] = r("div", null, null, -1))
|
|
105
|
+
]),
|
|
106
|
+
(m(!0), u(L, null, S(e.modelValue, (i, y) => (m(), u("div", {
|
|
107
|
+
key: `${i.restaurantId || "new"}-${y}`,
|
|
108
|
+
class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
|
|
109
|
+
}, [
|
|
110
|
+
p(b, {
|
|
111
|
+
class: "min-w-0",
|
|
112
|
+
"model-value": i.restaurantId,
|
|
113
|
+
items: s(i.restaurantId),
|
|
114
|
+
multiselect: !1,
|
|
115
|
+
searchable: "",
|
|
116
|
+
"search-debounce": 300,
|
|
117
|
+
placeholder: e.restaurantLabel,
|
|
118
|
+
disabled: n(i.restaurantId),
|
|
119
|
+
"onUpdate:modelValue": (g) => U(y, g)
|
|
120
|
+
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
121
|
+
p(b, {
|
|
122
|
+
class: "min-w-0",
|
|
123
|
+
"model-value": i.roleId,
|
|
124
|
+
items: c(i),
|
|
125
|
+
multiselect: !1,
|
|
126
|
+
placeholder: e.roleLabel,
|
|
127
|
+
disabled: !i.restaurantId || n(i.restaurantId),
|
|
128
|
+
"onUpdate:modelValue": (g) => z(y, g)
|
|
129
|
+
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
130
|
+
r("div", Q, [
|
|
131
|
+
e.modelValue.length > 1 ? (m(), u("div", {
|
|
132
|
+
key: 0,
|
|
133
|
+
role: "button",
|
|
134
|
+
tabindex: n(i.restaurantId) ? -1 : 0,
|
|
135
|
+
"aria-disabled": n(i.restaurantId),
|
|
136
|
+
class: j(["inline-flex h-40 w-40 shrink-0 items-center justify-center rounded-lg text-fm-color-neutral-gray-400 transition-colors hover:bg-fm-color-neutral-gray-100 focus:outline-none focus:ring-2 focus:ring-fm-color-primary disabled:cursor-not-allowed disabled:text-fm-color-neutral-gray-200 disabled:hover:bg-transparent", {
|
|
137
|
+
"cursor-pointer": !n(i.restaurantId),
|
|
138
|
+
"pointer-events-none": n(i.restaurantId)
|
|
139
|
+
}]),
|
|
140
|
+
"aria-label": e.removeLabel,
|
|
141
|
+
onClick: V((g) => R(y), ["stop"]),
|
|
142
|
+
onKeydown: [
|
|
143
|
+
F(V((g) => R(y), ["prevent", "stop"]), ["enter"]),
|
|
144
|
+
F(V((g) => R(y), ["prevent", "stop"]), ["space"])
|
|
145
|
+
]
|
|
146
|
+
}, [
|
|
147
|
+
p(v, {
|
|
148
|
+
name: "delete",
|
|
149
|
+
size: "md"
|
|
150
|
+
})
|
|
151
|
+
], 42, T)) : $("", !0)
|
|
152
|
+
])
|
|
153
|
+
]))), 128))
|
|
154
|
+
]),
|
|
155
|
+
p(h, {
|
|
156
|
+
type: "button",
|
|
157
|
+
variant: "secondary",
|
|
158
|
+
"text-color": "primary",
|
|
159
|
+
"border-color": "primary",
|
|
160
|
+
"prepend-icon": "add",
|
|
161
|
+
label: e.addLabel,
|
|
162
|
+
size: "md",
|
|
163
|
+
disabled: !A.value,
|
|
164
|
+
onClick: V(O, ["stop"])
|
|
165
|
+
}, null, 8, ["label", "disabled"])
|
|
166
|
+
]);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
}), W = {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "fm-typo-body-sm-400 text-fm-color-typo-secondary"
|
|
172
|
+
}, le = /* @__PURE__ */ I({
|
|
173
|
+
__name: "PasscodeGenerateButton",
|
|
174
|
+
props: {
|
|
175
|
+
label: {},
|
|
176
|
+
hint: {},
|
|
177
|
+
disabled: { type: Boolean, default: !1 },
|
|
178
|
+
loading: { type: Boolean, default: !1 }
|
|
179
|
+
},
|
|
180
|
+
emits: ["click"],
|
|
181
|
+
setup(e) {
|
|
182
|
+
return (a, t) => {
|
|
183
|
+
const o = k("FmButton");
|
|
184
|
+
return m(), u(L, null, [
|
|
185
|
+
p(o, {
|
|
186
|
+
variant: "secondary",
|
|
187
|
+
"text-color": "primary",
|
|
188
|
+
"border-color": "primary",
|
|
189
|
+
label: e.label,
|
|
190
|
+
size: "md",
|
|
191
|
+
loading: e.loading,
|
|
192
|
+
disabled: e.disabled,
|
|
193
|
+
onClick: t[0] || (t[0] = (l) => a.$emit("click"))
|
|
194
|
+
}, null, 8, ["label", "loading", "disabled"]),
|
|
195
|
+
e.disabled ? (m(), u("div", W, _(e.hint), 1)) : $("", !0)
|
|
196
|
+
], 64);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}), X = { class: "flex items-center gap-8" }, Y = ["aria-label"], ae = /* @__PURE__ */ I({
|
|
200
|
+
__name: "PasscodePinField",
|
|
201
|
+
props: {
|
|
202
|
+
modelValue: {},
|
|
203
|
+
masked: { type: Boolean },
|
|
204
|
+
length: { default: 4 },
|
|
205
|
+
toggleLabel: {}
|
|
206
|
+
},
|
|
207
|
+
emits: ["update:modelValue", "update:masked", "complete"],
|
|
208
|
+
setup(e, { emit: a }) {
|
|
209
|
+
const t = a;
|
|
210
|
+
return (o, l) => {
|
|
211
|
+
const s = k("FmPinField"), c = k("FmIcon");
|
|
212
|
+
return m(), u("div", X, [
|
|
213
|
+
p(s, {
|
|
214
|
+
"model-value": e.modelValue,
|
|
215
|
+
length: e.length,
|
|
216
|
+
masked: e.masked,
|
|
217
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => t("update:modelValue", n)),
|
|
218
|
+
onComplete: l[1] || (l[1] = (n) => t("complete", n)),
|
|
219
|
+
onFocus: l[2] || (l[2] = (n) => t("update:masked", !1))
|
|
220
|
+
}, null, 8, ["model-value", "length", "masked"]),
|
|
221
|
+
r("button", {
|
|
222
|
+
type: "button",
|
|
223
|
+
class: "flex items-center justify-center rounded-full p-4 hover:bg-fm-color-neutral-gray-100",
|
|
224
|
+
"aria-label": e.toggleLabel,
|
|
225
|
+
onClick: l[3] || (l[3] = (n) => t("update:masked", !e.masked))
|
|
226
|
+
}, [
|
|
227
|
+
p(c, {
|
|
228
|
+
name: e.masked ? "visibility" : "visibility_off",
|
|
229
|
+
size: "md",
|
|
230
|
+
class: "text-fm-color-neutral-gray-300"
|
|
231
|
+
}, null, 8, ["name"])
|
|
232
|
+
], 8, Y)
|
|
233
|
+
]);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
export {
|
|
238
|
+
ae as _,
|
|
239
|
+
le as a,
|
|
240
|
+
te as b,
|
|
241
|
+
ee as c,
|
|
242
|
+
B as s
|
|
243
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as v, computed as
|
|
2
|
-
import { useI18n as se, useCoreStore as
|
|
3
|
-
import { useSnackbar as oe, useDialog as te, useBreakpoints as ne, components as
|
|
4
|
-
import { v as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { u as ie,
|
|
8
|
-
import { l as
|
|
9
|
-
import "./
|
|
1
|
+
import { defineComponent as Z, ref as v, computed as b, watch as ue, resolveComponent as h, createBlock as de, openBlock as ee, unref as r, withCtx as C, createVNode as m, createElementVNode as y, toDisplayString as G, nextTick as pe, onMounted as fe, createElementBlock as ve, Fragment as Se, h as S } from "vue";
|
|
2
|
+
import { useI18n as se, useCoreStore as be } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as oe, useDialog as te, useBreakpoints as ne, components as H } from "@feedmepos/ui-library";
|
|
4
|
+
import { v as Q, _ as he } from "./app-BzlH-2cN.js";
|
|
5
|
+
import { _ as _e } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
6
|
+
import { _ as ge } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
|
|
7
|
+
import { u as ie, c as M, d as ae, p as Y, i as Pe, b as ye, m as A, n as we, o as xe, k as Fe, l as ke, v as Ce } from "./rule-DMgkHpva.js";
|
|
8
|
+
import { l as T } from "./lodash-DGG_-VgI.js";
|
|
9
|
+
import { c as Ie } from "./iteration-Dz0e08VH.js";
|
|
10
10
|
import { u as Ve } from "./useDiscardConfirm-CzZSPyvh.js";
|
|
11
|
-
import { u as Re } from "./useLoading-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
11
|
+
import { u as Re } from "./useLoading-W3YSF8OB.js";
|
|
12
|
+
import { _ as Ee } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-T7dkd5Uv.js";
|
|
13
|
+
import { A as je } from "./restaurant-DJBQY9N5.js";
|
|
14
|
+
const Te = { class: "flex w-full items-center justify-between" }, $e = { class: "fm-typo-en-title-md-600" }, Be = { class: "fm-typo-en-title-sm-600 mt-24" }, Le = { class: "flex items-center justify-start gap-8" }, Ae = /* @__PURE__ */ Z({
|
|
15
15
|
__name: "PermissionSetForm",
|
|
16
16
|
props: {
|
|
17
17
|
modelValue: {
|
|
@@ -20,18 +20,18 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
setup(K, { expose: D }) {
|
|
23
|
-
const o = K, { t: i } = se(), f = v(!1),
|
|
23
|
+
const o = K, { t: i } = se(), f = v(!1), $ = b(() => {
|
|
24
24
|
var e;
|
|
25
25
|
return (e = o.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
|
|
26
|
-
}), I = v(), N = oe(), w = te(), { breakpoints: V } = ne(), R = Re(N), l = ie(), d = v({ ...o.modelValue }), a = v([]), p = v([]),
|
|
26
|
+
}), I = v(), N = oe(), w = te(), { breakpoints: V } = ne(), R = Re(N), l = ie(), d = v({ ...o.modelValue }), a = v([]), p = v([]), B = [(e) => !!e || i("permissionSet.form.nameRequired")], O = b(() => {
|
|
27
27
|
var e;
|
|
28
28
|
return (e = o.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
|
|
29
|
-
}),
|
|
29
|
+
}), q = b(
|
|
30
30
|
() => l.permissionSets.value.filter((e) => {
|
|
31
31
|
var s;
|
|
32
32
|
return e.id !== ((s = o.modelValue) == null ? void 0 : s.id);
|
|
33
33
|
}).map((e) => ({ label: e.name, value: e.id }))
|
|
34
|
-
),
|
|
34
|
+
), E = b(
|
|
35
35
|
() => M(a.value, l.permissionSets.value)
|
|
36
36
|
), {
|
|
37
37
|
fetchCustomReportPermissions: n,
|
|
@@ -39,61 +39,61 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
39
39
|
isLoaded: c
|
|
40
40
|
} = ae(), _ = new Set(
|
|
41
41
|
Y.filter((e) => e.subject.startsWith(Pe)).map((e) => e.subject)
|
|
42
|
-
), g =
|
|
42
|
+
), g = b(() => {
|
|
43
43
|
const e = new Set(_);
|
|
44
44
|
for (const s of t.value) e.add(s.subject);
|
|
45
45
|
return e;
|
|
46
|
-
}),
|
|
46
|
+
}), z = b(() => {
|
|
47
47
|
const e = /* @__PURE__ */ new Set();
|
|
48
48
|
for (const s of Y)
|
|
49
|
-
s.category ===
|
|
49
|
+
s.category === Q.reports && e.add(s.subject);
|
|
50
50
|
for (const s of t.value)
|
|
51
|
-
s.category ===
|
|
51
|
+
s.category === Q.reports && e.add(s.subject);
|
|
52
52
|
return e;
|
|
53
|
-
}),
|
|
53
|
+
}), P = v({ name: "", permissionSetIds: [], userPermissions: [] });
|
|
54
54
|
async function U() {
|
|
55
55
|
var s, u;
|
|
56
56
|
await pe(), f.value = !f.value, d.value = { ...o.modelValue }, a.value = ((s = o.modelValue) == null ? void 0 : s.permissionSetIds) ?? [];
|
|
57
57
|
const e = ((u = o.modelValue) == null ? void 0 : u.permissions) ?? [];
|
|
58
|
-
p.value =
|
|
59
|
-
A(
|
|
58
|
+
p.value = ye(
|
|
59
|
+
A(E.value),
|
|
60
60
|
e
|
|
61
|
-
),
|
|
61
|
+
), P.value = {
|
|
62
62
|
name: d.value.name ?? "",
|
|
63
63
|
permissionSetIds: [...a.value],
|
|
64
|
-
userPermissions:
|
|
64
|
+
userPermissions: Ie(p.value)
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
ue(f, async (e) => {
|
|
68
68
|
e && await n();
|
|
69
69
|
});
|
|
70
70
|
const W = Ve(
|
|
71
|
-
() =>
|
|
71
|
+
() => !T.isEqual(d.value.name ?? "", P.value.name) || !T.isEqual(a.value, P.value.permissionSetIds) || !T.isEqual(p.value, P.value.userPermissions),
|
|
72
72
|
() => {
|
|
73
73
|
f.value = !1;
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
function re() {
|
|
77
|
-
const e = A(
|
|
78
|
-
return
|
|
77
|
+
const e = A(E.value), s = c.value ? g.value : _, u = we(p.value, s), x = xe(u, z.value), F = Fe(x);
|
|
78
|
+
return ke(e, F);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function J(e) {
|
|
81
81
|
return A(
|
|
82
82
|
M(e, l.permissionSets.value)
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
p.value =
|
|
85
|
+
function X(e) {
|
|
86
|
+
p.value = J(e);
|
|
87
87
|
}
|
|
88
88
|
function le(e) {
|
|
89
89
|
const s = [...e ?? []];
|
|
90
|
-
if (
|
|
91
|
-
const u =
|
|
90
|
+
if (T.isEqual(s, a.value)) return;
|
|
91
|
+
const u = !T.isEqual(
|
|
92
92
|
p.value,
|
|
93
|
-
|
|
93
|
+
J(a.value)
|
|
94
94
|
);
|
|
95
95
|
if (a.value = s, !u) {
|
|
96
|
-
|
|
96
|
+
X(s);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
w.open({
|
|
@@ -109,16 +109,16 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
109
109
|
close: !0
|
|
110
110
|
}
|
|
111
111
|
}).onPrimary(() => {
|
|
112
|
-
|
|
112
|
+
X(s), w.close();
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
async function me() {
|
|
116
116
|
var u, x;
|
|
117
|
-
const e = await ((u = I.value) == null ? void 0 : u.validateInputsWithoutSubmit()), s = (x =
|
|
117
|
+
const e = await ((u = I.value) == null ? void 0 : u.validateInputsWithoutSubmit()), s = (x = be().currentBusiness.value) == null ? void 0 : x.id;
|
|
118
118
|
!(e != null && e.length) && s && R.minor(async () => {
|
|
119
|
-
var
|
|
119
|
+
var L;
|
|
120
120
|
const F = re();
|
|
121
|
-
if ((
|
|
121
|
+
if ((L = o.modelValue) != null && L.id) {
|
|
122
122
|
const k = {
|
|
123
123
|
name: d.value.name,
|
|
124
124
|
permissions: F,
|
|
@@ -141,17 +141,17 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
141
141
|
return D({
|
|
142
142
|
trigger: U
|
|
143
143
|
}), (e, s) => {
|
|
144
|
-
const u =
|
|
144
|
+
const u = h("FmIcon"), x = h("FmTextField"), F = h("FmSelect"), L = h("FmForm"), k = h("FmButton"), ce = h("FmSideSheet");
|
|
145
145
|
return ee(), de(ce, {
|
|
146
146
|
modelValue: f.value,
|
|
147
|
-
"onUpdate:modelValue": s[2] || (s[2] = (
|
|
147
|
+
"onUpdate:modelValue": s[2] || (s[2] = (j) => f.value = j),
|
|
148
148
|
"max-width": 960,
|
|
149
149
|
"close-button": !1,
|
|
150
150
|
"onOn:clickedAway": r(W)
|
|
151
151
|
}, {
|
|
152
152
|
"side-sheet-header": C(() => [
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
y("div", Te, [
|
|
154
|
+
y("p", $e, G($.value), 1),
|
|
155
155
|
m(u, {
|
|
156
156
|
name: "close",
|
|
157
157
|
size: "md",
|
|
@@ -161,9 +161,9 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
161
161
|
])
|
|
162
162
|
]),
|
|
163
163
|
"side-sheet-footer": C(() => [
|
|
164
|
-
|
|
164
|
+
y("div", Le, [
|
|
165
165
|
m(k, {
|
|
166
|
-
label:
|
|
166
|
+
label: O.value,
|
|
167
167
|
size: "md",
|
|
168
168
|
variant: "primary",
|
|
169
169
|
type: "submit",
|
|
@@ -178,34 +178,34 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
178
178
|
])
|
|
179
179
|
]),
|
|
180
180
|
default: C(() => [
|
|
181
|
-
m(
|
|
181
|
+
m(L, {
|
|
182
182
|
ref_key: "formRef",
|
|
183
183
|
ref: I
|
|
184
184
|
}, {
|
|
185
185
|
default: C(() => [
|
|
186
186
|
m(x, {
|
|
187
187
|
modelValue: d.value.name,
|
|
188
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
188
|
+
"onUpdate:modelValue": s[0] || (s[0] = (j) => d.value.name = j),
|
|
189
189
|
label: r(i)("permissionSet.form.name"),
|
|
190
190
|
placeholder: r(i)("permissionSet.form.namePlaceholder"),
|
|
191
|
-
rules:
|
|
191
|
+
rules: B
|
|
192
192
|
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
193
193
|
m(F, {
|
|
194
194
|
"model-value": a.value,
|
|
195
195
|
multiselect: "",
|
|
196
196
|
searchable: "",
|
|
197
197
|
"search-debounce": 300,
|
|
198
|
-
items:
|
|
198
|
+
items: q.value,
|
|
199
199
|
label: r(i)("permissionSet.form.includedSets"),
|
|
200
200
|
placeholder: r(i)("permissionSet.form.includedSetsPlaceholder"),
|
|
201
201
|
class: "mt-16",
|
|
202
202
|
"onUpdate:modelValue": le
|
|
203
203
|
}, null, 8, ["model-value", "items", "label", "placeholder"]),
|
|
204
|
-
|
|
204
|
+
y("div", Be, G(r(i)("team.memberForm.permissions.title")), 1),
|
|
205
205
|
m(Ee, {
|
|
206
206
|
modelValue: p.value,
|
|
207
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
208
|
-
"inherit-permissions":
|
|
207
|
+
"onUpdate:modelValue": s[1] || (s[1] = (j) => p.value = j),
|
|
208
|
+
"inherit-permissions": E.value,
|
|
209
209
|
class: "mt-16"
|
|
210
210
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
211
211
|
]),
|
|
@@ -216,26 +216,26 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
216
216
|
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
-
}), De = { class: "space-y-8" }, Ne = { class: "flex justify-end xs:px-16" },
|
|
219
|
+
}), De = { class: "space-y-8" }, Ne = { class: "flex justify-end xs:px-16" }, Oe = { class: "flex flex-col h-full overflow-auto" }, es = /* @__PURE__ */ Z({
|
|
220
220
|
__name: "PermissionSetList",
|
|
221
221
|
setup(K, { expose: D }) {
|
|
222
|
-
const { t: o } = se(), { customReportPermissions: i, fetchCustomReportPermissions: f } = ae(),
|
|
222
|
+
const { t: o } = se(), { customReportPermissions: i, fetchCustomReportPermissions: f } = ae(), $ = oe(), I = te(), { breakpoints: N } = ne(), w = v(""), V = b(() => {
|
|
223
223
|
var n;
|
|
224
224
|
return (n = d.value) == null ? void 0 : n.filter((t) => {
|
|
225
225
|
const c = w.value.toLowerCase();
|
|
226
226
|
return t.name.toLowerCase().includes(c);
|
|
227
227
|
});
|
|
228
|
-
}), R = v(), l = ie(), d =
|
|
228
|
+
}), R = v(), l = ie(), d = b(
|
|
229
229
|
() => l.permissionSets.value
|
|
230
230
|
), a = v();
|
|
231
231
|
async function p() {
|
|
232
232
|
await l.readPermissionSets();
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function B(n) {
|
|
235
235
|
var t;
|
|
236
236
|
a.value = n, (t = R.value) == null || t.trigger();
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const O = [
|
|
239
239
|
{
|
|
240
240
|
accessorKey: "name",
|
|
241
241
|
header: () => o("permissionSet.table.columns.name")
|
|
@@ -248,24 +248,24 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
248
248
|
const t = n.row.original, c = M(
|
|
249
249
|
[t.id],
|
|
250
250
|
l.permissionSets.value
|
|
251
|
-
), _ = A(c), g = _.length,
|
|
251
|
+
), _ = A(c), g = _.length, z = Ce(
|
|
252
252
|
_,
|
|
253
253
|
i.value
|
|
254
254
|
);
|
|
255
255
|
return S("div", { class: "flex items-center gap-8" }, [
|
|
256
256
|
S("span", o("team.labels.allowed", { count: g })),
|
|
257
257
|
S(
|
|
258
|
-
|
|
258
|
+
H.FmTooltip,
|
|
259
259
|
{ variant: "plain", placement: "top" },
|
|
260
260
|
{
|
|
261
|
-
default: () => S(
|
|
261
|
+
default: () => S(H.FmIcon, {
|
|
262
262
|
name: "info",
|
|
263
263
|
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
264
264
|
}),
|
|
265
265
|
content: () => S("div", [
|
|
266
266
|
o("team.labels.permission"),
|
|
267
|
-
...
|
|
268
|
-
(
|
|
267
|
+
...z.map(
|
|
268
|
+
(P, U) => S("div", { key: `${P}-${U}` }, `- ${P}`)
|
|
269
269
|
)
|
|
270
270
|
])
|
|
271
271
|
}
|
|
@@ -289,12 +289,12 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
289
289
|
onClick: (c) => c.stopPropagation()
|
|
290
290
|
},
|
|
291
291
|
[
|
|
292
|
-
S(
|
|
292
|
+
S(ge, {
|
|
293
293
|
items: [
|
|
294
|
-
{ label: o("common.update"), onClick: () =>
|
|
294
|
+
{ label: o("common.update"), onClick: () => B(t) },
|
|
295
295
|
{
|
|
296
296
|
label: o("common.remove"),
|
|
297
|
-
onClick: () =>
|
|
297
|
+
onClick: () => E(t),
|
|
298
298
|
itemClass: "text-fm-color-typo-error"
|
|
299
299
|
}
|
|
300
300
|
]
|
|
@@ -305,11 +305,11 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
305
305
|
enableSorting: !1
|
|
306
306
|
}
|
|
307
307
|
];
|
|
308
|
-
function
|
|
308
|
+
function q() {
|
|
309
309
|
var n;
|
|
310
310
|
a.value = void 0, (n = R.value) == null || n.trigger();
|
|
311
311
|
}
|
|
312
|
-
async function
|
|
312
|
+
async function E(n) {
|
|
313
313
|
I.open({
|
|
314
314
|
title: o("permissionSet.form.delete.title"),
|
|
315
315
|
message: o("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
|
|
@@ -322,15 +322,15 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
322
322
|
secondaryActions: { text: o("common.cancel"), close: !0 }
|
|
323
323
|
}).onPrimary(async () => {
|
|
324
324
|
try {
|
|
325
|
-
await l.deletePermissionSet(n.id),
|
|
325
|
+
await l.deletePermissionSet(n.id), $.open({
|
|
326
326
|
message: o("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
|
|
327
327
|
type: "success"
|
|
328
328
|
});
|
|
329
329
|
} catch (t) {
|
|
330
|
-
const c = t instanceof
|
|
330
|
+
const c = t instanceof je && t.status === 409 ? t.message.includes("referenced by") ? o("permissionSet.form.delete.setReferencedConflictError", {
|
|
331
331
|
permissionSetName: n.name
|
|
332
332
|
}) : o("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
|
|
333
|
-
|
|
333
|
+
$.open({ message: c, type: "error" });
|
|
334
334
|
}
|
|
335
335
|
I.close();
|
|
336
336
|
});
|
|
@@ -338,17 +338,17 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
338
338
|
return fe(() => {
|
|
339
339
|
p(), f();
|
|
340
340
|
}), D({
|
|
341
|
-
create:
|
|
341
|
+
create: q
|
|
342
342
|
}), (n, t) => {
|
|
343
|
-
const c =
|
|
343
|
+
const c = h("FmSearch"), _ = h("FmTable");
|
|
344
344
|
return ee(), ve(Se, null, [
|
|
345
345
|
m(Ae, {
|
|
346
346
|
ref_key: "permissionSetFormRef",
|
|
347
347
|
ref: R,
|
|
348
348
|
"model-value": a.value
|
|
349
349
|
}, null, 8, ["model-value"]),
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
y("div", De, [
|
|
351
|
+
y("div", Ne, [
|
|
352
352
|
m(c, {
|
|
353
353
|
modelValue: w.value,
|
|
354
354
|
"onUpdate:modelValue": t[0] || (t[0] = (g) => w.value = g),
|
|
@@ -357,10 +357,10 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
357
357
|
placeholder: r(o)("permissionSet.search.placeholder")
|
|
358
358
|
}, null, 8, ["modelValue", "placeholder"])
|
|
359
359
|
]),
|
|
360
|
-
m(
|
|
360
|
+
m(he, null, {
|
|
361
361
|
default: C(() => [
|
|
362
|
-
|
|
363
|
-
m(
|
|
362
|
+
y("div", Oe, [
|
|
363
|
+
m(_e, {
|
|
364
364
|
"is-loading": r(l).isLoading.value,
|
|
365
365
|
"is-empty": V.value.length === 0,
|
|
366
366
|
"collapse-at": !1,
|
|
@@ -369,14 +369,14 @@ const $e = { class: "flex w-full items-center justify-between" }, Be = { class:
|
|
|
369
369
|
}, {
|
|
370
370
|
default: C(() => [
|
|
371
371
|
m(_, {
|
|
372
|
-
"column-defs":
|
|
372
|
+
"column-defs": O,
|
|
373
373
|
"row-data": V.value,
|
|
374
374
|
"page-size": V.value.length,
|
|
375
375
|
loading: r(l).isLoading.value,
|
|
376
376
|
"pin-header-row": "",
|
|
377
377
|
"hide-footer": "",
|
|
378
378
|
"shrink-at": !1,
|
|
379
|
-
onRowClick: t[1] || (t[1] = (g) =>
|
|
379
|
+
onRowClick: t[1] || (t[1] = (g) => B(g.original))
|
|
380
380
|
}, null, 8, ["row-data", "page-size", "loading"])
|
|
381
381
|
]),
|
|
382
382
|
_: 1
|