@feedmepos/mf-hrm-portal 1.1.0-dev → 1.1.1-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/AuditLogList-D62QRWN-.js +232 -0
- package/dist/{EmployeeList-tmUqs5a6.js → EmployeeList-CMUbRS7j.js} +156 -150
- package/dist/Main-BbZ-t-pu.js +85 -0
- package/dist/{main-DOtgCRZe.js → Main-un3v_g6p.js} +1500 -1532
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-DuwNwJDM.js → PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js} +2 -2
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js +3119 -0
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
- package/dist/{RoleList-C5xG7LHg.js → RoleList-mlTepnhN.js} +52 -50
- package/dist/RolePermissionList-tR-Kmlu7.js +285 -0
- package/dist/TeamMemberList-BkRQl6x8.js +948 -0
- package/dist/{TimesheetList-CZfo4Dua.js → TimesheetList-i5yaAzhB.js} +21 -21
- package/dist/api/audit-log/index.d.ts +10 -0
- package/dist/api/index.d.ts +1 -3
- package/dist/api/permission-assignment/index.d.ts +10 -0
- package/dist/api/permission-set/index.d.ts +8 -0
- package/dist/api/team/index.d.ts +2 -1
- package/dist/app-4LaGLcWC.js +2305 -0
- package/dist/app.js +1 -1
- package/dist/components/AppForm.vue.d.ts +3 -2
- package/dist/components/CheckboxInput.vue.d.ts +10 -4
- package/dist/components/CollapsibleWrapper.vue.d.ts +3 -2
- package/dist/components/form/SelectFilter.vue.d.ts +3 -2
- package/dist/components/layout/FormColumn.vue.d.ts +6 -3
- package/dist/components/layout/FormItem.vue.d.ts +2 -1
- package/dist/components/layout/FormSection.vue.d.ts +2 -1
- package/dist/components/layout/FullWrapper.vue.d.ts +6 -3
- package/dist/components/layout/PageLayout.vue.d.ts +2 -1
- package/dist/components/menu/BottomSheetMenu.vue.d.ts +2 -1
- package/dist/components/menu/BottomSheetMenuItem.vue.d.ts +6 -3
- package/dist/components/table/EmptyDataTemplate/index.vue.d.ts +6 -3
- package/dist/composables/useAppStore.d.ts +6 -6
- package/dist/composables/useDateRange.d.ts +1 -1
- package/dist/composables/useRestaurantMap.d.ts +4 -8
- package/dist/composables/useSheet.d.ts +1 -1
- package/dist/{employee-BQc7Wgpu.js → employee-BZTntAR0.js} +9 -9
- package/dist/helpers/permission-set.d.ts +32 -0
- package/dist/helpers/portal-user.d.ts +8 -0
- package/dist/helpers/rule.d.ts +4 -3
- package/dist/index-BsEM84j5.js +8440 -0
- package/dist/{empty-placeholder-ey8LJtN1.js → index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js} +43 -2
- package/dist/{lodash-DNzKT_gG.js → lodash-DYaYvsmp.js} +326 -343
- package/dist/router/shared.d.ts +3 -1
- package/dist/stores/employee.d.ts +4 -4
- package/dist/stores/permission-assignment.d.ts +277 -0
- package/dist/stores/permission-set.d.ts +250 -0
- package/dist/stores/role.d.ts +4 -4
- package/dist/stores/team.d.ts +288 -0
- package/dist/stores/timesheet.d.ts +19 -19
- package/dist/team-eo_yQh1g.js +26 -0
- package/dist/{timesheet-B4M1nCIm.js → timesheet-CfPIK52Q.js} +14 -15
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/audit-log.d.ts +18 -0
- package/dist/types/permission-assignment.d.ts +20 -0
- package/dist/types/permission-set.d.ts +20 -0
- package/dist/types/permission.d.ts +4 -3
- package/dist/types/team.d.ts +13 -3
- package/dist/useAppStore-D0F-tWJO.js +180 -0
- package/dist/useLoading-DpbOtToC.js +99 -0
- package/dist/useRestaurantMap-D5BNPLKh.js +107 -0
- package/dist/{useSearch-C25VELOk.js → useSearch-C6gRA62e.js} +8 -8
- package/dist/views/hr/employee/{components/EmployeeForm.vue.d.ts → EmployeeForm.vue.d.ts} +10 -7
- package/dist/views/hr/locales/index.d.ts +0 -214
- package/dist/views/team/components/BasePermission.vue.d.ts +76 -0
- package/dist/views/team/components/{TeamMemberConditionPermission.vue.d.ts → ConditionPermission.vue.d.ts} +14 -1
- package/dist/views/team/components/InheritPermissionTooltip.vue.d.ts +14 -0
- package/dist/views/team/components/PermissionWithTooltip.vue.d.ts +14 -0
- package/dist/views/team/components/PortalPermissionEditor.vue.d.ts +68 -28
- package/dist/views/team/components/{TeamMemberRolePermission.vue.d.ts → PosRolePermission.vue.d.ts} +14 -1
- package/dist/views/team/locales/index.d.ts +176 -4
- package/dist/views/team/{components → member}/AddMemberForm.vue.d.ts +1 -0
- package/dist/views/team/member/TeamMemberList.vue.d.ts +4 -0
- package/dist/views/team/member/TeamMemberMasterUser.vue.d.ts +55 -0
- package/dist/views/team/role/RolePermissionForm.vue.d.ts +19 -0
- package/dist/views/{hr/grant-user/GrantUserList.vue.d.ts → team/role/RolePermissionList.vue.d.ts} +0 -12
- package/package.json +14 -9
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BY9VGOoM.js +0 -71
- package/dist/HorizontalSplitter-B9DVYJIM.js +0 -12
- package/dist/Main-ebQsujY3.js +0 -600
- package/dist/TeamMemberList-09_3YTHe.js +0 -1509
- package/dist/api/grant-user/index.d.ts +0 -8
- package/dist/app-B4KDGOw1.js +0 -1432
- package/dist/index-CSG8t9Dl.js +0 -58
- package/dist/role-DGAu9X1X.js +0 -9728
- package/dist/rule-CSj0p2P3.js +0 -450
- package/dist/stores/grant-user.d.ts +0 -86
- package/dist/types/grant-user.d.ts +0 -17
- package/dist/useAppStore-CKmMR-gI.js +0 -93
- package/dist/useLoading-v4m-6mEy.js +0 -141
- package/dist/useRestaurantMap-e9fQJiLC.js +0 -39
- package/dist/views/hr/grant-user/components/GrantUserForm.vue.d.ts +0 -14
- package/dist/views/team/components/TeamMemberBasePermission.vue.d.ts +0 -36
- package/dist/views/team/components/TeamMemberMasterUser.vue.d.ts +0 -718
- /package/dist/views/hr/{grant-user/Main.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/views/hr/{main.vue.d.ts → audit-log/AuditLogList.vue.d.ts} +0 -0
- /package/dist/views/team/{TeamMemberList.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/views/team/{components → member}/MemberInfo.vue.d.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as p, computed as t, resolveComponent as c, createBlock as m, createElementBlock as u, openBlock as n, normalizeProps as v, mergeProps as r, createVNode as d } from "vue";
|
|
2
|
+
import { useBreakpoints as b } from "@feedmepos/ui-library";
|
|
3
|
+
const _ = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "z-10 fixed bottom-72 right-16"
|
|
6
|
+
}, C = /* @__PURE__ */ p({
|
|
7
|
+
__name: "ResponsiveFabButton",
|
|
8
|
+
props: {
|
|
9
|
+
variant: {},
|
|
10
|
+
label: {},
|
|
11
|
+
icon: {},
|
|
12
|
+
size: {},
|
|
13
|
+
disabled: { type: Boolean },
|
|
14
|
+
iconColor: {},
|
|
15
|
+
borderColor: {},
|
|
16
|
+
textColor: {},
|
|
17
|
+
bgColor: {},
|
|
18
|
+
type: {},
|
|
19
|
+
iconPosition: {},
|
|
20
|
+
prependIcon: {},
|
|
21
|
+
appendIcon: {},
|
|
22
|
+
loading: { type: Boolean },
|
|
23
|
+
disableIconStatus: { type: Boolean },
|
|
24
|
+
overwriteIconOutline: {}
|
|
25
|
+
},
|
|
26
|
+
setup(a) {
|
|
27
|
+
const o = a, i = t(() => o.variant === "primary" || !o.variant ? "fab" : o.variant), s = b(), l = t(() => s.breakpoints.value.xs);
|
|
28
|
+
return (B, k) => {
|
|
29
|
+
const e = c("FmButton");
|
|
30
|
+
return l.value ? (n(), u("div", _, [
|
|
31
|
+
d(e, r(o, { variant: i.value }), null, 16, ["variant"])
|
|
32
|
+
])) : (n(), m(e, v(r({ key: 0 }, o)), null, 16));
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
C as _
|
|
38
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as ce, ref as T, computed as _, onMounted as pe, watch as xe, resolveComponent as y,
|
|
2
|
-
import {
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import { _ as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { u as
|
|
9
|
-
import { l as z } from "./lodash-
|
|
10
|
-
import {
|
|
11
|
-
const Te = { class: "fm-typo-en-title-md-600" },
|
|
1
|
+
import { defineComponent as ce, ref as T, computed as _, onMounted as pe, watch as xe, resolveComponent as y, createBlock as C, openBlock as p, unref as t, withCtx as b, createElementVNode as f, createVNode as c, createCommentVNode as re, createElementBlock as L, Fragment as q, renderList as G, toDisplayString as P, h as F, createTextVNode as ne, resolveDynamicComponent as ie, withModifiers as Fe, nextTick as ue } from "vue";
|
|
2
|
+
import { e as Ce, a as E, r as K, h as le, f as Re, c as de, d as j } from "./index-BsEM84j5.js";
|
|
3
|
+
import { useI18n as ve, useCoreStore as fe } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as _e, components as W, useDialog as Ve, useBreakpoints as we, FmButtonColorThemeVariant as me, FmButtonVariant as ke } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as Ie } from "./app-4LaGLcWC.js";
|
|
6
|
+
import { _ as Le } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
7
|
+
import { u as he } from "./useAppStore-D0F-tWJO.js";
|
|
8
|
+
import { u as Ue, _ as se, a as Se, b as $e } from "./useRestaurantMap-D5BNPLKh.js";
|
|
9
|
+
import { l as z } from "./lodash-DYaYvsmp.js";
|
|
10
|
+
import { u as Ee } from "./useLoading-DpbOtToC.js";
|
|
11
|
+
const Te = { class: "fm-typo-en-title-md-600" }, Be = { class: "space-y-40" }, De = { class: "space-y-8" }, Pe = { class: "space-y-8" }, Me = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "w-50 ml-5 flex flex-row items-start"
|
|
14
14
|
}, Ae = { class: "m-2" }, Ne = { class: "flex gap-8 items-center justify-start" }, Oe = /* @__PURE__ */ ce({
|
|
@@ -20,12 +20,14 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
setup(te, { expose: H }) {
|
|
23
|
-
const { t: s } =
|
|
23
|
+
const { t: s } = ve(), Q = fe(), U = T(""), R = _(() => Q.restaurants.value.filter(({ profile: e }) => {
|
|
24
24
|
const a = `${e.code ? e.code + "-" : ""}${e.legalName}`;
|
|
25
25
|
return !U.value || a.toLowerCase().includes(U.value.toLowerCase());
|
|
26
|
-
})), S =
|
|
26
|
+
})), S = he(), J = _e(), X = Ee(J), B = te, d = T(!1), Y = () => {
|
|
27
27
|
d.value = !d.value, d.value && $();
|
|
28
|
-
}, Z = _(() =>
|
|
28
|
+
}, Z = _(() => B.id ? s("hr.role.form.update") : s("hr.role.form.add")), M = _(() => B.id ? s("common.update") : s("common.add")), A = _(() => Ce.filter(
|
|
29
|
+
(e) => !(e.subject === E.F_RULE_SUBJECT.enum.report && !e.conditions)
|
|
30
|
+
).map((e) => K(e))), m = _(() => S.roles.value.find((e) => e._id == B.id)), V = () => ({
|
|
29
31
|
name: "",
|
|
30
32
|
restaurantIds: [],
|
|
31
33
|
permissions: [],
|
|
@@ -56,8 +58,8 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
56
58
|
function $() {
|
|
57
59
|
var e;
|
|
58
60
|
l.value = V(), l.value.name = ((e = m.value) == null ? void 0 : e.name) ?? "", h.value ? (l.value.restaurantIds = R.value.map((a) => a._id), l.value.permissions = A.value.map((a) => a.value)) : m.value && (l.value.restaurantIds = m.value.restaurants.map((a) => a.id), l.value.permissions = m.value.permissions.map(
|
|
59
|
-
(a) =>
|
|
60
|
-
), l.value.maxDiscountPercentage =
|
|
61
|
+
(a) => K(a).value
|
|
62
|
+
), l.value.maxDiscountPercentage = de(
|
|
61
63
|
m.value.permissions
|
|
62
64
|
));
|
|
63
65
|
}
|
|
@@ -68,7 +70,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
68
70
|
restaurantIds: l.value.restaurantIds,
|
|
69
71
|
role: {
|
|
70
72
|
name: l.value.name,
|
|
71
|
-
permissions:
|
|
73
|
+
permissions: Re(l.value.permissions, l.value.maxDiscountPercentage)
|
|
72
74
|
}
|
|
73
75
|
})), o = () => {
|
|
74
76
|
const e = ae.value;
|
|
@@ -87,7 +89,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
87
89
|
i.value === !0 ? l.value.restaurantIds = e : l.value.restaurantIds = R.value.map((a) => a._id);
|
|
88
90
|
}, g = (e) => e.map((v) => v.value).every((v) => l.value.permissions.includes(v)), w = (e) => {
|
|
89
91
|
const a = l.value.permissions.filter(
|
|
90
|
-
(v) => !e.map((
|
|
92
|
+
(v) => !e.map((D) => D.value).includes(v)
|
|
91
93
|
);
|
|
92
94
|
g(e) === !0 ? l.value.permissions = a : l.value.permissions = [...a, ...e.map((v) => v.value)];
|
|
93
95
|
};
|
|
@@ -97,18 +99,18 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
97
99
|
e.length > 0 && (ee.value = "");
|
|
98
100
|
}
|
|
99
101
|
);
|
|
100
|
-
const O =
|
|
102
|
+
const O = Ue(
|
|
101
103
|
() => {
|
|
102
|
-
var e, a, v,
|
|
104
|
+
var e, a, v, D;
|
|
103
105
|
return !z.isEqual(l.value.name, ((e = m.value) == null ? void 0 : e.name) || V().name) || !z.isEqual(
|
|
104
106
|
l.value.restaurantIds,
|
|
105
107
|
((a = m.value) == null ? void 0 : a.restaurants.map((k) => k.id)) || V().restaurantIds
|
|
106
108
|
) || !z.isEqual(
|
|
107
109
|
l.value.permissions,
|
|
108
|
-
((v = m.value) == null ? void 0 : v.permissions.map((k) =>
|
|
110
|
+
((v = m.value) == null ? void 0 : v.permissions.map((k) => K(k).value)) || V().permissions
|
|
109
111
|
) || !z.isEqual(
|
|
110
112
|
l.value.maxDiscountPercentage,
|
|
111
|
-
m.value ?
|
|
113
|
+
m.value ? de((D = m.value) == null ? void 0 : D.permissions) : V().maxDiscountPercentage
|
|
112
114
|
);
|
|
113
115
|
},
|
|
114
116
|
() => {
|
|
@@ -119,12 +121,12 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
119
121
|
show: d,
|
|
120
122
|
trigger: Y
|
|
121
123
|
}), (e, a) => {
|
|
122
|
-
const v = y("FmTextField"),
|
|
124
|
+
const v = y("FmTextField"), D = y("FmSearch"), k = y("FmCheckbox"), ge = y("FmFormGroup"), be = y("FmCard"), oe = y("fm-button"), ye = y("fm-side-sheet");
|
|
123
125
|
return p(), C(ye, {
|
|
124
126
|
id: "unit-form",
|
|
125
127
|
modelValue: d.value,
|
|
126
128
|
"onUpdate:modelValue": a[7] || (a[7] = (n) => d.value = n),
|
|
127
|
-
"is-container": t(
|
|
129
|
+
"is-container": t(W).FmForm,
|
|
128
130
|
"is-container-props": {
|
|
129
131
|
onValidationSuccess: o,
|
|
130
132
|
blameFormChildOnValidationFailed: !0
|
|
@@ -133,7 +135,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
133
135
|
"onOn:clickedAway": t(O)
|
|
134
136
|
}, {
|
|
135
137
|
"side-sheet-header": b(() => [
|
|
136
|
-
f("p", Te,
|
|
138
|
+
f("p", Te, P(Z.value), 1)
|
|
137
139
|
]),
|
|
138
140
|
"side-sheet-footer": b(() => [
|
|
139
141
|
f("div", Ne, [
|
|
@@ -153,7 +155,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
153
155
|
])
|
|
154
156
|
]),
|
|
155
157
|
default: b(() => [
|
|
156
|
-
f("div",
|
|
158
|
+
f("div", Be, [
|
|
157
159
|
c(se, { title: "Role detail" }, {
|
|
158
160
|
default: b(() => [
|
|
159
161
|
c(v, {
|
|
@@ -171,7 +173,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
171
173
|
title: t(s)("hr.role.form.restaurant")
|
|
172
174
|
}, {
|
|
173
175
|
default: b(() => [
|
|
174
|
-
c(
|
|
176
|
+
c(D, {
|
|
175
177
|
modelValue: U.value,
|
|
176
178
|
"onUpdate:modelValue": a[1] || (a[1] = (n) => U.value = n),
|
|
177
179
|
placeholder: t(s)("hr.restaurant.search.placeholder")
|
|
@@ -182,7 +184,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
182
184
|
rules: [(n) => n.length > 0 || t(s)("hr.role.form.atLeastOneRestaurant")]
|
|
183
185
|
}, {
|
|
184
186
|
default: b(() => [
|
|
185
|
-
f("div",
|
|
187
|
+
f("div", De, [
|
|
186
188
|
U.value ? re("", !0) : (p(), C(k, {
|
|
187
189
|
key: 0,
|
|
188
190
|
"model-value": i.value,
|
|
@@ -219,11 +221,11 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
219
221
|
class: "p-16"
|
|
220
222
|
}, {
|
|
221
223
|
default: b(() => [
|
|
222
|
-
c(
|
|
224
|
+
c(Se, {
|
|
223
225
|
label: n.title
|
|
224
226
|
}, {
|
|
225
227
|
default: b(() => [
|
|
226
|
-
f("div",
|
|
228
|
+
f("div", Pe, [
|
|
227
229
|
c(k, {
|
|
228
230
|
"model-value": g(n.options),
|
|
229
231
|
label: "All",
|
|
@@ -242,7 +244,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
242
244
|
disabled: h.value
|
|
243
245
|
}, null, 8, ["modelValue", "label", "value", "disabled"]),
|
|
244
246
|
I.value === "order:discount" && l.value.permissions.includes(I.value) ? (p(), L("div", Me, [
|
|
245
|
-
f("div", Ae,
|
|
247
|
+
f("div", Ae, P(t(s)("hr.role.form.maxDiscountPercentage")), 1),
|
|
246
248
|
c(v, {
|
|
247
249
|
modelValue: l.value.maxDiscountPercentage,
|
|
248
250
|
"onUpdate:modelValue": a[5] || (a[5] = (x) => l.value.maxDiscountPercentage = x),
|
|
@@ -296,10 +298,10 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
296
298
|
}) {
|
|
297
299
|
const {
|
|
298
300
|
t: s
|
|
299
|
-
} =
|
|
301
|
+
} = ve(), Q = fe(), U = _(() => Q.restaurants.value), R = _(() => U.value.map((o) => o._id));
|
|
300
302
|
function S(o, r) {
|
|
301
303
|
const i = j(o, r);
|
|
302
|
-
return ["-", "All"].includes(i) ? () => null : () => F(
|
|
304
|
+
return ["-", "All"].includes(i) ? () => null : () => F(W.FmTooltip, {
|
|
303
305
|
"z-index": "999",
|
|
304
306
|
placement: "top",
|
|
305
307
|
class: "ml-2"
|
|
@@ -307,12 +309,12 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
307
309
|
content: () => F("div", {
|
|
308
310
|
innerHTML: `
|
|
309
311
|
${s("hr.role.tooltip.labels.permission")}
|
|
310
|
-
${o.filter((u) => u.subject === r).map((u) => `<div>- ${
|
|
312
|
+
${o.filter((u) => u.subject === r).map((u) => `<div>- ${K(u).label}</div>`).join("")}
|
|
311
313
|
`
|
|
312
314
|
}),
|
|
313
|
-
default: () => F(
|
|
315
|
+
default: () => F(W.FmIcon, {
|
|
314
316
|
name: "info",
|
|
315
|
-
color:
|
|
317
|
+
color: me.NeutralGray400
|
|
316
318
|
})
|
|
317
319
|
});
|
|
318
320
|
}
|
|
@@ -354,19 +356,19 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
354
356
|
},
|
|
355
357
|
cell: (o) => F("div", {
|
|
356
358
|
class: "w-full flex justify-end items-center"
|
|
357
|
-
}, [F(
|
|
359
|
+
}, [F(W.FmButton, {
|
|
358
360
|
prependIcon: "delete",
|
|
359
|
-
variant:
|
|
360
|
-
textColor:
|
|
361
|
+
variant: ke.Tertiary,
|
|
362
|
+
textColor: me.NeutralGray400,
|
|
361
363
|
disabled: le(o.row.original.permissions),
|
|
362
364
|
onClick: (r) => {
|
|
363
365
|
r.stopPropagation(), l(o.row.original);
|
|
364
366
|
}
|
|
365
367
|
})])
|
|
366
|
-
}],
|
|
368
|
+
}], B = async (o) => {
|
|
367
369
|
var r;
|
|
368
370
|
$.value = o._id, await ue(), (r = h.value) == null || r.trigger();
|
|
369
|
-
}, d =
|
|
371
|
+
}, d = he(), Y = $e(), Z = _(() => (d.roles.value || []).filter((i) => i.restaurants.some((u) => R.value.includes(u.id))).map((i) => {
|
|
370
372
|
const u = i.restaurants.map((g) => {
|
|
371
373
|
const w = Y.value[g.id];
|
|
372
374
|
return {
|
|
@@ -387,9 +389,9 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
387
389
|
});
|
|
388
390
|
return g || O;
|
|
389
391
|
});
|
|
390
|
-
}), A =
|
|
392
|
+
}), A = Ve(), m = _e(), {
|
|
391
393
|
breakpoints: V
|
|
392
|
-
} =
|
|
394
|
+
} = we(), l = (o) => {
|
|
393
395
|
A.open({
|
|
394
396
|
title: s("hr.role.remove.title"),
|
|
395
397
|
message: s("hr.role.remove.message", {
|
|
@@ -441,7 +443,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
441
443
|
class: "w-[320px] xs:w-full",
|
|
442
444
|
autofocus: "",
|
|
443
445
|
placeholder: t(s)("hr.role.search.placeholder") + " / " + t(s)("hr.restaurant.search.placeholder")
|
|
444
|
-
}, null, 8, ["modelValue", "placeholder"])]), t(d).roles.value.length > 0 || t(d).isLoading.value ? (p(), C(
|
|
446
|
+
}, null, 8, ["modelValue", "placeholder"])]), t(d).roles.value.length > 0 || t(d).isLoading.value ? (p(), C(Ie, {
|
|
445
447
|
key: 0,
|
|
446
448
|
class: "overflow-auto"
|
|
447
449
|
}, {
|
|
@@ -454,20 +456,20 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
454
456
|
"pin-header-row": "",
|
|
455
457
|
"hide-footer": "",
|
|
456
458
|
"shrink-at": !1,
|
|
457
|
-
onRowClick: r[1] || (r[1] = (e) =>
|
|
459
|
+
onRowClick: r[1] || (r[1] = (e) => B(e.original))
|
|
458
460
|
}, null, 8, ["row-data", "page-size", "loading"]), f("div", je, [c(O, {
|
|
459
461
|
separator: ""
|
|
460
462
|
}, {
|
|
461
463
|
default: b(() => [(p(!0), L(q, null, G(M.value, (e) => (p(), C(w, {
|
|
462
464
|
key: e._id,
|
|
463
465
|
class: "py-12 px-16 items-center justify-between",
|
|
464
|
-
onClick: (a) =>
|
|
466
|
+
onClick: (a) => B(e)
|
|
465
467
|
}, {
|
|
466
|
-
default: b(() => [f("div", ze, [f("p", Ge,
|
|
468
|
+
default: b(() => [f("div", ze, [f("p", Ge, P(e.name), 1), f("div", Ke, [f("p", null, P(t(s)("hr.role.labels.restaurantList", {
|
|
467
469
|
items: e.restaurants.map((a) => a.name).join(", ")
|
|
468
|
-
})), 1), f("p", We, [ne(
|
|
470
|
+
})), 1), f("p", We, [ne(P(t(s)("hr.role.labels.operationList", {
|
|
469
471
|
items: t(j)(e.permissions, t(E.F_RULE_SUBJECT).enum.order)
|
|
470
|
-
})) + " ", 1), (p(), C(ie(S(e.permissions, t(E.F_RULE_SUBJECT).enum.order))))]), f("p", He, [ne(
|
|
472
|
+
})) + " ", 1), (p(), C(ie(S(e.permissions, t(E.F_RULE_SUBJECT).enum.order))))]), f("p", He, [ne(P(t(s)("hr.role.labels.reportList", {
|
|
471
473
|
items: t(j)(e.permissions, t(E.F_RULE_SUBJECT).enum.report)
|
|
472
474
|
})) + " ", 1), (p(), C(ie(S(e.permissions, t(E.F_RULE_SUBJECT).enum.report))))])])]), c(g, {
|
|
473
475
|
disabled: t(le)(e.permissions),
|
|
@@ -481,7 +483,7 @@ const Te = { class: "fm-typo-en-title-md-600" }, Pe = { class: "space-y-40" }, B
|
|
|
481
483
|
_: 1
|
|
482
484
|
})])]),
|
|
483
485
|
_: 1
|
|
484
|
-
})) : (p(), C(t(
|
|
486
|
+
})) : (p(), C(t(Le), {
|
|
485
487
|
key: 1,
|
|
486
488
|
title: t(s)("hr.role.noData.title"),
|
|
487
489
|
subtitle: t(s)("hr.role.noData.subtitle")
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { defineComponent as I, computed as V, resolveComponent as m, createElementBlock as w, openBlock as g, createElementVNode as h, createVNode as r, toDisplayString as C, unref as c, withCtx as _, createTextVNode as E, Fragment as D, renderList as M, ref as S, createBlock as W, nextTick as U, onMounted as q, h as L } from "vue";
|
|
2
|
+
import { useI18n as N, useCoreStore as K } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as j, useDialog as G, useBreakpoints as O, components as H, FmButtonColorThemeVariant as J, FmButtonVariant as Q } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as X } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
5
|
+
import { v as Y, u as z } from "./index-BsEM84j5.js";
|
|
6
|
+
import { u as Z } from "./useLoading-DpbOtToC.js";
|
|
7
|
+
import { a as ee } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js";
|
|
8
|
+
const oe = { class: "flex flex-row items-center gap-8" }, te = /* @__PURE__ */ I({
|
|
9
|
+
__name: "PermissionWithTooltip",
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: !0
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(P) {
|
|
17
|
+
const b = P, t = V(() => Y(b.modelValue)), { t: l } = N();
|
|
18
|
+
return (i, k) => {
|
|
19
|
+
const u = m("FmIcon"), y = m("FmTooltip");
|
|
20
|
+
return g(), w("div", oe, [
|
|
21
|
+
h("span", null, C(c(l)("team.labels.allowed", { count: t.value.length })), 1),
|
|
22
|
+
r(y, {
|
|
23
|
+
variant: "plain",
|
|
24
|
+
placement: "top"
|
|
25
|
+
}, {
|
|
26
|
+
content: _(() => [
|
|
27
|
+
h("div", null, [
|
|
28
|
+
E(C(c(l)("team.labels.permission")) + " ", 1),
|
|
29
|
+
(g(!0), w(D, null, M(t.value, (d, p) => (g(), w("div", {
|
|
30
|
+
key: `${d}-${p}`
|
|
31
|
+
}, " - " + C(d), 1))), 128))
|
|
32
|
+
])
|
|
33
|
+
]),
|
|
34
|
+
default: _(() => [
|
|
35
|
+
r(u, {
|
|
36
|
+
name: "info",
|
|
37
|
+
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
38
|
+
})
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
})
|
|
42
|
+
]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}), se = { class: "fm-typo-en-title-md-600" }, le = { class: "flex items-center justify-start gap-8" }, ne = /* @__PURE__ */ I({
|
|
46
|
+
__name: "RolePermissionForm",
|
|
47
|
+
props: {
|
|
48
|
+
modelValue: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => ({})
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(P, { expose: b }) {
|
|
54
|
+
const t = P, { t: l } = N(), i = S(!1), k = V(() => {
|
|
55
|
+
var s;
|
|
56
|
+
return (s = t.modelValue) != null && s.id ? l("role.form.update.title") : l("role.form.create.title");
|
|
57
|
+
}), u = S(), y = j(), d = Z(y), p = z(), a = S({ ...t.modelValue }), x = [(s) => !!s || "Role name is required"], B = V(() => {
|
|
58
|
+
var s;
|
|
59
|
+
return (s = t.modelValue) != null && s.id ? l("role.form.update.confirmButtonLabel") : l("role.form.create.confirmButtonLabel");
|
|
60
|
+
});
|
|
61
|
+
async function T() {
|
|
62
|
+
await U(), i.value = !i.value, a.value = {
|
|
63
|
+
...t.modelValue
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function $(s) {
|
|
67
|
+
a.value = {
|
|
68
|
+
...a.value,
|
|
69
|
+
permissions: s
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async function R() {
|
|
73
|
+
var o, f;
|
|
74
|
+
const s = await ((o = u.value) == null ? void 0 : o.validateInputsWithoutSubmit()), e = (f = K().currentBusiness.value) == null ? void 0 : f.id;
|
|
75
|
+
!(s != null && s.length) && e && d.minor(async () => {
|
|
76
|
+
var v;
|
|
77
|
+
if ((v = t.modelValue) != null && v.id) {
|
|
78
|
+
const { id: F, ...n } = a.value, A = n;
|
|
79
|
+
await p.updatePermissionSet(t.modelValue.id, A);
|
|
80
|
+
} else {
|
|
81
|
+
const F = {
|
|
82
|
+
...a.value,
|
|
83
|
+
businessId: e
|
|
84
|
+
};
|
|
85
|
+
await p.createPermissionSet(F);
|
|
86
|
+
}
|
|
87
|
+
i.value = !1;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return b({
|
|
91
|
+
trigger: T
|
|
92
|
+
}), (s, e) => {
|
|
93
|
+
const o = m("FmTextField"), f = m("FmForm"), v = m("FmButton"), F = m("FmSideSheet");
|
|
94
|
+
return g(), W(F, {
|
|
95
|
+
modelValue: i.value,
|
|
96
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => i.value = n),
|
|
97
|
+
"max-width": 560,
|
|
98
|
+
"dismiss-away": ""
|
|
99
|
+
}, {
|
|
100
|
+
"side-sheet-header": _(() => [
|
|
101
|
+
h("p", se, C(k.value), 1)
|
|
102
|
+
]),
|
|
103
|
+
"side-sheet-footer": _(() => [
|
|
104
|
+
h("div", le, [
|
|
105
|
+
r(v, {
|
|
106
|
+
label: B.value,
|
|
107
|
+
size: "md",
|
|
108
|
+
variant: "primary",
|
|
109
|
+
type: "submit",
|
|
110
|
+
onClick: R
|
|
111
|
+
}, null, 8, ["label"]),
|
|
112
|
+
r(v, {
|
|
113
|
+
label: c(l)("common.cancel"),
|
|
114
|
+
size: "md",
|
|
115
|
+
variant: "secondary",
|
|
116
|
+
onClick: e[2] || (e[2] = (n) => i.value = !1)
|
|
117
|
+
}, null, 8, ["label"])
|
|
118
|
+
])
|
|
119
|
+
]),
|
|
120
|
+
default: _(() => [
|
|
121
|
+
r(f, {
|
|
122
|
+
ref_key: "formRef",
|
|
123
|
+
ref: u
|
|
124
|
+
}, {
|
|
125
|
+
default: _(() => [
|
|
126
|
+
r(o, {
|
|
127
|
+
modelValue: a.value.name,
|
|
128
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => a.value.name = n),
|
|
129
|
+
label: c(l)("role.form.name"),
|
|
130
|
+
placeholder: c(l)("role.form.roleNamePlaceholder"),
|
|
131
|
+
rules: x
|
|
132
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
133
|
+
r(ee, {
|
|
134
|
+
"model-value": a.value.permissions,
|
|
135
|
+
class: "mt-24",
|
|
136
|
+
onPermissionChanged: e[1] || (e[1] = (n) => $(n))
|
|
137
|
+
}, null, 8, ["model-value"])
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
}, 512)
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
}, 8, ["modelValue"]);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}), ae = { class: "space-y-8" }, re = { class: "flex justify-end xs:px-16" }, ie = {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "overflow-auto"
|
|
149
|
+
}, me = { class: "pb-64" }, ge = /* @__PURE__ */ I({
|
|
150
|
+
__name: "RolePermissionList",
|
|
151
|
+
setup(P, { expose: b }) {
|
|
152
|
+
const { t } = N(), l = j(), i = G(), { breakpoints: k } = O(), u = S(""), y = V(() => {
|
|
153
|
+
var e;
|
|
154
|
+
return (e = a.value) == null ? void 0 : e.filter((o) => {
|
|
155
|
+
const f = u.value.toLowerCase();
|
|
156
|
+
return o.name.toLowerCase().includes(f);
|
|
157
|
+
});
|
|
158
|
+
}), d = S(), p = z(), a = V(
|
|
159
|
+
() => p.permissionSets.value
|
|
160
|
+
), x = S();
|
|
161
|
+
async function B() {
|
|
162
|
+
await p.readPermissionSets();
|
|
163
|
+
}
|
|
164
|
+
function T(e) {
|
|
165
|
+
var o;
|
|
166
|
+
x.value = e, (o = d.value) == null || o.trigger();
|
|
167
|
+
}
|
|
168
|
+
const $ = [
|
|
169
|
+
{
|
|
170
|
+
accessorKey: "name",
|
|
171
|
+
header: () => t("role.table.columns.name")
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
accessorKey: "permission",
|
|
175
|
+
header: () => t("role.table.columns.permissions"),
|
|
176
|
+
enableSorting: !1,
|
|
177
|
+
cell(e) {
|
|
178
|
+
const o = e.row.original.permissions;
|
|
179
|
+
return L(te, { modelValue: o });
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: "action",
|
|
184
|
+
meta: {
|
|
185
|
+
cellClass: "pl-16",
|
|
186
|
+
headerContentClass: "-mx-16"
|
|
187
|
+
},
|
|
188
|
+
cell(e) {
|
|
189
|
+
return L("div", { class: "w-full flex justify-end items-center" }, [
|
|
190
|
+
L(H.FmButton, {
|
|
191
|
+
prependIcon: "delete",
|
|
192
|
+
variant: Q.Tertiary,
|
|
193
|
+
textColor: J.NeutralGray400,
|
|
194
|
+
class: "flex flex-end",
|
|
195
|
+
onClick: (o) => {
|
|
196
|
+
o.stopPropagation(), s(e.row.original);
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
]);
|
|
200
|
+
},
|
|
201
|
+
enableSorting: !1
|
|
202
|
+
}
|
|
203
|
+
];
|
|
204
|
+
function R() {
|
|
205
|
+
var e;
|
|
206
|
+
x.value = void 0, (e = d.value) == null || e.trigger();
|
|
207
|
+
}
|
|
208
|
+
async function s(e) {
|
|
209
|
+
i.open({
|
|
210
|
+
title: t("role.form.delete.title"),
|
|
211
|
+
message: t("role.form.delete.confirmationMessage", { roleName: e.name }),
|
|
212
|
+
minWidth: k.value.lg ? 588 : 0,
|
|
213
|
+
primaryActions: {
|
|
214
|
+
text: t("common.remove"),
|
|
215
|
+
close: !1,
|
|
216
|
+
variant: "destructive"
|
|
217
|
+
},
|
|
218
|
+
secondaryActions: { text: t("common.cancel"), close: !0 }
|
|
219
|
+
}).onPrimary(async () => {
|
|
220
|
+
try {
|
|
221
|
+
await p.deletePermissionSet(e.id), l.open({
|
|
222
|
+
message: t("role.form.delete.successMessage", { roleName: e.name }),
|
|
223
|
+
type: "success"
|
|
224
|
+
});
|
|
225
|
+
} catch (o) {
|
|
226
|
+
l.open({
|
|
227
|
+
message: o instanceof Error ? o.message : `${o}`,
|
|
228
|
+
type: "error"
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
i.close();
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
return q(() => {
|
|
235
|
+
B();
|
|
236
|
+
}), b({
|
|
237
|
+
create: R
|
|
238
|
+
}), (e, o) => {
|
|
239
|
+
const f = m("FmSearch"), v = m("FmTable"), F = m("FullWrapper");
|
|
240
|
+
return g(), w(D, null, [
|
|
241
|
+
r(ne, {
|
|
242
|
+
ref_key: "rolePermissionFormRef",
|
|
243
|
+
ref: d,
|
|
244
|
+
"model-value": x.value
|
|
245
|
+
}, null, 8, ["model-value"]),
|
|
246
|
+
h("div", ae, [
|
|
247
|
+
h("div", re, [
|
|
248
|
+
r(f, {
|
|
249
|
+
modelValue: u.value,
|
|
250
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => u.value = n),
|
|
251
|
+
class: "w-[320px] xs:w-full",
|
|
252
|
+
autofocus: "",
|
|
253
|
+
placeholder: c(t)("role.search.placeholder")
|
|
254
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
255
|
+
]),
|
|
256
|
+
a.value.length > 0 ? (g(), w("div", ie, [
|
|
257
|
+
h("div", me, [
|
|
258
|
+
r(F, null, {
|
|
259
|
+
default: _(() => [
|
|
260
|
+
r(v, {
|
|
261
|
+
"column-defs": $,
|
|
262
|
+
"row-data": y.value,
|
|
263
|
+
"page-size": y.value.length,
|
|
264
|
+
"pin-header-row": "",
|
|
265
|
+
"hide-footer": "",
|
|
266
|
+
"shrink-at": !1,
|
|
267
|
+
onRowClick: o[1] || (o[1] = (n) => T(n.original))
|
|
268
|
+
}, null, 8, ["row-data", "page-size"])
|
|
269
|
+
]),
|
|
270
|
+
_: 1
|
|
271
|
+
})
|
|
272
|
+
])
|
|
273
|
+
])) : (g(), W(c(X), {
|
|
274
|
+
key: 1,
|
|
275
|
+
title: c(t)("role.noData.title"),
|
|
276
|
+
subtitle: c(t)("role.noData.subtitle")
|
|
277
|
+
}, null, 8, ["title", "subtitle"]))
|
|
278
|
+
])
|
|
279
|
+
], 64);
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
export {
|
|
284
|
+
ge as default
|
|
285
|
+
};
|