@feedmepos/mf-hrm-portal 2.0.25-dev.2 → 2.1.0-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-C1bGND8z.js +1037 -0
- package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-tiuei7CA.js +383 -0
- package/dist/{EmployeeList-Cpv6Pc4J.js → EmployeeList-DqQF9xEx.js} +78 -78
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js → FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js} +1 -1
- package/dist/{Main-3IwCguRi.js → Main-BgOhmojO.js} +6 -6
- package/dist/{Main-DrquIYbM.js → Main-D2Wf__wM.js} +1138 -1142
- package/dist/Main-DcKVuIjB.js +90 -0
- package/dist/PermissionSetList-CQpTa0eY.js +384 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CCKVpAwv.js +4030 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-sueNu2MD.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-D-14ca2J.js} +1 -1
- package/dist/RoleList-tSC8RJHe.js +674 -0
- package/dist/SelectFilter-DUj7GBtT.js +251 -0
- package/dist/TeamMemberList-Bz-kDJ0e.js +1163 -0
- package/dist/{TimesheetList-CMqKNZOd.js → TimesheetList-BFVhmcRt.js} +10 -10
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-ekr2tKEO.js → TimesheetList.vue_vue_type_style_index_0_scoped_d7ed31d7_lang-CtHuL5tW.js} +2 -2
- package/dist/{app-D5h3x9dh.js → app-DRnSocX8.js} +5052 -2394
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BLtrWiQ_.js → dayjs.min-B8xOAypU.js} +1 -1
- package/dist/{employee-CpW9HMLY.js → employee-UrXqUaik.js} +3 -3
- package/dist/{iteration-D1WDQ_Kv.js → iteration-LEYoQKiI.js} +1 -1
- package/dist/{lodash-BI_MmDQa.js → lodash-Bq6_eZZ0.js} +1 -1
- package/dist/rule-CJC6Cq6S.js +1047 -0
- package/dist/src/api/audit-log/index.d.ts +0 -17
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/form/SelectFilter.vue.d.ts +0 -3
- package/dist/src/composables/useBasePermission.d.ts +1 -0
- package/dist/src/composables/useConditionDraft.d.ts +40 -0
- package/dist/src/composables/useCoverConditionOverride.d.ts +61 -0
- package/dist/src/helpers/business-timezone.d.ts +22 -0
- package/dist/src/helpers/permission-set.d.ts +4 -2
- package/dist/src/helpers/rule.d.ts +2 -1
- package/dist/src/stores/team.d.ts +1 -4
- package/dist/src/views/audit-log/locales/index.d.ts +16 -24
- package/dist/src/views/hr/locales/index.d.ts +0 -4
- package/dist/src/views/team/components/BasePermission.vue.d.ts +13 -0
- package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +22 -0
- package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +23 -0
- package/dist/src/views/team/condition-builders/component-map.d.ts +4 -0
- package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +23 -0
- package/dist/src/views/team/locales/index.d.ts +68 -4
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-hU1uAhE-.js → useAppStore-BGsfYWAR.js} +1 -1
- package/dist/{useLoading-D0XTdxji.js → useLoading-BUM5R2qV.js} +1 -1
- package/dist/{useReportPermissions-Drb4irzE.js → useReportPermissions-nlQ_BBL2.js} +3 -3
- package/package.json +2 -2
- package/dist/AuditLogList-UHJxYRdr.js +0 -1145
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
- package/dist/Main-Da2SFU8t.js +0 -94
- package/dist/PermissionSetList-upvouEfb.js +0 -356
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CAjf-JPW.js +0 -3457
- package/dist/RoleList-CgSg0ydf.js +0 -566
- package/dist/SelectFilter-ATOm0hdn.js +0 -269
- package/dist/TeamMemberList-jEODaxFX.js +0 -1130
- package/dist/rule-DG8tt7hf.js +0 -995
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { defineComponent as f, ref as a, onMounted as v, nextTick as y, onUnmounted as _, resolveComponent as g, createElementBlock as r, openBlock as c, Fragment as h, createElementVNode as n, renderSlot as u, createCommentVNode as b, toDisplayString as k, createVNode as C, normalizeStyle as w } from "vue";
|
|
2
|
-
const x = { class: "flex items-center" }, B = {
|
|
3
|
-
key: 0,
|
|
4
|
-
class: "ml-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
5
|
-
}, H = { class: "ml-auto" }, S = /* @__PURE__ */ f({
|
|
6
|
-
__name: "CollapsibleWrapper",
|
|
7
|
-
props: {
|
|
8
|
-
title: { default: "" },
|
|
9
|
-
subtitle: { default: "" },
|
|
10
|
-
initiallyCollapsed: { type: Boolean, default: !1 }
|
|
11
|
-
},
|
|
12
|
-
setup(l) {
|
|
13
|
-
const e = a(l.initiallyCollapsed), t = a(), s = a(0);
|
|
14
|
-
let o;
|
|
15
|
-
function d() {
|
|
16
|
-
e.value = !e.value;
|
|
17
|
-
}
|
|
18
|
-
function m() {
|
|
19
|
-
t.value && (s.value = t.value.scrollHeight);
|
|
20
|
-
}
|
|
21
|
-
return v(async () => {
|
|
22
|
-
await y(), t.value && (o = new ResizeObserver(() => {
|
|
23
|
-
m();
|
|
24
|
-
}), o.observe(t.value));
|
|
25
|
-
}), _(() => {
|
|
26
|
-
o == null || o.disconnect();
|
|
27
|
-
}), (i, N) => {
|
|
28
|
-
const p = g("FmButton");
|
|
29
|
-
return c(), r(h, null, [
|
|
30
|
-
n("div", { onClick: d }, [
|
|
31
|
-
n("div", x, [
|
|
32
|
-
u(i.$slots, "title"),
|
|
33
|
-
e.value && l.subtitle ? (c(), r("span", B, k(l.subtitle), 1)) : b("", !0),
|
|
34
|
-
n("div", H, [
|
|
35
|
-
C(p, {
|
|
36
|
-
icon: e.value ? "keyboard_arrow_down" : "keyboard_arrow_up",
|
|
37
|
-
"text-color": "neutral-gray-400",
|
|
38
|
-
variant: "tertiary",
|
|
39
|
-
size: "md"
|
|
40
|
-
}, null, 8, ["icon"])
|
|
41
|
-
])
|
|
42
|
-
])
|
|
43
|
-
]),
|
|
44
|
-
n("div", {
|
|
45
|
-
ref_key: "contentRef",
|
|
46
|
-
ref: t,
|
|
47
|
-
class: "transition-all duration-300 ease-in-out overflow-hidden",
|
|
48
|
-
style: w({ maxHeight: e.value ? "0" : s.value + "px" })
|
|
49
|
-
}, [
|
|
50
|
-
u(i.$slots, "default")
|
|
51
|
-
], 4)
|
|
52
|
-
], 64);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
export {
|
|
57
|
-
S as _
|
|
58
|
-
};
|
package/dist/Main-Da2SFU8t.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { defineComponent as M, ref as R, computed as s, resolveComponent as i, createBlock as c, openBlock as p, withCtx as l, createElementVNode as S, createVNode as d, resolveDynamicComponent as g, createCommentVNode as y, createTextVNode as A, toDisplayString as C } from "vue";
|
|
2
|
-
import { useRouter as N, useRoute as h } from "vue-router";
|
|
3
|
-
import { useI18n as k } from "@feedmepos/mf-common";
|
|
4
|
-
import { _ as x } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
|
-
import { _ as F } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
6
|
-
import { u as w } from "./iteration-D1WDQ_Kv.js";
|
|
7
|
-
import "@feedmepos/ui-library";
|
|
8
|
-
import "./rule-DG8tt7hf.js";
|
|
9
|
-
import "./lodash-BI_MmDQa.js";
|
|
10
|
-
import "./useAppStore-hU1uAhE-.js";
|
|
11
|
-
import { R as v } from "./app-D5h3x9dh.js";
|
|
12
|
-
/* empty css */
|
|
13
|
-
import "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-sueNu2MD.js";
|
|
14
|
-
const $ = { class: "space-y-24" }, X = /* @__PURE__ */ M({
|
|
15
|
-
__name: "Main",
|
|
16
|
-
setup(q) {
|
|
17
|
-
const { t: o } = k(), b = N(), B = h(), { readRestaurants: T } = w(), _ = R(), f = R(), a = s({
|
|
18
|
-
get: () => B.name === v.TEAM_ROLE ? "role" : "member",
|
|
19
|
-
set: (e) => {
|
|
20
|
-
b.push({
|
|
21
|
-
name: e === "role" ? v.TEAM_ROLE : v.TEAM_MEMBER,
|
|
22
|
-
query: b.currentRoute.value.query
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
T();
|
|
27
|
-
const r = s(() => u.value.find((e) => e.value === a.value) || u.value[0]), u = s(() => [
|
|
28
|
-
{
|
|
29
|
-
label: o("team.title"),
|
|
30
|
-
subTitle: o("team.subtitle"),
|
|
31
|
-
value: "member",
|
|
32
|
-
createButtonLabel: o("team.actions.addMember"),
|
|
33
|
-
createButtonAction: () => {
|
|
34
|
-
var e;
|
|
35
|
-
(e = _.value) == null || e.create();
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: o("permissionSet.title"),
|
|
40
|
-
value: "role",
|
|
41
|
-
createButtonLabel: o("permissionSet.createButtonLabel"),
|
|
42
|
-
createButtonAction: () => {
|
|
43
|
-
var e;
|
|
44
|
-
(e = f.value) == null || e.create();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
]);
|
|
48
|
-
return (e, n) => {
|
|
49
|
-
const L = i("FmSpacer"), V = i("FmTabs"), E = i("RouterView");
|
|
50
|
-
return p(), c(F, {
|
|
51
|
-
heading: r.value.label
|
|
52
|
-
}, {
|
|
53
|
-
"sub-heading": l(() => [
|
|
54
|
-
A(C(r.value.subTitle), 1)
|
|
55
|
-
]),
|
|
56
|
-
"append-heading": l(() => {
|
|
57
|
-
var t;
|
|
58
|
-
return [
|
|
59
|
-
d(L),
|
|
60
|
-
(t = r.value) != null && t.createButtonLabel ? (p(), c(x, {
|
|
61
|
-
key: 0,
|
|
62
|
-
icon: "add",
|
|
63
|
-
label: r.value.createButtonLabel,
|
|
64
|
-
onClick: n[0] || (n[0] = (m) => r.value.createButtonAction())
|
|
65
|
-
}, null, 8, ["label"])) : y("", !0)
|
|
66
|
-
];
|
|
67
|
-
}),
|
|
68
|
-
default: l(() => [
|
|
69
|
-
S("div", $, [
|
|
70
|
-
d(V, {
|
|
71
|
-
modelValue: a.value,
|
|
72
|
-
"onUpdate:modelValue": n[1] || (n[1] = (t) => a.value = t),
|
|
73
|
-
items: u.value
|
|
74
|
-
}, null, 8, ["modelValue", "items"]),
|
|
75
|
-
d(E, null, {
|
|
76
|
-
default: l(({ Component: t }) => [
|
|
77
|
-
(p(), c(g(t), {
|
|
78
|
-
ref: (m) => {
|
|
79
|
-
a.value === "member" && (_.value = m), a.value === "role" && (f.value = m);
|
|
80
|
-
}
|
|
81
|
-
}, null, 512))
|
|
82
|
-
]),
|
|
83
|
-
_: 1
|
|
84
|
-
})
|
|
85
|
-
])
|
|
86
|
-
]),
|
|
87
|
-
_: 1
|
|
88
|
-
}, 8, ["heading"]);
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
export {
|
|
93
|
-
X as default
|
|
94
|
-
};
|
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Q, ref as p, computed as _, watch as ae, resolveComponent as f, createBlock as M, openBlock as A, unref as l, withCtx as E, createVNode as u, createElementVNode as C, toDisplayString as J, nextTick as le, onMounted as re, createElementBlock as me, Fragment as ce, h as b } from "vue";
|
|
2
|
-
import { useI18n as Y, useCoreStore as ue } from "@feedmepos/mf-common";
|
|
3
|
-
import { useSnackbar as Z, useDialog as de, useBreakpoints as pe, components as X } from "@feedmepos/ui-library";
|
|
4
|
-
import { _ as fe } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
5
|
-
import { u as ve, _ as Se } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
6
|
-
import { u as ee, c as se, d as oe, p as G, i as be, b as _e, m as D, l as he, n as Pe, s as ge, o as ye, v as we } from "./rule-DG8tt7hf.js";
|
|
7
|
-
import { l as q } from "./lodash-BI_MmDQa.js";
|
|
8
|
-
import { d as Fe, A as ke } from "./iteration-D1WDQ_Kv.js";
|
|
9
|
-
import { u as xe } from "./useLoading-D0XTdxji.js";
|
|
10
|
-
import { b as H } from "./app-D5h3x9dh.js";
|
|
11
|
-
import { _ as Ce } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CAjf-JPW.js";
|
|
12
|
-
const Ve = { class: "flex w-full items-center justify-between" }, Re = { class: "fm-typo-en-title-md-600" }, Ie = { class: "fm-typo-en-title-sm-600 mt-24" }, je = { class: "flex items-center justify-start gap-8" }, Ee = /* @__PURE__ */ Q({
|
|
13
|
-
__name: "PermissionSetForm",
|
|
14
|
-
props: {
|
|
15
|
-
modelValue: {
|
|
16
|
-
type: Object,
|
|
17
|
-
default: () => ({})
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
setup(K, { expose: N }) {
|
|
21
|
-
const s = K, { t: i } = Y(), v = p(!1), B = _(() => {
|
|
22
|
-
var e;
|
|
23
|
-
return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
|
|
24
|
-
}), V = p(), O = Z(), R = xe(O), h = ee(), r = p({ ...s.modelValue }), a = p([]), c = p([]), I = [(e) => !!e || i("permissionSet.form.nameRequired")], z = _(() => {
|
|
25
|
-
var e;
|
|
26
|
-
return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
|
|
27
|
-
}), T = _(
|
|
28
|
-
() => h.permissionSets.value.filter((e) => {
|
|
29
|
-
var o;
|
|
30
|
-
return e.id !== ((o = s.modelValue) == null ? void 0 : o.id);
|
|
31
|
-
}).map((e) => ({ label: e.name, value: e.id }))
|
|
32
|
-
), g = _(
|
|
33
|
-
() => se(a.value, h.permissionSets.value)
|
|
34
|
-
), {
|
|
35
|
-
fetchCustomReportPermissions: U,
|
|
36
|
-
customReportPermissions: $,
|
|
37
|
-
isLoaded: n
|
|
38
|
-
} = oe(), t = new Set(
|
|
39
|
-
G.filter((e) => e.subject.startsWith(be)).map((e) => e.subject)
|
|
40
|
-
), m = _(() => {
|
|
41
|
-
const e = new Set(t);
|
|
42
|
-
for (const o of $.value) e.add(o.subject);
|
|
43
|
-
return e;
|
|
44
|
-
}), y = _(() => {
|
|
45
|
-
const e = /* @__PURE__ */ new Set();
|
|
46
|
-
for (const o of G)
|
|
47
|
-
o.category === H.reports && e.add(o.subject);
|
|
48
|
-
for (const o of $.value)
|
|
49
|
-
o.category === H.reports && e.add(o.subject);
|
|
50
|
-
return e;
|
|
51
|
-
}), S = p({ name: "", permissionSetIds: [], userPermissions: [] });
|
|
52
|
-
async function P() {
|
|
53
|
-
var o, d;
|
|
54
|
-
await le(), v.value = !v.value, r.value = { ...s.modelValue }, a.value = ((o = s.modelValue) == null ? void 0 : o.permissionSetIds) ?? [];
|
|
55
|
-
const e = ((d = s.modelValue) == null ? void 0 : d.permissions) ?? [];
|
|
56
|
-
c.value = _e(
|
|
57
|
-
D(g.value),
|
|
58
|
-
e
|
|
59
|
-
), S.value = {
|
|
60
|
-
name: r.value.name ?? "",
|
|
61
|
-
permissionSetIds: [...a.value],
|
|
62
|
-
userPermissions: Fe(c.value)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
ae(v, async (e) => {
|
|
66
|
-
e && await U();
|
|
67
|
-
});
|
|
68
|
-
const w = ve(
|
|
69
|
-
() => !q.isEqual(r.value.name ?? "", S.value.name) || !q.isEqual(a.value, S.value.permissionSetIds) || !q.isEqual(c.value, S.value.userPermissions),
|
|
70
|
-
() => {
|
|
71
|
-
v.value = !1;
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
function W() {
|
|
75
|
-
const e = D(g.value), o = n.value ? m.value : t, d = he(c.value, o), F = Pe(d, y.value), k = ge(F);
|
|
76
|
-
return ye(e, k);
|
|
77
|
-
}
|
|
78
|
-
function te() {
|
|
79
|
-
c.value = D(g.value);
|
|
80
|
-
}
|
|
81
|
-
async function ne() {
|
|
82
|
-
var d, F;
|
|
83
|
-
const e = await ((d = V.value) == null ? void 0 : d.validateInputsWithoutSubmit()), o = (F = ue().currentBusiness.value) == null ? void 0 : F.id;
|
|
84
|
-
!(e != null && e.length) && o && R.minor(async () => {
|
|
85
|
-
var L;
|
|
86
|
-
const k = W();
|
|
87
|
-
if ((L = s.modelValue) != null && L.id) {
|
|
88
|
-
const x = {
|
|
89
|
-
name: r.value.name,
|
|
90
|
-
permissions: k,
|
|
91
|
-
permissionSetIds: a.value,
|
|
92
|
-
businessId: r.value.businessId
|
|
93
|
-
};
|
|
94
|
-
await h.updatePermissionSet(s.modelValue.id, x);
|
|
95
|
-
} else {
|
|
96
|
-
const x = {
|
|
97
|
-
name: r.value.name,
|
|
98
|
-
businessId: o,
|
|
99
|
-
permissions: k,
|
|
100
|
-
permissionSetIds: a.value
|
|
101
|
-
};
|
|
102
|
-
await h.createPermissionSet(x);
|
|
103
|
-
}
|
|
104
|
-
v.value = !1;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return N({
|
|
108
|
-
trigger: P
|
|
109
|
-
}), (e, o) => {
|
|
110
|
-
const d = f("FmIcon"), F = f("FmTextField"), k = f("FmSelect"), L = f("FmForm"), x = f("FmButton"), ie = f("FmSideSheet");
|
|
111
|
-
return A(), M(ie, {
|
|
112
|
-
"model-value": v.value,
|
|
113
|
-
"max-width": 960,
|
|
114
|
-
"close-button": !1,
|
|
115
|
-
"onOn:clickedAway": l(w)
|
|
116
|
-
}, {
|
|
117
|
-
"side-sheet-header": E(() => [
|
|
118
|
-
C("div", Ve, [
|
|
119
|
-
C("p", Re, J(B.value), 1),
|
|
120
|
-
u(d, {
|
|
121
|
-
name: "close",
|
|
122
|
-
size: "md",
|
|
123
|
-
class: "cursor-pointer",
|
|
124
|
-
onClick: l(w)
|
|
125
|
-
}, null, 8, ["onClick"])
|
|
126
|
-
])
|
|
127
|
-
]),
|
|
128
|
-
"side-sheet-footer": E(() => [
|
|
129
|
-
C("div", je, [
|
|
130
|
-
u(x, {
|
|
131
|
-
label: z.value,
|
|
132
|
-
size: "md",
|
|
133
|
-
variant: "primary",
|
|
134
|
-
type: "submit",
|
|
135
|
-
onClick: ne
|
|
136
|
-
}, null, 8, ["label"]),
|
|
137
|
-
u(x, {
|
|
138
|
-
label: l(i)("common.cancel"),
|
|
139
|
-
size: "md",
|
|
140
|
-
variant: "secondary",
|
|
141
|
-
onClick: l(w)
|
|
142
|
-
}, null, 8, ["label", "onClick"])
|
|
143
|
-
])
|
|
144
|
-
]),
|
|
145
|
-
default: E(() => [
|
|
146
|
-
u(L, {
|
|
147
|
-
ref_key: "formRef",
|
|
148
|
-
ref: V
|
|
149
|
-
}, {
|
|
150
|
-
default: E(() => [
|
|
151
|
-
u(F, {
|
|
152
|
-
modelValue: r.value.name,
|
|
153
|
-
"onUpdate:modelValue": o[0] || (o[0] = (j) => r.value.name = j),
|
|
154
|
-
label: l(i)("permissionSet.form.name"),
|
|
155
|
-
placeholder: l(i)("permissionSet.form.namePlaceholder"),
|
|
156
|
-
rules: I
|
|
157
|
-
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
158
|
-
u(k, {
|
|
159
|
-
modelValue: a.value,
|
|
160
|
-
"onUpdate:modelValue": [
|
|
161
|
-
o[1] || (o[1] = (j) => a.value = j),
|
|
162
|
-
te
|
|
163
|
-
],
|
|
164
|
-
multiselect: "",
|
|
165
|
-
searchable: "",
|
|
166
|
-
"search-debounce": 300,
|
|
167
|
-
items: T.value,
|
|
168
|
-
label: l(i)("permissionSet.form.includedSets"),
|
|
169
|
-
placeholder: l(i)("permissionSet.form.includedSetsPlaceholder"),
|
|
170
|
-
class: "mt-16"
|
|
171
|
-
}, null, 8, ["modelValue", "items", "label", "placeholder"]),
|
|
172
|
-
C("div", Ie, J(l(i)("team.memberForm.permissions.title")), 1),
|
|
173
|
-
u(Ce, {
|
|
174
|
-
modelValue: c.value,
|
|
175
|
-
"onUpdate:modelValue": o[2] || (o[2] = (j) => c.value = j),
|
|
176
|
-
"inherit-permissions": g.value,
|
|
177
|
-
class: "mt-16"
|
|
178
|
-
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
179
|
-
]),
|
|
180
|
-
_: 1
|
|
181
|
-
}, 512)
|
|
182
|
-
]),
|
|
183
|
-
_: 1
|
|
184
|
-
}, 8, ["model-value", "onOn:clickedAway"]);
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
}), Be = { class: "space-y-8" }, Te = { class: "flex justify-end xs:px-16" }, Ke = /* @__PURE__ */ Q({
|
|
188
|
-
__name: "PermissionSetList",
|
|
189
|
-
setup(K, { expose: N }) {
|
|
190
|
-
const { t: s } = Y(), { customReportPermissions: i, fetchCustomReportPermissions: v } = oe(), B = Z(), V = de(), { breakpoints: O } = pe(), R = p(""), h = _(() => {
|
|
191
|
-
var n;
|
|
192
|
-
return (n = c.value) == null ? void 0 : n.filter((t) => {
|
|
193
|
-
const m = R.value.toLowerCase();
|
|
194
|
-
return t.name.toLowerCase().includes(m);
|
|
195
|
-
});
|
|
196
|
-
}), r = p(), a = ee(), c = _(
|
|
197
|
-
() => a.permissionSets.value
|
|
198
|
-
), I = p();
|
|
199
|
-
async function z() {
|
|
200
|
-
await a.readPermissionSets();
|
|
201
|
-
}
|
|
202
|
-
function T(n) {
|
|
203
|
-
var t;
|
|
204
|
-
I.value = n, (t = r.value) == null || t.trigger();
|
|
205
|
-
}
|
|
206
|
-
const g = [
|
|
207
|
-
{
|
|
208
|
-
accessorKey: "name",
|
|
209
|
-
header: () => s("permissionSet.table.columns.name")
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
accessorKey: "permission",
|
|
213
|
-
header: () => s("permissionSet.table.columns.permissions"),
|
|
214
|
-
enableSorting: !1,
|
|
215
|
-
cell(n) {
|
|
216
|
-
const t = n.row.original, m = se(
|
|
217
|
-
[t.id],
|
|
218
|
-
a.permissionSets.value
|
|
219
|
-
), y = D(m), S = y.length, P = we(
|
|
220
|
-
y,
|
|
221
|
-
i.value
|
|
222
|
-
);
|
|
223
|
-
return b("div", { class: "flex items-center gap-8" }, [
|
|
224
|
-
b("span", s("team.labels.allowed", { count: S })),
|
|
225
|
-
b(
|
|
226
|
-
X.FmTooltip,
|
|
227
|
-
{ variant: "plain", placement: "top" },
|
|
228
|
-
{
|
|
229
|
-
default: () => b(X.FmIcon, {
|
|
230
|
-
name: "info",
|
|
231
|
-
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
232
|
-
}),
|
|
233
|
-
content: () => b("div", [
|
|
234
|
-
s("team.labels.permission"),
|
|
235
|
-
...P.map(
|
|
236
|
-
(w, W) => b("div", { key: `${w}-${W}` }, `- ${w}`)
|
|
237
|
-
)
|
|
238
|
-
])
|
|
239
|
-
}
|
|
240
|
-
)
|
|
241
|
-
]);
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
id: "action",
|
|
246
|
-
size: 52,
|
|
247
|
-
meta: {
|
|
248
|
-
cellClass: "pl-16",
|
|
249
|
-
headerContentClass: "-mx-16"
|
|
250
|
-
},
|
|
251
|
-
cell(n) {
|
|
252
|
-
const t = n.row.original;
|
|
253
|
-
return b(
|
|
254
|
-
"div",
|
|
255
|
-
{
|
|
256
|
-
class: "flex w-full items-center justify-end",
|
|
257
|
-
onClick: (m) => m.stopPropagation()
|
|
258
|
-
},
|
|
259
|
-
[
|
|
260
|
-
b(Se, {
|
|
261
|
-
items: [
|
|
262
|
-
{ label: s("common.update"), onClick: () => T(t) },
|
|
263
|
-
{
|
|
264
|
-
label: s("common.remove"),
|
|
265
|
-
onClick: () => $(t),
|
|
266
|
-
itemClass: "text-fm-color-typo-error"
|
|
267
|
-
}
|
|
268
|
-
]
|
|
269
|
-
})
|
|
270
|
-
]
|
|
271
|
-
);
|
|
272
|
-
},
|
|
273
|
-
enableSorting: !1
|
|
274
|
-
}
|
|
275
|
-
];
|
|
276
|
-
function U() {
|
|
277
|
-
var n;
|
|
278
|
-
I.value = void 0, (n = r.value) == null || n.trigger();
|
|
279
|
-
}
|
|
280
|
-
async function $(n) {
|
|
281
|
-
V.open({
|
|
282
|
-
title: s("permissionSet.form.delete.title"),
|
|
283
|
-
message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
|
|
284
|
-
minWidth: O.value.lg ? 588 : 0,
|
|
285
|
-
primaryActions: {
|
|
286
|
-
text: s("common.remove"),
|
|
287
|
-
close: !1,
|
|
288
|
-
variant: "destructive"
|
|
289
|
-
},
|
|
290
|
-
secondaryActions: { text: s("common.cancel"), close: !0 }
|
|
291
|
-
}).onPrimary(async () => {
|
|
292
|
-
try {
|
|
293
|
-
await a.deletePermissionSet(n.id), B.open({
|
|
294
|
-
message: s("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
|
|
295
|
-
type: "success"
|
|
296
|
-
});
|
|
297
|
-
} catch (t) {
|
|
298
|
-
const m = t instanceof ke && t.status === 409 ? t.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
|
|
299
|
-
permissionSetName: n.name
|
|
300
|
-
}) : s("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
|
|
301
|
-
B.open({ message: m, type: "error" });
|
|
302
|
-
}
|
|
303
|
-
V.close();
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
return re(() => {
|
|
307
|
-
z(), v();
|
|
308
|
-
}), N({
|
|
309
|
-
create: U
|
|
310
|
-
}), (n, t) => {
|
|
311
|
-
const m = f("FmSearch"), y = f("FmTable"), S = f("FullWrapper");
|
|
312
|
-
return A(), me(ce, null, [
|
|
313
|
-
u(Ee, {
|
|
314
|
-
ref_key: "permissionSetFormRef",
|
|
315
|
-
ref: r,
|
|
316
|
-
"model-value": I.value
|
|
317
|
-
}, null, 8, ["model-value"]),
|
|
318
|
-
C("div", Be, [
|
|
319
|
-
C("div", Te, [
|
|
320
|
-
u(m, {
|
|
321
|
-
modelValue: R.value,
|
|
322
|
-
"onUpdate:modelValue": t[0] || (t[0] = (P) => R.value = P),
|
|
323
|
-
class: "w-[320px] xs:w-full",
|
|
324
|
-
autofocus: "",
|
|
325
|
-
placeholder: l(s)("permissionSet.search.placeholder")
|
|
326
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
327
|
-
]),
|
|
328
|
-
c.value.length > 0 ? (A(), M(S, {
|
|
329
|
-
key: 0,
|
|
330
|
-
class: "overflow-auto"
|
|
331
|
-
}, {
|
|
332
|
-
default: E(() => [
|
|
333
|
-
u(y, {
|
|
334
|
-
"column-defs": g,
|
|
335
|
-
"row-data": h.value,
|
|
336
|
-
"page-size": h.value.length,
|
|
337
|
-
"pin-header-row": "",
|
|
338
|
-
"hide-footer": "",
|
|
339
|
-
"shrink-at": !1,
|
|
340
|
-
onRowClick: t[1] || (t[1] = (P) => T(P.original))
|
|
341
|
-
}, null, 8, ["row-data", "page-size"])
|
|
342
|
-
]),
|
|
343
|
-
_: 1
|
|
344
|
-
})) : (A(), M(l(fe), {
|
|
345
|
-
key: 1,
|
|
346
|
-
title: l(s)("permissionSet.noData.title"),
|
|
347
|
-
subtitle: l(s)("permissionSet.noData.subtitle")
|
|
348
|
-
}, null, 8, ["title", "subtitle"]))
|
|
349
|
-
])
|
|
350
|
-
], 64);
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
export {
|
|
355
|
-
Ke as default
|
|
356
|
-
};
|