@feedmepos/mf-hrm-portal 1.1.3-dev → 1.1.3-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.
- package/dist/AuditLogList-kZBi77lv.js +435 -0
- package/dist/{EmployeeList-zU7fmC4c.js → EmployeeList-Cg-mhdLv.js} +5 -5
- package/dist/{Main-BqhrqOzx.js → Main-BHF7vXlD.js} +28 -27
- package/dist/{Main-DGymQNz9.js → Main-CC9_bKTG.js} +7 -7
- package/dist/PermissionSetList-C0FOYrQ6.js +283 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CS4B-7AU.js +3084 -0
- package/dist/{RoleList-jbZqer7A.js → RoleList-D2NTVZa_.js} +5 -5
- package/dist/{TeamMemberList-uamoOFIV.js → TeamMemberList-DC0Gxjin.js} +325 -322
- package/dist/{TimesheetList-hgT9DrHd.js → TimesheetList-CksRCsTc.js} +6 -6
- package/dist/api/index.d.ts +4 -0
- package/dist/api/team/index.d.ts +2 -2
- package/dist/{app-CcbYGJ22.js → app-kKq54h9D.js} +490 -344
- package/dist/app.js +3 -3
- package/dist/{dayjs.min-CgN1oBQf.js → dayjs.min-CGTR0SS0.js} +1 -1
- package/dist/{employee-khk560IC.js → employee-CRKx3zN0.js} +3 -3
- package/dist/helpers/permission-set.d.ts +15 -0
- package/dist/{index-D5sdamN5.js → index-DRoNwfyW.js} +2153 -2053
- package/dist/index-TP4vQCyq.js +827 -0
- package/dist/{lodash-7Am6_Zd3.js → lodash-CeWi5dyp.js} +1 -1
- package/dist/stores/team.d.ts +4 -1
- package/dist/team-CuLNHjGN.js +29 -0
- package/dist/{timesheet-DKhEeLe7.js → timesheet-V636ISlI.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/audit-log.d.ts +1 -19
- package/dist/{useAppStore-DOSLuH24.js → useAppStore-DoX0IUFz.js} +1 -1
- package/dist/{useLoading-BA-GSZ3R.js → useLoading-1yy1KHsE.js} +1 -1
- package/dist/views/audit-log/locales/index.d.ts +76 -0
- package/dist/views/team/locales/index.d.ts +12 -8
- package/package.json +3 -2
- package/dist/AuditLogList-DNQh1rE9.js +0 -316
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BvjXcknf.js +0 -3050
- package/dist/RolePermissionList-Dd8ks5i7.js +0 -285
- package/dist/team-CFyc6tnm.js +0 -26
- package/dist/types/permission.d.ts +0 -1
- /package/dist/views/team/{role/RolePermissionForm.vue.d.ts → permission-set/PermissionSetForm.vue.d.ts} +0 -0
- /package/dist/views/team/{role/RolePermissionList.vue.d.ts → permission-set/PermissionSetList.vue.d.ts} +0 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { defineComponent as N, computed as V, resolveComponent as c, createElementBlock as w, openBlock as _, createElementVNode as g, createVNode as i, toDisplayString as C, unref as u, withCtx as S, createTextVNode as z, Fragment as A, renderList as M, ref as F, createBlock as D, nextTick as U, onMounted as q, h as I } from "vue";
|
|
2
|
+
import { useI18n as R, useCoreStore as K } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as E, useDialog as G, useBreakpoints as O, components as H, FmButtonColorThemeVariant as J, FmButtonVariant as Q } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as X } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
5
|
+
import { x as Y, u as W, A as Z } from "./index-DRoNwfyW.js";
|
|
6
|
+
import { u as ee } from "./useLoading-1yy1KHsE.js";
|
|
7
|
+
import { a as te } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CS4B-7AU.js";
|
|
8
|
+
const oe = { class: "flex flex-row items-center gap-8" }, se = /* @__PURE__ */ N({
|
|
9
|
+
__name: "PermissionWithTooltip",
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: !0
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(k) {
|
|
17
|
+
const b = k, o = V(() => Y(b.modelValue)), { t: n } = R();
|
|
18
|
+
return (r, P) => {
|
|
19
|
+
const d = c("FmIcon"), h = c("FmTooltip");
|
|
20
|
+
return _(), w("div", oe, [
|
|
21
|
+
g("span", null, C(u(n)("team.labels.allowed", { count: o.value.length })), 1),
|
|
22
|
+
i(h, {
|
|
23
|
+
variant: "plain",
|
|
24
|
+
placement: "top"
|
|
25
|
+
}, {
|
|
26
|
+
content: S(() => [
|
|
27
|
+
g("div", null, [
|
|
28
|
+
z(C(u(n)("team.labels.permission")) + " ", 1),
|
|
29
|
+
(_(!0), w(A, null, M(o.value, (p, f) => (_(), w("div", {
|
|
30
|
+
key: `${p}-${f}`
|
|
31
|
+
}, " - " + C(p), 1))), 128))
|
|
32
|
+
])
|
|
33
|
+
]),
|
|
34
|
+
default: S(() => [
|
|
35
|
+
i(d, {
|
|
36
|
+
name: "info",
|
|
37
|
+
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
38
|
+
})
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
})
|
|
42
|
+
]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}), ne = { class: "fm-typo-en-title-md-600" }, ae = { class: "flex items-center justify-start gap-8" }, le = /* @__PURE__ */ N({
|
|
46
|
+
__name: "PermissionSetForm",
|
|
47
|
+
props: {
|
|
48
|
+
modelValue: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => ({})
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(k, { expose: b }) {
|
|
54
|
+
const o = k, { t: n } = R(), r = F(!1), P = V(() => {
|
|
55
|
+
var s;
|
|
56
|
+
return (s = o.modelValue) != null && s.id ? n("permissionSet.form.update.title") : n("permissionSet.form.create.title");
|
|
57
|
+
}), d = F(), h = E(), p = ee(h), f = W(), l = F({ ...o.modelValue }), x = [(s) => !!s || "Permission set name is required"], B = V(() => {
|
|
58
|
+
var s;
|
|
59
|
+
return (s = o.modelValue) != null && s.id ? n("permissionSet.form.update.confirmButtonLabel") : n("permissionSet.form.create.confirmButtonLabel");
|
|
60
|
+
});
|
|
61
|
+
async function T() {
|
|
62
|
+
await U(), r.value = !r.value, l.value = {
|
|
63
|
+
...o.modelValue
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function $(s) {
|
|
67
|
+
l.value = {
|
|
68
|
+
...l.value,
|
|
69
|
+
permissions: s
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async function L() {
|
|
73
|
+
var t, m;
|
|
74
|
+
const s = await ((t = d.value) == null ? void 0 : t.validateInputsWithoutSubmit()), e = (m = K().currentBusiness.value) == null ? void 0 : m.id;
|
|
75
|
+
!(s != null && s.length) && e && p.minor(async () => {
|
|
76
|
+
var v;
|
|
77
|
+
if ((v = o.modelValue) != null && v.id) {
|
|
78
|
+
const { id: y, ...a } = l.value, j = a;
|
|
79
|
+
await f.updatePermissionSet(o.modelValue.id, j);
|
|
80
|
+
} else {
|
|
81
|
+
const y = {
|
|
82
|
+
...l.value,
|
|
83
|
+
businessId: e
|
|
84
|
+
};
|
|
85
|
+
await f.createPermissionSet(y);
|
|
86
|
+
}
|
|
87
|
+
r.value = !1;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return b({
|
|
91
|
+
trigger: T
|
|
92
|
+
}), (s, e) => {
|
|
93
|
+
const t = c("FmTextField"), m = c("FmForm"), v = c("FmButton"), y = c("FmSideSheet");
|
|
94
|
+
return _(), D(y, {
|
|
95
|
+
modelValue: r.value,
|
|
96
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => r.value = a),
|
|
97
|
+
"max-width": 560,
|
|
98
|
+
"dismiss-away": ""
|
|
99
|
+
}, {
|
|
100
|
+
"side-sheet-header": S(() => [
|
|
101
|
+
g("p", ne, C(P.value), 1)
|
|
102
|
+
]),
|
|
103
|
+
"side-sheet-footer": S(() => [
|
|
104
|
+
g("div", ae, [
|
|
105
|
+
i(v, {
|
|
106
|
+
label: B.value,
|
|
107
|
+
size: "md",
|
|
108
|
+
variant: "primary",
|
|
109
|
+
type: "submit",
|
|
110
|
+
onClick: L
|
|
111
|
+
}, null, 8, ["label"]),
|
|
112
|
+
i(v, {
|
|
113
|
+
label: u(n)("common.cancel"),
|
|
114
|
+
size: "md",
|
|
115
|
+
variant: "secondary",
|
|
116
|
+
onClick: e[2] || (e[2] = (a) => r.value = !1)
|
|
117
|
+
}, null, 8, ["label"])
|
|
118
|
+
])
|
|
119
|
+
]),
|
|
120
|
+
default: S(() => [
|
|
121
|
+
i(m, {
|
|
122
|
+
ref_key: "formRef",
|
|
123
|
+
ref: d
|
|
124
|
+
}, {
|
|
125
|
+
default: S(() => [
|
|
126
|
+
i(t, {
|
|
127
|
+
modelValue: l.value.name,
|
|
128
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => l.value.name = a),
|
|
129
|
+
label: u(n)("permissionSet.form.name"),
|
|
130
|
+
placeholder: u(n)("permissionSet.form.namePlaceholder"),
|
|
131
|
+
rules: x
|
|
132
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
133
|
+
i(te, {
|
|
134
|
+
"model-value": l.value.permissions,
|
|
135
|
+
class: "mt-24",
|
|
136
|
+
onPermissionChanged: e[1] || (e[1] = (a) => $(a))
|
|
137
|
+
}, null, 8, ["model-value"])
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
}, 512)
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
}, 8, ["modelValue"]);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}), ie = { class: "space-y-8" }, re = { class: "flex justify-end xs:px-16" }, me = {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "overflow-auto"
|
|
149
|
+
}, ce = { class: "pb-64" }, ge = /* @__PURE__ */ N({
|
|
150
|
+
__name: "PermissionSetList",
|
|
151
|
+
setup(k, { expose: b }) {
|
|
152
|
+
const { t: o } = R(), n = E(), r = G(), { breakpoints: P } = O(), d = F(""), h = V(() => {
|
|
153
|
+
var e;
|
|
154
|
+
return (e = l.value) == null ? void 0 : e.filter((t) => {
|
|
155
|
+
const m = d.value.toLowerCase();
|
|
156
|
+
return t.name.toLowerCase().includes(m);
|
|
157
|
+
});
|
|
158
|
+
}), p = F(), f = W(), l = V(
|
|
159
|
+
() => f.permissionSets.value
|
|
160
|
+
), x = F();
|
|
161
|
+
async function B() {
|
|
162
|
+
await f.readPermissionSets();
|
|
163
|
+
}
|
|
164
|
+
function T(e) {
|
|
165
|
+
var t;
|
|
166
|
+
x.value = e, (t = p.value) == null || t.trigger();
|
|
167
|
+
}
|
|
168
|
+
const $ = [
|
|
169
|
+
{
|
|
170
|
+
accessorKey: "name",
|
|
171
|
+
header: () => o("permissionSet.table.columns.name")
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
accessorKey: "permission",
|
|
175
|
+
header: () => o("permissionSet.table.columns.permissions"),
|
|
176
|
+
enableSorting: !1,
|
|
177
|
+
cell(e) {
|
|
178
|
+
const t = e.row.original.permissions;
|
|
179
|
+
return I(se, { modelValue: t });
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: "action",
|
|
184
|
+
meta: {
|
|
185
|
+
cellClass: "pl-16",
|
|
186
|
+
headerContentClass: "-mx-16"
|
|
187
|
+
},
|
|
188
|
+
cell(e) {
|
|
189
|
+
return I("div", { class: "w-full flex justify-end items-center" }, [
|
|
190
|
+
I(H.FmButton, {
|
|
191
|
+
prependIcon: "delete",
|
|
192
|
+
variant: Q.Tertiary,
|
|
193
|
+
textColor: J.NeutralGray400,
|
|
194
|
+
class: "flex flex-end",
|
|
195
|
+
onClick: (t) => {
|
|
196
|
+
t.stopPropagation(), s(e.row.original);
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
]);
|
|
200
|
+
},
|
|
201
|
+
enableSorting: !1
|
|
202
|
+
}
|
|
203
|
+
];
|
|
204
|
+
function L() {
|
|
205
|
+
var e;
|
|
206
|
+
x.value = void 0, (e = p.value) == null || e.trigger();
|
|
207
|
+
}
|
|
208
|
+
async function s(e) {
|
|
209
|
+
r.open({
|
|
210
|
+
title: o("permissionSet.form.delete.title"),
|
|
211
|
+
message: o("permissionSet.form.delete.confirmationMessage", { permissionSetName: e.name }),
|
|
212
|
+
minWidth: P.value.lg ? 588 : 0,
|
|
213
|
+
primaryActions: {
|
|
214
|
+
text: o("common.remove"),
|
|
215
|
+
close: !1,
|
|
216
|
+
variant: "destructive"
|
|
217
|
+
},
|
|
218
|
+
secondaryActions: { text: o("common.cancel"), close: !0 }
|
|
219
|
+
}).onPrimary(async () => {
|
|
220
|
+
try {
|
|
221
|
+
await f.deletePermissionSet(e.id), n.open({
|
|
222
|
+
message: o("permissionSet.form.delete.successMessage", { permissionSetName: e.name }),
|
|
223
|
+
type: "success"
|
|
224
|
+
});
|
|
225
|
+
} catch (t) {
|
|
226
|
+
const m = t instanceof Z && t.status === 409 ? o("permissionSet.form.delete.conflictError", { permissionSetName: e.name }) : t instanceof Error ? t.message : `${t}`;
|
|
227
|
+
n.open({ message: m, type: "error" });
|
|
228
|
+
}
|
|
229
|
+
r.close();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
return q(() => {
|
|
233
|
+
B();
|
|
234
|
+
}), b({
|
|
235
|
+
create: L
|
|
236
|
+
}), (e, t) => {
|
|
237
|
+
const m = c("FmSearch"), v = c("FmTable"), y = c("FullWrapper");
|
|
238
|
+
return _(), w(A, null, [
|
|
239
|
+
i(le, {
|
|
240
|
+
ref_key: "permissionSetFormRef",
|
|
241
|
+
ref: p,
|
|
242
|
+
"model-value": x.value
|
|
243
|
+
}, null, 8, ["model-value"]),
|
|
244
|
+
g("div", ie, [
|
|
245
|
+
g("div", re, [
|
|
246
|
+
i(m, {
|
|
247
|
+
modelValue: d.value,
|
|
248
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => d.value = a),
|
|
249
|
+
class: "w-[320px] xs:w-full",
|
|
250
|
+
autofocus: "",
|
|
251
|
+
placeholder: u(o)("permissionSet.search.placeholder")
|
|
252
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
253
|
+
]),
|
|
254
|
+
l.value.length > 0 ? (_(), w("div", me, [
|
|
255
|
+
g("div", ce, [
|
|
256
|
+
i(y, null, {
|
|
257
|
+
default: S(() => [
|
|
258
|
+
i(v, {
|
|
259
|
+
"column-defs": $,
|
|
260
|
+
"row-data": h.value,
|
|
261
|
+
"page-size": h.value.length,
|
|
262
|
+
"pin-header-row": "",
|
|
263
|
+
"hide-footer": "",
|
|
264
|
+
"shrink-at": !1,
|
|
265
|
+
onRowClick: t[1] || (t[1] = (a) => T(a.original))
|
|
266
|
+
}, null, 8, ["row-data", "page-size"])
|
|
267
|
+
]),
|
|
268
|
+
_: 1
|
|
269
|
+
})
|
|
270
|
+
])
|
|
271
|
+
])) : (_(), D(u(X), {
|
|
272
|
+
key: 1,
|
|
273
|
+
title: u(o)("permissionSet.noData.title"),
|
|
274
|
+
subtitle: u(o)("permissionSet.noData.subtitle")
|
|
275
|
+
}, null, 8, ["title", "subtitle"]))
|
|
276
|
+
])
|
|
277
|
+
], 64);
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
export {
|
|
282
|
+
ge as default
|
|
283
|
+
};
|