@feedmepos/mf-hrm-portal 2.0.6-dev → 2.0.6-dev.1

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 (50) hide show
  1. package/dist/{AuditLogList-BxigxQv3.js → AuditLogList-C23_MiyK.js} +31 -30
  2. package/dist/{EmployeeList-DyvqwZtw.js → EmployeeList-vXPEVqoh.js} +164 -169
  3. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
  4. package/dist/HorizontalSplitter-o860F4xM.js +12 -0
  5. package/dist/Main-CQWe1-SW.js +599 -0
  6. package/dist/{Main-B8tSMq-U.js → Main-DC9H9bAs.js} +11 -10
  7. package/dist/{Main-CtH5MCty.js → Main-k56Iy_zg.js} +8 -7
  8. package/dist/PermissionSetList-B8tJCNpR.js +338 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BPJpVG8_.js +3356 -0
  10. package/dist/{RoleList-jykDD_zm.js → RoleList-C5WA3Kxu.js} +26 -24
  11. package/dist/TeamMemberList-Ic-iWBHd.js +989 -0
  12. package/dist/{TimesheetList-Bk1XF9xy.js → TimesheetList-DlGpcOUp.js} +11 -10
  13. package/dist/{app-BPlaahxK.js → app-D0xH_99A.js} +1310 -937
  14. package/dist/app.js +2 -2
  15. package/dist/{dayjs.min-LweNOSZ_.js → dayjs.min-C1rTVn8X.js} +1 -1
  16. package/dist/{employee-DPfiL6rd.js → employee-BK4sYiRy.js} +21 -20
  17. package/dist/index-C2ubYSVV.js +968 -0
  18. package/dist/{index-BAhsHYNv.js → index-DSAB4vz3.js} +1 -1
  19. package/dist/{index-CBxn7cxI.js → iteration-BSGKcAZm.js} +3416 -4256
  20. package/dist/{lodash-D1uG3PY3.js → lodash-CeTePH4O.js} +1 -1
  21. package/dist/src/api/grant-user/index.d.ts +8 -0
  22. package/dist/src/api/index.d.ts +3 -1
  23. package/dist/src/api/permission-assignment/index.d.ts +3 -0
  24. package/dist/src/api/report-query/index.d.ts +1 -0
  25. package/dist/src/composables/useCustomReportPermissions.d.ts +7 -0
  26. package/dist/src/helpers/permission-set.d.ts +32 -1
  27. package/dist/src/helpers/permission-set.test.d.ts +1 -0
  28. package/dist/src/helpers/rule.d.ts +4 -1
  29. package/dist/src/router/shared.d.ts +2 -1
  30. package/dist/src/stores/grant-user.d.ts +86 -0
  31. package/dist/src/types/grant-user.d.ts +27 -0
  32. package/dist/src/types/report-query.d.ts +1 -0
  33. package/dist/src/views/grant/GrantUserList.vue.d.ts +17 -0
  34. package/dist/src/views/grant/Main.vue.d.ts +2 -0
  35. package/dist/src/views/grant/components/GrantUserForm.vue.d.ts +17 -0
  36. package/dist/src/views/grant/locales/index.d.ts +232 -0
  37. package/dist/src/views/team/components/BasePermission.vue.d.ts +17 -0
  38. package/dist/{team-B1osnB4U.js → team-B25hRkju.js} +1 -1
  39. package/dist/{timesheet-rte2utJf.js → timesheet-C8oy-bxz.js} +10 -9
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{useAppStore-CqrjwnF_.js → useAppStore-WGnUS7Wm.js} +1 -1
  42. package/dist/{useLoading-B5IjfVEP.js → useLoading-BCi2g_rf.js} +1 -1
  43. package/dist/useReportPermissions--LOfl1e-.js +60 -0
  44. package/dist/useRestaurantMap-e9fQJiLC.js +39 -0
  45. package/package.json +2 -2
  46. package/dist/PermissionSetList-DCONmOgn.js +0 -323
  47. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-07Dsea27.js +0 -3092
  48. package/dist/TeamMemberList-DMrPgF1l.js +0 -973
  49. package/dist/useReportPermissions-C4Q29AQJ.js +0 -65
  50. package/dist/useRestaurantMap-D5BNPLKh.js +0 -107
@@ -3,16 +3,17 @@ 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-WGnUS7Wm.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-BK4sYiRy.js";
10
+ import "./lodash-CeTePH4O.js";
11
+ import "./iteration-BSGKcAZm.js";
12
+ import { R as vt } from "./app-D0xH_99A.js";
13
+ import "./index-C2ubYSVV.js";
14
+ import "./useReportPermissions--LOfl1e-.js";
15
+ import "./dayjs.min-C1rTVn8X.js";
16
+ import "./timesheet-C8oy-bxz.js";
16
17
  var In = {};
17
18
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
18
19
  var jt = {};
@@ -15483,7 +15484,7 @@ var Yt = {
15483
15484
  const f2 = {
15484
15485
  key: 0,
15485
15486
  class: "mr-16"
15486
- }, l2 = { class: "space-y-24" }, y2 = /* @__PURE__ */ rf({
15487
+ }, l2 = { class: "space-y-24" }, O2 = /* @__PURE__ */ rf({
15487
15488
  __name: "Main",
15488
15489
  setup(e) {
15489
15490
  const t = of(), r = cf(), { readTeamMemberPosUserIds: n } = mf(), { restaurants: a, currentBusiness: i, readRestaurants: s } = hf(), { readRoles: f, roles: o } = df(), { t: l } = uf(), c = yn(), d = yn(), p = yn(), v = On({
@@ -15603,5 +15604,5 @@ const f2 = {
15603
15604
  }
15604
15605
  });
15605
15606
  export {
15606
- y2 as default
15607
+ O2 as default
15607
15608
  };
@@ -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 "./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-C2ubYSVV.js";
8
+ import "./iteration-BSGKcAZm.js";
9
+ import { R as v } from "./app-D0xH_99A.js";
10
+ import "./useAppStore-WGnUS7Wm.js";
11
+ import "./index-DSAB4vz3.js";
11
12
  /* empty css */
12
13
  /* empty css */
13
- import "./team-B1osnB4U.js";
14
- const w = { class: "space-y-24" }, P = /* @__PURE__ */ V({
14
+ import "./team-B25hRkju.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
- P as default
86
+ Q as default
86
87
  };
@@ -0,0 +1,338 @@
1
+ import { defineComponent as q, computed as S, resolveComponent as u, createElementBlock as E, openBlock as g, createElementVNode as y, createVNode as r, toDisplayString as N, unref as c, withCtx as P, createTextVNode as te, Fragment as X, renderList as oe, ref as b, createBlock as H, nextTick as ne, onMounted as ie, h as z } from "vue";
2
+ import { useI18n as M, useCoreStore as ae } from "@feedmepos/mf-common";
3
+ import { useSnackbar as Q, useDialog as le, useBreakpoints as re, components as me, FmButtonColorThemeVariant as ce, FmButtonVariant as ue } from "@feedmepos/ui-library";
4
+ import { _ as de } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
+ import { j as K, w as pe, u as Y, c as Z, p as G, k as fe, d as ve, m as A, n as Se, o as _e, s as be, q as he } from "./index-C2ubYSVV.js";
6
+ import { A as Pe } from "./iteration-BSGKcAZm.js";
7
+ import { u as ge } from "./useLoading-BCi2g_rf.js";
8
+ import { i as J } from "./app-D0xH_99A.js";
9
+ import { a as ye } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BPJpVG8_.js";
10
+ const Fe = { class: "flex flex-row items-center gap-8" }, Ve = /* @__PURE__ */ q({
11
+ __name: "PermissionWithTooltip",
12
+ props: {
13
+ modelValue: {
14
+ type: Array,
15
+ required: !0
16
+ }
17
+ },
18
+ setup($) {
19
+ const { customReportPermissions: k } = K(), t = $, i = S(() => pe(t.modelValue, k.value)), { t: l } = M();
20
+ return (R, C) => {
21
+ const h = u("FmIcon"), F = u("FmTooltip");
22
+ return g(), E("div", Fe, [
23
+ y("span", null, N(c(l)("team.labels.allowed", { count: i.value.length })), 1),
24
+ r(F, {
25
+ variant: "plain",
26
+ placement: "top"
27
+ }, {
28
+ content: P(() => [
29
+ y("div", null, [
30
+ te(N(c(l)("team.labels.permission")) + " ", 1),
31
+ (g(!0), E(X, null, oe(i.value, (m, a) => (g(), E("div", {
32
+ key: `${m}-${a}`
33
+ }, " - " + N(m), 1))), 128))
34
+ ])
35
+ ]),
36
+ default: P(() => [
37
+ r(h, {
38
+ name: "info",
39
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
40
+ })
41
+ ]),
42
+ _: 1
43
+ })
44
+ ]);
45
+ };
46
+ }
47
+ }), we = { class: "fm-typo-en-title-md-600" }, xe = { class: "flex items-center justify-start gap-8" }, ke = /* @__PURE__ */ q({
48
+ __name: "PermissionSetForm",
49
+ props: {
50
+ modelValue: {
51
+ type: Object,
52
+ default: () => ({})
53
+ }
54
+ },
55
+ setup($, { expose: k }) {
56
+ const t = $, { t: i } = M(), l = b(!1), R = S(() => {
57
+ var e;
58
+ return (e = t.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
59
+ }), C = b(), h = Q(), F = ge(h), m = Y(), a = b({ ...t.modelValue }), d = b([]), p = b([]), D = [(e) => !!e || "Permission set name is required"], U = S(() => {
60
+ var e;
61
+ return (e = t.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
62
+ }), W = S(
63
+ () => m.permissionSets.value.filter((e) => {
64
+ var s;
65
+ return e.id !== ((s = t.modelValue) == null ? void 0 : s.id);
66
+ }).map((e) => ({ label: e.name, value: e.id }))
67
+ ), V = S(
68
+ () => Z(d.value, m.permissionSets.value)
69
+ ), { customReportPermissions: L, isLoaded: n } = K(), o = new Set(
70
+ G.filter((e) => e.subject.startsWith(fe)).map((e) => e.subject)
71
+ ), f = S(() => {
72
+ const e = new Set(o);
73
+ for (const s of L.value) e.add(s.subject);
74
+ return e;
75
+ }), j = S(() => {
76
+ const e = /* @__PURE__ */ new Set();
77
+ for (const s of G)
78
+ s.category === J.reports && e.add(s.subject);
79
+ for (const s of L.value)
80
+ s.category === J.reports && e.add(s.subject);
81
+ return e;
82
+ });
83
+ async function O() {
84
+ var s, v;
85
+ await ne(), l.value = !l.value, a.value = { ...t.modelValue }, d.value = ((s = t.modelValue) == null ? void 0 : s.permissionSetIds) ?? [];
86
+ const e = ((v = t.modelValue) == null ? void 0 : v.permissions) ?? [];
87
+ p.value = ve(
88
+ A(V.value),
89
+ e
90
+ );
91
+ }
92
+ function I() {
93
+ const e = A(V.value), s = n.value ? f.value : o, v = Se(p.value, s), w = _e(v, j.value), x = be(w);
94
+ return he(e, x);
95
+ }
96
+ function ee() {
97
+ p.value = A(V.value);
98
+ }
99
+ async function se() {
100
+ var v, w;
101
+ const e = await ((v = C.value) == null ? void 0 : v.validateInputsWithoutSubmit()), s = (w = ae().currentBusiness.value) == null ? void 0 : w.id;
102
+ !(e != null && e.length) && s && F.minor(async () => {
103
+ var T;
104
+ const x = I();
105
+ if ((T = t.modelValue) != null && T.id) {
106
+ const B = {
107
+ name: a.value.name,
108
+ permissions: x,
109
+ permissionSetIds: d.value,
110
+ businessId: a.value.businessId
111
+ };
112
+ await m.updatePermissionSet(t.modelValue.id, B);
113
+ } else {
114
+ const B = {
115
+ name: a.value.name,
116
+ businessId: s,
117
+ permissions: x,
118
+ permissionSetIds: d.value
119
+ };
120
+ await m.createPermissionSet(B);
121
+ }
122
+ l.value = !1;
123
+ });
124
+ }
125
+ return k({
126
+ trigger: O
127
+ }), (e, s) => {
128
+ const v = u("FmTextField"), w = u("FmSelect"), x = u("FmForm"), T = u("FmButton"), B = u("FmSideSheet");
129
+ return g(), H(B, {
130
+ modelValue: l.value,
131
+ "onUpdate:modelValue": s[4] || (s[4] = (_) => l.value = _),
132
+ "max-width": 560,
133
+ "dismiss-away": ""
134
+ }, {
135
+ "side-sheet-header": P(() => [
136
+ y("p", we, N(R.value), 1)
137
+ ]),
138
+ "side-sheet-footer": P(() => [
139
+ y("div", xe, [
140
+ r(T, {
141
+ label: U.value,
142
+ size: "md",
143
+ variant: "primary",
144
+ type: "submit",
145
+ onClick: se
146
+ }, null, 8, ["label"]),
147
+ r(T, {
148
+ label: c(i)("common.cancel"),
149
+ size: "md",
150
+ variant: "secondary",
151
+ onClick: s[3] || (s[3] = (_) => l.value = !1)
152
+ }, null, 8, ["label"])
153
+ ])
154
+ ]),
155
+ default: P(() => [
156
+ r(x, {
157
+ ref_key: "formRef",
158
+ ref: C
159
+ }, {
160
+ default: P(() => [
161
+ r(v, {
162
+ modelValue: a.value.name,
163
+ "onUpdate:modelValue": s[0] || (s[0] = (_) => a.value.name = _),
164
+ label: c(i)("permissionSet.form.name"),
165
+ placeholder: c(i)("permissionSet.form.namePlaceholder"),
166
+ rules: D
167
+ }, null, 8, ["modelValue", "label", "placeholder"]),
168
+ r(w, {
169
+ modelValue: d.value,
170
+ "onUpdate:modelValue": [
171
+ s[1] || (s[1] = (_) => d.value = _),
172
+ ee
173
+ ],
174
+ multiselect: "",
175
+ searchable: "",
176
+ "search-debounce": 300,
177
+ items: W.value,
178
+ label: c(i)("permissionSet.form.includedSets"),
179
+ placeholder: c(i)("permissionSet.form.includedSetsPlaceholder"),
180
+ class: "mt-16"
181
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
182
+ r(ye, {
183
+ modelValue: p.value,
184
+ "onUpdate:modelValue": s[2] || (s[2] = (_) => p.value = _),
185
+ "inherit-permissions": V.value,
186
+ class: "mt-24"
187
+ }, null, 8, ["modelValue", "inherit-permissions"])
188
+ ]),
189
+ _: 1
190
+ }, 512)
191
+ ]),
192
+ _: 1
193
+ }, 8, ["modelValue"]);
194
+ };
195
+ }
196
+ }), Re = { class: "space-y-8" }, Ce = { class: "flex justify-end xs:px-16" }, je = {
197
+ key: 0,
198
+ class: "overflow-auto"
199
+ }, Ie = { class: "pb-64" }, We = /* @__PURE__ */ q({
200
+ __name: "PermissionSetList",
201
+ setup($, { expose: k }) {
202
+ const { t } = M(), { fetchCustomReportPermissions: i } = K(), l = Q(), R = le(), { breakpoints: C } = re(), h = b(""), F = S(() => {
203
+ var n;
204
+ return (n = d.value) == null ? void 0 : n.filter((o) => {
205
+ const f = h.value.toLowerCase();
206
+ return o.name.toLowerCase().includes(f);
207
+ });
208
+ }), m = b(), a = Y(), d = S(
209
+ () => a.permissionSets.value
210
+ ), p = b();
211
+ async function D() {
212
+ await a.readPermissionSets();
213
+ }
214
+ function U(n) {
215
+ var o;
216
+ p.value = n, (o = m.value) == null || o.trigger();
217
+ }
218
+ const W = [
219
+ {
220
+ accessorKey: "name",
221
+ header: () => t("permissionSet.table.columns.name")
222
+ },
223
+ {
224
+ accessorKey: "permission",
225
+ header: () => t("permissionSet.table.columns.permissions"),
226
+ enableSorting: !1,
227
+ cell(n) {
228
+ const o = n.row.original, f = Z(
229
+ [o.id],
230
+ a.permissionSets.value
231
+ ), j = A(f);
232
+ return z(Ve, { modelValue: j });
233
+ }
234
+ },
235
+ {
236
+ id: "action",
237
+ meta: {
238
+ cellClass: "pl-16",
239
+ headerContentClass: "-mx-16"
240
+ },
241
+ cell(n) {
242
+ return z("div", { class: "w-full flex justify-end items-center" }, [
243
+ z(me.FmButton, {
244
+ prependIcon: "delete",
245
+ variant: ue.Tertiary,
246
+ textColor: ce.NeutralGray400,
247
+ class: "flex flex-end",
248
+ onClick: (o) => {
249
+ o.stopPropagation(), L(n.row.original);
250
+ }
251
+ })
252
+ ]);
253
+ },
254
+ enableSorting: !1
255
+ }
256
+ ];
257
+ function V() {
258
+ var n;
259
+ p.value = void 0, (n = m.value) == null || n.trigger();
260
+ }
261
+ async function L(n) {
262
+ R.open({
263
+ title: t("permissionSet.form.delete.title"),
264
+ message: t("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
265
+ minWidth: C.value.lg ? 588 : 0,
266
+ primaryActions: {
267
+ text: t("common.remove"),
268
+ close: !1,
269
+ variant: "destructive"
270
+ },
271
+ secondaryActions: { text: t("common.cancel"), close: !0 }
272
+ }).onPrimary(async () => {
273
+ try {
274
+ await a.deletePermissionSet(n.id), l.open({
275
+ message: t("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
276
+ type: "success"
277
+ });
278
+ } catch (o) {
279
+ const f = o instanceof Pe && o.status === 409 ? o.message.includes("referenced by") ? t("permissionSet.form.delete.setReferencedConflictError", {
280
+ permissionSetName: n.name
281
+ }) : t("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : o instanceof Error ? o.message : `${o}`;
282
+ l.open({ message: f, type: "error" });
283
+ }
284
+ R.close();
285
+ });
286
+ }
287
+ return ie(() => {
288
+ D(), i();
289
+ }), k({
290
+ create: V
291
+ }), (n, o) => {
292
+ const f = u("FmSearch"), j = u("FmTable"), O = u("FullWrapper");
293
+ return g(), E(X, null, [
294
+ r(ke, {
295
+ ref_key: "permissionSetFormRef",
296
+ ref: m,
297
+ "model-value": p.value
298
+ }, null, 8, ["model-value"]),
299
+ y("div", Re, [
300
+ y("div", Ce, [
301
+ r(f, {
302
+ modelValue: h.value,
303
+ "onUpdate:modelValue": o[0] || (o[0] = (I) => h.value = I),
304
+ class: "w-[320px] xs:w-full",
305
+ autofocus: "",
306
+ placeholder: c(t)("permissionSet.search.placeholder")
307
+ }, null, 8, ["modelValue", "placeholder"])
308
+ ]),
309
+ d.value.length > 0 ? (g(), E("div", je, [
310
+ y("div", Ie, [
311
+ r(O, null, {
312
+ default: P(() => [
313
+ r(j, {
314
+ "column-defs": W,
315
+ "row-data": F.value,
316
+ "page-size": F.value.length,
317
+ "pin-header-row": "",
318
+ "hide-footer": "",
319
+ "shrink-at": !1,
320
+ onRowClick: o[1] || (o[1] = (I) => U(I.original))
321
+ }, null, 8, ["row-data", "page-size"])
322
+ ]),
323
+ _: 1
324
+ })
325
+ ])
326
+ ])) : (g(), H(c(de), {
327
+ key: 1,
328
+ title: c(t)("permissionSet.noData.title"),
329
+ subtitle: c(t)("permissionSet.noData.subtitle")
330
+ }, null, 8, ["title", "subtitle"]))
331
+ ])
332
+ ], 64);
333
+ };
334
+ }
335
+ });
336
+ export {
337
+ We as default
338
+ };