@feedmepos/mf-hrm-portal 2.0.17-dev.3 → 2.0.17-dev.5

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 (41) hide show
  1. package/dist/AuditLogList-Dl3Nmf00.js +1011 -0
  2. package/dist/EmployeeList-DBd_rVW2.js +831 -0
  3. package/dist/{Main-Dkr5lzbv.js → Main-CQ3KwxDY.js} +1368 -1371
  4. package/dist/{Main--tejoyEP.js → Main-pTgqNncY.js} +125 -125
  5. package/dist/{Main-BNXKItvX.js → Main-w0XUUaBp.js} +6 -6
  6. package/dist/PermissionSetList-B8qNOWH6.js +347 -0
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BBsaxaXu.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js} +1064 -1060
  8. package/dist/{RoleList-SZCgvYvC.js → RoleList-DMFJsUZv.js} +202 -200
  9. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +16 -0
  10. package/dist/TeamMemberList-BLRTfKLz.js +1031 -0
  11. package/dist/{TimesheetList-D-3k0Uad.js → TimesheetList-Bwp9_xHe.js} +6 -6
  12. package/dist/{app-BjXuSCis.js → app-COJbSNM4.js} +1975 -1440
  13. package/dist/app.js +1 -1
  14. package/dist/{dayjs.min-z-vrgFCL.js → dayjs.min-CcBi6N-K.js} +1 -1
  15. package/dist/{employee-DAqAMupR.js → employee-xiV0LfnL.js} +3 -3
  16. package/dist/{iteration-Cp1eSTJA.js → iteration-JOKbtlLf.js} +1 -1
  17. package/dist/{lodash-CXLZQQp8.js → lodash-D5xlVzib.js} +1 -1
  18. package/dist/rule-3sXHiW0y.js +994 -0
  19. package/dist/src/api/audit-log/index.d.ts +9 -0
  20. package/dist/src/api/report-query/index.d.ts +2 -2
  21. package/dist/src/components/Skeleton.vue.d.ts +7 -0
  22. package/dist/src/composables/useBasePermission.d.ts +1 -0
  23. package/dist/src/stores/team.d.ts +6 -6
  24. package/dist/src/types/team.d.ts +1 -1
  25. package/dist/src/views/hr/locales/index.d.ts +172 -0
  26. package/dist/src/views/team/components/BasePermission.vue.d.ts +1 -1
  27. package/dist/src/views/team/locales/index.d.ts +312 -0
  28. package/dist/style.css +1 -1
  29. package/dist/{team-CnQ_rIx2.js → team-CyNektSD.js} +1 -1
  30. package/dist/{timesheet-BlPhOifI.js → timesheet-DkD3AysG.js} +2 -2
  31. package/dist/tsconfig.app.tsbuildinfo +1 -1
  32. package/dist/{useAppStore-BVnrWyPF.js → useAppStore-CvmsaYSG.js} +1 -1
  33. package/dist/{useLoading-7ia-Bps7.js → useLoading-4TNmhm5N.js} +1 -1
  34. package/dist/useReportPermissions-CWMFFb8E.js +70 -0
  35. package/package.json +2 -2
  36. package/dist/AuditLogList-C6qAeY5g.js +0 -954
  37. package/dist/EmployeeList-COtXtTqG.js +0 -827
  38. package/dist/PermissionSetList-B_Sdvbu7.js +0 -340
  39. package/dist/TeamMemberList-Dk5HeFfQ.js +0 -1008
  40. package/dist/rule-vBxopbM_.js +0 -990
  41. package/dist/useReportPermissions-C8HMek35.js +0 -60
@@ -1,340 +0,0 @@
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
- };