@feedmepos/mf-hrm-portal 2.0.20-dev.1 → 2.0.20-dev.2

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