@feedmepos/mf-hrm-portal 2.0.6-dev → 2.0.7-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.
Files changed (34) hide show
  1. package/dist/{AuditLogList-BxigxQv3.js → AuditLogList-COq6WH3T.js} +12 -12
  2. package/dist/{EmployeeList-DyvqwZtw.js → EmployeeList-CtosIPFL.js} +5 -5
  3. package/dist/{Main-CtH5MCty.js → Main-B4YdcrGe.js} +5 -5
  4. package/dist/{Main-B8tSMq-U.js → Main-CdsqeB2G.js} +8 -8
  5. package/dist/PermissionSetList-BUORArci.js +327 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ChqCTn1L.js +3333 -0
  7. package/dist/{RoleList-jykDD_zm.js → RoleList-D1NGE2IC.js} +6 -6
  8. package/dist/TeamMemberList-auSjZRNz.js +979 -0
  9. package/dist/{TimesheetList-Bk1XF9xy.js → TimesheetList-B8yCkaxb.js} +6 -6
  10. package/dist/{app-BPlaahxK.js → app-CB3ye-CT.js} +785 -688
  11. package/dist/app.js +1 -1
  12. package/dist/{dayjs.min-LweNOSZ_.js → dayjs.min-DOxEzdpe.js} +1 -1
  13. package/dist/{employee-DPfiL6rd.js → employee-G0pQg8_6.js} +3 -3
  14. package/dist/{index-CBxn7cxI.js → index-Beu6IuhT.js} +1803 -1735
  15. package/dist/{index-BAhsHYNv.js → index-DQArLkVB.js} +1 -1
  16. package/dist/{lodash-D1uG3PY3.js → lodash-COjtwv4w.js} +1 -1
  17. package/dist/src/api/permission-assignment/index.d.ts +3 -0
  18. package/dist/src/api/report-query/index.d.ts +1 -0
  19. package/dist/src/composables/useCustomReportPermissions.d.ts +7 -0
  20. package/dist/src/helpers/permission-set.d.ts +9 -0
  21. package/dist/src/helpers/rule.d.ts +4 -1
  22. package/dist/src/types/report-query.d.ts +1 -0
  23. package/dist/src/views/team/components/BasePermission.vue.d.ts +17 -0
  24. package/dist/{team-B1osnB4U.js → team-CEtKQK6n.js} +1 -1
  25. package/dist/{timesheet-rte2utJf.js → timesheet-DZF9D3QQ.js} +2 -2
  26. package/dist/tsconfig.app.tsbuildinfo +1 -1
  27. package/dist/{useAppStore-CqrjwnF_.js → useAppStore-9lbKMy_9.js} +1 -1
  28. package/dist/{useLoading-B5IjfVEP.js → useLoading-BIIvuJcM.js} +1 -1
  29. package/dist/useReportPermissions-BXQ0-WwK.js +59 -0
  30. package/package.json +1 -1
  31. package/dist/PermissionSetList-DCONmOgn.js +0 -323
  32. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-07Dsea27.js +0 -3092
  33. package/dist/TeamMemberList-DMrPgF1l.js +0 -973
  34. package/dist/useReportPermissions-C4Q29AQJ.js +0 -65
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as de, ref as h, computed as k, watch as R, resolveComponent as D, createElementBlock as f, openBlock as m, Fragment as F, createVNode as d, unref as n, withCtx as N, createElementVNode as e, createBlock as $, createCommentVNode as x, toDisplayString as s, renderList as re, createTextVNode as Y } from "vue";
2
- import { d as ce } from "./dayjs.min-LweNOSZ_.js";
2
+ import { d as ce } from "./dayjs.min-DOxEzdpe.js";
3
3
  import { useI18n as ue, useCoreStore as me } from "@feedmepos/mf-common";
4
- import { G, _ as fe } from "./app-BPlaahxK.js";
4
+ import { L as J, _ as fe } from "./app-CB3ye-CT.js";
5
5
  import { _ as pe } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
6
  import { _ as ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
- import { components as J } from "@feedmepos/ui-library";
8
- import { g as _e, b as ge, p as Z } from "./index-CBxn7cxI.js";
9
- import { u as he } from "./team-B1osnB4U.js";
7
+ import { components as G } from "@feedmepos/ui-library";
8
+ import { g as _e, b as ge, p as Z } from "./index-Beu6IuhT.js";
9
+ import { u as he } from "./team-CEtKQK6n.js";
10
10
  import { S as U } from "./SelectFilter-DUj7GBtT.js";
11
11
  const be = "/audit-logs", xe = {
12
12
  async read(i) {
@@ -91,9 +91,9 @@ const be = "/audit-logs", xe = {
91
91
  class: "text-xs text-fm-color-typo-secondary"
92
92
  }, Ye = {
93
93
  class: "font-semibold"
94
- }, Ge = {
95
- key: 1
96
94
  }, Je = {
95
+ key: 1
96
+ }, Ge = {
97
97
  class: "text-xs text-fm-color-typo-secondary"
98
98
  }, Ze = {
99
99
  class: "font-semibold"
@@ -182,7 +182,7 @@ const be = "/audit-logs", xe = {
182
182
  const l = Z.flatMap((c) => H(c.subject).map((_) => ({
183
183
  label: c.label,
184
184
  value: _
185
- }))), t = Object.entries(G).map(([c, _]) => ({
185
+ }))), t = Object.entries(J).map(([c, _]) => ({
186
186
  label: _,
187
187
  value: c
188
188
  })), r = /* @__PURE__ */ new Set(), v = [];
@@ -227,7 +227,7 @@ const be = "/audit-logs", xe = {
227
227
  }), B = k(() => w.value);
228
228
  function z(l) {
229
229
  var t;
230
- return ((t = Z.find((r) => r.subject === l)) == null ? void 0 : t.label) ?? G[l];
230
+ return ((t = Z.find((r) => r.subject === l)) == null ? void 0 : t.label) ?? J[l];
231
231
  }
232
232
  const M = {
233
233
  allowed: "success",
@@ -249,7 +249,7 @@ const be = "/audit-logs", xe = {
249
249
  const t = l.row.original, r = g.userIdToName[t.userId], v = g.userIdToPhone[t.userId], c = g.userIdToEmail[t.userId];
250
250
  return d("div", {
251
251
  class: "flex items-center gap-8"
252
- }, [d(J.FmAvatar, {
252
+ }, [d(G.FmAvatar, {
253
253
  initials: r || t.userId,
254
254
  size: "sm",
255
255
  class: "shrink-0"
@@ -302,7 +302,7 @@ const be = "/audit-logs", xe = {
302
302
  enableSorting: !1,
303
303
  cell(l) {
304
304
  const t = l.row.original;
305
- return d(J.FmChip, {
305
+ return d(G.FmChip, {
306
306
  variant: M[t.outcome] ?? "neutral",
307
307
  label: t.outcome,
308
308
  compact: !0
@@ -472,7 +472,7 @@ const be = "/audit-logs", xe = {
472
472
  compact: ""
473
473
  }, null, 8, ["variant", "label"])]), t[7] || (t[7] = e("hr", {
474
474
  class: "border-fm-color-border-default"
475
- }, null, -1)), e("div", Fe, [e("div", null, [e("p", Ne, s(n(o)("auditLog.detail.timestamp")), 1), e("p", Ue, s(new Date(a.value.timestamp).toLocaleString()), 1)]), n(g).userIdToName[a.value.userId] ? (m(), f("div", Be, [e("p", Ee, s(n(o)("auditLog.detail.user")), 1), e("p", Re, s(n(g).userIdToName[a.value.userId]), 1)])) : x("", !0), e("div", null, [e("p", qe, s(n(o)("auditLog.detail.email")), 1), e("p", ze, s(n(g).userIdToEmail[a.value.userId] || a.value.userId), 1)]), e("div", null, [e("p", Me, s(n(o)("auditLog.detail.action")), 1), e("p", Ke, s(a.value.action), 1)]), e("div", null, [e("p", $e, s(n(o)("auditLog.detail.subject")), 1), e("p", Ye, s(z(a.value.subject) || a.value.subject), 1)]), a.value.field ? (m(), f("div", Ge, [e("p", Je, s(n(o)("auditLog.detail.field")), 1), e("p", Ze, s(a.value.field), 1)])) : x("", !0), e("div", null, [e("p", He, s(n(o)("auditLog.detail.business")), 1), e("p", Qe, s(a.value.businessId || "-"), 1)]), e("div", null, [e("p", We, s(n(o)("auditLog.detail.restaurant")), 1), e("p", Xe, s(a.value.restaurantId || "-"), 1)])])]), e("div", et, [e("div", tt, [e("p", ot, s(n(o)("auditLog.detail.metadata")), 1)]), t[8] || (t[8] = e("hr", {
475
+ }, null, -1)), e("div", Fe, [e("div", null, [e("p", Ne, s(n(o)("auditLog.detail.timestamp")), 1), e("p", Ue, s(new Date(a.value.timestamp).toLocaleString()), 1)]), n(g).userIdToName[a.value.userId] ? (m(), f("div", Be, [e("p", Ee, s(n(o)("auditLog.detail.user")), 1), e("p", Re, s(n(g).userIdToName[a.value.userId]), 1)])) : x("", !0), e("div", null, [e("p", qe, s(n(o)("auditLog.detail.email")), 1), e("p", ze, s(n(g).userIdToEmail[a.value.userId] || a.value.userId), 1)]), e("div", null, [e("p", Me, s(n(o)("auditLog.detail.action")), 1), e("p", Ke, s(a.value.action), 1)]), e("div", null, [e("p", $e, s(n(o)("auditLog.detail.subject")), 1), e("p", Ye, s(z(a.value.subject) || a.value.subject), 1)]), a.value.field ? (m(), f("div", Je, [e("p", Ge, s(n(o)("auditLog.detail.field")), 1), e("p", Ze, s(a.value.field), 1)])) : x("", !0), e("div", null, [e("p", He, s(n(o)("auditLog.detail.business")), 1), e("p", Qe, s(a.value.businessId || "-"), 1)]), e("div", null, [e("p", We, s(n(o)("auditLog.detail.restaurant")), 1), e("p", Xe, s(a.value.restaurantId || "-"), 1)])])]), e("div", et, [e("div", tt, [e("p", ot, s(n(o)("auditLog.detail.metadata")), 1)]), t[8] || (t[8] = e("hr", {
476
476
  class: "border-fm-color-border-default"
477
477
  }, null, -1)), e("div", at, [a.value.metadata.reason ? (m(), f("div", lt, [e("p", st, s(n(o)("auditLog.detail.reason")), 1), e("p", nt, s(a.value.metadata.reason), 1)])) : x("", !0), e("div", null, [e("p", it, s(n(o)("auditLog.detail.resolvedFrom")), 1), e("p", dt, s(a.value.metadata.resolvedFrom), 1)]), a.value.metadata.permissionSetId ? (m(), f("div", rt, [e("p", ct, s(n(o)("auditLog.detail.permissionSet")), 1), a.value.metadata.resolvedFrom === "systemPermissionSet" ? (m(), f(F, {
478
478
  key: 0
@@ -2,14 +2,14 @@ import { createElementBlock as $, openBlock as g, createElementVNode as m, toRaw
2
2
  import { useCoreStore as Fe, useI18n as we, RestaurantSelector as ce } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as xe, components as Ue, useDialog as Ne, useBreakpoints as Be, FmButtonVariant as De } from "@feedmepos/ui-library";
4
4
  import { _ as Pe, S as pe } from "./SelectFilter-DUj7GBtT.js";
5
- import { _ as Te } from "./app-BPlaahxK.js";
5
+ import { _ as Te } from "./app-CB3ye-CT.js";
6
6
  import { _ as ze } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
7
  import { u as ke } from "./useSearch-B6WK1LBB.js";
8
- import { u as Se, E as Ae } from "./employee-DPfiL6rd.js";
9
- import { l as je } from "./lodash-D1uG3PY3.js";
8
+ import { u as Se, E as Ae } from "./employee-G0pQg8_6.js";
9
+ import { l as je } from "./lodash-COjtwv4w.js";
10
10
  import { u as Ke, _ as ve, a as fe, b as Ge } from "./useRestaurantMap-D5BNPLKh.js";
11
- import { u as qe } from "./useLoading-B5IjfVEP.js";
12
- import { u as ue } from "./useAppStore-CqrjwnF_.js";
11
+ import { u as qe } from "./useLoading-BIIvuJcM.js";
12
+ import { u as ue } from "./useAppStore-9lbKMy_9.js";
13
13
  const He = {};
14
14
  function Je(S, O) {
15
15
  return g(), $("div", null, [...O[0] || (O[0] = [
@@ -4,13 +4,13 @@ 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 "./index-CBxn7cxI.js";
8
- import { R as v } from "./app-BPlaahxK.js";
9
- import "./useAppStore-CqrjwnF_.js";
10
- import "./index-BAhsHYNv.js";
7
+ import "./index-Beu6IuhT.js";
8
+ import { R as v } from "./app-CB3ye-CT.js";
9
+ import "./useAppStore-9lbKMy_9.js";
10
+ import "./index-DQArLkVB.js";
11
11
  /* empty css */
12
12
  /* empty css */
13
- import "./team-B1osnB4U.js";
13
+ import "./team-CEtKQK6n.js";
14
14
  const w = { class: "space-y-24" }, P = /* @__PURE__ */ V({
15
15
  __name: "Main",
16
16
  setup(x) {
@@ -3,16 +3,16 @@ import { useRouter as of, useRoute as cf } from "vue-router";
3
3
  import { useCoreStore as hf, useI18n as uf } from "@feedmepos/mf-common";
4
4
  import { _ as vf } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
5
  import { _ as pf } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
- import { u as df } from "./useAppStore-CqrjwnF_.js";
6
+ import { u as df } from "./useAppStore-9lbKMy_9.js";
7
7
  import "@feedmepos/ui-library";
8
8
  /* empty css */
9
- import { u as mf } from "./employee-DPfiL6rd.js";
10
- import "./lodash-D1uG3PY3.js";
11
- import "./index-CBxn7cxI.js";
12
- import { R as vt } from "./app-BPlaahxK.js";
13
- import "./useReportPermissions-C4Q29AQJ.js";
14
- import "./dayjs.min-LweNOSZ_.js";
15
- import "./timesheet-rte2utJf.js";
9
+ import { u as mf } from "./employee-G0pQg8_6.js";
10
+ import "./lodash-COjtwv4w.js";
11
+ import "./index-Beu6IuhT.js";
12
+ import { R as vt } from "./app-CB3ye-CT.js";
13
+ import "./useReportPermissions-BXQ0-WwK.js";
14
+ import "./dayjs.min-DOxEzdpe.js";
15
+ import "./timesheet-DZF9D3QQ.js";
16
16
  var In = {};
17
17
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
18
18
  var jt = {};
@@ -0,0 +1,327 @@
1
+ import { defineComponent as q, computed as _, resolveComponent as c, createElementBlock as $, openBlock as P, createElementVNode as y, createVNode as r, toDisplayString as E, unref as u, withCtx as g, createTextVNode as Z, Fragment as G, renderList as ee, ref as b, createBlock as H, nextTick as se, onMounted as te, h as O } from "vue";
2
+ import { useI18n as M, useCoreStore as oe } from "@feedmepos/mf-common";
3
+ import { useSnackbar as J, useDialog as ne, useBreakpoints as ie, components as le, FmButtonColorThemeVariant as ae, FmButtonVariant as re } from "@feedmepos/ui-library";
4
+ import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
+ import { q as K, A as ue, u as Q, m as X, p as ce, n as de, o as N, w as pe, x as fe, y as ve, B as Se } from "./index-Beu6IuhT.js";
6
+ import { u as _e } from "./useLoading-BIIvuJcM.js";
7
+ import { a as be } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ChqCTn1L.js";
8
+ const he = { class: "flex flex-row items-center gap-8" }, ge = /* @__PURE__ */ q({
9
+ __name: "PermissionWithTooltip",
10
+ props: {
11
+ modelValue: {
12
+ type: Array,
13
+ required: !0
14
+ }
15
+ },
16
+ setup(j) {
17
+ const { customReportPermissions: w } = K(), s = j, i = _(() => ue(s.modelValue, w.value)), { t: a } = M();
18
+ return (k, C) => {
19
+ const h = c("FmIcon"), F = c("FmTooltip");
20
+ return P(), $("div", he, [
21
+ y("span", null, E(u(a)("team.labels.allowed", { count: i.value.length })), 1),
22
+ r(F, {
23
+ variant: "plain",
24
+ placement: "top"
25
+ }, {
26
+ content: g(() => [
27
+ y("div", null, [
28
+ Z(E(u(a)("team.labels.permission")) + " ", 1),
29
+ (P(!0), $(G, null, ee(i.value, (m, l) => (P(), $("div", {
30
+ key: `${m}-${l}`
31
+ }, " - " + E(m), 1))), 128))
32
+ ])
33
+ ]),
34
+ default: g(() => [
35
+ r(h, {
36
+ name: "info",
37
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
38
+ })
39
+ ]),
40
+ _: 1
41
+ })
42
+ ]);
43
+ };
44
+ }
45
+ }), Pe = { class: "fm-typo-en-title-md-600" }, ye = { class: "flex items-center justify-start gap-8" }, Fe = /* @__PURE__ */ q({
46
+ __name: "PermissionSetForm",
47
+ props: {
48
+ modelValue: {
49
+ type: Object,
50
+ default: () => ({})
51
+ }
52
+ },
53
+ setup(j, { expose: w }) {
54
+ const s = j, { t: i } = M(), a = b(!1), k = _(() => {
55
+ var e;
56
+ return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
57
+ }), C = b(), h = J(), F = _e(h), m = Q(), l = b({ ...s.modelValue }), d = b([]), p = b([]), A = [(e) => !!e || "Permission set name is required"], D = _(() => {
58
+ var e;
59
+ return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
60
+ }), U = _(
61
+ () => m.permissionSets.value.filter((e) => {
62
+ var o;
63
+ return e.id !== ((o = s.modelValue) == null ? void 0 : o.id);
64
+ }).map((e) => ({ label: e.name, value: e.id }))
65
+ ), V = _(
66
+ () => X(d.value, m.permissionSets.value)
67
+ ), { customReportPermissions: W, isLoaded: n } = K(), t = new Set(ce.map((e) => e.subject)), f = _(() => {
68
+ const e = new Set(t);
69
+ for (const o of W.value) e.add(o.subject);
70
+ return e;
71
+ });
72
+ async function I() {
73
+ var o, v;
74
+ await se(), a.value = !a.value, l.value = { ...s.modelValue }, d.value = ((o = s.modelValue) == null ? void 0 : o.permissionSetIds) ?? [];
75
+ const e = ((v = s.modelValue) == null ? void 0 : v.permissions) ?? [];
76
+ p.value = de(
77
+ N(V.value),
78
+ e
79
+ );
80
+ }
81
+ function z() {
82
+ const e = N(V.value), o = n.value ? f.value : t, v = pe(p.value, o), x = fe(v);
83
+ return ve(e, x);
84
+ }
85
+ function B() {
86
+ p.value = N(V.value);
87
+ }
88
+ async function Y() {
89
+ var v, x;
90
+ const e = await ((v = C.value) == null ? void 0 : v.validateInputsWithoutSubmit()), o = (x = oe().currentBusiness.value) == null ? void 0 : x.id;
91
+ !(e != null && e.length) && o && F.minor(async () => {
92
+ var T;
93
+ const L = z();
94
+ if ((T = s.modelValue) != null && T.id) {
95
+ const R = {
96
+ name: l.value.name,
97
+ permissions: L,
98
+ permissionSetIds: d.value,
99
+ businessId: l.value.businessId
100
+ };
101
+ await m.updatePermissionSet(s.modelValue.id, R);
102
+ } else {
103
+ const R = {
104
+ name: l.value.name,
105
+ businessId: o,
106
+ permissions: L,
107
+ permissionSetIds: d.value
108
+ };
109
+ await m.createPermissionSet(R);
110
+ }
111
+ a.value = !1;
112
+ });
113
+ }
114
+ return w({
115
+ trigger: I
116
+ }), (e, o) => {
117
+ const v = c("FmTextField"), x = c("FmSelect"), L = c("FmForm"), T = c("FmButton"), R = c("FmSideSheet");
118
+ return P(), H(R, {
119
+ modelValue: a.value,
120
+ "onUpdate:modelValue": o[4] || (o[4] = (S) => a.value = S),
121
+ "max-width": 560,
122
+ "dismiss-away": ""
123
+ }, {
124
+ "side-sheet-header": g(() => [
125
+ y("p", Pe, E(k.value), 1)
126
+ ]),
127
+ "side-sheet-footer": g(() => [
128
+ y("div", ye, [
129
+ r(T, {
130
+ label: D.value,
131
+ size: "md",
132
+ variant: "primary",
133
+ type: "submit",
134
+ onClick: Y
135
+ }, null, 8, ["label"]),
136
+ r(T, {
137
+ label: u(i)("common.cancel"),
138
+ size: "md",
139
+ variant: "secondary",
140
+ onClick: o[3] || (o[3] = (S) => a.value = !1)
141
+ }, null, 8, ["label"])
142
+ ])
143
+ ]),
144
+ default: g(() => [
145
+ r(L, {
146
+ ref_key: "formRef",
147
+ ref: C
148
+ }, {
149
+ default: g(() => [
150
+ r(v, {
151
+ modelValue: l.value.name,
152
+ "onUpdate:modelValue": o[0] || (o[0] = (S) => l.value.name = S),
153
+ label: u(i)("permissionSet.form.name"),
154
+ placeholder: u(i)("permissionSet.form.namePlaceholder"),
155
+ rules: A
156
+ }, null, 8, ["modelValue", "label", "placeholder"]),
157
+ r(x, {
158
+ modelValue: d.value,
159
+ "onUpdate:modelValue": [
160
+ o[1] || (o[1] = (S) => d.value = S),
161
+ B
162
+ ],
163
+ multiselect: "",
164
+ searchable: "",
165
+ "search-debounce": 300,
166
+ items: U.value,
167
+ label: u(i)("permissionSet.form.includedSets"),
168
+ placeholder: u(i)("permissionSet.form.includedSetsPlaceholder"),
169
+ class: "mt-16"
170
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
171
+ r(be, {
172
+ modelValue: p.value,
173
+ "onUpdate:modelValue": o[2] || (o[2] = (S) => p.value = S),
174
+ "inherit-permissions": V.value,
175
+ class: "mt-24"
176
+ }, null, 8, ["modelValue", "inherit-permissions"])
177
+ ]),
178
+ _: 1
179
+ }, 512)
180
+ ]),
181
+ _: 1
182
+ }, 8, ["modelValue"]);
183
+ };
184
+ }
185
+ }), Ve = { class: "space-y-8" }, xe = { class: "flex justify-end xs:px-16" }, we = {
186
+ key: 0,
187
+ class: "overflow-auto"
188
+ }, ke = { class: "pb-64" }, Le = /* @__PURE__ */ q({
189
+ __name: "PermissionSetList",
190
+ setup(j, { expose: w }) {
191
+ const { t: s } = M(), { fetchCustomReportPermissions: i } = K(), a = J(), k = ne(), { breakpoints: C } = ie(), h = b(""), F = _(() => {
192
+ var n;
193
+ return (n = d.value) == null ? void 0 : n.filter((t) => {
194
+ const f = h.value.toLowerCase();
195
+ return t.name.toLowerCase().includes(f);
196
+ });
197
+ }), m = b(), l = Q(), d = _(
198
+ () => l.permissionSets.value
199
+ ), p = b();
200
+ async function A() {
201
+ await l.readPermissionSets();
202
+ }
203
+ function D(n) {
204
+ var t;
205
+ p.value = n, (t = m.value) == null || t.trigger();
206
+ }
207
+ const U = [
208
+ {
209
+ accessorKey: "name",
210
+ header: () => s("permissionSet.table.columns.name")
211
+ },
212
+ {
213
+ accessorKey: "permission",
214
+ header: () => s("permissionSet.table.columns.permissions"),
215
+ enableSorting: !1,
216
+ cell(n) {
217
+ const t = n.row.original, f = X(
218
+ [t.id],
219
+ l.permissionSets.value
220
+ ), I = N(f);
221
+ return O(ge, { modelValue: I });
222
+ }
223
+ },
224
+ {
225
+ id: "action",
226
+ meta: {
227
+ cellClass: "pl-16",
228
+ headerContentClass: "-mx-16"
229
+ },
230
+ cell(n) {
231
+ return O("div", { class: "w-full flex justify-end items-center" }, [
232
+ O(le.FmButton, {
233
+ prependIcon: "delete",
234
+ variant: re.Tertiary,
235
+ textColor: ae.NeutralGray400,
236
+ class: "flex flex-end",
237
+ onClick: (t) => {
238
+ t.stopPropagation(), W(n.row.original);
239
+ }
240
+ })
241
+ ]);
242
+ },
243
+ enableSorting: !1
244
+ }
245
+ ];
246
+ function V() {
247
+ var n;
248
+ p.value = void 0, (n = m.value) == null || n.trigger();
249
+ }
250
+ async function W(n) {
251
+ k.open({
252
+ title: s("permissionSet.form.delete.title"),
253
+ message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
254
+ minWidth: C.value.lg ? 588 : 0,
255
+ primaryActions: {
256
+ text: s("common.remove"),
257
+ close: !1,
258
+ variant: "destructive"
259
+ },
260
+ secondaryActions: { text: s("common.cancel"), close: !0 }
261
+ }).onPrimary(async () => {
262
+ try {
263
+ await l.deletePermissionSet(n.id), a.open({
264
+ message: s("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
265
+ type: "success"
266
+ });
267
+ } catch (t) {
268
+ const f = t instanceof Se && t.status === 409 ? t.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
269
+ permissionSetName: n.name
270
+ }) : s("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
271
+ a.open({ message: f, type: "error" });
272
+ }
273
+ k.close();
274
+ });
275
+ }
276
+ return te(() => {
277
+ A(), i();
278
+ }), w({
279
+ create: V
280
+ }), (n, t) => {
281
+ const f = c("FmSearch"), I = c("FmTable"), z = c("FullWrapper");
282
+ return P(), $(G, null, [
283
+ r(Fe, {
284
+ ref_key: "permissionSetFormRef",
285
+ ref: m,
286
+ "model-value": p.value
287
+ }, null, 8, ["model-value"]),
288
+ y("div", Ve, [
289
+ y("div", xe, [
290
+ r(f, {
291
+ modelValue: h.value,
292
+ "onUpdate:modelValue": t[0] || (t[0] = (B) => h.value = B),
293
+ class: "w-[320px] xs:w-full",
294
+ autofocus: "",
295
+ placeholder: u(s)("permissionSet.search.placeholder")
296
+ }, null, 8, ["modelValue", "placeholder"])
297
+ ]),
298
+ d.value.length > 0 ? (P(), $("div", we, [
299
+ y("div", ke, [
300
+ r(z, null, {
301
+ default: g(() => [
302
+ r(I, {
303
+ "column-defs": U,
304
+ "row-data": F.value,
305
+ "page-size": F.value.length,
306
+ "pin-header-row": "",
307
+ "hide-footer": "",
308
+ "shrink-at": !1,
309
+ onRowClick: t[1] || (t[1] = (B) => D(B.original))
310
+ }, null, 8, ["row-data", "page-size"])
311
+ ]),
312
+ _: 1
313
+ })
314
+ ])
315
+ ])) : (P(), H(u(me), {
316
+ key: 1,
317
+ title: u(s)("permissionSet.noData.title"),
318
+ subtitle: u(s)("permissionSet.noData.subtitle")
319
+ }, null, 8, ["title", "subtitle"]))
320
+ ])
321
+ ], 64);
322
+ };
323
+ }
324
+ });
325
+ export {
326
+ Le as default
327
+ };