@feedmepos/mf-hrm-portal 2.1.1-dev.4 → 2.1.1-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 (71) hide show
  1. package/dist/ApprovalCodeList-CXJyMKEg.js +757 -0
  2. package/dist/AuditLogList-CXUkbDyT.js +1145 -0
  3. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  4. package/dist/EmployeeList-BSfUFTcN.js +899 -0
  5. package/dist/{GrantUserList-DoyxknJZ.js → GrantUserList-DKP4MBQM.js} +137 -140
  6. package/dist/{Main-BGONIxo8.js → Main-CblWfQk_.js} +3 -3
  7. package/dist/{Main-B5BKGpLg.js → Main-CyCfz4ka.js} +1029 -1033
  8. package/dist/{Main-DQj4xtkB.js → Main-Cz1pfe2k.js} +7 -7
  9. package/dist/PermissionSetList-BwyblSeE.js +357 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BJ-PZ2Nv.js +3458 -0
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DVVSBIx2.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js} +0 -1
  12. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
  13. package/dist/RoleList-CXYgCmHp.js +567 -0
  14. package/dist/TeamMemberList-CnLbqaPS.js +1131 -0
  15. package/dist/{TimesheetList-DwIcsOM-.js → TimesheetList-s_bP5OGA.js} +112 -118
  16. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-B9qlQ6KG.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-BCLv-2Re.js} +2 -2
  17. package/dist/{app-BZwE2coe.js → app-BP0oihBR.js} +2359 -5361
  18. package/dist/app.js +1 -1
  19. package/dist/{dayjs.min-BXBPls4m.js → dayjs.min-BTSZLci9.js} +1 -1
  20. package/dist/{employee-CJTbs1f7.js → employee-BPv1j6T4.js} +3 -3
  21. package/dist/{iteration-BCbIbdHR.js → iteration-BNA1cEos.js} +1 -1
  22. package/dist/{lodash-CUIS1iIz.js → lodash-DKG9IyB-.js} +1 -1
  23. package/dist/{role-CzXchcSS.js → role-BS3LFO8u.js} +1 -1
  24. package/dist/rule-DaSLVZWm.js +996 -0
  25. package/dist/src/api/audit-log/index.d.ts +0 -6
  26. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  27. package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +1 -7
  28. package/dist/src/components/table/TableEmptyState.vue.d.ts +15 -7
  29. package/dist/src/composables/useBasePermission.d.ts +1 -2
  30. package/dist/src/helpers/permission-set.d.ts +4 -8
  31. package/dist/src/helpers/rule.d.ts +1 -2
  32. package/dist/src/stores/approval-code.d.ts +6 -6
  33. package/dist/src/stores/permission-set.d.ts +3 -12
  34. package/dist/src/types/approval-code.d.ts +51 -26
  35. package/dist/src/types/audit-log.d.ts +1 -1
  36. package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +1 -1
  37. package/dist/src/views/approval-code/locales/index.d.ts +4 -12
  38. package/dist/src/views/audit-log/locales/index.d.ts +0 -296
  39. package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +0 -1
  40. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -13
  41. package/dist/src/views/team/locales/index.d.ts +0 -80
  42. package/dist/style.css +1 -1
  43. package/dist/tsconfig.app.tsbuildinfo +1 -1
  44. package/dist/useDebounce-CWb5QR9G.js +28 -0
  45. package/dist/{useReportPermissions-Q-xLwz5N.js → useReportPermissions-J3-DjopO.js} +3 -3
  46. package/package.json +2 -2
  47. package/dist/ApprovalCodeList-B0PLZwav.js +0 -758
  48. package/dist/AuditLogList-CRXwPImZ.js +0 -1611
  49. package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-zJwkM_Xb.js +0 -387
  50. package/dist/EmployeeList-DN2pnXcS.js +0 -884
  51. package/dist/PermissionSetList-4uIU9FvN.js +0 -393
  52. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-D0luaKDb.js +0 -4122
  53. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +0 -42
  54. package/dist/RoleList-Bj5Y5jd_.js +0 -685
  55. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
  56. package/dist/TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js +0 -37
  57. package/dist/TeamMemberList-Byjlca2Y.js +0 -1216
  58. package/dist/rule-BO6xj2Xa.js +0 -1058
  59. package/dist/src/composables/useConditionDraft.d.ts +0 -40
  60. package/dist/src/composables/useCoverConditionOverride.d.ts +0 -61
  61. package/dist/src/helpers/business-timezone.d.ts +0 -22
  62. package/dist/src/helpers/filter.d.ts +0 -15
  63. package/dist/src/helpers/permission-reconcile.d.ts +0 -15
  64. package/dist/src/helpers/permission-reconcile.test.d.ts +0 -1
  65. package/dist/src/views/audit-log/event-line.d.ts +0 -13
  66. package/dist/src/views/audit-log/snapshot-diff.d.ts +0 -11
  67. package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +0 -22
  68. package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +0 -23
  69. package/dist/src/views/team/condition-builders/component-map.d.ts +0 -4
  70. package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +0 -23
  71. package/dist/useDebounce-B8ZPVS5C.js +0 -15
@@ -1,18 +1,18 @@
1
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
2
  import { useRouter as N, useRoute as h } from "vue-router";
3
3
  import { useI18n as k } from "@feedmepos/mf-common";
4
- import { _ as x } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js";
4
+ import { _ as x } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
5
  import { _ as F } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
6
  import { u as w } from "./restaurant-YOVMuuFY.js";
7
7
  import "@feedmepos/ui-library";
8
- import "./rule-BO6xj2Xa.js";
9
- import "./lodash-CUIS1iIz.js";
10
- import "./iteration-BCbIbdHR.js";
8
+ import "./rule-DaSLVZWm.js";
9
+ import "./lodash-DKG9IyB-.js";
10
+ import "./iteration-BNA1cEos.js";
11
11
  import "./useAppStore-DNTlIeMv.js";
12
- import { R as v } from "./app-BZwE2coe.js";
13
- import "./role-CzXchcSS.js";
12
+ import { R as v } from "./app-BP0oihBR.js";
13
+ import "./role-BS3LFO8u.js";
14
14
  /* empty css */
15
- import "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DVVSBIx2.js";
15
+ import "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js";
16
16
  const $ = { class: "space-y-24" }, Z = /* @__PURE__ */ M({
17
17
  __name: "Main",
18
18
  setup(q) {
@@ -0,0 +1,357 @@
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-BVVwfd7B.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-DaSLVZWm.js";
7
+ import { l as q } from "./lodash-DKG9IyB-.js";
8
+ import { c as Fe } from "./iteration-BNA1cEos.js";
9
+ import { u as ke } from "./useLoading-BH02lYns.js";
10
+ import { e as H } from "./app-BP0oihBR.js";
11
+ import { _ as xe } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BJ-PZ2Nv.js";
12
+ import { A as Ce } from "./restaurant-YOVMuuFY.js";
13
+ 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({
14
+ __name: "PermissionSetForm",
15
+ props: {
16
+ modelValue: {
17
+ type: Object,
18
+ default: () => ({})
19
+ }
20
+ },
21
+ setup(K, { expose: N }) {
22
+ const s = K, { t: i } = Y(), v = p(!1), B = _(() => {
23
+ var e;
24
+ return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
25
+ }), V = p(), O = Z(), R = ke(O), h = ee(), r = p({ ...s.modelValue }), a = p([]), c = p([]), I = [(e) => !!e || i("permissionSet.form.nameRequired")], z = _(() => {
26
+ var e;
27
+ return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
28
+ }), T = _(
29
+ () => h.permissionSets.value.filter((e) => {
30
+ var o;
31
+ return e.id !== ((o = s.modelValue) == null ? void 0 : o.id);
32
+ }).map((e) => ({ label: e.name, value: e.id }))
33
+ ), g = _(
34
+ () => se(a.value, h.permissionSets.value)
35
+ ), {
36
+ fetchCustomReportPermissions: U,
37
+ customReportPermissions: $,
38
+ isLoaded: n
39
+ } = oe(), t = new Set(
40
+ G.filter((e) => e.subject.startsWith(be)).map((e) => e.subject)
41
+ ), m = _(() => {
42
+ const e = new Set(t);
43
+ for (const o of $.value) e.add(o.subject);
44
+ return e;
45
+ }), y = _(() => {
46
+ const e = /* @__PURE__ */ new Set();
47
+ for (const o of G)
48
+ o.category === H.reports && e.add(o.subject);
49
+ for (const o of $.value)
50
+ o.category === H.reports && e.add(o.subject);
51
+ return e;
52
+ }), S = p({ name: "", permissionSetIds: [], userPermissions: [] });
53
+ async function P() {
54
+ var o, d;
55
+ await le(), v.value = !v.value, r.value = { ...s.modelValue }, a.value = ((o = s.modelValue) == null ? void 0 : o.permissionSetIds) ?? [];
56
+ const e = ((d = s.modelValue) == null ? void 0 : d.permissions) ?? [];
57
+ c.value = _e(
58
+ D(g.value),
59
+ e
60
+ ), S.value = {
61
+ name: r.value.name ?? "",
62
+ permissionSetIds: [...a.value],
63
+ userPermissions: Fe(c.value)
64
+ };
65
+ }
66
+ ae(v, async (e) => {
67
+ e && await U();
68
+ });
69
+ const w = ve(
70
+ () => !q.isEqual(r.value.name ?? "", S.value.name) || !q.isEqual(a.value, S.value.permissionSetIds) || !q.isEqual(c.value, S.value.userPermissions),
71
+ () => {
72
+ v.value = !1;
73
+ }
74
+ );
75
+ function W() {
76
+ const e = D(g.value), o = n.value ? m.value : t, d = he(c.value, o), F = Pe(d, y.value), k = ge(F);
77
+ return ye(e, k);
78
+ }
79
+ function te() {
80
+ c.value = D(g.value);
81
+ }
82
+ async function ne() {
83
+ var d, F;
84
+ const e = await ((d = V.value) == null ? void 0 : d.validateInputsWithoutSubmit()), o = (F = ue().currentBusiness.value) == null ? void 0 : F.id;
85
+ !(e != null && e.length) && o && R.minor(async () => {
86
+ var L;
87
+ const k = W();
88
+ if ((L = s.modelValue) != null && L.id) {
89
+ const x = {
90
+ name: r.value.name,
91
+ permissions: k,
92
+ permissionSetIds: a.value,
93
+ businessId: r.value.businessId
94
+ };
95
+ await h.updatePermissionSet(s.modelValue.id, x);
96
+ } else {
97
+ const x = {
98
+ name: r.value.name,
99
+ businessId: o,
100
+ permissions: k,
101
+ permissionSetIds: a.value
102
+ };
103
+ await h.createPermissionSet(x);
104
+ }
105
+ v.value = !1;
106
+ });
107
+ }
108
+ return N({
109
+ trigger: P
110
+ }), (e, o) => {
111
+ const d = f("FmIcon"), F = f("FmTextField"), k = f("FmSelect"), L = f("FmForm"), x = f("FmButton"), ie = f("FmSideSheet");
112
+ return A(), M(ie, {
113
+ "model-value": v.value,
114
+ "max-width": 960,
115
+ "close-button": !1,
116
+ "onOn:clickedAway": l(w)
117
+ }, {
118
+ "side-sheet-header": E(() => [
119
+ C("div", Ve, [
120
+ C("p", Re, J(B.value), 1),
121
+ u(d, {
122
+ name: "close",
123
+ size: "md",
124
+ class: "cursor-pointer",
125
+ onClick: l(w)
126
+ }, null, 8, ["onClick"])
127
+ ])
128
+ ]),
129
+ "side-sheet-footer": E(() => [
130
+ C("div", je, [
131
+ u(x, {
132
+ label: z.value,
133
+ size: "md",
134
+ variant: "primary",
135
+ type: "submit",
136
+ onClick: ne
137
+ }, null, 8, ["label"]),
138
+ u(x, {
139
+ label: l(i)("common.cancel"),
140
+ size: "md",
141
+ variant: "secondary",
142
+ onClick: l(w)
143
+ }, null, 8, ["label", "onClick"])
144
+ ])
145
+ ]),
146
+ default: E(() => [
147
+ u(L, {
148
+ ref_key: "formRef",
149
+ ref: V
150
+ }, {
151
+ default: E(() => [
152
+ u(F, {
153
+ modelValue: r.value.name,
154
+ "onUpdate:modelValue": o[0] || (o[0] = (j) => r.value.name = j),
155
+ label: l(i)("permissionSet.form.name"),
156
+ placeholder: l(i)("permissionSet.form.namePlaceholder"),
157
+ rules: I
158
+ }, null, 8, ["modelValue", "label", "placeholder"]),
159
+ u(k, {
160
+ modelValue: a.value,
161
+ "onUpdate:modelValue": [
162
+ o[1] || (o[1] = (j) => a.value = j),
163
+ te
164
+ ],
165
+ multiselect: "",
166
+ searchable: "",
167
+ "search-debounce": 300,
168
+ items: T.value,
169
+ label: l(i)("permissionSet.form.includedSets"),
170
+ placeholder: l(i)("permissionSet.form.includedSetsPlaceholder"),
171
+ class: "mt-16"
172
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
173
+ C("div", Ie, J(l(i)("team.memberForm.permissions.title")), 1),
174
+ u(xe, {
175
+ modelValue: c.value,
176
+ "onUpdate:modelValue": o[2] || (o[2] = (j) => c.value = j),
177
+ "inherit-permissions": g.value,
178
+ class: "mt-16"
179
+ }, null, 8, ["modelValue", "inherit-permissions"])
180
+ ]),
181
+ _: 1
182
+ }, 512)
183
+ ]),
184
+ _: 1
185
+ }, 8, ["model-value", "onOn:clickedAway"]);
186
+ };
187
+ }
188
+ }), Be = { class: "space-y-8" }, Te = { class: "flex justify-end xs:px-16" }, Je = /* @__PURE__ */ Q({
189
+ __name: "PermissionSetList",
190
+ setup(K, { expose: N }) {
191
+ const { t: s } = Y(), { customReportPermissions: i, fetchCustomReportPermissions: v } = oe(), B = Z(), V = de(), { breakpoints: O } = pe(), R = p(""), h = _(() => {
192
+ var n;
193
+ return (n = c.value) == null ? void 0 : n.filter((t) => {
194
+ const m = R.value.toLowerCase();
195
+ return t.name.toLowerCase().includes(m);
196
+ });
197
+ }), r = p(), a = ee(), c = _(
198
+ () => a.permissionSets.value
199
+ ), I = p();
200
+ async function z() {
201
+ await a.readPermissionSets();
202
+ }
203
+ function T(n) {
204
+ var t;
205
+ I.value = n, (t = r.value) == null || t.trigger();
206
+ }
207
+ const g = [
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, m = se(
218
+ [t.id],
219
+ a.permissionSets.value
220
+ ), y = D(m), S = y.length, P = we(
221
+ y,
222
+ i.value
223
+ );
224
+ return b("div", { class: "flex items-center gap-8" }, [
225
+ b("span", s("team.labels.allowed", { count: S })),
226
+ b(
227
+ X.FmTooltip,
228
+ { variant: "plain", placement: "top" },
229
+ {
230
+ default: () => b(X.FmIcon, {
231
+ name: "info",
232
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
233
+ }),
234
+ content: () => b("div", [
235
+ s("team.labels.permission"),
236
+ ...P.map(
237
+ (w, W) => b("div", { key: `${w}-${W}` }, `- ${w}`)
238
+ )
239
+ ])
240
+ }
241
+ )
242
+ ]);
243
+ }
244
+ },
245
+ {
246
+ id: "action",
247
+ size: 52,
248
+ meta: {
249
+ cellClass: "pl-16",
250
+ headerContentClass: "-mx-16"
251
+ },
252
+ cell(n) {
253
+ const t = n.row.original;
254
+ return b(
255
+ "div",
256
+ {
257
+ class: "flex w-full items-center justify-end",
258
+ onClick: (m) => m.stopPropagation()
259
+ },
260
+ [
261
+ b(Se, {
262
+ items: [
263
+ { label: s("common.update"), onClick: () => T(t) },
264
+ {
265
+ label: s("common.remove"),
266
+ onClick: () => $(t),
267
+ itemClass: "text-fm-color-typo-error"
268
+ }
269
+ ]
270
+ })
271
+ ]
272
+ );
273
+ },
274
+ enableSorting: !1
275
+ }
276
+ ];
277
+ function U() {
278
+ var n;
279
+ I.value = void 0, (n = r.value) == null || n.trigger();
280
+ }
281
+ async function $(n) {
282
+ V.open({
283
+ title: s("permissionSet.form.delete.title"),
284
+ message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
285
+ minWidth: O.value.lg ? 588 : 0,
286
+ primaryActions: {
287
+ text: s("common.remove"),
288
+ close: !1,
289
+ variant: "destructive"
290
+ },
291
+ secondaryActions: { text: s("common.cancel"), close: !0 }
292
+ }).onPrimary(async () => {
293
+ try {
294
+ await a.deletePermissionSet(n.id), B.open({
295
+ message: s("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
296
+ type: "success"
297
+ });
298
+ } catch (t) {
299
+ const m = t instanceof Ce && t.status === 409 ? t.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
300
+ permissionSetName: n.name
301
+ }) : s("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
302
+ B.open({ message: m, type: "error" });
303
+ }
304
+ V.close();
305
+ });
306
+ }
307
+ return re(() => {
308
+ z(), v();
309
+ }), N({
310
+ create: U
311
+ }), (n, t) => {
312
+ const m = f("FmSearch"), y = f("FmTable"), S = f("FullWrapper");
313
+ return A(), me(ce, null, [
314
+ u(Ee, {
315
+ ref_key: "permissionSetFormRef",
316
+ ref: r,
317
+ "model-value": I.value
318
+ }, null, 8, ["model-value"]),
319
+ C("div", Be, [
320
+ C("div", Te, [
321
+ u(m, {
322
+ modelValue: R.value,
323
+ "onUpdate:modelValue": t[0] || (t[0] = (P) => R.value = P),
324
+ class: "w-[320px] xs:w-full",
325
+ autofocus: "",
326
+ placeholder: l(s)("permissionSet.search.placeholder")
327
+ }, null, 8, ["modelValue", "placeholder"])
328
+ ]),
329
+ c.value.length > 0 ? (A(), M(S, {
330
+ key: 0,
331
+ class: "overflow-auto"
332
+ }, {
333
+ default: E(() => [
334
+ u(y, {
335
+ "column-defs": g,
336
+ "row-data": h.value,
337
+ "page-size": h.value.length,
338
+ "pin-header-row": "",
339
+ "hide-footer": "",
340
+ "shrink-at": !1,
341
+ onRowClick: t[1] || (t[1] = (P) => T(P.original))
342
+ }, null, 8, ["row-data", "page-size"])
343
+ ]),
344
+ _: 1
345
+ })) : (A(), M(l(fe), {
346
+ key: 1,
347
+ title: l(s)("permissionSet.noData.title"),
348
+ subtitle: l(s)("permissionSet.noData.subtitle")
349
+ }, null, 8, ["title", "subtitle"]))
350
+ ])
351
+ ], 64);
352
+ };
353
+ }
354
+ });
355
+ export {
356
+ Je as default
357
+ };