@feedmepos/mf-hrm-portal 2.1.1-dev.3 → 2.1.1-dev.5
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/ApprovalCodeList-CXJyMKEg.js +757 -0
- package/dist/{AuditLogList-Q4L5Te8O.js → AuditLogList-CXUkbDyT.js} +3 -3
- package/dist/{EmployeeList-GtKmJZbf.js → EmployeeList-BSfUFTcN.js} +4 -4
- package/dist/{GrantUserList-CnLjOi5_.js → GrantUserList-DKP4MBQM.js} +175 -182
- package/dist/Main-CblWfQk_.js +122 -0
- package/dist/{Main-cskEZ3k_.js → Main-CyCfz4ka.js} +9 -9
- package/dist/{Main-DLlpEU3j.js → Main-Cz1pfe2k.js} +5 -5
- package/dist/{PermissionSetList-C2fK2pTz.js → PermissionSetList-BwyblSeE.js} +5 -5
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMh0DL1_.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BJ-PZ2Nv.js} +599 -599
- package/dist/{RoleList-CcuT1ERb.js → RoleList-CXYgCmHp.js} +6 -6
- package/dist/{TeamMemberList-Dfs2iNdC.js → TeamMemberList-CnLbqaPS.js} +6 -6
- package/dist/{TimesheetList-B1H_6zfP.js → TimesheetList-s_bP5OGA.js} +5 -5
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-BCLv-2Re.js} +2 -2
- package/dist/{app-DX-PG6wx.js → app-BP0oihBR.js} +783 -752
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BJrHE7oz.js → dayjs.min-BTSZLci9.js} +1 -1
- package/dist/{employee-BJcqtqLM.js → employee-BPv1j6T4.js} +3 -3
- package/dist/{iteration-Cfaqt-0s.js → iteration-BNA1cEos.js} +1 -1
- package/dist/{lodash-ClKqCmlZ.js → lodash-DKG9IyB-.js} +1 -1
- package/dist/{role-CR_-nBDY.js → role-BS3LFO8u.js} +1 -1
- package/dist/{rule-BB-3S-2R.js → rule-DaSLVZWm.js} +2 -2
- package/dist/src/stores/approval-code.d.ts +6 -6
- package/dist/src/types/approval-code.d.ts +60 -20
- package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +1 -1
- package/dist/src/views/approval-code/components/ApprovalCodeCreatedDialog.vue.d.ts +9 -0
- package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +6 -1
- package/dist/src/views/approval-code/locales/index.d.ts +44 -12
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-ybHA26cJ.js → useReportPermissions-J3-DjopO.js} +3 -3
- package/package.json +1 -1
- package/dist/ApprovalCodeList-BH5sgVMU.js +0 -638
- package/dist/Main-Cn7Dawg4.js +0 -120
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as Xe, ref as f, computed as h, onMounted as Vt, onBeforeUnmount as Et, watch as Q, resolveComponent as C, createElementBlock as M, openBlock as y, createBlock as Z, createCommentVNode as N, createElementVNode as a, Fragment as ee, renderList as re, withCtx as z, createVNode as p, toDisplayString as i, unref as n, nextTick as Rt } from "vue";
|
|
2
|
-
import { d as x } from "./dayjs.min-
|
|
2
|
+
import { d as x } from "./dayjs.min-BTSZLci9.js";
|
|
3
3
|
import { useI18n as Qe, useCoreStore as Ct } from "@feedmepos/mf-common";
|
|
4
|
-
import { G as He, _ as Ut } from "./app-
|
|
4
|
+
import { G as He, _ as Ut } from "./app-BP0oihBR.js";
|
|
5
5
|
import { components as We } from "@feedmepos/ui-library";
|
|
6
6
|
import { g as Ae, b as Fe } from "./restaurant-YOVMuuFY.js";
|
|
7
7
|
import { S as be, _ as $t } from "./SelectFilter-ATOm0hdn.js";
|
|
8
8
|
import { _ as Nt } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
9
9
|
import { _ as Yt } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
|
|
10
|
-
import { t as Bt, p as Je } from "./rule-
|
|
10
|
+
import { t as Bt, p as Je } from "./rule-DaSLVZWm.js";
|
|
11
11
|
import { defineStore as Kt } from "pinia";
|
|
12
12
|
const ue = [
|
|
13
13
|
{ key: "all", label: "All", subjectPrefixes: [] },
|
|
@@ -2,17 +2,17 @@ import { defineComponent as Ee, computed as b, createElementBlock as C, openBloc
|
|
|
2
2
|
import { useI18n as Be, useCoreStore as We } from "@feedmepos/mf-common";
|
|
3
3
|
import { useBreakpoints as Te, useSnackbar as Ne, components as ze, useDialog as Qe } from "@feedmepos/ui-library";
|
|
4
4
|
import { S as pe, _ as Ye } from "./SelectFilter-ATOm0hdn.js";
|
|
5
|
-
import { _ as Ze, a as Xe } from "./app-
|
|
5
|
+
import { _ as Ze, a as Xe } from "./app-BP0oihBR.js";
|
|
6
6
|
import { _ as Ce, u as et, H as tt } from "./FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js";
|
|
7
7
|
import { u as at, _ as lt } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
8
|
import { _ as Re } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
|
|
9
9
|
import { u as st, _ as $e } from "./useDebounce-CWb5QR9G.js";
|
|
10
|
-
import { u as Oe, E as ot } from "./employee-
|
|
10
|
+
import { u as Oe, E as ot } from "./employee-BPv1j6T4.js";
|
|
11
11
|
import { u as Ke } from "./restaurant-YOVMuuFY.js";
|
|
12
|
-
import { l as rt } from "./lodash-
|
|
12
|
+
import { l as rt } from "./lodash-DKG9IyB-.js";
|
|
13
13
|
import { _ as Ue } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
14
14
|
import { u as je } from "./useLoading-BH02lYns.js";
|
|
15
|
-
import { u as xe } from "./role-
|
|
15
|
+
import { u as xe } from "./role-BS3LFO8u.js";
|
|
16
16
|
/* empty css */
|
|
17
17
|
const nt = {
|
|
18
18
|
key: 0,
|
|
@@ -1,127 +1,128 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as S, computed as
|
|
1
|
+
import { defineComponent as Z, ref as S, computed as f, watch as de, resolveComponent as v, createElementBlock as D, openBlock as b, Fragment as P, renderSlot as me, createVNode as l, unref as s, withCtx as y, createElementVNode as n, toDisplayString as _, createBlock as O, isRef as W, renderList as pe, createCommentVNode as fe, withModifiers as J, createTextVNode as Q, normalizeClass as ve, h as p } from "vue";
|
|
2
|
+
import { d as ge } from "./dayjs.min-BTSZLci9.js";
|
|
2
3
|
import { useI18n as ee } from "@feedmepos/mf-common";
|
|
3
|
-
import { useSnackbar as te, components as
|
|
4
|
-
import { S as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
4
|
+
import { useSnackbar as te, components as K, useDialog as _e, useBreakpoints as ye, FmButtonVariant as E } from "@feedmepos/ui-library";
|
|
5
|
+
import { S as A } from "./SelectFilter-ATOm0hdn.js";
|
|
6
|
+
import { _ as Ue } from "./app-BP0oihBR.js";
|
|
7
|
+
import { _ as X, u as he, H as xe } from "./FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js";
|
|
8
|
+
import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
|
|
8
9
|
import { u as ae } from "./useLoading-BH02lYns.js";
|
|
9
10
|
import { u as se } from "./grant-user-CQZaTzVt.js";
|
|
10
11
|
import { u as re } from "./restaurant-YOVMuuFY.js";
|
|
11
|
-
import { u as le } from "./role-
|
|
12
|
-
import { _ as
|
|
13
|
-
const
|
|
12
|
+
import { u as le } from "./role-BS3LFO8u.js";
|
|
13
|
+
import { _ as ke } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
14
|
+
const Ve = { class: "fm-typo-en-title-md-600" }, Fe = { class: "space-y-40" }, we = { class: "flex gap-8 items-center justify-start" }, Se = /* @__PURE__ */ Z({
|
|
14
15
|
__name: "GrantUserForm",
|
|
15
|
-
setup(oe, { expose:
|
|
16
|
-
const a = se(),
|
|
16
|
+
setup(oe, { expose: M }) {
|
|
17
|
+
const a = se(), I = le(), U = re(), h = te(), C = ae(h), { t: d } = ee(), g = S(!1), o = S({
|
|
17
18
|
name: "",
|
|
18
19
|
restaurantId: "",
|
|
19
20
|
roleId: ""
|
|
20
|
-
}),
|
|
21
|
-
|
|
21
|
+
}), B = () => {
|
|
22
|
+
o.value = {
|
|
22
23
|
name: "",
|
|
23
24
|
restaurantId: "",
|
|
24
25
|
roleId: ""
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
label: `${
|
|
28
|
-
value:
|
|
29
|
-
}))),
|
|
30
|
-
label:
|
|
31
|
-
value:
|
|
32
|
-
disabled: !
|
|
26
|
+
}, g.value = !0;
|
|
27
|
+
}, x = f(() => d("grantUser.form.title")), k = f(() => d("common.create")), V = f(() => U.restaurants.value.map((c) => ({
|
|
28
|
+
label: `${c.profile.code ? c.profile.code + " - " : ""}${c.profile.name}`,
|
|
29
|
+
value: c._id
|
|
30
|
+
}))), $ = f(() => o.value.restaurantId ? I.roles.value.filter((c) => c.restaurants.some((i) => i.id === o.value.restaurantId)).map((c) => ({
|
|
31
|
+
label: c.name,
|
|
32
|
+
value: c._id,
|
|
33
|
+
disabled: !c.isUsable
|
|
33
34
|
})) : []);
|
|
34
|
-
|
|
35
|
-
() =>
|
|
35
|
+
de(
|
|
36
|
+
() => o.value.restaurantId,
|
|
36
37
|
() => {
|
|
37
|
-
|
|
38
|
+
o.value.roleId = "";
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
|
-
async function
|
|
41
|
-
await
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
message:
|
|
45
|
-
passcode:
|
|
41
|
+
async function N() {
|
|
42
|
+
await C.minor(async () => {
|
|
43
|
+
const c = await a.createGrantUser(o.value);
|
|
44
|
+
h.open({
|
|
45
|
+
message: d("grantUser.create.successMessage", {
|
|
46
|
+
passcode: c.passcode
|
|
46
47
|
}),
|
|
47
48
|
type: "success"
|
|
48
49
|
});
|
|
49
|
-
}),
|
|
50
|
+
}), g.value = !1;
|
|
50
51
|
}
|
|
51
|
-
return
|
|
52
|
-
show:
|
|
53
|
-
trigger:
|
|
54
|
-
}), (
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
l(
|
|
52
|
+
return M({
|
|
53
|
+
show: g,
|
|
54
|
+
trigger: B
|
|
55
|
+
}), (c, i) => {
|
|
56
|
+
const R = v("FmTextField"), z = v("FmSelect"), w = v("fm-button"), T = v("fm-side-sheet");
|
|
57
|
+
return b(), D(P, null, [
|
|
58
|
+
me(c.$slots, "default", { trigger: B }),
|
|
59
|
+
l(T, {
|
|
59
60
|
id: "grant-user-form",
|
|
60
|
-
modelValue:
|
|
61
|
-
"onUpdate:modelValue":
|
|
62
|
-
"is-container": s(
|
|
61
|
+
modelValue: g.value,
|
|
62
|
+
"onUpdate:modelValue": i[4] || (i[4] = (u) => g.value = u),
|
|
63
|
+
"is-container": s(K).FmForm,
|
|
63
64
|
"is-container-props": {
|
|
64
|
-
onValidationSuccess:
|
|
65
|
+
onValidationSuccess: N,
|
|
65
66
|
blameFormChildOnValidationFailed: !0
|
|
66
67
|
},
|
|
67
68
|
"max-width": 560
|
|
68
69
|
}, {
|
|
69
70
|
"side-sheet-header": y(() => [
|
|
70
|
-
|
|
71
|
+
n("p", Ve, _(x.value), 1)
|
|
71
72
|
]),
|
|
72
73
|
"side-sheet-footer": y(() => [
|
|
73
|
-
|
|
74
|
-
l(
|
|
75
|
-
label:
|
|
74
|
+
n("div", we, [
|
|
75
|
+
l(w, {
|
|
76
|
+
label: k.value,
|
|
76
77
|
size: "lg",
|
|
77
78
|
type: "submit",
|
|
78
79
|
variant: "primary"
|
|
79
80
|
}, null, 8, ["label"]),
|
|
80
|
-
l(
|
|
81
|
-
label: s(
|
|
81
|
+
l(w, {
|
|
82
|
+
label: s(d)("common.cancel"),
|
|
82
83
|
size: "lg",
|
|
83
84
|
variant: "tertiary",
|
|
84
|
-
onClick:
|
|
85
|
+
onClick: i[3] || (i[3] = () => g.value = !1)
|
|
85
86
|
}, null, 8, ["label"])
|
|
86
87
|
])
|
|
87
88
|
]),
|
|
88
89
|
default: y(() => [
|
|
89
|
-
|
|
90
|
-
l(
|
|
91
|
-
title: s(
|
|
90
|
+
n("div", Fe, [
|
|
91
|
+
l(ke, {
|
|
92
|
+
title: s(d)("grantUser.form.section")
|
|
92
93
|
}, {
|
|
93
94
|
default: y(() => [
|
|
94
|
-
l(
|
|
95
|
-
modelValue:
|
|
96
|
-
"onUpdate:modelValue":
|
|
97
|
-
label: s(
|
|
98
|
-
rules: [(
|
|
95
|
+
l(R, {
|
|
96
|
+
modelValue: o.value.name,
|
|
97
|
+
"onUpdate:modelValue": i[0] || (i[0] = (u) => o.value.name = u),
|
|
98
|
+
label: s(d)("grantUser.form.name"),
|
|
99
|
+
rules: [(u) => !!u || s(d)("grantUser.form.nameRequired")]
|
|
99
100
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
100
|
-
l(
|
|
101
|
-
label: s(
|
|
101
|
+
l(X, {
|
|
102
|
+
label: s(d)("grantUser.form.restaurant")
|
|
102
103
|
}, {
|
|
103
104
|
default: y(() => [
|
|
104
|
-
l(
|
|
105
|
-
modelValue:
|
|
106
|
-
"onUpdate:modelValue":
|
|
107
|
-
items:
|
|
108
|
-
placeholder: s(
|
|
109
|
-
rules: [(
|
|
105
|
+
l(z, {
|
|
106
|
+
modelValue: o.value.restaurantId,
|
|
107
|
+
"onUpdate:modelValue": i[1] || (i[1] = (u) => o.value.restaurantId = u),
|
|
108
|
+
items: V.value,
|
|
109
|
+
placeholder: s(d)("grantUser.form.selectRestaurant"),
|
|
110
|
+
rules: [(u) => !!u || s(d)("grantUser.form.restaurantRequired")]
|
|
110
111
|
}, null, 8, ["modelValue", "items", "placeholder", "rules"])
|
|
111
112
|
]),
|
|
112
113
|
_: 1
|
|
113
114
|
}, 8, ["label"]),
|
|
114
|
-
l(
|
|
115
|
-
label: s(
|
|
115
|
+
l(X, {
|
|
116
|
+
label: s(d)("grantUser.form.role")
|
|
116
117
|
}, {
|
|
117
118
|
default: y(() => [
|
|
118
|
-
l(
|
|
119
|
-
modelValue:
|
|
120
|
-
"onUpdate:modelValue":
|
|
121
|
-
items:
|
|
122
|
-
placeholder: s(
|
|
123
|
-
disabled: !
|
|
124
|
-
rules: [(
|
|
119
|
+
l(z, {
|
|
120
|
+
modelValue: o.value.roleId,
|
|
121
|
+
"onUpdate:modelValue": i[2] || (i[2] = (u) => o.value.roleId = u),
|
|
122
|
+
items: $.value,
|
|
123
|
+
placeholder: s(d)("grantUser.form.selectRole"),
|
|
124
|
+
disabled: !o.value.restaurantId,
|
|
125
|
+
rules: [(u) => !!u || s(d)("grantUser.form.roleRequired")]
|
|
125
126
|
}, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
|
|
126
127
|
]),
|
|
127
128
|
_: 1
|
|
@@ -136,72 +137,70 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
136
137
|
], 64);
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
|
-
}),
|
|
140
|
+
}), Ie = {
|
|
140
141
|
class: "space-y-8"
|
|
141
|
-
},
|
|
142
|
+
}, Ce = {
|
|
142
143
|
class: "xs:hidden flex w-full items-start justify-between"
|
|
143
|
-
},
|
|
144
|
+
}, Be = {
|
|
144
145
|
class: "flex items-start gap-8"
|
|
145
|
-
},
|
|
146
|
+
}, $e = {
|
|
146
147
|
class: "space-y-4 hidden xs:block"
|
|
147
|
-
},
|
|
148
|
+
}, Ne = {
|
|
148
149
|
class: "px-16"
|
|
149
|
-
},
|
|
150
|
+
}, Re = {
|
|
150
151
|
class: "px-16 flex items-start gap-8"
|
|
151
|
-
},
|
|
152
|
+
}, ze = {
|
|
152
153
|
class: "pb-64 hidden xs:block"
|
|
153
|
-
}, Re = {
|
|
154
|
-
class: "space-y-4"
|
|
155
154
|
}, Le = {
|
|
155
|
+
class: "space-y-4"
|
|
156
|
+
}, Ae = {
|
|
156
157
|
class: "flex items-center gap-8"
|
|
157
|
-
},
|
|
158
|
+
}, De = {
|
|
158
159
|
class: "fm-typo-en-body-lg-600"
|
|
159
|
-
},
|
|
160
|
+
}, Ke = {
|
|
160
161
|
class: "font-mono text-lg font-bold mr-4"
|
|
161
|
-
},
|
|
162
|
+
}, Me = {
|
|
162
163
|
class: "text-fm-color-typo-secondary"
|
|
163
|
-
}, Ke = {
|
|
164
|
-
class: "text-xs"
|
|
165
164
|
}, Te = {
|
|
166
165
|
class: "mt-4 space-y-2"
|
|
167
166
|
}, Ge = {
|
|
168
167
|
class: "text-xs"
|
|
169
|
-
},
|
|
168
|
+
}, je = {
|
|
170
169
|
class: "text-xs"
|
|
171
170
|
}, Oe = {
|
|
172
171
|
key: 0,
|
|
173
172
|
class: "flex flex-col gap-4"
|
|
174
|
-
},
|
|
173
|
+
}, st = /* @__PURE__ */ Z({
|
|
175
174
|
__name: "GrantUserList",
|
|
176
175
|
setup(oe, {
|
|
177
|
-
expose:
|
|
176
|
+
expose: M
|
|
178
177
|
}) {
|
|
179
178
|
const {
|
|
180
179
|
t: a
|
|
181
|
-
} = ee(), U = S(),
|
|
182
|
-
restaurants:
|
|
180
|
+
} = ee(), I = (e) => ge(e).format("DD/MM/YYYY, h:mm:ss A"), U = S(), h = se(), {
|
|
181
|
+
restaurants: C
|
|
183
182
|
} = re(), {
|
|
184
|
-
roles:
|
|
185
|
-
} = le(),
|
|
186
|
-
searchKey:
|
|
187
|
-
filter:
|
|
188
|
-
} =
|
|
183
|
+
roles: d
|
|
184
|
+
} = le(), g = f(() => h.grantUsers), {
|
|
185
|
+
searchKey: o,
|
|
186
|
+
filter: B
|
|
187
|
+
} = he(), x = f(() => {
|
|
189
188
|
var e;
|
|
190
|
-
return (e =
|
|
191
|
-
const m = !U.value || U.value.includes(t.restaurantId),
|
|
192
|
-
return m &&
|
|
189
|
+
return (e = g.value) == null ? void 0 : e.filter((t) => {
|
|
190
|
+
const m = !U.value || U.value.includes(t.restaurantId), G = !F.value || F.value.includes(t.status), L = k.value[t.restaurantId] || "", j = V.value[t.roleId] || "";
|
|
191
|
+
return m && G && B([t.passcode, t.name, L, j, t.grantByName]);
|
|
193
192
|
});
|
|
194
|
-
}), k =
|
|
193
|
+
}), k = f(() => {
|
|
195
194
|
const e = {};
|
|
196
|
-
return
|
|
195
|
+
return C.value.forEach((t) => {
|
|
197
196
|
e[t._id] = t.profile.name;
|
|
198
197
|
}), e;
|
|
199
|
-
}), V =
|
|
198
|
+
}), V = f(() => {
|
|
200
199
|
const e = {};
|
|
201
|
-
return
|
|
200
|
+
return d.value.forEach((t) => {
|
|
202
201
|
e[t._id] = t.name;
|
|
203
202
|
}), e;
|
|
204
|
-
}),
|
|
203
|
+
}), $ = (e) => {
|
|
205
204
|
switch (e) {
|
|
206
205
|
case "active":
|
|
207
206
|
return "bg-fm-color-system-success-100 text-fm-color-typo-success";
|
|
@@ -212,7 +211,7 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
212
211
|
default:
|
|
213
212
|
return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
|
|
214
213
|
}
|
|
215
|
-
},
|
|
214
|
+
}, N = (e) => a(`grantUser.status.${e}`), c = [{
|
|
216
215
|
accessorKey: "passcode",
|
|
217
216
|
size: 120,
|
|
218
217
|
maxSize: 120,
|
|
@@ -222,12 +221,12 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
222
221
|
const t = e.row.original.passcode;
|
|
223
222
|
return p("div", {
|
|
224
223
|
class: "flex items-center gap-8"
|
|
225
|
-
}, [p(
|
|
224
|
+
}, [p(K.FmButton, {
|
|
226
225
|
variant: E.Tertiary,
|
|
227
226
|
textColor: "neutral-gray-400",
|
|
228
227
|
icon: "content_copy",
|
|
229
228
|
onClick: (m) => {
|
|
230
|
-
m.stopPropagation(),
|
|
229
|
+
m.stopPropagation(), H(t);
|
|
231
230
|
}
|
|
232
231
|
}), p("span", {
|
|
233
232
|
class: "font-mono text-lg font-bold"
|
|
@@ -244,10 +243,7 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
244
243
|
width: "250px"
|
|
245
244
|
},
|
|
246
245
|
cell(e) {
|
|
247
|
-
|
|
248
|
-
return p("div", [p("div", m), p("div", {
|
|
249
|
-
class: "text-fm-color-typo-secondary text-sm"
|
|
250
|
-
}, `${t}`)]);
|
|
246
|
+
return p("div", k.value[e.row.original.restaurantId] || "-");
|
|
251
247
|
}
|
|
252
248
|
}, {
|
|
253
249
|
accessorKey: "roleName",
|
|
@@ -265,26 +261,23 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
265
261
|
},
|
|
266
262
|
cell(e) {
|
|
267
263
|
const t = e.row.original.status;
|
|
268
|
-
return p(
|
|
269
|
-
label:
|
|
270
|
-
class:
|
|
264
|
+
return p(K.FmChip, {
|
|
265
|
+
label: N(t),
|
|
266
|
+
class: $(t)
|
|
271
267
|
});
|
|
272
268
|
}
|
|
273
269
|
}, {
|
|
274
270
|
accessorKey: "grantByName",
|
|
275
271
|
header: () => a("grantUser.columns.grantedBy"),
|
|
276
272
|
cell(e) {
|
|
277
|
-
|
|
278
|
-
return p("div", [p("div", m), p("div", {
|
|
279
|
-
class: "text-fm-color-typo-secondary text-sm"
|
|
280
|
-
}, `${t}`)]);
|
|
273
|
+
return p("div", e.row.original.grantByName);
|
|
281
274
|
}
|
|
282
275
|
}, {
|
|
283
276
|
accessorKey: "createdAt",
|
|
284
277
|
header: () => a("grantUser.columns.createdAt"),
|
|
285
278
|
cell(e) {
|
|
286
279
|
const t = e.row.original.createdAt;
|
|
287
|
-
return p("div",
|
|
280
|
+
return p("div", I(t));
|
|
288
281
|
}
|
|
289
282
|
}, {
|
|
290
283
|
id: "action",
|
|
@@ -297,23 +290,23 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
297
290
|
const t = e.row.original;
|
|
298
291
|
return t.status !== "active" ? null : p("div", {
|
|
299
292
|
class: "w-full flex justify-end items-center gap-4"
|
|
300
|
-
}, [p(
|
|
293
|
+
}, [p(K.FmButton, {
|
|
301
294
|
label: a("grantUser.actions.revoke"),
|
|
302
295
|
variant: E.Secondary,
|
|
303
296
|
onClick: (m) => {
|
|
304
|
-
m.stopPropagation(),
|
|
297
|
+
m.stopPropagation(), u(t);
|
|
305
298
|
}
|
|
306
299
|
})]);
|
|
307
300
|
}
|
|
308
|
-
}],
|
|
309
|
-
breakpoints:
|
|
310
|
-
} =
|
|
311
|
-
|
|
301
|
+
}], i = te(), R = _e(), z = ae(i), w = S(), {
|
|
302
|
+
breakpoints: T
|
|
303
|
+
} = ye(), u = (e) => {
|
|
304
|
+
R.open({
|
|
312
305
|
title: a("grantUser.revoke.title"),
|
|
313
306
|
message: a("grantUser.revoke.message", {
|
|
314
307
|
name: e.name
|
|
315
308
|
}),
|
|
316
|
-
minWidth:
|
|
309
|
+
minWidth: T.value.lg ? 588 : 0,
|
|
317
310
|
primaryActions: {
|
|
318
311
|
text: a("grantUser.actions.revoke"),
|
|
319
312
|
close: !1,
|
|
@@ -324,20 +317,20 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
324
317
|
close: !0
|
|
325
318
|
}
|
|
326
319
|
}).onPrimary(async () => {
|
|
327
|
-
|
|
328
|
-
await
|
|
320
|
+
z.minor(async () => {
|
|
321
|
+
await h.revokeGrantUser(e._id, e.restaurantId);
|
|
329
322
|
}, {
|
|
330
323
|
successMessage: a("grantUser.revoke.successMessage", {
|
|
331
324
|
name: e.name
|
|
332
325
|
})
|
|
333
|
-
}),
|
|
326
|
+
}), R.close();
|
|
334
327
|
});
|
|
335
328
|
};
|
|
336
|
-
function
|
|
329
|
+
function ne() {
|
|
337
330
|
var e;
|
|
338
|
-
(e =
|
|
331
|
+
(e = w.value) == null || e.trigger();
|
|
339
332
|
}
|
|
340
|
-
const
|
|
333
|
+
const Y = f(() => [{
|
|
341
334
|
label: a("grantUser.status.active"),
|
|
342
335
|
value: "active"
|
|
343
336
|
}, {
|
|
@@ -346,116 +339,116 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
346
339
|
}, {
|
|
347
340
|
label: a("grantUser.status.revoked"),
|
|
348
341
|
value: "revoked"
|
|
349
|
-
}]),
|
|
342
|
+
}]), q = f(() => C.value.map((e) => ({
|
|
350
343
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
351
344
|
value: e._id
|
|
352
|
-
}))),
|
|
353
|
-
async function
|
|
345
|
+
}))), F = S();
|
|
346
|
+
async function H(e) {
|
|
354
347
|
try {
|
|
355
|
-
await navigator.clipboard.writeText(e),
|
|
348
|
+
await navigator.clipboard.writeText(e), i.open({
|
|
356
349
|
message: a("grantUser.passcode.copied"),
|
|
357
350
|
type: "success"
|
|
358
351
|
});
|
|
359
352
|
} catch (t) {
|
|
360
|
-
|
|
353
|
+
i.open({
|
|
361
354
|
message: String(t),
|
|
362
355
|
type: "error"
|
|
363
356
|
});
|
|
364
357
|
}
|
|
365
358
|
}
|
|
366
|
-
return
|
|
367
|
-
create:
|
|
368
|
-
filteredGrantUsers:
|
|
359
|
+
return M({
|
|
360
|
+
create: ne,
|
|
361
|
+
filteredGrantUsers: x
|
|
369
362
|
}), (e, t) => {
|
|
370
|
-
const m =
|
|
371
|
-
return
|
|
363
|
+
const m = v("FmSearch"), G = v("FmTable"), L = v("FmButton"), j = v("FmChip"), ce = v("FmListItem"), ie = v("FmList");
|
|
364
|
+
return b(), D(P, null, [l(Se, {
|
|
372
365
|
ref_key: "grantUserFormRef",
|
|
373
|
-
ref:
|
|
366
|
+
ref: w,
|
|
374
367
|
class: "gap-8"
|
|
375
|
-
}, null, 512),
|
|
368
|
+
}, null, 512), n("div", Ie, [n("div", Ce, [n("div", Be, [l(A, {
|
|
376
369
|
modelValue: U.value,
|
|
377
370
|
"onUpdate:modelValue": t[0] || (t[0] = (r) => U.value = r),
|
|
378
371
|
multiple: "",
|
|
379
|
-
items:
|
|
372
|
+
items: q.value,
|
|
380
373
|
variant: "dark",
|
|
381
374
|
"selected-prefix": s(a)("grantUser.columns.restaurant"),
|
|
382
375
|
placeholder: s(a)("grantUser.columns.restaurant"),
|
|
383
376
|
class: "!w-auto"
|
|
384
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(
|
|
385
|
-
modelValue:
|
|
386
|
-
"onUpdate:modelValue": t[1] || (t[1] = (r) =>
|
|
377
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(A, {
|
|
378
|
+
modelValue: F.value,
|
|
379
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => F.value = r),
|
|
387
380
|
multiple: "",
|
|
388
381
|
variant: "dark",
|
|
389
|
-
items:
|
|
382
|
+
items: Y.value,
|
|
390
383
|
"selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
|
|
391
384
|
placeholder: s(a)("grantUser.filter.status_placeholder")
|
|
392
385
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), l(m, {
|
|
393
|
-
modelValue: s(
|
|
394
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) =>
|
|
386
|
+
modelValue: s(o),
|
|
387
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => W(o) ? o.value = r : null),
|
|
395
388
|
autofocus: "",
|
|
396
389
|
class: "pl-4 w-[320px]",
|
|
397
390
|
placeholder: s(a)("grantUser.search.placeholder")
|
|
398
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
399
|
-
modelValue: s(
|
|
400
|
-
"onUpdate:modelValue": t[3] || (t[3] = (r) =>
|
|
391
|
+
}, null, 8, ["modelValue", "placeholder"])]), n("div", $e, [n("div", Ne, [l(m, {
|
|
392
|
+
modelValue: s(o),
|
|
393
|
+
"onUpdate:modelValue": t[3] || (t[3] = (r) => W(o) ? o.value = r : null),
|
|
401
394
|
autofocus: "",
|
|
402
395
|
placeholder: s(a)("grantUser.search.placeholder")
|
|
403
|
-
}, null, 8, ["modelValue", "placeholder"])]), l(
|
|
396
|
+
}, null, 8, ["modelValue", "placeholder"])]), l(xe), n("div", Re, [l(A, {
|
|
404
397
|
modelValue: U.value,
|
|
405
398
|
"onUpdate:modelValue": t[4] || (t[4] = (r) => U.value = r),
|
|
406
399
|
multiple: "",
|
|
407
|
-
items:
|
|
400
|
+
items: q.value,
|
|
408
401
|
variant: "dark",
|
|
409
402
|
"selected-prefix": s(a)("grantUser.columns.restaurant"),
|
|
410
403
|
placeholder: s(a)("grantUser.columns.restaurant"),
|
|
411
404
|
class: "!w-auto"
|
|
412
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(
|
|
413
|
-
modelValue:
|
|
414
|
-
"onUpdate:modelValue": t[5] || (t[5] = (r) =>
|
|
405
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(A, {
|
|
406
|
+
modelValue: F.value,
|
|
407
|
+
"onUpdate:modelValue": t[5] || (t[5] = (r) => F.value = r),
|
|
415
408
|
multiple: "",
|
|
416
|
-
items:
|
|
409
|
+
items: Y.value,
|
|
417
410
|
variant: "dark",
|
|
418
411
|
"selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
|
|
419
412
|
placeholder: s(a)("grantUser.filter.status_placeholder")
|
|
420
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]),
|
|
413
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), g.value.length > 0 || s(h).isLoading ? (b(), O(Ue, {
|
|
421
414
|
key: 0,
|
|
422
415
|
class: "overflow-auto"
|
|
423
416
|
}, {
|
|
424
|
-
default: y(() => [l(
|
|
417
|
+
default: y(() => [l(G, {
|
|
425
418
|
class: "xs:hidden",
|
|
426
|
-
"column-defs":
|
|
427
|
-
"row-data":
|
|
428
|
-
"page-size":
|
|
429
|
-
loading: s(
|
|
430
|
-
virtual:
|
|
419
|
+
"column-defs": c,
|
|
420
|
+
"row-data": x.value,
|
|
421
|
+
"page-size": x.value.length,
|
|
422
|
+
loading: s(h).isLoading,
|
|
423
|
+
virtual: x.value.length > 0,
|
|
431
424
|
"pin-header-row": "",
|
|
432
425
|
"hide-footer": ""
|
|
433
|
-
}, null, 8, ["row-data", "page-size", "loading", "virtual"]),
|
|
426
|
+
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), n("div", ze, [l(ie, {
|
|
434
427
|
separator: ""
|
|
435
428
|
}, {
|
|
436
|
-
default: y(() => [(
|
|
429
|
+
default: y(() => [(b(!0), D(P, null, pe(x.value, (r) => (b(), O(ce, {
|
|
437
430
|
key: r._id,
|
|
438
431
|
class: "py-12 px-16 items-center justify-between"
|
|
439
432
|
}, {
|
|
440
|
-
default: y(() => [
|
|
433
|
+
default: y(() => [n("div", Le, [n("div", Ae, [l(L, {
|
|
441
434
|
variant: "tertiary",
|
|
442
435
|
"text-color": "neutral-gray-400",
|
|
443
436
|
icon: "content_copy",
|
|
444
|
-
onClick:
|
|
445
|
-
}, null, 8, ["onClick"]),
|
|
446
|
-
label:
|
|
447
|
-
class: ve(
|
|
448
|
-
}, null, 8, ["label", "class"])])])]), r.status === "active" ? (
|
|
437
|
+
onClick: J((ue) => H(r.passcode), ["stop"])
|
|
438
|
+
}, null, 8, ["onClick"]), n("p", De, [n("span", Ke, _(r.passcode), 1), Q(" - " + _(r.name), 1)])]), n("div", Me, [n("div", null, [Q(_(k.value[r.restaurantId] || "-") + " ", 1), n("div", null, _(V.value[r.roleId] || "-"), 1)]), n("div", Te, [n("div", Ge, _(s(a)("grantUser.columns.grantedBy")) + ": " + _(r.grantByName), 1), n("div", je, _(s(a)("grantUser.columns.createdAt")) + ": " + _(I(r.createdAt)), 1), l(j, {
|
|
439
|
+
label: N(r.status),
|
|
440
|
+
class: ve($(r.status))
|
|
441
|
+
}, null, 8, ["label", "class"])])])]), r.status === "active" ? (b(), D("div", Oe, [l(L, {
|
|
449
442
|
label: s(a)("grantUser.actions.revoke"),
|
|
450
443
|
variant: s(E).Secondary,
|
|
451
|
-
onClick:
|
|
452
|
-
}, null, 8, ["label", "variant", "onClick"])])) :
|
|
444
|
+
onClick: J((ue) => u(r), ["stop"])
|
|
445
|
+
}, null, 8, ["label", "variant", "onClick"])])) : fe("", !0)]),
|
|
453
446
|
_: 2
|
|
454
447
|
}, 1024))), 128))]),
|
|
455
448
|
_: 1
|
|
456
449
|
})])]),
|
|
457
450
|
_: 1
|
|
458
|
-
})) : (
|
|
451
|
+
})) : (b(), O(s(be), {
|
|
459
452
|
key: 1,
|
|
460
453
|
title: s(a)("grantUser.noData.title"),
|
|
461
454
|
subtitle: s(a)("grantUser.noData.subtitle")
|
|
@@ -464,5 +457,5 @@ const be = { class: "fm-typo-en-title-md-600" }, ke = { class: "space-y-40" }, V
|
|
|
464
457
|
}
|
|
465
458
|
});
|
|
466
459
|
export {
|
|
467
|
-
|
|
460
|
+
st as default
|
|
468
461
|
};
|