@feedmepos/mf-hrm-portal 2.0.17-dev.2 → 2.0.17-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/{AuditLogList-DQOiwup5.js → AuditLogList-C6qAeY5g.js} +5 -5
- package/dist/{EmployeeList-oERrzrAd.js → EmployeeList-COtXtTqG.js} +16 -17
- package/dist/{Main-C8ja5xs6.js → Main--tejoyEP.js} +4 -4
- package/dist/{Main-2uJvk5L7.js → Main-BNXKItvX.js} +8 -7
- package/dist/{Main-5nIpv-Sp.js → Main-Dkr5lzbv.js} +9 -9
- package/dist/PermissionSetList-B_Sdvbu7.js +340 -0
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-B-hvBqE0.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BBsaxaXu.js} +575 -575
- package/dist/{RoleList-CDBP2W5v.js → RoleList-SZCgvYvC.js} +17 -18
- package/dist/TeamMemberList-Dk5HeFfQ.js +1008 -0
- package/dist/{TimesheetList-D1ByiuwP.js → TimesheetList-D-3k0Uad.js} +6 -6
- package/dist/{app-hS6MBhCw.js → app-BjXuSCis.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-DFcH-XYr.js → dayjs.min-z-vrgFCL.js} +1 -1
- package/dist/{employee-fBtBUEwZ.js → employee-DAqAMupR.js} +3 -3
- package/dist/{iteration-D23fqAQH.js → iteration-Cp1eSTJA.js} +1 -1
- package/dist/{lodash-Cqc7y4P5.js → lodash-CXLZQQp8.js} +1 -1
- package/dist/{rule-BBJzenE1.js → rule-vBxopbM_.js} +2 -2
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +2 -0
- package/dist/{team-Dq3VcGNH.js → team-CnQ_rIx2.js} +1 -1
- package/dist/{timesheet-OfLQjuvO.js → timesheet-BlPhOifI.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-Du6PRBq0.js → useAppStore-BVnrWyPF.js} +1 -1
- package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
- package/dist/{useLoading-DkTCR5A7.js → useLoading-7ia-Bps7.js} +1 -1
- package/dist/{useReportPermissions-DhhjBwPs.js → useReportPermissions-C8HMek35.js} +3 -3
- package/package.json +1 -1
- package/dist/PermissionSetList-CtpaWlVM.js +0 -323
- package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +0 -132
- package/dist/TeamMemberList-DSzNjP4y.js +0 -996
- package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as Ae, ref as h, computed as w, onMounted as ft, onBeforeUnmount as vt, watch as Q, resolveComponent as C, createElementBlock as b, openBlock as c, createBlock as oe, createCommentVNode as V, createElementVNode as l, Fragment as ee, renderList as se, withCtx as N, createVNode as u, toDisplayString as i, unref as n, nextTick as pt } from "vue";
|
|
2
|
-
import { d as y } from "./dayjs.min-
|
|
2
|
+
import { d as y } from "./dayjs.min-z-vrgFCL.js";
|
|
3
3
|
import { useI18n as Ee, useCoreStore as gt } from "@feedmepos/mf-common";
|
|
4
|
-
import { f as Ve, _ as bt } from "./app-
|
|
4
|
+
import { f as Ve, _ as bt } from "./app-BjXuSCis.js";
|
|
5
5
|
import { components as Oe } from "@feedmepos/ui-library";
|
|
6
|
-
import { g as ht, b as yt } from "./iteration-
|
|
6
|
+
import { g as ht, b as yt } from "./iteration-Cp1eSTJA.js";
|
|
7
7
|
import { S as ce } from "./SelectFilter-DUj7GBtT.js";
|
|
8
8
|
import { _ as _t } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
9
9
|
import { _ as xt } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
10
|
-
import { p as Pe } from "./rule-
|
|
11
|
-
import { u as Lt } from "./team-
|
|
10
|
+
import { p as Pe } from "./rule-vBxopbM_.js";
|
|
11
|
+
import { u as Lt } from "./team-CnQ_rIx2.js";
|
|
12
12
|
const be = [
|
|
13
13
|
{ key: "all", label: "All", subjectPrefixes: [] },
|
|
14
14
|
{ key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"] },
|
|
@@ -2,17 +2,16 @@ import { watch as Z, toRaw as Ke, defineComponent as Ce, ref as v, computed as R
|
|
|
2
2
|
import { useCoreStore as Le, useI18n as Ae, RestaurantSelector as Ee } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as Pe, components as De, useDialog as We, useBreakpoints as qe } from "@feedmepos/ui-library";
|
|
4
4
|
import { S as Fe, _ as He } from "./SelectFilter-DUj7GBtT.js";
|
|
5
|
-
import { _ as Je, a as Qe } from "./app-
|
|
5
|
+
import { _ as Je, a as Qe } from "./app-BjXuSCis.js";
|
|
6
6
|
import { _ as Ie, H as Ye } from "./FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js";
|
|
7
|
-
import {
|
|
8
|
-
import { _ as
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as Ne, E as
|
|
11
|
-
import { l as
|
|
7
|
+
import { u as Ze, _ as Xe } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
|
+
import { _ as ea } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
9
|
+
import { u as aa } from "./useSearch-BAPEUu1R.js";
|
|
10
|
+
import { u as Ne, E as ta } from "./employee-DAqAMupR.js";
|
|
11
|
+
import { l as la } from "./lodash-CXLZQQp8.js";
|
|
12
12
|
import { _ as ke } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
13
|
-
import { u as
|
|
14
|
-
import { u as
|
|
15
|
-
import { u as _e } from "./useAppStore-Du6PRBq0.js";
|
|
13
|
+
import { u as Te } from "./useLoading-7ia-Bps7.js";
|
|
14
|
+
import { u as _e } from "./useAppStore-BVnrWyPF.js";
|
|
16
15
|
/* empty css */
|
|
17
16
|
function sa(U, X, u = 300) {
|
|
18
17
|
let y;
|
|
@@ -137,14 +136,14 @@ const oa = { class: "fm-typo-en-title-md-600" }, ra = { class: "space-y-40" }, n
|
|
|
137
136
|
async function ee() {
|
|
138
137
|
J.value = !0;
|
|
139
138
|
try {
|
|
140
|
-
const o = await
|
|
139
|
+
const o = await ta.generateEmployeePasscode();
|
|
141
140
|
M.value = !1, k.value = o.split("");
|
|
142
141
|
} finally {
|
|
143
142
|
J.value = !1;
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
|
-
const ye =
|
|
147
|
-
() => !
|
|
145
|
+
const ye = Ze(
|
|
146
|
+
() => !la.isEqual(s.value, _.value),
|
|
148
147
|
() => {
|
|
149
148
|
V.value = !1;
|
|
150
149
|
}
|
|
@@ -492,7 +491,7 @@ const oa = { class: "fm-typo-en-title-md-600" }, ra = { class: "space-y-40" }, n
|
|
|
492
491
|
}
|
|
493
492
|
}), me = R(() => f.listEmployees.value), {
|
|
494
493
|
searchKey: F
|
|
495
|
-
} =
|
|
494
|
+
} = aa(), L = v(""), q = R(() => me.value), A = R(() => f.totalEmployees.value), _ = v(1), s = R(() => f.isLoading.value), P = v(!1), z = R(() => {
|
|
496
495
|
var e;
|
|
497
496
|
return JSON.stringify({
|
|
498
497
|
businessId: ((e = C.value) == null ? void 0 : e._id) ?? "",
|
|
@@ -522,7 +521,7 @@ const oa = { class: "fm-typo-en-title-md-600" }, ra = { class: "space-y-40" }, n
|
|
|
522
521
|
onClick: (a) => {
|
|
523
522
|
a.stopPropagation();
|
|
524
523
|
}
|
|
525
|
-
}, [n(
|
|
524
|
+
}, [n(Xe, {
|
|
526
525
|
items: pe(e)
|
|
527
526
|
}, null)]), ve = [{
|
|
528
527
|
accessorKey: "code",
|
|
@@ -778,7 +777,7 @@ const oa = { class: "fm-typo-en-title-md-600" }, ra = { class: "space-y-40" }, n
|
|
|
778
777
|
}, {
|
|
779
778
|
default: x(() => [c("div", Ia, [!P.value && r(f).isLoading.value ? (b(), K(Qe, {
|
|
780
779
|
key: 0
|
|
781
|
-
})) : !P.value || A.value === 0 ? (b(), K(r(
|
|
780
|
+
})) : !P.value || A.value === 0 ? (b(), K(r(ea), {
|
|
782
781
|
key: 1,
|
|
783
782
|
title: r(u)("hr.employee.noData.title"),
|
|
784
783
|
subtitle: r(u)("hr.employee.noData.subtitle")
|
|
@@ -822,7 +821,7 @@ const oa = { class: "fm-typo-en-title-md-600" }, ra = { class: "space-y-40" }, n
|
|
|
822
821
|
})) : B("", !0)])], 64);
|
|
823
822
|
};
|
|
824
823
|
}
|
|
825
|
-
}),
|
|
824
|
+
}), Ha = /* @__PURE__ */ He(Ma, [["__scopeId", "data-v-ea2be538"]]);
|
|
826
825
|
export {
|
|
827
|
-
|
|
826
|
+
Ha as default
|
|
828
827
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ref as S, defineComponent as J, computed as F, watch as ce, resolveComponent as h, createElementBlock as D, openBlock as I, Fragment as W, renderSlot as ge, createVNode as n, unref as s, withCtx as x, createElementVNode as l, toDisplayString as k, createBlock as K, isRef as ae, renderList as fe, createCommentVNode as ve, withModifiers as se, createTextVNode as re, normalizeClass as _e, h as _ } from "vue";
|
|
2
2
|
import { useCoreStore as Q, useI18n as X, RestaurantSelector as oe } from "@feedmepos/mf-common";
|
|
3
3
|
import { _ as ye } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
4
|
-
import { u as Y } from "./useAppStore-
|
|
4
|
+
import { u as Y } from "./useAppStore-BVnrWyPF.js";
|
|
5
5
|
import { defineStore as Ue } from "pinia";
|
|
6
|
-
import { g as z, a as he, b as O } from "./iteration-
|
|
6
|
+
import { g as z, a as he, b as O } from "./iteration-Cp1eSTJA.js";
|
|
7
7
|
import { useSnackbar as ie, components as E, useDialog as xe, useBreakpoints as be, FmButtonVariant as q } from "@feedmepos/ui-library";
|
|
8
8
|
import { S as ne } from "./SelectFilter-DUj7GBtT.js";
|
|
9
|
-
import { _ as we } from "./app-
|
|
9
|
+
import { _ as we } from "./app-BjXuSCis.js";
|
|
10
10
|
import { _ as le, H as ke } from "./FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js";
|
|
11
11
|
import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
12
12
|
import { u as Fe } from "./useSearch-BAPEUu1R.js";
|
|
13
|
-
import { u as ue } from "./useLoading-
|
|
13
|
+
import { u as ue } from "./useLoading-7ia-Bps7.js";
|
|
14
14
|
import { _ as Ie } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
15
15
|
const H = {
|
|
16
16
|
async getGrantUsers() {
|
|
@@ -4,14 +4,15 @@ import { useI18n as N } from "@feedmepos/mf-common";
|
|
|
4
4
|
import { _ as g } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
5
|
import { _ as h } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
6
6
|
import "@feedmepos/ui-library";
|
|
7
|
-
import "./rule-
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
7
|
+
import "./rule-vBxopbM_.js";
|
|
8
|
+
import "./lodash-CXLZQQp8.js";
|
|
9
|
+
import "./iteration-Cp1eSTJA.js";
|
|
10
|
+
import "./useAppStore-BVnrWyPF.js";
|
|
11
|
+
import { R as v } from "./app-BjXuSCis.js";
|
|
11
12
|
/* empty css */
|
|
12
13
|
/* empty css */
|
|
13
|
-
import "./team-
|
|
14
|
-
const w = { class: "space-y-24" },
|
|
14
|
+
import "./team-CnQ_rIx2.js";
|
|
15
|
+
const w = { class: "space-y-24" }, Q = /* @__PURE__ */ V({
|
|
15
16
|
__name: "Main",
|
|
16
17
|
setup(x) {
|
|
17
18
|
const { t: a } = N(), f = k(), R = F(), _ = u(), b = u(), t = u("member");
|
|
@@ -82,5 +83,5 @@ const w = { class: "space-y-24" }, P = /* @__PURE__ */ V({
|
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
Q as default
|
|
86
87
|
};
|
|
@@ -3,18 +3,18 @@ import { useRouter as lf, useRoute as of } from "vue-router";
|
|
|
3
3
|
import { useCoreStore as cf, useI18n as hf } from "@feedmepos/mf-common";
|
|
4
4
|
import { _ as uf } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
5
|
import { _ as vf } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
6
|
-
import { u as pf } from "./useAppStore-
|
|
6
|
+
import { u as pf } from "./useAppStore-BVnrWyPF.js";
|
|
7
7
|
import "@feedmepos/ui-library";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import "./employee-
|
|
10
|
-
import "./lodash-
|
|
11
|
-
import "./iteration-
|
|
9
|
+
import "./employee-DAqAMupR.js";
|
|
10
|
+
import "./lodash-CXLZQQp8.js";
|
|
11
|
+
import "./iteration-Cp1eSTJA.js";
|
|
12
12
|
/* empty css */
|
|
13
|
-
import { R as vt } from "./app-
|
|
14
|
-
import "./rule-
|
|
15
|
-
import "./useReportPermissions-
|
|
16
|
-
import "./dayjs.min-
|
|
17
|
-
import "./timesheet-
|
|
13
|
+
import { R as vt } from "./app-BjXuSCis.js";
|
|
14
|
+
import "./rule-vBxopbM_.js";
|
|
15
|
+
import "./useReportPermissions-C8HMek35.js";
|
|
16
|
+
import "./dayjs.min-z-vrgFCL.js";
|
|
17
|
+
import "./timesheet-BlPhOifI.js";
|
|
18
18
|
var In = {};
|
|
19
19
|
/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
|
20
20
|
var Zt = {};
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { defineComponent as H, ref as p, computed as P, resolveComponent as _, createBlock as M, openBlock as L, unref as m, withCtx as E, createVNode as f, createElementVNode as D, toDisplayString as te, nextTick as ne, onMounted as ie, createElementBlock as ae, Fragment as le, h as b } from "vue";
|
|
2
|
+
import { useI18n as Q, useCoreStore as re } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as Y, useDialog as me, useBreakpoints as ce, components as J } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as ue } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
5
|
+
import { u as de, _ as pe } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
6
|
+
import { u as Z, c as ee, d as se, p as X, i as fe, b as ve, m as A, k as Se, l as be, s as Pe, n as _e, q as ge } from "./rule-vBxopbM_.js";
|
|
7
|
+
import { l as W } from "./lodash-CXLZQQp8.js";
|
|
8
|
+
import { d as he, A as ye } from "./iteration-Cp1eSTJA.js";
|
|
9
|
+
import { u as we } from "./useLoading-7ia-Bps7.js";
|
|
10
|
+
import { p as G } from "./app-BjXuSCis.js";
|
|
11
|
+
import { _ as Fe } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BBsaxaXu.js";
|
|
12
|
+
const Ve = { class: "fm-typo-en-title-md-600" }, ke = { class: "flex items-center justify-start gap-8" }, xe = /* @__PURE__ */ H({
|
|
13
|
+
__name: "PermissionSetForm",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => ({})
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(K, { expose: N }) {
|
|
21
|
+
const o = K, { t: l } = Q(), v = p(!1), j = P(() => {
|
|
22
|
+
var e;
|
|
23
|
+
return (e = o.modelValue) != null && e.id ? l("permissionSet.form.update.title") : l("permissionSet.form.create.title");
|
|
24
|
+
}), V = p(), O = Y(), k = we(O), g = Z(), a = p({ ...o.modelValue }), i = p([]), c = p([]), x = [(e) => !!e || "Permission set name is required"], U = P(() => {
|
|
25
|
+
var e;
|
|
26
|
+
return (e = o.modelValue) != null && e.id ? l("permissionSet.form.update.confirmButtonLabel") : l("permissionSet.form.create.confirmButtonLabel");
|
|
27
|
+
}), $ = P(
|
|
28
|
+
() => g.permissionSets.value.filter((e) => {
|
|
29
|
+
var s;
|
|
30
|
+
return e.id !== ((s = o.modelValue) == null ? void 0 : s.id);
|
|
31
|
+
}).map((e) => ({ label: e.name, value: e.id }))
|
|
32
|
+
), y = P(
|
|
33
|
+
() => ee(i.value, g.permissionSets.value)
|
|
34
|
+
), { customReportPermissions: B, isLoaded: q } = se(), n = new Set(
|
|
35
|
+
X.filter((e) => e.subject.startsWith(fe)).map((e) => e.subject)
|
|
36
|
+
), t = P(() => {
|
|
37
|
+
const e = new Set(n);
|
|
38
|
+
for (const s of B.value) e.add(s.subject);
|
|
39
|
+
return e;
|
|
40
|
+
}), r = P(() => {
|
|
41
|
+
const e = /* @__PURE__ */ new Set();
|
|
42
|
+
for (const s of X)
|
|
43
|
+
s.category === G.reports && e.add(s.subject);
|
|
44
|
+
for (const s of B.value)
|
|
45
|
+
s.category === G.reports && e.add(s.subject);
|
|
46
|
+
return e;
|
|
47
|
+
}), u = p({ name: "", permissionSetIds: [], userPermissions: [] });
|
|
48
|
+
async function C() {
|
|
49
|
+
var s, d;
|
|
50
|
+
await ne(), v.value = !v.value, a.value = { ...o.modelValue }, i.value = ((s = o.modelValue) == null ? void 0 : s.permissionSetIds) ?? [];
|
|
51
|
+
const e = ((d = o.modelValue) == null ? void 0 : d.permissions) ?? [];
|
|
52
|
+
c.value = ve(
|
|
53
|
+
A(y.value),
|
|
54
|
+
e
|
|
55
|
+
), u.value = {
|
|
56
|
+
name: a.value.name ?? "",
|
|
57
|
+
permissionSetIds: [...i.value],
|
|
58
|
+
userPermissions: he(c.value)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const S = de(
|
|
62
|
+
() => !W.isEqual(a.value.name ?? "", u.value.name) || !W.isEqual(i.value, u.value.permissionSetIds) || !W.isEqual(c.value, u.value.userPermissions),
|
|
63
|
+
() => {
|
|
64
|
+
v.value = !1;
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
function T() {
|
|
68
|
+
const e = A(y.value), s = q.value ? t.value : n, d = Se(c.value, s), w = be(d, r.value), F = Pe(w);
|
|
69
|
+
return _e(e, F);
|
|
70
|
+
}
|
|
71
|
+
function z() {
|
|
72
|
+
c.value = A(y.value);
|
|
73
|
+
}
|
|
74
|
+
async function oe() {
|
|
75
|
+
var d, w;
|
|
76
|
+
const e = await ((d = V.value) == null ? void 0 : d.validateInputsWithoutSubmit()), s = (w = re().currentBusiness.value) == null ? void 0 : w.id;
|
|
77
|
+
!(e != null && e.length) && s && k.minor(async () => {
|
|
78
|
+
var R;
|
|
79
|
+
const F = T();
|
|
80
|
+
if ((R = o.modelValue) != null && R.id) {
|
|
81
|
+
const I = {
|
|
82
|
+
name: a.value.name,
|
|
83
|
+
permissions: F,
|
|
84
|
+
permissionSetIds: i.value,
|
|
85
|
+
businessId: a.value.businessId
|
|
86
|
+
};
|
|
87
|
+
await g.updatePermissionSet(o.modelValue.id, I);
|
|
88
|
+
} else {
|
|
89
|
+
const I = {
|
|
90
|
+
name: a.value.name,
|
|
91
|
+
businessId: s,
|
|
92
|
+
permissions: F,
|
|
93
|
+
permissionSetIds: i.value
|
|
94
|
+
};
|
|
95
|
+
await g.createPermissionSet(I);
|
|
96
|
+
}
|
|
97
|
+
v.value = !1;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return N({
|
|
101
|
+
trigger: C
|
|
102
|
+
}), (e, s) => {
|
|
103
|
+
const d = _("FmTextField"), w = _("FmSelect"), F = _("FmForm"), R = _("FmButton"), I = _("FmSideSheet");
|
|
104
|
+
return L(), M(I, {
|
|
105
|
+
modelValue: v.value,
|
|
106
|
+
"onUpdate:modelValue": s[3] || (s[3] = (h) => v.value = h),
|
|
107
|
+
"max-width": 960,
|
|
108
|
+
"onOn:clickedAway": m(S)
|
|
109
|
+
}, {
|
|
110
|
+
"side-sheet-header": E(() => [
|
|
111
|
+
D("p", Ve, te(j.value), 1)
|
|
112
|
+
]),
|
|
113
|
+
"side-sheet-footer": E(() => [
|
|
114
|
+
D("div", ke, [
|
|
115
|
+
f(R, {
|
|
116
|
+
label: U.value,
|
|
117
|
+
size: "md",
|
|
118
|
+
variant: "primary",
|
|
119
|
+
type: "submit",
|
|
120
|
+
onClick: oe
|
|
121
|
+
}, null, 8, ["label"]),
|
|
122
|
+
f(R, {
|
|
123
|
+
label: m(l)("common.cancel"),
|
|
124
|
+
size: "md",
|
|
125
|
+
variant: "secondary",
|
|
126
|
+
onClick: m(S)
|
|
127
|
+
}, null, 8, ["label", "onClick"])
|
|
128
|
+
])
|
|
129
|
+
]),
|
|
130
|
+
default: E(() => [
|
|
131
|
+
f(F, {
|
|
132
|
+
ref_key: "formRef",
|
|
133
|
+
ref: V
|
|
134
|
+
}, {
|
|
135
|
+
default: E(() => [
|
|
136
|
+
f(d, {
|
|
137
|
+
modelValue: a.value.name,
|
|
138
|
+
"onUpdate:modelValue": s[0] || (s[0] = (h) => a.value.name = h),
|
|
139
|
+
label: m(l)("permissionSet.form.name"),
|
|
140
|
+
placeholder: m(l)("permissionSet.form.namePlaceholder"),
|
|
141
|
+
rules: x
|
|
142
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
143
|
+
f(w, {
|
|
144
|
+
modelValue: i.value,
|
|
145
|
+
"onUpdate:modelValue": [
|
|
146
|
+
s[1] || (s[1] = (h) => i.value = h),
|
|
147
|
+
z
|
|
148
|
+
],
|
|
149
|
+
multiselect: "",
|
|
150
|
+
searchable: "",
|
|
151
|
+
"search-debounce": 300,
|
|
152
|
+
items: $.value,
|
|
153
|
+
label: m(l)("permissionSet.form.includedSets"),
|
|
154
|
+
placeholder: m(l)("permissionSet.form.includedSetsPlaceholder"),
|
|
155
|
+
class: "mt-16"
|
|
156
|
+
}, null, 8, ["modelValue", "items", "label", "placeholder"]),
|
|
157
|
+
f(Fe, {
|
|
158
|
+
modelValue: c.value,
|
|
159
|
+
"onUpdate:modelValue": s[2] || (s[2] = (h) => c.value = h),
|
|
160
|
+
"inherit-permissions": y.value,
|
|
161
|
+
class: "mt-24"
|
|
162
|
+
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
}, 512)
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}), Ce = { class: "space-y-8" }, Re = { class: "flex justify-end xs:px-16" }, Ue = /* @__PURE__ */ H({
|
|
172
|
+
__name: "PermissionSetList",
|
|
173
|
+
setup(K, { expose: N }) {
|
|
174
|
+
const { t: o } = Q(), { customReportPermissions: l, fetchCustomReportPermissions: v } = se(), j = Y(), V = me(), { breakpoints: O } = ce(), k = p(""), g = P(() => {
|
|
175
|
+
var n;
|
|
176
|
+
return (n = c.value) == null ? void 0 : n.filter((t) => {
|
|
177
|
+
const r = k.value.toLowerCase();
|
|
178
|
+
return t.name.toLowerCase().includes(r);
|
|
179
|
+
});
|
|
180
|
+
}), a = p(), i = Z(), c = P(
|
|
181
|
+
() => i.permissionSets.value
|
|
182
|
+
), x = p();
|
|
183
|
+
async function U() {
|
|
184
|
+
await i.readPermissionSets();
|
|
185
|
+
}
|
|
186
|
+
function $(n) {
|
|
187
|
+
var t;
|
|
188
|
+
x.value = n, (t = a.value) == null || t.trigger();
|
|
189
|
+
}
|
|
190
|
+
const y = [
|
|
191
|
+
{
|
|
192
|
+
accessorKey: "name",
|
|
193
|
+
header: () => o("permissionSet.table.columns.name")
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
accessorKey: "permission",
|
|
197
|
+
header: () => o("permissionSet.table.columns.permissions"),
|
|
198
|
+
enableSorting: !1,
|
|
199
|
+
cell(n) {
|
|
200
|
+
const t = n.row.original, r = ee(
|
|
201
|
+
[t.id],
|
|
202
|
+
i.permissionSets.value
|
|
203
|
+
), u = A(r), C = u.length, S = ge(
|
|
204
|
+
u,
|
|
205
|
+
l.value
|
|
206
|
+
);
|
|
207
|
+
return b("div", { class: "flex items-center gap-8" }, [
|
|
208
|
+
b("span", o("team.labels.allowed", { count: C })),
|
|
209
|
+
b(
|
|
210
|
+
J.FmTooltip,
|
|
211
|
+
{ variant: "plain", placement: "top" },
|
|
212
|
+
{
|
|
213
|
+
default: () => b(J.FmIcon, {
|
|
214
|
+
name: "info",
|
|
215
|
+
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
216
|
+
}),
|
|
217
|
+
content: () => b("div", [
|
|
218
|
+
o("team.labels.permission"),
|
|
219
|
+
...S.map(
|
|
220
|
+
(T, z) => b("div", { key: `${T}-${z}` }, `- ${T}`)
|
|
221
|
+
)
|
|
222
|
+
])
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
]);
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "action",
|
|
230
|
+
size: 52,
|
|
231
|
+
meta: {
|
|
232
|
+
cellClass: "pl-16",
|
|
233
|
+
headerContentClass: "-mx-16"
|
|
234
|
+
},
|
|
235
|
+
cell(n) {
|
|
236
|
+
const t = n.row.original;
|
|
237
|
+
return b(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
class: "flex w-full items-center justify-end",
|
|
241
|
+
onClick: (r) => r.stopPropagation()
|
|
242
|
+
},
|
|
243
|
+
[
|
|
244
|
+
b(pe, {
|
|
245
|
+
items: [
|
|
246
|
+
{ label: o("common.update"), onClick: () => $(t) },
|
|
247
|
+
{
|
|
248
|
+
label: o("common.remove"),
|
|
249
|
+
onClick: () => q(t),
|
|
250
|
+
itemClass: "text-fm-color-typo-error"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
})
|
|
254
|
+
]
|
|
255
|
+
);
|
|
256
|
+
},
|
|
257
|
+
enableSorting: !1
|
|
258
|
+
}
|
|
259
|
+
];
|
|
260
|
+
function B() {
|
|
261
|
+
var n;
|
|
262
|
+
x.value = void 0, (n = a.value) == null || n.trigger();
|
|
263
|
+
}
|
|
264
|
+
async function q(n) {
|
|
265
|
+
V.open({
|
|
266
|
+
title: o("permissionSet.form.delete.title"),
|
|
267
|
+
message: o("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
|
|
268
|
+
minWidth: O.value.lg ? 588 : 0,
|
|
269
|
+
primaryActions: {
|
|
270
|
+
text: o("common.remove"),
|
|
271
|
+
close: !1,
|
|
272
|
+
variant: "destructive"
|
|
273
|
+
},
|
|
274
|
+
secondaryActions: { text: o("common.cancel"), close: !0 }
|
|
275
|
+
}).onPrimary(async () => {
|
|
276
|
+
try {
|
|
277
|
+
await i.deletePermissionSet(n.id), j.open({
|
|
278
|
+
message: o("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
|
|
279
|
+
type: "success"
|
|
280
|
+
});
|
|
281
|
+
} catch (t) {
|
|
282
|
+
const r = t instanceof ye && t.status === 409 ? t.message.includes("referenced by") ? o("permissionSet.form.delete.setReferencedConflictError", {
|
|
283
|
+
permissionSetName: n.name
|
|
284
|
+
}) : o("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
|
|
285
|
+
j.open({ message: r, type: "error" });
|
|
286
|
+
}
|
|
287
|
+
V.close();
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
return ie(() => {
|
|
291
|
+
U(), v();
|
|
292
|
+
}), N({
|
|
293
|
+
create: B
|
|
294
|
+
}), (n, t) => {
|
|
295
|
+
const r = _("FmSearch"), u = _("FmTable"), C = _("FullWrapper");
|
|
296
|
+
return L(), ae(le, null, [
|
|
297
|
+
f(xe, {
|
|
298
|
+
ref_key: "permissionSetFormRef",
|
|
299
|
+
ref: a,
|
|
300
|
+
"model-value": x.value
|
|
301
|
+
}, null, 8, ["model-value"]),
|
|
302
|
+
D("div", Ce, [
|
|
303
|
+
D("div", Re, [
|
|
304
|
+
f(r, {
|
|
305
|
+
modelValue: k.value,
|
|
306
|
+
"onUpdate:modelValue": t[0] || (t[0] = (S) => k.value = S),
|
|
307
|
+
class: "w-[320px] xs:w-full",
|
|
308
|
+
autofocus: "",
|
|
309
|
+
placeholder: m(o)("permissionSet.search.placeholder")
|
|
310
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
311
|
+
]),
|
|
312
|
+
c.value.length > 0 ? (L(), M(C, {
|
|
313
|
+
key: 0,
|
|
314
|
+
class: "overflow-auto"
|
|
315
|
+
}, {
|
|
316
|
+
default: E(() => [
|
|
317
|
+
f(u, {
|
|
318
|
+
"column-defs": y,
|
|
319
|
+
"row-data": g.value,
|
|
320
|
+
"page-size": g.value.length,
|
|
321
|
+
"pin-header-row": "",
|
|
322
|
+
"hide-footer": "",
|
|
323
|
+
"shrink-at": !1,
|
|
324
|
+
onRowClick: t[1] || (t[1] = (S) => $(S.original))
|
|
325
|
+
}, null, 8, ["row-data", "page-size"])
|
|
326
|
+
]),
|
|
327
|
+
_: 1
|
|
328
|
+
})) : (L(), M(m(ue), {
|
|
329
|
+
key: 1,
|
|
330
|
+
title: m(o)("permissionSet.noData.title"),
|
|
331
|
+
subtitle: m(o)("permissionSet.noData.subtitle")
|
|
332
|
+
}, null, 8, ["title", "subtitle"]))
|
|
333
|
+
])
|
|
334
|
+
], 64);
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
export {
|
|
339
|
+
Ue as default
|
|
340
|
+
};
|