@feedmepos/mf-hrm-portal 2.0.8-dev → 2.0.8-dev.10
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-CNrMFE7u.js +708 -0
- package/dist/{EmployeeList-O6XTYBcz.js → EmployeeList-cOmlbt40.js} +164 -169
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
- package/dist/HorizontalSplitter-o860F4xM.js +12 -0
- package/dist/{Main-XEb1ECXG.js → Main-BDXOkOE2.js} +11 -10
- package/dist/Main-BJh3lH16.js +560 -0
- package/dist/{Main--bRTC1IR.js → Main-C3koRp1u.js} +8 -7
- package/dist/PermissionSetList-CLJn0V0J.js +338 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bcr-EX6B.js +3471 -0
- package/dist/{RoleList-BeB1etH6.js → RoleList-Bd3v0EoJ.js} +26 -24
- package/dist/TeamMemberList-CbfbIqYV.js +989 -0
- package/dist/{TimesheetList-DNzuykEu.js → TimesheetList-DkJWAHEN.js} +11 -10
- package/dist/{app-BovCLczm.js → app-CBCdQFuQ.js} +1458 -1005
- package/dist/app.js +2 -2
- package/dist/{dayjs.min-dxVeOXk_.js → dayjs.min-D-dyRkoG.js} +1 -1
- package/dist/{employee-DGiDGhcK.js → employee-BUIgpjQN.js} +21 -20
- package/dist/{index-CQ26ps7Z.js → index-BMJS_Lkf.js} +1 -1
- package/dist/index-CPrEayXj.js +968 -0
- package/dist/{index-C0yiZ_7g.js → iteration-CsLWDBUl.js} +3444 -4352
- package/dist/{lodash-CBlFHm6b.js → lodash-B9IFDgiG.js} +1 -1
- package/dist/src/api/grant-user/index.d.ts +8 -0
- package/dist/src/api/index.d.ts +3 -1
- package/dist/src/composables/useBasePermission.d.ts +37 -0
- package/dist/src/helpers/permission-set.d.ts +26 -4
- package/dist/src/helpers/permission-set.test.d.ts +1 -0
- package/dist/src/helpers/permission-sync.d.ts +12 -0
- package/dist/src/router/shared.d.ts +2 -1
- package/dist/src/stores/grant-user.d.ts +86 -0
- package/dist/src/types/grant-user.d.ts +27 -0
- package/dist/src/views/audit-log/locales/index.d.ts +140 -0
- package/dist/src/views/grant/GrantUserList.vue.d.ts +17 -0
- package/dist/src/views/grant/Main.vue.d.ts +2 -0
- package/dist/src/views/grant/components/GrantUserForm.vue.d.ts +17 -0
- package/dist/src/views/grant/locales/index.d.ts +232 -0
- package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -3
- package/dist/style.css +1 -1
- package/dist/{team-BqxJ-gNb.js → team-6mA14lfK.js} +1 -1
- package/dist/{timesheet-BVR_FxsT.js → timesheet-DG2p1hTy.js} +10 -9
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-gvdZApLV.js → useAppStore-CmUOIsdB.js} +1 -1
- package/dist/{useLoading-CCzb5k4G.js → useLoading-Ct9N6Ir6.js} +1 -1
- package/dist/{useReportPermissions-9TaHhs9I.js → useReportPermissions-D_KEL6RC.js} +12 -11
- package/dist/useRestaurantMap-e9fQJiLC.js +39 -0
- package/package.json +2 -2
- package/dist/AuditLogList-Dp5B1jR-.js +0 -492
- package/dist/PermissionSetList-DAwnZ-Gu.js +0 -327
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bx7A0p-f.js +0 -3333
- package/dist/TeamMemberList-BKCsNEuQ.js +0 -979
- 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 "./
|
|
4
|
+
import { g as l, b as d, s as R } from "./iteration-CsLWDBUl.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-
|
|
3
|
+
import { a as w, v } from "./useAppStore-CmUOIsdB.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
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import "./
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { e as l } from "./iteration-CsLWDBUl.js";
|
|
3
|
+
import { useCoreStore as y } from "@feedmepos/mf-common";
|
|
4
|
+
import { e as R, R as h } from "./index-CPrEayXj.js";
|
|
5
|
+
import "./app-CBCdQFuQ.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 =
|
|
11
|
-
if (s && (
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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.8-dev",
|
|
3
|
+
"version": "2.0.8-dev.10",
|
|
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.
|
|
32
|
+
"@feedmepos/hrm-permission": "1.0.5"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@casl/ability": "^3.4.0",
|
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
import { defineComponent as de, ref as h, computed as k, watch as R, resolveComponent as D, createElementBlock as f, openBlock as m, Fragment as F, createVNode as d, unref as n, withCtx as N, createElementVNode as e, createBlock as $, createCommentVNode as x, toDisplayString as s, renderList as re, createTextVNode as Y } from "vue";
|
|
2
|
-
import { d as ce } from "./dayjs.min-dxVeOXk_.js";
|
|
3
|
-
import { useI18n as ue, useCoreStore as me } from "@feedmepos/mf-common";
|
|
4
|
-
import { L as J, _ as fe } from "./app-BovCLczm.js";
|
|
5
|
-
import { _ as pe } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
6
|
-
import { _ as ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
7
|
-
import { components as G } from "@feedmepos/ui-library";
|
|
8
|
-
import { g as _e, b as ge, p as Z } from "./index-C0yiZ_7g.js";
|
|
9
|
-
import { u as he } from "./team-BqxJ-gNb.js";
|
|
10
|
-
import { S as U } from "./SelectFilter-DUj7GBtT.js";
|
|
11
|
-
const be = "/audit-logs", xe = {
|
|
12
|
-
async read(i) {
|
|
13
|
-
var O, g, L, w;
|
|
14
|
-
const o = {
|
|
15
|
-
limit: (i == null ? void 0 : i.limit) ?? 100,
|
|
16
|
-
offset: (i == null ? void 0 : i.offset) ?? 0,
|
|
17
|
-
...i != null && i.from ? { from: i.from } : {},
|
|
18
|
-
...i != null && i.to ? { to: i.to } : {},
|
|
19
|
-
...(O = i == null ? void 0 : i.userIds) != null && O.length ? { userIds: i.userIds } : {},
|
|
20
|
-
...(g = i == null ? void 0 : i.subjects) != null && g.length ? { subjects: i.subjects } : {},
|
|
21
|
-
...(L = i == null ? void 0 : i.actions) != null && L.length ? { actions: i.actions } : {},
|
|
22
|
-
...(w = i == null ? void 0 : i.outcomes) != null && w.length ? { outcomes: i.outcomes } : {}
|
|
23
|
-
};
|
|
24
|
-
return console.log("[AuditLogAPI] request params:", o), _e(
|
|
25
|
-
await ge().get(be, {
|
|
26
|
-
params: o,
|
|
27
|
-
// Serialize arrays as repeated params: key=val1&key=val2
|
|
28
|
-
// (NestJS @Query expects this; axios default adds brackets which break matching)
|
|
29
|
-
paramsSerializer: (a) => {
|
|
30
|
-
const y = new URLSearchParams();
|
|
31
|
-
for (const [p, b] of Object.entries(a))
|
|
32
|
-
if (Array.isArray(b))
|
|
33
|
-
for (const A of b) y.append(p, String(A));
|
|
34
|
-
else b != null && y.append(p, String(b));
|
|
35
|
-
return console.log("[AuditLogAPI] serialized query string:", y.toString()), y.toString();
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
}, ye = {
|
|
41
|
-
class: "flex flex-1 flex-col gap-16 min-h-0"
|
|
42
|
-
}, Le = {
|
|
43
|
-
class: "flex items-center gap-8"
|
|
44
|
-
}, Se = {
|
|
45
|
-
class: "w-fit"
|
|
46
|
-
}, ke = {
|
|
47
|
-
class: "w-fit"
|
|
48
|
-
}, we = {
|
|
49
|
-
class: "w-fit"
|
|
50
|
-
}, Ie = {
|
|
51
|
-
class: "w-fit"
|
|
52
|
-
}, Ce = {
|
|
53
|
-
class: "flex h-full flex-col"
|
|
54
|
-
}, Pe = {
|
|
55
|
-
key: 0,
|
|
56
|
-
class: "flex shrink-0 items-center justify-end border-t border-fm-color-border-default py-4"
|
|
57
|
-
}, Te = {
|
|
58
|
-
class: "text-sm text-fm-color-typo-secondary"
|
|
59
|
-
}, Ve = {
|
|
60
|
-
key: 0,
|
|
61
|
-
class: "space-y-12 p-4 text-sm"
|
|
62
|
-
}, je = {
|
|
63
|
-
class: "rounded-lg border border-fm-color-border-default"
|
|
64
|
-
}, De = {
|
|
65
|
-
class: "flex items-start justify-between gap-8 p-12"
|
|
66
|
-
}, Oe = {
|
|
67
|
-
class: "text-base font-bold leading-snug text-fm-color-typo-primary flex-1 min-w-0"
|
|
68
|
-
}, Ae = {
|
|
69
|
-
class: "audit-log-operation-label-detail font-semibold"
|
|
70
|
-
}, Fe = {
|
|
71
|
-
class: "space-y-12 p-12"
|
|
72
|
-
}, Ne = {
|
|
73
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
74
|
-
}, Ue = {
|
|
75
|
-
class: "font-semibold"
|
|
76
|
-
}, Be = {
|
|
77
|
-
key: 0
|
|
78
|
-
}, Ee = {
|
|
79
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
80
|
-
}, Re = {
|
|
81
|
-
class: "font-semibold"
|
|
82
|
-
}, qe = {
|
|
83
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
84
|
-
}, ze = {
|
|
85
|
-
class: "break-all font-mono text-xs font-semibold"
|
|
86
|
-
}, Me = {
|
|
87
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
88
|
-
}, Ke = {
|
|
89
|
-
class: "font-semibold"
|
|
90
|
-
}, $e = {
|
|
91
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
92
|
-
}, Ye = {
|
|
93
|
-
class: "font-semibold"
|
|
94
|
-
}, Je = {
|
|
95
|
-
key: 1
|
|
96
|
-
}, Ge = {
|
|
97
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
98
|
-
}, Ze = {
|
|
99
|
-
class: "font-semibold"
|
|
100
|
-
}, He = {
|
|
101
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
102
|
-
}, Qe = {
|
|
103
|
-
class: "break-all font-mono text-xs font-semibold"
|
|
104
|
-
}, We = {
|
|
105
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
106
|
-
}, Xe = {
|
|
107
|
-
class: "font-semibold"
|
|
108
|
-
}, et = {
|
|
109
|
-
class: "rounded-lg border border-fm-color-border-default"
|
|
110
|
-
}, tt = {
|
|
111
|
-
class: "p-12"
|
|
112
|
-
}, ot = {
|
|
113
|
-
class: "text-base font-bold text-fm-color-typo-primary"
|
|
114
|
-
}, at = {
|
|
115
|
-
class: "space-y-12 p-12"
|
|
116
|
-
}, lt = {
|
|
117
|
-
key: 0
|
|
118
|
-
}, st = {
|
|
119
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
120
|
-
}, nt = {
|
|
121
|
-
class: "font-semibold"
|
|
122
|
-
}, it = {
|
|
123
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
124
|
-
}, dt = {
|
|
125
|
-
class: "font-semibold"
|
|
126
|
-
}, rt = {
|
|
127
|
-
key: 1
|
|
128
|
-
}, ct = {
|
|
129
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
130
|
-
}, ut = {
|
|
131
|
-
class: "font-semibold"
|
|
132
|
-
}, mt = {
|
|
133
|
-
class: "break-all font-mono text-xs text-fm-color-typo-secondary"
|
|
134
|
-
}, ft = {
|
|
135
|
-
class: "font-semibold"
|
|
136
|
-
}, pt = {
|
|
137
|
-
key: 0,
|
|
138
|
-
class: "break-all font-mono text-xs text-fm-color-typo-secondary"
|
|
139
|
-
}, vt = {
|
|
140
|
-
key: 2
|
|
141
|
-
}, _t = {
|
|
142
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
143
|
-
}, gt = {
|
|
144
|
-
class: "mt-4 space-y-4"
|
|
145
|
-
}, ht = {
|
|
146
|
-
class: "flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-fm-color-primary-default text-xs font-bold text-white"
|
|
147
|
-
}, bt = {
|
|
148
|
-
class: "text-xs font-semibold"
|
|
149
|
-
}, xt = {
|
|
150
|
-
key: 0,
|
|
151
|
-
class: "text-fm-color-typo-secondary"
|
|
152
|
-
}, yt = {
|
|
153
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
154
|
-
}, Lt = {
|
|
155
|
-
class: "font-mono text-xs font-semibold"
|
|
156
|
-
}, St = {
|
|
157
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
158
|
-
}, kt = {
|
|
159
|
-
class: "break-all font-mono text-xs font-semibold"
|
|
160
|
-
}, wt = {
|
|
161
|
-
key: 3
|
|
162
|
-
}, It = {
|
|
163
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
164
|
-
}, Ct = {
|
|
165
|
-
class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner"
|
|
166
|
-
}, q = 100, Bt = /* @__PURE__ */ de({
|
|
167
|
-
__name: "AuditLogList",
|
|
168
|
-
setup(i) {
|
|
169
|
-
const {
|
|
170
|
-
t: o
|
|
171
|
-
} = ue(), O = me(), g = he(), L = h(!1), w = h([]), a = h(null), y = h(!1), p = h(1), b = h(!1), A = ce().format("YYYY-MM-DD"), I = h({
|
|
172
|
-
startDate: A,
|
|
173
|
-
endDate: A
|
|
174
|
-
}), C = h(), P = h(), T = h(), V = h();
|
|
175
|
-
function H(l) {
|
|
176
|
-
return typeof l == "string" ? [l] : Array.isArray(l) ? l.filter((t) => typeof t == "string") : [];
|
|
177
|
-
}
|
|
178
|
-
const Q = k(() => g.members.map((l) => ({
|
|
179
|
-
label: l.name,
|
|
180
|
-
value: l.doc.userId
|
|
181
|
-
}))), W = k(() => {
|
|
182
|
-
const l = Z.flatMap((c) => H(c.subject).map((_) => ({
|
|
183
|
-
label: c.label,
|
|
184
|
-
value: _
|
|
185
|
-
}))), t = Object.entries(J).map(([c, _]) => ({
|
|
186
|
-
label: _,
|
|
187
|
-
value: c
|
|
188
|
-
})), r = /* @__PURE__ */ new Set(), v = [];
|
|
189
|
-
for (const c of [...l, ...t])
|
|
190
|
-
r.has(c.value) || (r.add(c.value), v.push(c));
|
|
191
|
-
return v;
|
|
192
|
-
});
|
|
193
|
-
function X(l, t) {
|
|
194
|
-
const r = t.toLowerCase();
|
|
195
|
-
return !!(l.label.toLowerCase().includes(r) || l.value.replace(/^business::/, "").toLowerCase().includes(r) || l.value.toLowerCase().includes(r));
|
|
196
|
-
}
|
|
197
|
-
const ee = k(() => [{
|
|
198
|
-
label: o("auditLog.action.manage"),
|
|
199
|
-
value: "manage"
|
|
200
|
-
}, {
|
|
201
|
-
label: o("auditLog.action.create"),
|
|
202
|
-
value: "create"
|
|
203
|
-
}, {
|
|
204
|
-
label: o("auditLog.action.read"),
|
|
205
|
-
value: "read"
|
|
206
|
-
}, {
|
|
207
|
-
label: o("auditLog.action.update"),
|
|
208
|
-
value: "update"
|
|
209
|
-
}, {
|
|
210
|
-
label: o("auditLog.action.delete"),
|
|
211
|
-
value: "delete"
|
|
212
|
-
}]), te = k(() => [{
|
|
213
|
-
label: o("auditLog.outcome.allowed"),
|
|
214
|
-
value: "allowed"
|
|
215
|
-
}, {
|
|
216
|
-
label: o("auditLog.outcome.denied"),
|
|
217
|
-
value: "denied"
|
|
218
|
-
}, {
|
|
219
|
-
label: o("auditLog.outcome.skipped"),
|
|
220
|
-
value: "skipped"
|
|
221
|
-
}]), oe = k(() => {
|
|
222
|
-
const {
|
|
223
|
-
startDate: l,
|
|
224
|
-
endDate: t
|
|
225
|
-
} = I.value;
|
|
226
|
-
return l && t ? `${l} – ${t}` : l || t || o("auditLog.dateRange.placeholder");
|
|
227
|
-
}), B = k(() => w.value);
|
|
228
|
-
function z(l) {
|
|
229
|
-
var t;
|
|
230
|
-
return ((t = Z.find((r) => r.subject === l)) == null ? void 0 : t.label) ?? J[l];
|
|
231
|
-
}
|
|
232
|
-
const M = {
|
|
233
|
-
allowed: "success",
|
|
234
|
-
denied: "critical",
|
|
235
|
-
skipped: "warning"
|
|
236
|
-
}, ae = [{
|
|
237
|
-
accessorKey: "timestamp",
|
|
238
|
-
header: () => o("auditLog.columns.timestamp"),
|
|
239
|
-
cell(l) {
|
|
240
|
-
const t = l.row.original;
|
|
241
|
-
return new Date(t.timestamp).toLocaleString();
|
|
242
|
-
}
|
|
243
|
-
}, {
|
|
244
|
-
accessorKey: "userId",
|
|
245
|
-
header: () => o("auditLog.columns.user"),
|
|
246
|
-
enableSorting: !1,
|
|
247
|
-
size: 220,
|
|
248
|
-
cell(l) {
|
|
249
|
-
const t = l.row.original, r = g.userIdToName[t.userId], v = g.userIdToPhone[t.userId], c = g.userIdToEmail[t.userId];
|
|
250
|
-
return d("div", {
|
|
251
|
-
class: "flex items-center gap-8"
|
|
252
|
-
}, [d(G.FmAvatar, {
|
|
253
|
-
initials: r || t.userId,
|
|
254
|
-
size: "sm",
|
|
255
|
-
class: "shrink-0"
|
|
256
|
-
}, null), d("div", {
|
|
257
|
-
class: "min-w-0"
|
|
258
|
-
}, [r && d("p", {
|
|
259
|
-
class: "truncate font-semibold"
|
|
260
|
-
}, [r, v && d("span", {
|
|
261
|
-
class: "font-normal"
|
|
262
|
-
}, [Y(" ("), v, Y(")")])]), c && d("p", {
|
|
263
|
-
class: "truncate"
|
|
264
|
-
}, [c]), d("p", {
|
|
265
|
-
class: "truncate font-mono text-[10px] text-fm-color-typo-tertiary"
|
|
266
|
-
}, [t.userId])])]);
|
|
267
|
-
}
|
|
268
|
-
}, {
|
|
269
|
-
accessorKey: "subject",
|
|
270
|
-
header: () => o("auditLog.columns.subject"),
|
|
271
|
-
meta: {
|
|
272
|
-
cellClass: "text-left"
|
|
273
|
-
},
|
|
274
|
-
cell(l) {
|
|
275
|
-
const t = l.row.original, r = z(t.subject);
|
|
276
|
-
return r ? d("div", {
|
|
277
|
-
class: "text-left"
|
|
278
|
-
}, [d("span", null, [r]), d("p", {
|
|
279
|
-
class: "text-xs text-fm-color-typo-tertiary"
|
|
280
|
-
}, [t.subject])]) : d("div", {
|
|
281
|
-
class: "text-left"
|
|
282
|
-
}, [t.subject]);
|
|
283
|
-
}
|
|
284
|
-
}, {
|
|
285
|
-
accessorKey: "action",
|
|
286
|
-
header: () => o("auditLog.columns.action"),
|
|
287
|
-
enableSorting: !1
|
|
288
|
-
}, {
|
|
289
|
-
accessorKey: "operationLabel",
|
|
290
|
-
header: () => o("auditLog.columns.operation"),
|
|
291
|
-
enableSorting: !1,
|
|
292
|
-
size: 240,
|
|
293
|
-
meta: {
|
|
294
|
-
cellSpanClass: "audit-log-operation-label-table"
|
|
295
|
-
},
|
|
296
|
-
cell(l) {
|
|
297
|
-
return l.row.original.metadata.operationLabel ?? "-";
|
|
298
|
-
}
|
|
299
|
-
}, {
|
|
300
|
-
accessorKey: "outcome",
|
|
301
|
-
header: () => o("auditLog.columns.outcome"),
|
|
302
|
-
enableSorting: !1,
|
|
303
|
-
cell(l) {
|
|
304
|
-
const t = l.row.original;
|
|
305
|
-
return d(G.FmChip, {
|
|
306
|
-
variant: M[t.outcome] ?? "neutral",
|
|
307
|
-
label: t.outcome,
|
|
308
|
-
compact: !0
|
|
309
|
-
}, null);
|
|
310
|
-
}
|
|
311
|
-
}];
|
|
312
|
-
function K(l, t = !1) {
|
|
313
|
-
const [r, v, c] = l.split("-").map(Number), _ = new Date(r, v - 1, c);
|
|
314
|
-
return t && _.setDate(_.getDate() + 1), _.toISOString().slice(0, 19).replace("T", " ");
|
|
315
|
-
}
|
|
316
|
-
async function j() {
|
|
317
|
-
var l, t, r, v;
|
|
318
|
-
L.value = !0;
|
|
319
|
-
try {
|
|
320
|
-
const {
|
|
321
|
-
startDate: c,
|
|
322
|
-
endDate: _
|
|
323
|
-
} = I.value, E = (p.value - 1) * q, u = {
|
|
324
|
-
limit: q,
|
|
325
|
-
offset: E,
|
|
326
|
-
// Convert local date boundaries to UTC ISO strings so ClickHouse
|
|
327
|
-
// (which stores timestamps in UTC) receives the correct range.
|
|
328
|
-
...c ? {
|
|
329
|
-
from: K(c)
|
|
330
|
-
} : {},
|
|
331
|
-
..._ ? {
|
|
332
|
-
to: K(_, !0)
|
|
333
|
-
} : {},
|
|
334
|
-
...(l = C.value) != null && l.length ? {
|
|
335
|
-
userIds: C.value
|
|
336
|
-
} : {},
|
|
337
|
-
...(t = P.value) != null && t.length ? {
|
|
338
|
-
subjects: P.value
|
|
339
|
-
} : {},
|
|
340
|
-
...(r = V.value) != null && r.length ? {
|
|
341
|
-
actions: V.value
|
|
342
|
-
} : {},
|
|
343
|
-
...(v = T.value) != null && v.length ? {
|
|
344
|
-
outcomes: T.value
|
|
345
|
-
} : {}
|
|
346
|
-
}, S = await xe.read(u);
|
|
347
|
-
w.value = S, b.value = S.length === q;
|
|
348
|
-
} finally {
|
|
349
|
-
L.value = !1;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
R(I, () => {
|
|
353
|
-
p.value = 1, j();
|
|
354
|
-
}), R([C, P, T, V], () => {
|
|
355
|
-
p.value = 1, j();
|
|
356
|
-
});
|
|
357
|
-
async function le() {
|
|
358
|
-
p.value > 1 && (p.value--, await j());
|
|
359
|
-
}
|
|
360
|
-
async function se() {
|
|
361
|
-
b.value && (p.value++, await j());
|
|
362
|
-
}
|
|
363
|
-
function ne(l) {
|
|
364
|
-
a.value = l, y.value = !0;
|
|
365
|
-
}
|
|
366
|
-
function ie() {
|
|
367
|
-
y.value = !1, a.value = null;
|
|
368
|
-
}
|
|
369
|
-
return R(O.currentBusiness, (l) => {
|
|
370
|
-
l && (p.value = 1, g.readTeamMembers(), j());
|
|
371
|
-
}, {
|
|
372
|
-
immediate: !0
|
|
373
|
-
}), (l, t) => {
|
|
374
|
-
const r = D("FmChip"), v = D("FmDateRangePicker"), c = D("FmTable"), _ = D("FmButton"), E = D("FmSideSheet");
|
|
375
|
-
return m(), f(F, null, [d(pe, {
|
|
376
|
-
heading: n(o)("auditLog.title")
|
|
377
|
-
}, {
|
|
378
|
-
default: N(() => [e("div", ye, [e("div", Le, [d(v, {
|
|
379
|
-
modelValue: I.value,
|
|
380
|
-
"onUpdate:modelValue": t[0] || (t[0] = (u) => I.value = u),
|
|
381
|
-
"show-predefined-range": ""
|
|
382
|
-
}, {
|
|
383
|
-
"trigger-button": N(() => [d(r, {
|
|
384
|
-
label: oe.value,
|
|
385
|
-
icon: "calendar_month"
|
|
386
|
-
}, null, 8, ["label"])]),
|
|
387
|
-
_: 1
|
|
388
|
-
}, 8, ["modelValue"]), e("div", Se, [d(U, {
|
|
389
|
-
modelValue: C.value,
|
|
390
|
-
"onUpdate:modelValue": t[1] || (t[1] = (u) => C.value = u),
|
|
391
|
-
items: Q.value,
|
|
392
|
-
multiple: "",
|
|
393
|
-
variant: "dark",
|
|
394
|
-
placeholder: n(o)("auditLog.filter.user_placeholder"),
|
|
395
|
-
"selected-prefix": n(o)("auditLog.filter.selected_user_prefix"),
|
|
396
|
-
"chip-icon": "account_circle"
|
|
397
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), e("div", ke, [d(U, {
|
|
398
|
-
modelValue: P.value,
|
|
399
|
-
"onUpdate:modelValue": t[2] || (t[2] = (u) => P.value = u),
|
|
400
|
-
items: W.value,
|
|
401
|
-
"filter-fn": X,
|
|
402
|
-
multiple: "",
|
|
403
|
-
variant: "dark",
|
|
404
|
-
placeholder: n(o)("auditLog.filter.subject_placeholder"),
|
|
405
|
-
"selected-prefix": n(o)("auditLog.filter.selected_subject_prefix"),
|
|
406
|
-
"chip-icon": "badge"
|
|
407
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), e("div", we, [d(U, {
|
|
408
|
-
modelValue: V.value,
|
|
409
|
-
"onUpdate:modelValue": t[3] || (t[3] = (u) => V.value = u),
|
|
410
|
-
items: ee.value,
|
|
411
|
-
multiple: "",
|
|
412
|
-
variant: "dark",
|
|
413
|
-
placeholder: n(o)("auditLog.filter.action_placeholder"),
|
|
414
|
-
"selected-prefix": n(o)("auditLog.filter.selected_action_prefix"),
|
|
415
|
-
searchable: !1
|
|
416
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), e("div", Ie, [d(U, {
|
|
417
|
-
modelValue: T.value,
|
|
418
|
-
"onUpdate:modelValue": t[4] || (t[4] = (u) => T.value = u),
|
|
419
|
-
items: te.value,
|
|
420
|
-
multiple: "",
|
|
421
|
-
variant: "dark",
|
|
422
|
-
placeholder: n(o)("auditLog.filter.status_placeholder"),
|
|
423
|
-
"selected-prefix": n(o)("auditLog.filter.selected_status_prefix"),
|
|
424
|
-
searchable: !1,
|
|
425
|
-
"chip-icon": "check_circle"
|
|
426
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])]), !L.value && B.value.length === 0 ? (m(), $(n(ve), {
|
|
427
|
-
key: 0,
|
|
428
|
-
title: n(o)("auditLog.noData.title"),
|
|
429
|
-
subtitle: n(o)("auditLog.noData.subtitle")
|
|
430
|
-
}, null, 8, ["title", "subtitle"])) : (m(), $(fe, {
|
|
431
|
-
key: 1
|
|
432
|
-
}, {
|
|
433
|
-
default: N(() => [e("div", Ce, [d(c, {
|
|
434
|
-
"column-defs": ae,
|
|
435
|
-
"row-data": B.value,
|
|
436
|
-
"page-size": B.value.length,
|
|
437
|
-
loading: L.value,
|
|
438
|
-
"pin-header-row": "",
|
|
439
|
-
"hide-footer": "",
|
|
440
|
-
class: "min-h-0 flex-1 cursor-pointer",
|
|
441
|
-
onRowClick: t[5] || (t[5] = (u) => ne(u.original))
|
|
442
|
-
}, null, 8, ["row-data", "page-size", "loading"]), p.value > 1 || b.value ? (m(), f("div", Pe, [d(_, {
|
|
443
|
-
variant: "tertiary",
|
|
444
|
-
icon: "chevron_left",
|
|
445
|
-
disabled: p.value === 1,
|
|
446
|
-
"aria-label": n(o)("auditLog.pagination.prevPage"),
|
|
447
|
-
onClick: le
|
|
448
|
-
}, null, 8, ["disabled", "aria-label"]), e("span", Te, s(n(o)("auditLog.pagination.page", {
|
|
449
|
-
page: p.value
|
|
450
|
-
})), 1), d(_, {
|
|
451
|
-
variant: "tertiary",
|
|
452
|
-
icon: "chevron_right",
|
|
453
|
-
disabled: !b.value,
|
|
454
|
-
"aria-label": n(o)("auditLog.pagination.nextPage"),
|
|
455
|
-
onClick: se
|
|
456
|
-
}, null, 8, ["disabled", "aria-label"])])) : x("", !0)])]),
|
|
457
|
-
_: 1
|
|
458
|
-
}))])]),
|
|
459
|
-
_: 1
|
|
460
|
-
}, 8, ["heading"]), d(E, {
|
|
461
|
-
header: n(o)("auditLog.detail.header"),
|
|
462
|
-
"model-value": y.value,
|
|
463
|
-
"max-width": 480,
|
|
464
|
-
"dismiss-away": "",
|
|
465
|
-
"onUpdate:modelValue": t[6] || (t[6] = (u) => {
|
|
466
|
-
u || ie();
|
|
467
|
-
})
|
|
468
|
-
}, {
|
|
469
|
-
default: N(() => [a.value ? (m(), f("div", Ve, [e("div", je, [e("div", De, [e("div", Oe, [e("p", Ae, s(a.value.metadata.operationLabel || "-"), 1)]), d(r, {
|
|
470
|
-
variant: M[a.value.outcome] ?? "neutral",
|
|
471
|
-
label: a.value.outcome,
|
|
472
|
-
compact: ""
|
|
473
|
-
}, null, 8, ["variant", "label"])]), t[7] || (t[7] = e("hr", {
|
|
474
|
-
class: "border-fm-color-border-default"
|
|
475
|
-
}, null, -1)), e("div", Fe, [e("div", null, [e("p", Ne, s(n(o)("auditLog.detail.timestamp")), 1), e("p", Ue, s(new Date(a.value.timestamp).toLocaleString()), 1)]), n(g).userIdToName[a.value.userId] ? (m(), f("div", Be, [e("p", Ee, s(n(o)("auditLog.detail.user")), 1), e("p", Re, s(n(g).userIdToName[a.value.userId]), 1)])) : x("", !0), e("div", null, [e("p", qe, s(n(o)("auditLog.detail.email")), 1), e("p", ze, s(n(g).userIdToEmail[a.value.userId] || a.value.userId), 1)]), e("div", null, [e("p", Me, s(n(o)("auditLog.detail.action")), 1), e("p", Ke, s(a.value.action), 1)]), e("div", null, [e("p", $e, s(n(o)("auditLog.detail.subject")), 1), e("p", Ye, s(z(a.value.subject) || a.value.subject), 1)]), a.value.field ? (m(), f("div", Je, [e("p", Ge, s(n(o)("auditLog.detail.field")), 1), e("p", Ze, s(a.value.field), 1)])) : x("", !0), e("div", null, [e("p", He, s(n(o)("auditLog.detail.business")), 1), e("p", Qe, s(a.value.businessId || "-"), 1)]), e("div", null, [e("p", We, s(n(o)("auditLog.detail.restaurant")), 1), e("p", Xe, s(a.value.restaurantId || "-"), 1)])])]), e("div", et, [e("div", tt, [e("p", ot, s(n(o)("auditLog.detail.metadata")), 1)]), t[8] || (t[8] = e("hr", {
|
|
476
|
-
class: "border-fm-color-border-default"
|
|
477
|
-
}, null, -1)), e("div", at, [a.value.metadata.reason ? (m(), f("div", lt, [e("p", st, s(n(o)("auditLog.detail.reason")), 1), e("p", nt, s(a.value.metadata.reason), 1)])) : x("", !0), e("div", null, [e("p", it, s(n(o)("auditLog.detail.resolvedFrom")), 1), e("p", dt, s(a.value.metadata.resolvedFrom), 1)]), a.value.metadata.permissionSetId ? (m(), f("div", rt, [e("p", ct, s(n(o)("auditLog.detail.permissionSet")), 1), a.value.metadata.resolvedFrom === "systemPermissionSet" ? (m(), f(F, {
|
|
478
|
-
key: 0
|
|
479
|
-
}, [e("p", ut, s(a.value.metadata.permissionSetName) + " (system)", 1), e("p", mt, s(a.value.metadata.permissionSetId), 1)], 64)) : (m(), f(F, {
|
|
480
|
-
key: 1
|
|
481
|
-
}, [e("p", ft, s(a.value.metadata.permissionSetName || a.value.metadata.permissionSetId), 1), a.value.metadata.permissionSetName ? (m(), f("p", pt, s(a.value.metadata.permissionSetId), 1)) : x("", !0)], 64))])) : x("", !0), a.value.metadata.trace && a.value.metadata.trace.length > 0 ? (m(), f("div", vt, [e("p", _t, s(n(o)("auditLog.detail.permissionTrace")), 1), e("ol", gt, [(m(!0), f(F, null, re(a.value.metadata.trace, (u, S) => (m(), f("li", {
|
|
482
|
-
key: S,
|
|
483
|
-
class: "flex items-center gap-6"
|
|
484
|
-
}, [e("span", ht, s(S + 1), 1), e("span", bt, s(u), 1), S < a.value.metadata.trace.length - 1 ? (m(), f("span", xt, "→")) : x("", !0)]))), 128))])])) : x("", !0), e("div", null, [e("p", yt, s(n(o)("auditLog.detail.requestMethod")), 1), e("p", Lt, s(a.value.metadata.requestMethod), 1)]), e("div", null, [e("p", St, s(n(o)("auditLog.detail.requestPath")), 1), e("p", kt, s(a.value.metadata.requestPath), 1)]), a.value.metadata.requestBody && Object.keys(a.value.metadata.requestBody).length > 0 ? (m(), f("div", wt, [e("p", It, s(n(o)("auditLog.detail.requestBody")), 1), e("pre", Ct, s(JSON.stringify(a.value.metadata.requestBody, null, 2)), 1)])) : x("", !0)])])])) : x("", !0)]),
|
|
485
|
-
_: 1
|
|
486
|
-
}, 8, ["header", "model-value"])], 64);
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
|
-
export {
|
|
491
|
-
Bt as default
|
|
492
|
-
};
|