@feedmepos/mf-hrm-portal 2.0.20-dev.1 → 2.0.20-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.
Files changed (31) hide show
  1. package/dist/{AuditLogList-Bsj-qg8n.js → AuditLogList-7E8iWQWx.js} +4 -4
  2. package/dist/EmployeeList-DyNW3cUo.js +851 -0
  3. package/dist/{Main-CSMAtoMj.js → Main-BLJyOcEv.js} +184 -176
  4. package/dist/{Main-BGc6kNaR.js → Main-BZjZxFHp.js} +2008 -2001
  5. package/dist/Main-C9lMH4EN.js +90 -0
  6. package/dist/PermissionSetList-BuCp14Os.js +355 -0
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js} +675 -661
  8. package/dist/RoleList-L8L1xmJ2.js +564 -0
  9. package/dist/TeamMemberList-DEN9rHqb.js +1124 -0
  10. package/dist/{TimesheetList-tFjvFHqH.js → TimesheetList-D88u0GFn.js} +61 -53
  11. package/dist/{app-CL7rUfL3.js → app-g_SrJtfC.js} +191 -193
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-ChdFPuFV.js → dayjs.min-BGHzwXCt.js} +1 -1
  14. package/dist/employee-Dep-q_aU.js +200 -0
  15. package/dist/{iteration-BbD0nOgO.js → iteration-Dc-Bz5bA.js} +173 -175
  16. package/dist/{lodash-CDf3aG6G.js → lodash-Cxw1GZ6L.js} +1 -1
  17. package/dist/{rule-BJ-y3Sp8.js → rule-ClRtpdqO.js} +27 -26
  18. package/dist/src/types/team.d.ts +1 -0
  19. package/dist/style.css +1 -1
  20. package/dist/{timesheet-BmV02Rkz.js → timesheet-CZoSvFYT.js} +2 -2
  21. package/dist/tsconfig.app.tsbuildinfo +1 -1
  22. package/dist/{useAppStore-D8QAGZ02.js → useAppStore-CTBRpqmO.js} +36 -38
  23. package/dist/{useLoading-KpcQw0p4.js → useLoading-XvrLj1VM.js} +1 -1
  24. package/dist/{useReportPermissions-CmGJAz_N.js → useReportPermissions-nivbQm9V.js} +3 -3
  25. package/package.json +1 -1
  26. package/dist/EmployeeList-Cy2ayCko.js +0 -824
  27. package/dist/Main-D7bV8EuC.js +0 -86
  28. package/dist/PermissionSetList-CuHhDqWl.js +0 -347
  29. package/dist/RoleList-e0WUqt4Y.js +0 -545
  30. package/dist/TeamMemberList-CpPa1KyV.js +0 -1097
  31. package/dist/employee-kKV7UnHU.js +0 -204
@@ -0,0 +1,90 @@
1
+ import { defineComponent as T, ref as R, computed as m, resolveComponent as s, createBlock as i, openBlock as c, withCtx as p, createElementVNode as A, createVNode as d, resolveDynamicComponent as C, createCommentVNode as S } from "vue";
2
+ import { useRouter as y, useRoute as g } from "vue-router";
3
+ import { useI18n as k } from "@feedmepos/mf-common";
4
+ import { _ as F } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
+ import { _ as N } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
+ import { u as h } from "./iteration-Dc-Bz5bA.js";
7
+ import "@feedmepos/ui-library";
8
+ import "./rule-ClRtpdqO.js";
9
+ import "./lodash-Cxw1GZ6L.js";
10
+ import "./useAppStore-CTBRpqmO.js";
11
+ import { R as v } from "./app-g_SrJtfC.js";
12
+ /* empty css */
13
+ /* empty css */
14
+ const w = { class: "space-y-24" }, Q = /* @__PURE__ */ T({
15
+ __name: "Main",
16
+ setup(x) {
17
+ const { t: a } = k(), _ = y(), B = g(), { readRestaurants: L } = h(), f = R(), b = R(), o = m({
18
+ get: () => B.name === v.TEAM_ROLE ? "role" : "member",
19
+ set: (e) => {
20
+ _.push({
21
+ name: e === "role" ? v.TEAM_ROLE : v.TEAM_MEMBER,
22
+ query: _.currentRoute.value.query
23
+ });
24
+ }
25
+ });
26
+ L();
27
+ const r = m(() => l.value.find((e) => e.value === o.value) || l.value[0]), l = m(() => [
28
+ {
29
+ label: a("team.title"),
30
+ value: "member",
31
+ createButtonLabel: a("team.actions.addMember"),
32
+ createButtonAction: () => {
33
+ var e;
34
+ (e = f.value) == null || e.create();
35
+ }
36
+ },
37
+ {
38
+ label: a("permissionSet.title"),
39
+ value: "role",
40
+ createButtonLabel: a("permissionSet.createButtonLabel"),
41
+ createButtonAction: () => {
42
+ var e;
43
+ (e = b.value) == null || e.create();
44
+ }
45
+ }
46
+ ]);
47
+ return (e, n) => {
48
+ const E = s("FmSpacer"), M = s("FmTabs"), V = s("RouterView");
49
+ return c(), i(N, {
50
+ heading: r.value.label
51
+ }, {
52
+ "append-heading": p(() => {
53
+ var t;
54
+ return [
55
+ d(E),
56
+ (t = r.value) != null && t.createButtonLabel ? (c(), i(F, {
57
+ key: 0,
58
+ icon: "add",
59
+ label: r.value.createButtonLabel,
60
+ onClick: n[0] || (n[0] = (u) => r.value.createButtonAction())
61
+ }, null, 8, ["label"])) : S("", !0)
62
+ ];
63
+ }),
64
+ default: p(() => [
65
+ A("div", w, [
66
+ d(M, {
67
+ modelValue: o.value,
68
+ "onUpdate:modelValue": n[1] || (n[1] = (t) => o.value = t),
69
+ items: l.value
70
+ }, null, 8, ["modelValue", "items"]),
71
+ d(V, null, {
72
+ default: p(({ Component: t }) => [
73
+ (c(), i(C(t), {
74
+ ref: (u) => {
75
+ o.value === "member" && (f.value = u), o.value === "role" && (b.value = u);
76
+ }
77
+ }, null, 512))
78
+ ]),
79
+ _: 1
80
+ })
81
+ ])
82
+ ]),
83
+ _: 1
84
+ }, 8, ["heading"]);
85
+ };
86
+ }
87
+ });
88
+ export {
89
+ Q as default
90
+ };
@@ -0,0 +1,355 @@
1
+ import { defineComponent as H, ref as p, computed as _, watch as ie, resolveComponent as f, createBlock as M, openBlock as A, unref as r, withCtx as j, createVNode as u, createElementVNode as E, toDisplayString as ae, nextTick as le, onMounted as re, createElementBlock as me, Fragment as ce, h as b } from "vue";
2
+ import { useI18n as Q, useCoreStore as ue } from "@feedmepos/mf-common";
3
+ import { useSnackbar as Y, useDialog as de, useBreakpoints as pe, components as J } 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 Z, c as ee, d as se, p as X, 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-ClRtpdqO.js";
7
+ import { l as q } from "./lodash-Cxw1GZ6L.js";
8
+ import { d as Fe, A as ke } from "./iteration-Dc-Bz5bA.js";
9
+ import { u as xe } from "./useLoading-XvrLj1VM.js";
10
+ import { b as G } from "./app-g_SrJtfC.js";
11
+ import { _ as Ce } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js";
12
+ const Ve = { class: "flex w-full items-center justify-between" }, Re = { class: "fm-typo-en-title-md-600" }, Ie = { class: "flex items-center justify-start gap-8" }, je = /* @__PURE__ */ H({
13
+ __name: "PermissionSetForm",
14
+ props: {
15
+ modelValue: {
16
+ type: Object,
17
+ default: () => ({})
18
+ }
19
+ },
20
+ setup(K, { expose: N }) {
21
+ const s = K, { t: a } = Q(), v = p(!1), B = _(() => {
22
+ var e;
23
+ return (e = s.modelValue) != null && e.id ? a("permissionSet.form.update.title") : a("permissionSet.form.create.title");
24
+ }), C = p(), O = Y(), V = xe(O), h = Z(), l = p({ ...s.modelValue }), i = p([]), c = p([]), R = [(e) => !!e || a("permissionSet.form.nameRequired")], z = _(() => {
25
+ var e;
26
+ return (e = s.modelValue) != null && e.id ? a("permissionSet.form.update.confirmButtonLabel") : a("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
+ () => ee(i.value, h.permissionSets.value)
34
+ ), {
35
+ fetchCustomReportPermissions: U,
36
+ customReportPermissions: $,
37
+ isLoaded: n
38
+ } = se(), t = new Set(
39
+ X.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 X)
47
+ o.category === G.reports && e.add(o.subject);
48
+ for (const o of $.value)
49
+ o.category === G.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, l.value = { ...s.modelValue }, i.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: l.value.name ?? "",
61
+ permissionSetIds: [...i.value],
62
+ userPermissions: Fe(c.value)
63
+ };
64
+ }
65
+ ie(v, async (e) => {
66
+ e && await U();
67
+ });
68
+ const w = ve(
69
+ () => !q.isEqual(l.value.name ?? "", S.value.name) || !q.isEqual(i.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 oe() {
79
+ c.value = D(g.value);
80
+ }
81
+ async function te() {
82
+ var d, F;
83
+ const e = await ((d = C.value) == null ? void 0 : d.validateInputsWithoutSubmit()), o = (F = ue().currentBusiness.value) == null ? void 0 : F.id;
84
+ !(e != null && e.length) && o && V.minor(async () => {
85
+ var L;
86
+ const k = W();
87
+ if ((L = s.modelValue) != null && L.id) {
88
+ const x = {
89
+ name: l.value.name,
90
+ permissions: k,
91
+ permissionSetIds: i.value,
92
+ businessId: l.value.businessId
93
+ };
94
+ await h.updatePermissionSet(s.modelValue.id, x);
95
+ } else {
96
+ const x = {
97
+ name: l.value.name,
98
+ businessId: o,
99
+ permissions: k,
100
+ permissionSetIds: i.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"), ne = f("FmSideSheet");
111
+ return A(), M(ne, {
112
+ "model-value": v.value,
113
+ "max-width": 960,
114
+ "close-button": !1,
115
+ "onOn:clickedAway": r(w)
116
+ }, {
117
+ "side-sheet-header": j(() => [
118
+ E("div", Ve, [
119
+ E("p", Re, ae(B.value), 1),
120
+ u(d, {
121
+ name: "close",
122
+ size: "md",
123
+ class: "cursor-pointer",
124
+ onClick: r(w)
125
+ }, null, 8, ["onClick"])
126
+ ])
127
+ ]),
128
+ "side-sheet-footer": j(() => [
129
+ E("div", Ie, [
130
+ u(x, {
131
+ label: z.value,
132
+ size: "md",
133
+ variant: "primary",
134
+ type: "submit",
135
+ onClick: te
136
+ }, null, 8, ["label"]),
137
+ u(x, {
138
+ label: r(a)("common.cancel"),
139
+ size: "md",
140
+ variant: "secondary",
141
+ onClick: r(w)
142
+ }, null, 8, ["label", "onClick"])
143
+ ])
144
+ ]),
145
+ default: j(() => [
146
+ u(L, {
147
+ ref_key: "formRef",
148
+ ref: C
149
+ }, {
150
+ default: j(() => [
151
+ u(F, {
152
+ modelValue: l.value.name,
153
+ "onUpdate:modelValue": o[0] || (o[0] = (I) => l.value.name = I),
154
+ label: r(a)("permissionSet.form.name"),
155
+ placeholder: r(a)("permissionSet.form.namePlaceholder"),
156
+ rules: R
157
+ }, null, 8, ["modelValue", "label", "placeholder"]),
158
+ u(k, {
159
+ modelValue: i.value,
160
+ "onUpdate:modelValue": [
161
+ o[1] || (o[1] = (I) => i.value = I),
162
+ oe
163
+ ],
164
+ multiselect: "",
165
+ searchable: "",
166
+ "search-debounce": 300,
167
+ items: T.value,
168
+ label: r(a)("permissionSet.form.includedSets"),
169
+ placeholder: r(a)("permissionSet.form.includedSetsPlaceholder"),
170
+ class: "mt-16"
171
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
172
+ u(Ce, {
173
+ modelValue: c.value,
174
+ "onUpdate:modelValue": o[2] || (o[2] = (I) => c.value = I),
175
+ "inherit-permissions": g.value,
176
+ class: "mt-24"
177
+ }, null, 8, ["modelValue", "inherit-permissions"])
178
+ ]),
179
+ _: 1
180
+ }, 512)
181
+ ]),
182
+ _: 1
183
+ }, 8, ["model-value", "onOn:clickedAway"]);
184
+ };
185
+ }
186
+ }), Ee = { class: "space-y-8" }, Be = { class: "flex justify-end xs:px-16" }, Me = /* @__PURE__ */ H({
187
+ __name: "PermissionSetList",
188
+ setup(K, { expose: N }) {
189
+ const { t: s } = Q(), { customReportPermissions: a, fetchCustomReportPermissions: v } = se(), B = Y(), C = de(), { breakpoints: O } = pe(), V = p(""), h = _(() => {
190
+ var n;
191
+ return (n = c.value) == null ? void 0 : n.filter((t) => {
192
+ const m = V.value.toLowerCase();
193
+ return t.name.toLowerCase().includes(m);
194
+ });
195
+ }), l = p(), i = Z(), c = _(
196
+ () => i.permissionSets.value
197
+ ), R = p();
198
+ async function z() {
199
+ await i.readPermissionSets();
200
+ }
201
+ function T(n) {
202
+ var t;
203
+ R.value = n, (t = l.value) == null || t.trigger();
204
+ }
205
+ const g = [
206
+ {
207
+ accessorKey: "name",
208
+ header: () => s("permissionSet.table.columns.name")
209
+ },
210
+ {
211
+ accessorKey: "permission",
212
+ header: () => s("permissionSet.table.columns.permissions"),
213
+ enableSorting: !1,
214
+ cell(n) {
215
+ const t = n.row.original, m = ee(
216
+ [t.id],
217
+ i.permissionSets.value
218
+ ), y = D(m), S = y.length, P = we(
219
+ y,
220
+ a.value
221
+ );
222
+ return b("div", { class: "flex items-center gap-8" }, [
223
+ b("span", s("team.labels.allowed", { count: S })),
224
+ b(
225
+ J.FmTooltip,
226
+ { variant: "plain", placement: "top" },
227
+ {
228
+ default: () => b(J.FmIcon, {
229
+ name: "info",
230
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
231
+ }),
232
+ content: () => b("div", [
233
+ s("team.labels.permission"),
234
+ ...P.map(
235
+ (w, W) => b("div", { key: `${w}-${W}` }, `- ${w}`)
236
+ )
237
+ ])
238
+ }
239
+ )
240
+ ]);
241
+ }
242
+ },
243
+ {
244
+ id: "action",
245
+ size: 52,
246
+ meta: {
247
+ cellClass: "pl-16",
248
+ headerContentClass: "-mx-16"
249
+ },
250
+ cell(n) {
251
+ const t = n.row.original;
252
+ return b(
253
+ "div",
254
+ {
255
+ class: "flex w-full items-center justify-end",
256
+ onClick: (m) => m.stopPropagation()
257
+ },
258
+ [
259
+ b(Se, {
260
+ items: [
261
+ { label: s("common.update"), onClick: () => T(t) },
262
+ {
263
+ label: s("common.remove"),
264
+ onClick: () => $(t),
265
+ itemClass: "text-fm-color-typo-error"
266
+ }
267
+ ]
268
+ })
269
+ ]
270
+ );
271
+ },
272
+ enableSorting: !1
273
+ }
274
+ ];
275
+ function U() {
276
+ var n;
277
+ R.value = void 0, (n = l.value) == null || n.trigger();
278
+ }
279
+ async function $(n) {
280
+ C.open({
281
+ title: s("permissionSet.form.delete.title"),
282
+ message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
283
+ minWidth: O.value.lg ? 588 : 0,
284
+ primaryActions: {
285
+ text: s("common.remove"),
286
+ close: !1,
287
+ variant: "destructive"
288
+ },
289
+ secondaryActions: { text: s("common.cancel"), close: !0 }
290
+ }).onPrimary(async () => {
291
+ try {
292
+ await i.deletePermissionSet(n.id), B.open({
293
+ message: s("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
294
+ type: "success"
295
+ });
296
+ } catch (t) {
297
+ const m = t instanceof ke && t.status === 409 ? t.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
298
+ permissionSetName: n.name
299
+ }) : s("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
300
+ B.open({ message: m, type: "error" });
301
+ }
302
+ C.close();
303
+ });
304
+ }
305
+ return re(() => {
306
+ z(), v();
307
+ }), N({
308
+ create: U
309
+ }), (n, t) => {
310
+ const m = f("FmSearch"), y = f("FmTable"), S = f("FullWrapper");
311
+ return A(), me(ce, null, [
312
+ u(je, {
313
+ ref_key: "permissionSetFormRef",
314
+ ref: l,
315
+ "model-value": R.value
316
+ }, null, 8, ["model-value"]),
317
+ E("div", Ee, [
318
+ E("div", Be, [
319
+ u(m, {
320
+ modelValue: V.value,
321
+ "onUpdate:modelValue": t[0] || (t[0] = (P) => V.value = P),
322
+ class: "w-[320px] xs:w-full",
323
+ autofocus: "",
324
+ placeholder: r(s)("permissionSet.search.placeholder")
325
+ }, null, 8, ["modelValue", "placeholder"])
326
+ ]),
327
+ c.value.length > 0 ? (A(), M(S, {
328
+ key: 0,
329
+ class: "overflow-auto"
330
+ }, {
331
+ default: j(() => [
332
+ u(y, {
333
+ "column-defs": g,
334
+ "row-data": h.value,
335
+ "page-size": h.value.length,
336
+ "pin-header-row": "",
337
+ "hide-footer": "",
338
+ "shrink-at": !1,
339
+ onRowClick: t[1] || (t[1] = (P) => T(P.original))
340
+ }, null, 8, ["row-data", "page-size"])
341
+ ]),
342
+ _: 1
343
+ })) : (A(), M(r(fe), {
344
+ key: 1,
345
+ title: r(s)("permissionSet.noData.title"),
346
+ subtitle: r(s)("permissionSet.noData.subtitle")
347
+ }, null, 8, ["title", "subtitle"]))
348
+ ])
349
+ ], 64);
350
+ };
351
+ }
352
+ });
353
+ export {
354
+ Me as default
355
+ };