@feedmepos/mf-hrm-portal 1.1.3-dev.4 → 1.1.3-dev.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.
- package/dist/{AuditLogList-BeigpKv1.js → AuditLogList-n6xAYZGv.js} +127 -139
- package/dist/EmployeeList-D9rLxXo5.js +626 -0
- package/dist/{Main-iC9TGp41.js → Main-BCa8A1rV.js} +5 -5
- package/dist/{Main-DWnVJGpe.js → Main-zQF3GD9j.js} +10 -9
- package/dist/PermissionSetList-EsoA_anf.js +338 -0
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DqWrIJPe.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BA1LS-wd.js} +454 -447
- package/dist/RoleList-Cfv9wKaN.js +494 -0
- package/dist/TeamMemberList-HkvCqzPj.js +945 -0
- package/dist/{TimesheetList-C4_i17S7.js → TimesheetList-B0e-Muws.js} +25 -24
- package/dist/api/index.d.ts +1 -0
- package/dist/api/report-query/index.d.ts +5 -0
- package/dist/{app-BRpUSeEf.js → app-DKSPx49S.js} +1449 -867
- package/dist/app.js +1 -1
- package/dist/composables/useReportPermissions.d.ts +14 -0
- package/dist/{dayjs.min-Dfq8fN9X.js → dayjs.min-DZJQ_JpV.js} +1 -1
- package/dist/employee-DKRqMph9.js +144 -0
- package/dist/helpers/permission-set.d.ts +22 -0
- package/dist/helpers/rule.d.ts +1 -1
- package/dist/{index-CvpJyEnB.js → index-BwyUbhZj.js} +1 -1
- package/dist/{index-nVxD4_on.js → index-D09s817L.js} +5017 -3187
- package/dist/{lodash-Cbt71kLf.js → lodash-CL6AaeJB.js} +1 -1
- package/dist/stores/permission-set.d.ts +15 -0
- package/dist/{team-CZZo-waE.js → team-DEjtUFVl.js} +1 -1
- package/dist/{timesheet-DuYLbiJ_.js → timesheet-B0usAfjL.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/permission-set.d.ts +4 -0
- package/dist/types/report-query.d.ts +6 -0
- package/dist/{useAppStore-Dt1nUJ4t.js → useAppStore-DfaKfSuR.js} +34 -46
- package/dist/{useLoading-CjyXOp7A.js → useLoading-D2AX24ph.js} +1 -1
- package/dist/useReportPermissions-CwsHq61C.js +65 -0
- package/dist/views/team/locales/index.d.ts +12 -0
- package/package.json +2 -2
- package/dist/EmployeeList-pCs8sKuU.js +0 -607
- package/dist/PermissionSetList-BLmeu-lo.js +0 -283
- package/dist/RoleList-DyOF2uRf.js +0 -496
- package/dist/TeamMemberList-Ck2gpjCC.js +0 -952
- package/dist/employee-BZxYvY4n.js +0 -172
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { defineComponent as j, computed as h, resolveComponent as p, createElementBlock as B, openBlock as P, createElementVNode as F, createVNode as r, toDisplayString as E, unref as u, withCtx as y, createTextVNode as Q, Fragment as q, renderList as X, ref as b, createBlock as K, nextTick as Y, onMounted as Z, h as z } from "vue";
|
|
2
|
+
import { useI18n as O, useCoreStore as ee } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as G, useDialog as se, useBreakpoints as te, components as oe, FmButtonColorThemeVariant as ne, FmButtonVariant as ie } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as le } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
5
|
+
import { z as ae, u as H, m as W, n as J, o as U, w as re, x as me, A as M, B as ue } from "./index-D09s817L.js";
|
|
6
|
+
import { u as ce } from "./useLoading-D2AX24ph.js";
|
|
7
|
+
import { a as de } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BA1LS-wd.js";
|
|
8
|
+
import "./app-DKSPx49S.js";
|
|
9
|
+
const pe = { class: "flex flex-row items-center gap-8" }, fe = /* @__PURE__ */ j({
|
|
10
|
+
__name: "PermissionWithTooltip",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: Array,
|
|
14
|
+
required: !0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(T) {
|
|
18
|
+
const I = T, s = h(() => ae(I.modelValue)), { t: i } = O();
|
|
19
|
+
return (c, N) => {
|
|
20
|
+
const v = p("FmIcon"), V = p("FmTooltip");
|
|
21
|
+
return P(), B("div", pe, [
|
|
22
|
+
F("span", null, E(u(i)("team.labels.allowed", { count: s.value.length })), 1),
|
|
23
|
+
r(V, {
|
|
24
|
+
variant: "plain",
|
|
25
|
+
placement: "top"
|
|
26
|
+
}, {
|
|
27
|
+
content: y(() => [
|
|
28
|
+
F("div", null, [
|
|
29
|
+
Q(E(u(i)("team.labels.permission")) + " ", 1),
|
|
30
|
+
(P(!0), B(q, null, X(s.value, (S, a) => (P(), B("div", {
|
|
31
|
+
key: `${S}-${a}`
|
|
32
|
+
}, " - " + E(S), 1))), 128))
|
|
33
|
+
])
|
|
34
|
+
]),
|
|
35
|
+
default: y(() => [
|
|
36
|
+
r(v, {
|
|
37
|
+
name: "info",
|
|
38
|
+
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
39
|
+
})
|
|
40
|
+
]),
|
|
41
|
+
_: 1
|
|
42
|
+
})
|
|
43
|
+
]);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}), ve = { class: "fm-typo-en-title-md-600" }, Se = { class: "flex items-center justify-start gap-8" }, _e = /* @__PURE__ */ j({
|
|
47
|
+
__name: "PermissionSetForm",
|
|
48
|
+
props: {
|
|
49
|
+
modelValue: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: () => ({})
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(T, { expose: I }) {
|
|
55
|
+
const s = T, { t: i } = O(), c = b(!1), N = h(() => {
|
|
56
|
+
var e;
|
|
57
|
+
return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
|
|
58
|
+
}), v = b(), V = G(), S = ce(V), a = H(), f = b({ ...s.modelValue }), d = b([]), g = b([]), L = [(e) => !!e || "Permission set name is required"], R = h(() => {
|
|
59
|
+
var e;
|
|
60
|
+
return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
|
|
61
|
+
}), A = h(
|
|
62
|
+
() => a.permissionSets.value.filter((e) => {
|
|
63
|
+
var t;
|
|
64
|
+
return e.id !== ((t = s.modelValue) == null ? void 0 : t.id);
|
|
65
|
+
}).map((e) => ({ label: e.name, value: e.id }))
|
|
66
|
+
), x = h(
|
|
67
|
+
() => W(d.value, a.permissionSets.value)
|
|
68
|
+
);
|
|
69
|
+
async function D() {
|
|
70
|
+
var t, l;
|
|
71
|
+
await Y(), c.value = !c.value, f.value = { ...s.modelValue }, d.value = ((t = s.modelValue) == null ? void 0 : t.permissionSetIds) ?? [];
|
|
72
|
+
const e = ((l = s.modelValue) == null ? void 0 : l.permissions) ?? [];
|
|
73
|
+
g.value = J(
|
|
74
|
+
U(x.value),
|
|
75
|
+
e
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function o() {
|
|
79
|
+
const e = U(x.value), t = re(g.value);
|
|
80
|
+
return me(e, t);
|
|
81
|
+
}
|
|
82
|
+
function n() {
|
|
83
|
+
g.value = U(x.value);
|
|
84
|
+
}
|
|
85
|
+
async function m() {
|
|
86
|
+
var l, w;
|
|
87
|
+
const e = await ((l = v.value) == null ? void 0 : l.validateInputsWithoutSubmit()), t = (w = ee().currentBusiness.value) == null ? void 0 : w.id;
|
|
88
|
+
!(e != null && e.length) && t && S.minor(async () => {
|
|
89
|
+
var k;
|
|
90
|
+
const $ = o();
|
|
91
|
+
if ((k = s.modelValue) != null && k.id) {
|
|
92
|
+
const C = {
|
|
93
|
+
name: f.value.name,
|
|
94
|
+
permissions: $,
|
|
95
|
+
permissionSetIds: d.value,
|
|
96
|
+
businessId: f.value.businessId
|
|
97
|
+
};
|
|
98
|
+
await a.updatePermissionSet(s.modelValue.id, C);
|
|
99
|
+
} else {
|
|
100
|
+
const C = {
|
|
101
|
+
name: f.value.name,
|
|
102
|
+
businessId: t,
|
|
103
|
+
permissions: $,
|
|
104
|
+
permissionSetIds: d.value
|
|
105
|
+
};
|
|
106
|
+
await a.createPermissionSet(C);
|
|
107
|
+
}
|
|
108
|
+
c.value = !1;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return I({
|
|
112
|
+
trigger: D
|
|
113
|
+
}), (e, t) => {
|
|
114
|
+
const l = p("FmTextField"), w = p("FmSelect"), $ = p("FmForm"), k = p("FmButton"), C = p("FmSideSheet");
|
|
115
|
+
return P(), K(C, {
|
|
116
|
+
modelValue: c.value,
|
|
117
|
+
"onUpdate:modelValue": t[4] || (t[4] = (_) => c.value = _),
|
|
118
|
+
"max-width": 560,
|
|
119
|
+
"dismiss-away": ""
|
|
120
|
+
}, {
|
|
121
|
+
"side-sheet-header": y(() => [
|
|
122
|
+
F("p", ve, E(N.value), 1)
|
|
123
|
+
]),
|
|
124
|
+
"side-sheet-footer": y(() => [
|
|
125
|
+
F("div", Se, [
|
|
126
|
+
r(k, {
|
|
127
|
+
label: R.value,
|
|
128
|
+
size: "md",
|
|
129
|
+
variant: "primary",
|
|
130
|
+
type: "submit",
|
|
131
|
+
onClick: m
|
|
132
|
+
}, null, 8, ["label"]),
|
|
133
|
+
r(k, {
|
|
134
|
+
label: u(i)("common.cancel"),
|
|
135
|
+
size: "md",
|
|
136
|
+
variant: "secondary",
|
|
137
|
+
onClick: t[3] || (t[3] = (_) => c.value = !1)
|
|
138
|
+
}, null, 8, ["label"])
|
|
139
|
+
])
|
|
140
|
+
]),
|
|
141
|
+
default: y(() => [
|
|
142
|
+
r($, {
|
|
143
|
+
ref_key: "formRef",
|
|
144
|
+
ref: v
|
|
145
|
+
}, {
|
|
146
|
+
default: y(() => [
|
|
147
|
+
r(l, {
|
|
148
|
+
modelValue: f.value.name,
|
|
149
|
+
"onUpdate:modelValue": t[0] || (t[0] = (_) => f.value.name = _),
|
|
150
|
+
label: u(i)("permissionSet.form.name"),
|
|
151
|
+
placeholder: u(i)("permissionSet.form.namePlaceholder"),
|
|
152
|
+
rules: L
|
|
153
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
154
|
+
r(w, {
|
|
155
|
+
modelValue: d.value,
|
|
156
|
+
"onUpdate:modelValue": [
|
|
157
|
+
t[1] || (t[1] = (_) => d.value = _),
|
|
158
|
+
n
|
|
159
|
+
],
|
|
160
|
+
multiselect: "",
|
|
161
|
+
searchable: "",
|
|
162
|
+
"search-debounce": 300,
|
|
163
|
+
items: A.value,
|
|
164
|
+
label: u(i)("permissionSet.form.includedSets"),
|
|
165
|
+
placeholder: u(i)("permissionSet.form.includedSetsPlaceholder"),
|
|
166
|
+
class: "mt-16"
|
|
167
|
+
}, null, 8, ["modelValue", "items", "label", "placeholder"]),
|
|
168
|
+
r(de, {
|
|
169
|
+
modelValue: g.value,
|
|
170
|
+
"onUpdate:modelValue": t[2] || (t[2] = (_) => g.value = _),
|
|
171
|
+
"inherit-permissions": x.value,
|
|
172
|
+
class: "mt-24"
|
|
173
|
+
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
174
|
+
]),
|
|
175
|
+
_: 1
|
|
176
|
+
}, 512)
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["modelValue"]);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}), be = { class: "space-y-8" }, ge = { class: "flex justify-end xs:px-16" }, he = {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "overflow-auto"
|
|
185
|
+
}, ye = { class: "pb-64" }, Be = /* @__PURE__ */ j({
|
|
186
|
+
__name: "PermissionSetList",
|
|
187
|
+
setup(T, { expose: I }) {
|
|
188
|
+
const { t: s } = O(), i = G(), c = se(), { breakpoints: N } = te(), v = b(""), V = h(() => {
|
|
189
|
+
var o;
|
|
190
|
+
return (o = f.value) == null ? void 0 : o.filter((n) => {
|
|
191
|
+
const m = v.value.toLowerCase();
|
|
192
|
+
return n.name.toLowerCase().includes(m);
|
|
193
|
+
});
|
|
194
|
+
}), S = b(), a = H(), f = h(
|
|
195
|
+
() => a.permissionSets.value
|
|
196
|
+
), d = b();
|
|
197
|
+
async function g() {
|
|
198
|
+
await a.readPermissionSets();
|
|
199
|
+
}
|
|
200
|
+
function L(o) {
|
|
201
|
+
const n = W(
|
|
202
|
+
o.permissionSetIds ?? [],
|
|
203
|
+
a.permissionSets.value
|
|
204
|
+
), m = M(n).map(
|
|
205
|
+
({ setNames: e, setId: t, ...l }) => l
|
|
206
|
+
);
|
|
207
|
+
return {
|
|
208
|
+
...o,
|
|
209
|
+
permissions: J(m, o.permissions)
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function R(o) {
|
|
213
|
+
var n;
|
|
214
|
+
d.value = L(o), (n = S.value) == null || n.trigger();
|
|
215
|
+
}
|
|
216
|
+
const A = [
|
|
217
|
+
{
|
|
218
|
+
accessorKey: "name",
|
|
219
|
+
header: () => s("permissionSet.table.columns.name")
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
accessorKey: "permission",
|
|
223
|
+
header: () => s("permissionSet.table.columns.permissions"),
|
|
224
|
+
enableSorting: !1,
|
|
225
|
+
cell(o) {
|
|
226
|
+
const n = o.row.original, m = W(
|
|
227
|
+
[n.id],
|
|
228
|
+
a.permissionSets.value
|
|
229
|
+
), e = M(m).map(
|
|
230
|
+
({ setNames: t, setId: l, ...w }) => w
|
|
231
|
+
);
|
|
232
|
+
return z(fe, { modelValue: e });
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "action",
|
|
237
|
+
meta: {
|
|
238
|
+
cellClass: "pl-16",
|
|
239
|
+
headerContentClass: "-mx-16"
|
|
240
|
+
},
|
|
241
|
+
cell(o) {
|
|
242
|
+
return z("div", { class: "w-full flex justify-end items-center" }, [
|
|
243
|
+
z(oe.FmButton, {
|
|
244
|
+
prependIcon: "delete",
|
|
245
|
+
variant: ie.Tertiary,
|
|
246
|
+
textColor: ne.NeutralGray400,
|
|
247
|
+
class: "flex flex-end",
|
|
248
|
+
onClick: (n) => {
|
|
249
|
+
n.stopPropagation(), D(o.row.original);
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
]);
|
|
253
|
+
},
|
|
254
|
+
enableSorting: !1
|
|
255
|
+
}
|
|
256
|
+
];
|
|
257
|
+
function x() {
|
|
258
|
+
var o;
|
|
259
|
+
d.value = void 0, (o = S.value) == null || o.trigger();
|
|
260
|
+
}
|
|
261
|
+
async function D(o) {
|
|
262
|
+
c.open({
|
|
263
|
+
title: s("permissionSet.form.delete.title"),
|
|
264
|
+
message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: o.name }),
|
|
265
|
+
minWidth: N.value.lg ? 588 : 0,
|
|
266
|
+
primaryActions: {
|
|
267
|
+
text: s("common.remove"),
|
|
268
|
+
close: !1,
|
|
269
|
+
variant: "destructive"
|
|
270
|
+
},
|
|
271
|
+
secondaryActions: { text: s("common.cancel"), close: !0 }
|
|
272
|
+
}).onPrimary(async () => {
|
|
273
|
+
try {
|
|
274
|
+
await a.deletePermissionSet(o.id), i.open({
|
|
275
|
+
message: s("permissionSet.form.delete.successMessage", { permissionSetName: o.name }),
|
|
276
|
+
type: "success"
|
|
277
|
+
});
|
|
278
|
+
} catch (n) {
|
|
279
|
+
const m = n instanceof ue && n.status === 409 ? n.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
|
|
280
|
+
permissionSetName: o.name
|
|
281
|
+
}) : s("permissionSet.form.delete.conflictError", { permissionSetName: o.name }) : n instanceof Error ? n.message : `${n}`;
|
|
282
|
+
i.open({ message: m, type: "error" });
|
|
283
|
+
}
|
|
284
|
+
c.close();
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return Z(() => {
|
|
288
|
+
g();
|
|
289
|
+
}), I({
|
|
290
|
+
create: x
|
|
291
|
+
}), (o, n) => {
|
|
292
|
+
const m = p("FmSearch"), e = p("FmTable"), t = p("FullWrapper");
|
|
293
|
+
return P(), B(q, null, [
|
|
294
|
+
r(_e, {
|
|
295
|
+
ref_key: "permissionSetFormRef",
|
|
296
|
+
ref: S,
|
|
297
|
+
"model-value": d.value
|
|
298
|
+
}, null, 8, ["model-value"]),
|
|
299
|
+
F("div", be, [
|
|
300
|
+
F("div", ge, [
|
|
301
|
+
r(m, {
|
|
302
|
+
modelValue: v.value,
|
|
303
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => v.value = l),
|
|
304
|
+
class: "w-[320px] xs:w-full",
|
|
305
|
+
autofocus: "",
|
|
306
|
+
placeholder: u(s)("permissionSet.search.placeholder")
|
|
307
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
308
|
+
]),
|
|
309
|
+
f.value.length > 0 ? (P(), B("div", he, [
|
|
310
|
+
F("div", ye, [
|
|
311
|
+
r(t, null, {
|
|
312
|
+
default: y(() => [
|
|
313
|
+
r(e, {
|
|
314
|
+
"column-defs": A,
|
|
315
|
+
"row-data": V.value,
|
|
316
|
+
"page-size": V.value.length,
|
|
317
|
+
"pin-header-row": "",
|
|
318
|
+
"hide-footer": "",
|
|
319
|
+
"shrink-at": !1,
|
|
320
|
+
onRowClick: n[1] || (n[1] = (l) => R(l.original))
|
|
321
|
+
}, null, 8, ["row-data", "page-size"])
|
|
322
|
+
]),
|
|
323
|
+
_: 1
|
|
324
|
+
})
|
|
325
|
+
])
|
|
326
|
+
])) : (P(), K(u(le), {
|
|
327
|
+
key: 1,
|
|
328
|
+
title: u(s)("permissionSet.noData.title"),
|
|
329
|
+
subtitle: u(s)("permissionSet.noData.subtitle")
|
|
330
|
+
}, null, 8, ["title", "subtitle"]))
|
|
331
|
+
])
|
|
332
|
+
], 64);
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
export {
|
|
337
|
+
Be as default
|
|
338
|
+
};
|