@feedmepos/mf-hrm-portal 2.0.7-dev → 2.0.7

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 (44) hide show
  1. package/dist/{AuditLogList-COq6WH3T.js → AuditLogList-BWzKxoBK.js} +24 -23
  2. package/dist/{EmployeeList-CtosIPFL.js → EmployeeList-CPvHmCle.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-B4YdcrGe.js → Main-BEj_iUkZ.js} +8 -7
  6. package/dist/{Main-CdsqeB2G.js → Main-BNywXKr0.js} +11 -10
  7. package/dist/Main-BkIzKoHQ.js +560 -0
  8. package/dist/PermissionSetList-B8jSoL19.js +338 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ddnj8eg_.js +3356 -0
  10. package/dist/{RoleList-D1NGE2IC.js → RoleList-BEx1B8PE.js} +26 -24
  11. package/dist/TeamMemberList-BEDwcjeT.js +989 -0
  12. package/dist/{TimesheetList-B8yCkaxb.js → TimesheetList-CqZG4xmE.js} +11 -10
  13. package/dist/{app-CB3ye-CT.js → app-DHtKeCwy.js} +1333 -1060
  14. package/dist/app.js +2 -2
  15. package/dist/{dayjs.min-DOxEzdpe.js → dayjs.min-BWWy9u8p.js} +1 -1
  16. package/dist/{employee-G0pQg8_6.js → employee-C2ys9jf0.js} +21 -20
  17. package/dist/index-BwYlZrxP.js +968 -0
  18. package/dist/{index-DQArLkVB.js → index-O9ipnK-U.js} +1 -1
  19. package/dist/{index-Beu6IuhT.js → iteration-BdhU8jGb.js} +3444 -4352
  20. package/dist/{lodash-COjtwv4w.js → lodash-CDSEYvRz.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 +1 -1
  24. package/dist/src/helpers/permission-set.d.ts +26 -4
  25. package/dist/src/helpers/permission-set.test.d.ts +1 -0
  26. package/dist/src/router/shared.d.ts +2 -1
  27. package/dist/src/stores/grant-user.d.ts +86 -0
  28. package/dist/src/types/grant-user.d.ts +27 -0
  29. package/dist/src/views/grant/GrantUserList.vue.d.ts +17 -0
  30. package/dist/src/views/grant/Main.vue.d.ts +2 -0
  31. package/dist/src/views/grant/components/GrantUserForm.vue.d.ts +17 -0
  32. package/dist/src/views/grant/locales/index.d.ts +232 -0
  33. package/dist/{team-CEtKQK6n.js → team-9CwJsJGX.js} +1 -1
  34. package/dist/{timesheet-DZF9D3QQ.js → timesheet-ChKYJtjK.js} +10 -9
  35. package/dist/tsconfig.app.tsbuildinfo +1 -1
  36. package/dist/{useAppStore-9lbKMy_9.js → useAppStore-DGzBzMIR.js} +1 -1
  37. package/dist/{useLoading-BIIvuJcM.js → useLoading-CzteZR_c.js} +1 -1
  38. package/dist/{useReportPermissions-BXQ0-WwK.js → useReportPermissions-CaY_wr2l.js} +12 -11
  39. package/dist/useRestaurantMap-e9fQJiLC.js +39 -0
  40. package/package.json +2 -2
  41. package/dist/PermissionSetList-BUORArci.js +0 -327
  42. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ChqCTn1L.js +0 -3333
  43. package/dist/TeamMemberList-auSjZRNz.js +0 -979
  44. package/dist/useRestaurantMap-D5BNPLKh.js +0 -107
@@ -1,7 +1,7 @@
1
1
  import { defineStore as f, storeToRefs as v } from "pinia";
2
2
  import { ref as b } from "vue";
3
3
  import { useCoreStore as I, baseClientInstance as w } from "@feedmepos/mf-common";
4
- import { g as l, b as d, s as R } from "./index-Beu6IuhT.js";
4
+ import { g as l, b as d, s as R } from "./iteration-BdhU8jGb.js";
5
5
  const p = {
6
6
  async readRoles() {
7
7
  return l(await d().get("/pos-roles"));
@@ -1,6 +1,6 @@
1
1
  import { computed as I, isRef as L, watch as M } from "vue";
2
2
  import { SnackbarPosition as y } from "@feedmepos/ui-library";
3
- import { a as w, v } from "./useAppStore-9lbKMy_9.js";
3
+ import { a as w, v } from "./useAppStore-DGzBzMIR.js";
4
4
  const E = (r) => {
5
5
  async function d(u, e) {
6
6
  var l, a;
@@ -1,17 +1,18 @@
1
1
  import { computed as u, ref as r } from "vue";
2
- import { e as y, a as l, R } from "./index-Beu6IuhT.js";
3
- import { useCoreStore as h } from "@feedmepos/mf-common";
4
- import "./app-CB3ye-CT.js";
5
- const n = r([]), c = r(!1), t = r(!1), d = r(null);
6
- function K() {
7
- const m = h();
2
+ import { e as l } from "./iteration-BdhU8jGb.js";
3
+ import { useCoreStore as y } from "@feedmepos/mf-common";
4
+ import { e as R, R as h } from "./index-BwYlZrxP.js";
5
+ import "./app-DHtKeCwy.js";
6
+ const n = r([]), c = r(!1), t = r(!1), m = r(null);
7
+ function L() {
8
+ const d = y();
8
9
  async function f() {
9
10
  var o;
10
- const s = (o = m.currentBusiness.value) == null ? void 0 : o.id;
11
- if (s && (d.value !== s && (n.value = [], c.value = !1, t.value = !1, d.value = s), !(c.value || t.value))) {
11
+ const s = (o = d.currentBusiness.value) == null ? void 0 : o.id;
12
+ if (s && (m.value !== s && (n.value = [], c.value = !1, t.value = !1, m.value = s), !(c.value || t.value))) {
12
13
  t.value = !0;
13
14
  try {
14
- n.value = await R.fetchReportPermissions(s), c.value = !0;
15
+ n.value = await h.fetchReportPermissions(s), c.value = !0;
15
16
  } catch (e) {
16
17
  console.warn("Failed to fetch dynamic report permissions, using hardcoded only:", e), n.value = [];
17
18
  } finally {
@@ -19,7 +20,7 @@ function K() {
19
20
  }
20
21
  }
21
22
  }
22
- const i = y.filter(
23
+ const i = R.filter(
23
24
  (s) => s.subject === l.F_RULE_SUBJECT.enum.report && s.conditions
24
25
  ), p = u(() => {
25
26
  const s = new Set(
@@ -55,5 +56,5 @@ function K() {
55
56
  };
56
57
  }
57
58
  export {
58
- K as u
59
+ L as u
59
60
  };
@@ -0,0 +1,39 @@
1
+ import { useI18n as a, useCoreStore as n } from "@feedmepos/mf-common";
2
+ import { useDialog as i } from "@feedmepos/ui-library";
3
+ import { computed as m } from "vue";
4
+ function l(o, s) {
5
+ const r = i(), { t } = a();
6
+ function e() {
7
+ o() ? r.open({
8
+ title: t("portalCommon.dismiss.title"),
9
+ message: t("portalCommon.dismiss.message"),
10
+ zIndex: 200,
11
+ primaryActions: {
12
+ text: t("portalCommon.dismiss.primaryActions"),
13
+ variant: "primary",
14
+ close: !0
15
+ },
16
+ secondaryActions: {
17
+ text: t("common.cancel"),
18
+ variant: "tertiary",
19
+ close: !0
20
+ }
21
+ }).onPrimary(() => {
22
+ s();
23
+ }) : s();
24
+ }
25
+ return e;
26
+ }
27
+ function d() {
28
+ const o = n();
29
+ return m(() => {
30
+ const r = {};
31
+ return o.restaurants.value.forEach((t) => {
32
+ r[t._id] = t;
33
+ }), r;
34
+ });
35
+ }
36
+ export {
37
+ d as a,
38
+ l as u
39
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-hrm-portal",
3
- "version": "2.0.7-dev",
3
+ "version": "2.0.7",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,7 +29,7 @@
29
29
  "vue-router": "^4.3.2",
30
30
  "vue3-lottie": "^3.3.0",
31
31
  "xlsx": "^0.18.5",
32
- "@feedmepos/hrm-permission": "1.0.1"
32
+ "@feedmepos/hrm-permission": "1.0.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@casl/ability": "^3.4.0",
@@ -1,327 +0,0 @@
1
- import { defineComponent as q, computed as _, resolveComponent as c, createElementBlock as $, openBlock as P, createElementVNode as y, createVNode as r, toDisplayString as E, unref as u, withCtx as g, createTextVNode as Z, Fragment as G, renderList as ee, ref as b, createBlock as H, nextTick as se, onMounted as te, h as O } from "vue";
2
- import { useI18n as M, useCoreStore as oe } from "@feedmepos/mf-common";
3
- import { useSnackbar as J, useDialog as ne, useBreakpoints as ie, components as le, FmButtonColorThemeVariant as ae, FmButtonVariant as re } from "@feedmepos/ui-library";
4
- import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
- import { q as K, A as ue, u as Q, m as X, p as ce, n as de, o as N, w as pe, x as fe, y as ve, B as Se } from "./index-Beu6IuhT.js";
6
- import { u as _e } from "./useLoading-BIIvuJcM.js";
7
- import { a as be } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ChqCTn1L.js";
8
- const he = { class: "flex flex-row items-center gap-8" }, ge = /* @__PURE__ */ q({
9
- __name: "PermissionWithTooltip",
10
- props: {
11
- modelValue: {
12
- type: Array,
13
- required: !0
14
- }
15
- },
16
- setup(j) {
17
- const { customReportPermissions: w } = K(), s = j, i = _(() => ue(s.modelValue, w.value)), { t: a } = M();
18
- return (k, C) => {
19
- const h = c("FmIcon"), F = c("FmTooltip");
20
- return P(), $("div", he, [
21
- y("span", null, E(u(a)("team.labels.allowed", { count: i.value.length })), 1),
22
- r(F, {
23
- variant: "plain",
24
- placement: "top"
25
- }, {
26
- content: g(() => [
27
- y("div", null, [
28
- Z(E(u(a)("team.labels.permission")) + " ", 1),
29
- (P(!0), $(G, null, ee(i.value, (m, l) => (P(), $("div", {
30
- key: `${m}-${l}`
31
- }, " - " + E(m), 1))), 128))
32
- ])
33
- ]),
34
- default: g(() => [
35
- r(h, {
36
- name: "info",
37
- class: "cursor-pointer text-fm-color-neutral-gray-300"
38
- })
39
- ]),
40
- _: 1
41
- })
42
- ]);
43
- };
44
- }
45
- }), Pe = { class: "fm-typo-en-title-md-600" }, ye = { class: "flex items-center justify-start gap-8" }, Fe = /* @__PURE__ */ q({
46
- __name: "PermissionSetForm",
47
- props: {
48
- modelValue: {
49
- type: Object,
50
- default: () => ({})
51
- }
52
- },
53
- setup(j, { expose: w }) {
54
- const s = j, { t: i } = M(), a = b(!1), k = _(() => {
55
- var e;
56
- return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
57
- }), C = b(), h = J(), F = _e(h), m = Q(), l = b({ ...s.modelValue }), d = b([]), p = b([]), A = [(e) => !!e || "Permission set name is required"], D = _(() => {
58
- var e;
59
- return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
60
- }), U = _(
61
- () => m.permissionSets.value.filter((e) => {
62
- var o;
63
- return e.id !== ((o = s.modelValue) == null ? void 0 : o.id);
64
- }).map((e) => ({ label: e.name, value: e.id }))
65
- ), V = _(
66
- () => X(d.value, m.permissionSets.value)
67
- ), { customReportPermissions: W, isLoaded: n } = K(), t = new Set(ce.map((e) => e.subject)), f = _(() => {
68
- const e = new Set(t);
69
- for (const o of W.value) e.add(o.subject);
70
- return e;
71
- });
72
- async function I() {
73
- var o, v;
74
- await se(), a.value = !a.value, l.value = { ...s.modelValue }, d.value = ((o = s.modelValue) == null ? void 0 : o.permissionSetIds) ?? [];
75
- const e = ((v = s.modelValue) == null ? void 0 : v.permissions) ?? [];
76
- p.value = de(
77
- N(V.value),
78
- e
79
- );
80
- }
81
- function z() {
82
- const e = N(V.value), o = n.value ? f.value : t, v = pe(p.value, o), x = fe(v);
83
- return ve(e, x);
84
- }
85
- function B() {
86
- p.value = N(V.value);
87
- }
88
- async function Y() {
89
- var v, x;
90
- const e = await ((v = C.value) == null ? void 0 : v.validateInputsWithoutSubmit()), o = (x = oe().currentBusiness.value) == null ? void 0 : x.id;
91
- !(e != null && e.length) && o && F.minor(async () => {
92
- var T;
93
- const L = z();
94
- if ((T = s.modelValue) != null && T.id) {
95
- const R = {
96
- name: l.value.name,
97
- permissions: L,
98
- permissionSetIds: d.value,
99
- businessId: l.value.businessId
100
- };
101
- await m.updatePermissionSet(s.modelValue.id, R);
102
- } else {
103
- const R = {
104
- name: l.value.name,
105
- businessId: o,
106
- permissions: L,
107
- permissionSetIds: d.value
108
- };
109
- await m.createPermissionSet(R);
110
- }
111
- a.value = !1;
112
- });
113
- }
114
- return w({
115
- trigger: I
116
- }), (e, o) => {
117
- const v = c("FmTextField"), x = c("FmSelect"), L = c("FmForm"), T = c("FmButton"), R = c("FmSideSheet");
118
- return P(), H(R, {
119
- modelValue: a.value,
120
- "onUpdate:modelValue": o[4] || (o[4] = (S) => a.value = S),
121
- "max-width": 560,
122
- "dismiss-away": ""
123
- }, {
124
- "side-sheet-header": g(() => [
125
- y("p", Pe, E(k.value), 1)
126
- ]),
127
- "side-sheet-footer": g(() => [
128
- y("div", ye, [
129
- r(T, {
130
- label: D.value,
131
- size: "md",
132
- variant: "primary",
133
- type: "submit",
134
- onClick: Y
135
- }, null, 8, ["label"]),
136
- r(T, {
137
- label: u(i)("common.cancel"),
138
- size: "md",
139
- variant: "secondary",
140
- onClick: o[3] || (o[3] = (S) => a.value = !1)
141
- }, null, 8, ["label"])
142
- ])
143
- ]),
144
- default: g(() => [
145
- r(L, {
146
- ref_key: "formRef",
147
- ref: C
148
- }, {
149
- default: g(() => [
150
- r(v, {
151
- modelValue: l.value.name,
152
- "onUpdate:modelValue": o[0] || (o[0] = (S) => l.value.name = S),
153
- label: u(i)("permissionSet.form.name"),
154
- placeholder: u(i)("permissionSet.form.namePlaceholder"),
155
- rules: A
156
- }, null, 8, ["modelValue", "label", "placeholder"]),
157
- r(x, {
158
- modelValue: d.value,
159
- "onUpdate:modelValue": [
160
- o[1] || (o[1] = (S) => d.value = S),
161
- B
162
- ],
163
- multiselect: "",
164
- searchable: "",
165
- "search-debounce": 300,
166
- items: U.value,
167
- label: u(i)("permissionSet.form.includedSets"),
168
- placeholder: u(i)("permissionSet.form.includedSetsPlaceholder"),
169
- class: "mt-16"
170
- }, null, 8, ["modelValue", "items", "label", "placeholder"]),
171
- r(be, {
172
- modelValue: p.value,
173
- "onUpdate:modelValue": o[2] || (o[2] = (S) => p.value = S),
174
- "inherit-permissions": V.value,
175
- class: "mt-24"
176
- }, null, 8, ["modelValue", "inherit-permissions"])
177
- ]),
178
- _: 1
179
- }, 512)
180
- ]),
181
- _: 1
182
- }, 8, ["modelValue"]);
183
- };
184
- }
185
- }), Ve = { class: "space-y-8" }, xe = { class: "flex justify-end xs:px-16" }, we = {
186
- key: 0,
187
- class: "overflow-auto"
188
- }, ke = { class: "pb-64" }, Le = /* @__PURE__ */ q({
189
- __name: "PermissionSetList",
190
- setup(j, { expose: w }) {
191
- const { t: s } = M(), { fetchCustomReportPermissions: i } = K(), a = J(), k = ne(), { breakpoints: C } = ie(), h = b(""), F = _(() => {
192
- var n;
193
- return (n = d.value) == null ? void 0 : n.filter((t) => {
194
- const f = h.value.toLowerCase();
195
- return t.name.toLowerCase().includes(f);
196
- });
197
- }), m = b(), l = Q(), d = _(
198
- () => l.permissionSets.value
199
- ), p = b();
200
- async function A() {
201
- await l.readPermissionSets();
202
- }
203
- function D(n) {
204
- var t;
205
- p.value = n, (t = m.value) == null || t.trigger();
206
- }
207
- const U = [
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, f = X(
218
- [t.id],
219
- l.permissionSets.value
220
- ), I = N(f);
221
- return O(ge, { modelValue: I });
222
- }
223
- },
224
- {
225
- id: "action",
226
- meta: {
227
- cellClass: "pl-16",
228
- headerContentClass: "-mx-16"
229
- },
230
- cell(n) {
231
- return O("div", { class: "w-full flex justify-end items-center" }, [
232
- O(le.FmButton, {
233
- prependIcon: "delete",
234
- variant: re.Tertiary,
235
- textColor: ae.NeutralGray400,
236
- class: "flex flex-end",
237
- onClick: (t) => {
238
- t.stopPropagation(), W(n.row.original);
239
- }
240
- })
241
- ]);
242
- },
243
- enableSorting: !1
244
- }
245
- ];
246
- function V() {
247
- var n;
248
- p.value = void 0, (n = m.value) == null || n.trigger();
249
- }
250
- async function W(n) {
251
- k.open({
252
- title: s("permissionSet.form.delete.title"),
253
- message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
254
- minWidth: C.value.lg ? 588 : 0,
255
- primaryActions: {
256
- text: s("common.remove"),
257
- close: !1,
258
- variant: "destructive"
259
- },
260
- secondaryActions: { text: s("common.cancel"), close: !0 }
261
- }).onPrimary(async () => {
262
- try {
263
- await l.deletePermissionSet(n.id), a.open({
264
- message: s("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
265
- type: "success"
266
- });
267
- } catch (t) {
268
- const f = t instanceof Se && t.status === 409 ? t.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
269
- permissionSetName: n.name
270
- }) : s("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
271
- a.open({ message: f, type: "error" });
272
- }
273
- k.close();
274
- });
275
- }
276
- return te(() => {
277
- A(), i();
278
- }), w({
279
- create: V
280
- }), (n, t) => {
281
- const f = c("FmSearch"), I = c("FmTable"), z = c("FullWrapper");
282
- return P(), $(G, null, [
283
- r(Fe, {
284
- ref_key: "permissionSetFormRef",
285
- ref: m,
286
- "model-value": p.value
287
- }, null, 8, ["model-value"]),
288
- y("div", Ve, [
289
- y("div", xe, [
290
- r(f, {
291
- modelValue: h.value,
292
- "onUpdate:modelValue": t[0] || (t[0] = (B) => h.value = B),
293
- class: "w-[320px] xs:w-full",
294
- autofocus: "",
295
- placeholder: u(s)("permissionSet.search.placeholder")
296
- }, null, 8, ["modelValue", "placeholder"])
297
- ]),
298
- d.value.length > 0 ? (P(), $("div", we, [
299
- y("div", ke, [
300
- r(z, null, {
301
- default: g(() => [
302
- r(I, {
303
- "column-defs": U,
304
- "row-data": F.value,
305
- "page-size": F.value.length,
306
- "pin-header-row": "",
307
- "hide-footer": "",
308
- "shrink-at": !1,
309
- onRowClick: t[1] || (t[1] = (B) => D(B.original))
310
- }, null, 8, ["row-data", "page-size"])
311
- ]),
312
- _: 1
313
- })
314
- ])
315
- ])) : (P(), H(u(me), {
316
- key: 1,
317
- title: u(s)("permissionSet.noData.title"),
318
- subtitle: u(s)("permissionSet.noData.subtitle")
319
- }, null, 8, ["title", "subtitle"]))
320
- ])
321
- ], 64);
322
- };
323
- }
324
- });
325
- export {
326
- Le as default
327
- };