@feedmepos/mf-hrm-portal 2.3.0-dev.15 → 2.3.0-dev.17
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-CY0ox1dX.js → ApprovalCodeList-CQp5AXmP.js} +7 -7
- package/dist/{AuditLogList-CBkA-KQT.js → AuditLogList-CBOp_hDR.js} +5 -5
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B8cb8yqV.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-_2_usHCJ.js} +2 -2
- package/dist/{EmployeeList-0PrcuHPJ.js → EmployeeList-1vR0zMMp.js} +8 -8
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-rjDE1B4E.js → FormItem.vue_vue_type_script_setup_true_lang-NR_aWS7l.js} +1 -1
- package/dist/{GrantUserList-Dw923P2j.js → GrantUserList-CmeAG1Gy.js} +8 -8
- package/dist/{Main-Dpf2KdSH.js → Main-BUTiZtwj.js} +5 -5
- package/dist/{Main-C0bcn2NY.js → Main-DLh6VmQX.js} +8 -8
- package/dist/{Main-BqX7n1ik.js → Main-DTAb8QWQ.js} +11 -11
- package/dist/{PermissionSetList-xrI130SW.js → PermissionSetList-BtaX2k3V.js} +7 -7
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-3_8qycrF.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-B6dR75q1.js} +649 -649
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BVz6q3HE.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DQcgZ0nF.js} +1 -1
- package/dist/{RoleList-DPkG5dg9.js → RoleList-Qyyi7w2u.js} +9 -9
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-EPVMITc0.js +532 -0
- package/dist/{ScheduleGeneralPage-CISbuAff.js → ScheduleGeneralPage-CjZ8OFnN.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-BeTuMw3f.js → ScheduleModal.vue_vue_type_script_setup_true_lang-KOLBDv21.js} +523 -512
- package/dist/SchedulePage-BWpgAx3a.js +18831 -0
- package/dist/{SchedulePositionPage-Cu3WRfH-.js → SchedulePositionPage-Cu6rRBlZ.js} +3 -3
- package/dist/{SelectFilter-ssnRUIN6.js → SelectFilter-D58Vrs_W.js} +1 -1
- package/dist/{TeamMemberList-DTqNCDJb.js → TeamMemberList-CC_okKtX.js} +11 -11
- package/dist/{TimesheetList-CA19TmKm.js → TimesheetList-ULjiy1OT.js} +8 -8
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-B1jnsZpD.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D9xXvYuA.js} +3 -3
- package/dist/{app-3xGY2Rn0.js → app-COD0IHk1.js} +8 -8
- package/dist/app.js +1 -1
- package/dist/{approval-code-DHsUgc4K.js → approval-code-BXUiojPH.js} +1 -1
- package/dist/{dayjs.min-C_c8OoEU.js → dayjs.min-jNfjc_8X.js} +1 -1
- package/dist/{employee-Dt0y51t3.js → employee-Db1gyZQZ.js} +4 -4
- package/dist/{grant-user-qzKHFTro.js → grant-user-CBJ3gEgW.js} +1 -1
- package/dist/{iteration-C4YvbrCe.js → iteration-z1uPD-7T.js} +1 -1
- package/dist/{lodash-huRs3Cbj.js → lodash-uwLYB3oL.js} +1 -1
- package/dist/{restaurant-BbYRA_IT.js → restaurant-D2mfKHaH.js} +44 -45
- package/dist/{role-fM58UmtC.js → role-BhO6Cl-l.js} +2 -2
- package/dist/{rule-CCN0QCPF.js → rule-BZ340_dr.js} +3 -3
- package/dist/src/api/schedule/index.d.ts +6 -1
- package/dist/src/types/schedule.d.ts +1 -1
- package/dist/src/views/scheduling/components/ScheduleBoardOnboardingOverlays.vue.d.ts +1 -0
- package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +2 -0
- package/dist/src/views/scheduling/composables/remyPrompt.d.ts +4 -4
- package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +4 -1
- package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +3 -10
- package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +10 -1
- package/dist/src/views/scheduling/composables/useSchedulePageClearActions.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +6 -0
- package/dist/src/views/scheduling/schedule-state.d.ts +232 -232
- package/dist/src/views/scheduling/schedule-store.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-BoLkvkE2.js → useAppStore-DZCdxlCd.js} +1 -1
- package/dist/{useLoading-Ch1AUYT1.js → useLoading-Nygx2zn8.js} +1 -1
- package/dist/{useReportPermissions-BlX_Mk5f.js → useReportPermissions-BjkeMcNA.js} +3 -3
- package/package.json +1 -1
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DYLLW46A.js +0 -501
- package/dist/SchedulePage-Dn6_TiBS.js +0 -18757
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { ref as I, watch as me, computed as M, reactive as be, nextTick as Pe, defineComponent as we, createBlock as ee, openBlock as k, withCtx as T, createElementVNode as s, createVNode as U, toDisplayString as g, unref as Q, createElementBlock as S, withDirectives as re, withKeys as Ne, vModelText as ce, normalizeClass as ve, createTextVNode as L, createCommentVNode as X, Fragment as fe, renderList as $e } from "vue";
|
|
2
|
+
import { au as le, p as O, ax as ye, ay as te, az as Ce, u as Se, aA as pe, I as ae, e as Y, at as xe, ar as V } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-KOLBDv21.js";
|
|
3
|
+
import { useI18n as Ae } from "@feedmepos/mf-common";
|
|
4
|
+
function he() {
|
|
5
|
+
return le.map((e) => ({ id: e.id, name: e.name }));
|
|
6
|
+
}
|
|
7
|
+
function la(e = {}) {
|
|
8
|
+
const n = I(he()), f = [], a = /* @__PURE__ */ new Set();
|
|
9
|
+
let i = 0;
|
|
10
|
+
me(
|
|
11
|
+
() => le.map((l) => `${l.id}:${l.name}`).join(" "),
|
|
12
|
+
() => {
|
|
13
|
+
n.value = he();
|
|
14
|
+
}
|
|
15
|
+
), me(
|
|
16
|
+
() => {
|
|
17
|
+
var l;
|
|
18
|
+
return (((l = O.value) == null ? void 0 : l.positions) ?? []).map((m) => `${m.id}:${m.name}`).join(" ");
|
|
19
|
+
},
|
|
20
|
+
() => {
|
|
21
|
+
var l;
|
|
22
|
+
n.value = (((l = O.value) == null ? void 0 : l.positions) ?? []).map((m) => ({ id: m.id, name: m.name }));
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
const c = I(!1), w = I(""), P = I(null), N = I(!1), b = I(null);
|
|
26
|
+
function p(l) {
|
|
27
|
+
var m;
|
|
28
|
+
return (((m = O.value) == null ? void 0 : m.employees) ?? []).filter(
|
|
29
|
+
($) => {
|
|
30
|
+
var y;
|
|
31
|
+
return ((y = $.primaryPosition) == null ? void 0 : y.positionId) === l || $.secondaryPositions.some((A) => A.positionId === l);
|
|
32
|
+
}
|
|
33
|
+
).length;
|
|
34
|
+
}
|
|
35
|
+
function W(l) {
|
|
36
|
+
return n.value.some((m) => m.name.toLowerCase() === l.toLowerCase());
|
|
37
|
+
}
|
|
38
|
+
function z() {
|
|
39
|
+
c.value = !0, w.value = "", P.value = null, b.value = null;
|
|
40
|
+
}
|
|
41
|
+
function x() {
|
|
42
|
+
c.value = !1, w.value = "";
|
|
43
|
+
}
|
|
44
|
+
async function B() {
|
|
45
|
+
var m, $;
|
|
46
|
+
const l = w.value.trim().slice(0, 40);
|
|
47
|
+
if (!(!l || W(l))) {
|
|
48
|
+
N.value = !0, b.value = null;
|
|
49
|
+
try {
|
|
50
|
+
e.deferWrites ? (f.push(l), n.value = [...n.value, { id: `onboarding-draft-${++i}`, name: l }]) : await te({ name: l }), c.value = !1, w.value = "", (m = e.notify) == null || m.call(e, "Position added", "success");
|
|
51
|
+
} catch (y) {
|
|
52
|
+
b.value = y instanceof Error ? y.message : "Could not add this position", ($ = e.notify) == null || $.call(e, b.value, "error");
|
|
53
|
+
} finally {
|
|
54
|
+
N.value = !1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function Z(l) {
|
|
59
|
+
P.value = l;
|
|
60
|
+
}
|
|
61
|
+
function q() {
|
|
62
|
+
P.value = null;
|
|
63
|
+
}
|
|
64
|
+
async function E(l) {
|
|
65
|
+
var m, $;
|
|
66
|
+
N.value = !0, b.value = null;
|
|
67
|
+
try {
|
|
68
|
+
if (e.deferWrites) {
|
|
69
|
+
const y = n.value.find((A) => A.id === l);
|
|
70
|
+
if (l.startsWith("onboarding-draft-")) {
|
|
71
|
+
const A = f.indexOf((y == null ? void 0 : y.name) ?? "");
|
|
72
|
+
A >= 0 && f.splice(A, 1);
|
|
73
|
+
} else
|
|
74
|
+
a.add(l);
|
|
75
|
+
} else
|
|
76
|
+
await ye(l);
|
|
77
|
+
n.value = n.value.filter((y) => y.id !== l), P.value = null, (m = e.notify) == null || m.call(e, "Position removed", "success");
|
|
78
|
+
} catch (y) {
|
|
79
|
+
b.value = y instanceof Error ? y.message : "Could not delete this position", ($ = e.notify) == null || $.call(e, b.value, "error");
|
|
80
|
+
} finally {
|
|
81
|
+
N.value = !1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async function G() {
|
|
85
|
+
if (e.deferWrites)
|
|
86
|
+
for (; f.length; ) {
|
|
87
|
+
const l = f[0];
|
|
88
|
+
await te({ name: l }), f.shift();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function H() {
|
|
92
|
+
if (e.deferWrites)
|
|
93
|
+
for (const l of [...a])
|
|
94
|
+
await ye(l), a.delete(l);
|
|
95
|
+
}
|
|
96
|
+
function F() {
|
|
97
|
+
var l;
|
|
98
|
+
e.deferWrites && (f.splice(0, f.length), a.clear(), n.value = (((l = O.value) == null ? void 0 : l.positions) ?? []).map((m) => ({ id: m.id, name: m.name })));
|
|
99
|
+
}
|
|
100
|
+
const _ = M(() => n.value.length);
|
|
101
|
+
return {
|
|
102
|
+
positions: n,
|
|
103
|
+
pendingCreates: f,
|
|
104
|
+
pendingDeletes: a,
|
|
105
|
+
count: _,
|
|
106
|
+
isAdding: c,
|
|
107
|
+
newName: w,
|
|
108
|
+
pendingDeleteId: P,
|
|
109
|
+
saving: N,
|
|
110
|
+
error: b,
|
|
111
|
+
usageCountFor: p,
|
|
112
|
+
startAdd: z,
|
|
113
|
+
cancelAdd: x,
|
|
114
|
+
confirmAdd: B,
|
|
115
|
+
askDelete: Z,
|
|
116
|
+
cancelDelete: q,
|
|
117
|
+
confirmDelete: E,
|
|
118
|
+
commitCreates: G,
|
|
119
|
+
commitDeletes: H,
|
|
120
|
+
discardPending: F
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function Ee(e) {
|
|
124
|
+
var f;
|
|
125
|
+
const n = e.trim().split(/\s+/).filter(Boolean);
|
|
126
|
+
return n.length ? (n[0][0] + (((f = n[1]) == null ? void 0 : f[0]) ?? "")).toUpperCase() : "??";
|
|
127
|
+
}
|
|
128
|
+
function na(e, n = {}) {
|
|
129
|
+
const f = I(!1), a = I(""), i = I(""), c = be({}), w = I(!1), P = I(null), N = I(null), b = I(!1), p = I(null);
|
|
130
|
+
let W = "", z = /* @__PURE__ */ new Set();
|
|
131
|
+
const x = M(() => {
|
|
132
|
+
var r;
|
|
133
|
+
const t = new Map((((r = O.value) == null ? void 0 : r.employees) ?? []).map((v) => [v.employeeId, v]));
|
|
134
|
+
return Ce.value.map((v) => {
|
|
135
|
+
var j;
|
|
136
|
+
const d = t.get(v._id), D = [d == null ? void 0 : d.primaryPosition, ...(d == null ? void 0 : d.secondaryPositions) ?? []].map((o) => Se(o)).filter((o) => !!o), u = [
|
|
137
|
+
(j = d == null ? void 0 : d.primaryPosition) == null ? void 0 : j.positionId,
|
|
138
|
+
...((d == null ? void 0 : d.secondaryPositions) ?? []).map((o) => o.positionId)
|
|
139
|
+
].filter((o) => !!o);
|
|
140
|
+
return {
|
|
141
|
+
employeeId: v._id,
|
|
142
|
+
name: v.name,
|
|
143
|
+
initials: Ee(v.name),
|
|
144
|
+
held: D,
|
|
145
|
+
heldPositionIds: u
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
}), B = M(() => {
|
|
149
|
+
const t = i.value.trim().toLowerCase();
|
|
150
|
+
return x.value.filter((r) => !t || r.name.toLowerCase().includes(t));
|
|
151
|
+
}), Z = M(
|
|
152
|
+
() => x.value.filter((t) => c[t.employeeId]).map((t) => t.employeeId)
|
|
153
|
+
), q = M(
|
|
154
|
+
() => B.value.length > 0 && B.value.every((t) => c[t.employeeId])
|
|
155
|
+
), E = M(() => a.value.trim().slice(0, 40)), G = M(
|
|
156
|
+
() => !!E.value && le.some(
|
|
157
|
+
(t) => t.id !== p.value && t.name.toLowerCase() === E.value.toLowerCase()
|
|
158
|
+
)
|
|
159
|
+
), H = M(() => !!E.value && !G.value && !w.value);
|
|
160
|
+
function F() {
|
|
161
|
+
a.value = "", i.value = "", Object.keys(c).forEach((t) => delete c[t]), P.value = null, b.value = !1, N.value = null, p.value = null, W = "", z = /* @__PURE__ */ new Set();
|
|
162
|
+
}
|
|
163
|
+
function _() {
|
|
164
|
+
F(), f.value = !0;
|
|
165
|
+
}
|
|
166
|
+
function l(t, r) {
|
|
167
|
+
F(), p.value = t, a.value = r, W = r, z = new Set(
|
|
168
|
+
x.value.filter((v) => v.heldPositionIds.includes(t)).map((v) => v.employeeId)
|
|
169
|
+
), z.forEach((v) => c[v] = !0), f.value = !0;
|
|
170
|
+
}
|
|
171
|
+
function m() {
|
|
172
|
+
f.value = !1, F();
|
|
173
|
+
}
|
|
174
|
+
function $(t) {
|
|
175
|
+
c[t] = !c[t];
|
|
176
|
+
}
|
|
177
|
+
function y() {
|
|
178
|
+
if (q.value) {
|
|
179
|
+
Object.keys(c).forEach((t) => delete c[t]);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
B.value.forEach((t) => c[t.employeeId] = !0);
|
|
183
|
+
}
|
|
184
|
+
function A(t, r) {
|
|
185
|
+
const v = !!(t != null && t.primaryPosition), d = ((t == null ? void 0 : t.secondaryPositions) ?? []).map((u) => ({
|
|
186
|
+
positionId: u.positionId,
|
|
187
|
+
positionName: u.positionName
|
|
188
|
+
})), D = v ? [...d, { positionName: r }] : d;
|
|
189
|
+
return {
|
|
190
|
+
...v ? {} : { primaryPosition: Y(r) },
|
|
191
|
+
secondaryPositions: D.map((u) => Y(u.positionName, u.positionId)).filter((u) => !!u)
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
async function ge() {
|
|
195
|
+
var D;
|
|
196
|
+
const t = E.value;
|
|
197
|
+
await te({ name: t }), await Pe(), e == null || e(t);
|
|
198
|
+
const r = x.value.filter((u) => c[u.employeeId]), d = (await Promise.allSettled(
|
|
199
|
+
r.map((u) => {
|
|
200
|
+
var o;
|
|
201
|
+
const j = (o = O.value) == null ? void 0 : o.employees.find((h) => h.employeeId === u.employeeId);
|
|
202
|
+
return ae(u.employeeId, {
|
|
203
|
+
employeeName: u.name,
|
|
204
|
+
...A(j, t)
|
|
205
|
+
});
|
|
206
|
+
})
|
|
207
|
+
)).filter((u) => u.status === "rejected").length;
|
|
208
|
+
return N.value = { name: t, assigned: r.length - d, failed: d }, (D = n.notify) == null || D.call(
|
|
209
|
+
n,
|
|
210
|
+
d ? `Position added, but ${d} employee assignment${d === 1 ? "" : "s"} failed` : "Position added",
|
|
211
|
+
d ? "error" : "success"
|
|
212
|
+
), !0;
|
|
213
|
+
}
|
|
214
|
+
async function Ie(t) {
|
|
215
|
+
var j;
|
|
216
|
+
const r = E.value;
|
|
217
|
+
await pe(t, { name: r }), e == null || e(r);
|
|
218
|
+
const v = x.value.filter(
|
|
219
|
+
(o) => c[o.employeeId] && !z.has(o.employeeId)
|
|
220
|
+
), d = x.value.filter(
|
|
221
|
+
(o) => !c[o.employeeId] && z.has(o.employeeId)
|
|
222
|
+
), u = (await Promise.allSettled([
|
|
223
|
+
...v.map((o) => {
|
|
224
|
+
var R;
|
|
225
|
+
const h = (R = O.value) == null ? void 0 : R.employees.find((J) => J.employeeId === o.employeeId);
|
|
226
|
+
return ae(o.employeeId, {
|
|
227
|
+
employeeName: o.name,
|
|
228
|
+
...A(h, r)
|
|
229
|
+
});
|
|
230
|
+
}),
|
|
231
|
+
...d.map((o) => {
|
|
232
|
+
var ie, oe, de, ue;
|
|
233
|
+
const h = (ie = O.value) == null ? void 0 : ie.employees.find((C) => C.employeeId === o.employeeId), R = ((h == null ? void 0 : h.secondaryPositions) ?? []).filter(
|
|
234
|
+
(C) => C.positionId !== t && (C.positionId || C.positionName !== W)
|
|
235
|
+
), J = ((oe = h == null ? void 0 : h.primaryPosition) == null ? void 0 : oe.positionId) === t || !((de = h == null ? void 0 : h.primaryPosition) != null && de.positionId) && ((ue = h == null ? void 0 : h.primaryPosition) == null ? void 0 : ue.positionName) === W, K = J ? R.shift() : void 0;
|
|
236
|
+
return ae(o.employeeId, {
|
|
237
|
+
employeeName: o.name,
|
|
238
|
+
...J ? {
|
|
239
|
+
primaryPosition: Y(K == null ? void 0 : K.positionName, K == null ? void 0 : K.positionId) ?? null
|
|
240
|
+
} : {},
|
|
241
|
+
secondaryPositions: R.map((C) => Y(C.positionName, C.positionId)).filter((C) => !!C)
|
|
242
|
+
});
|
|
243
|
+
})
|
|
244
|
+
])).filter((o) => o.status === "rejected").length;
|
|
245
|
+
return N.value = { name: r, assigned: Math.max(0, v.length - u), failed: u }, (j = n.notify) == null || j.call(
|
|
246
|
+
n,
|
|
247
|
+
u ? `Position updated, but ${u} employee assignment${u === 1 ? "" : "s"} failed` : "Position updated",
|
|
248
|
+
u ? "error" : "success"
|
|
249
|
+
), !0;
|
|
250
|
+
}
|
|
251
|
+
async function ne() {
|
|
252
|
+
var t;
|
|
253
|
+
if (!E.value)
|
|
254
|
+
return b.value = !0, !1;
|
|
255
|
+
if (!H.value) return !1;
|
|
256
|
+
w.value = !0, P.value = null;
|
|
257
|
+
try {
|
|
258
|
+
return await (p.value ? Ie(p.value) : ge());
|
|
259
|
+
} catch (r) {
|
|
260
|
+
return P.value = r instanceof Error ? r.message : `Could not ${p.value ? "save" : "add"} this position`, (t = n.notify) == null || t.call(n, P.value, "error"), !1;
|
|
261
|
+
} finally {
|
|
262
|
+
w.value = !1;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function se() {
|
|
266
|
+
F();
|
|
267
|
+
}
|
|
268
|
+
async function ke() {
|
|
269
|
+
await ne() && se();
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
open: f,
|
|
273
|
+
name: a,
|
|
274
|
+
search: i,
|
|
275
|
+
picks: c,
|
|
276
|
+
saving: w,
|
|
277
|
+
error: P,
|
|
278
|
+
done: N,
|
|
279
|
+
nameError: b,
|
|
280
|
+
people: x,
|
|
281
|
+
visible: B,
|
|
282
|
+
pickedIds: Z,
|
|
283
|
+
allPicked: q,
|
|
284
|
+
nameTaken: G,
|
|
285
|
+
canSave: H,
|
|
286
|
+
editingId: p,
|
|
287
|
+
openNew: _,
|
|
288
|
+
openEdit: l,
|
|
289
|
+
close: m,
|
|
290
|
+
toggle: $,
|
|
291
|
+
toggleAll: y,
|
|
292
|
+
save: ne,
|
|
293
|
+
saveAndAnother: ke,
|
|
294
|
+
another: se
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
const Te = { class: "am-head" }, Me = {
|
|
298
|
+
id: "schedule-position-title",
|
|
299
|
+
class: "am-title"
|
|
300
|
+
}, Oe = { class: "ce-body" }, ze = { key: 0 }, De = { class: "ce-field" }, je = {
|
|
301
|
+
class: "ce-field asg-field",
|
|
302
|
+
style: { "margin-bottom": "0" }
|
|
303
|
+
}, Le = { class: "asg-head" }, Ve = { class: "asg-count" }, We = { class: "asg-list position-asg-list" }, Be = ["checked", "onChange"], Fe = { class: "asg-av" }, Ke = { class: "asg-id" }, Re = ["title"], Ue = { class: "asg-sub" }, qe = { key: 1 }, Ge = {
|
|
304
|
+
key: 0,
|
|
305
|
+
class: "asg-sub",
|
|
306
|
+
style: { padding: "10px" }
|
|
307
|
+
}, He = { key: 1 }, Je = { class: "cg-done" }, Qe = { class: "cg-st-main" }, Xe = {
|
|
308
|
+
key: 0,
|
|
309
|
+
class: "cg-done-also"
|
|
310
|
+
}, Ye = { class: "am-foot" }, Ze = {
|
|
311
|
+
key: 0,
|
|
312
|
+
class: "am-foot-btns"
|
|
313
|
+
}, _e = {
|
|
314
|
+
key: 1,
|
|
315
|
+
class: "am-foot-btns"
|
|
316
|
+
}, sa = /* @__PURE__ */ we({
|
|
317
|
+
__name: "ScheduleAddPositionModal",
|
|
318
|
+
props: {
|
|
319
|
+
modal: {}
|
|
320
|
+
},
|
|
321
|
+
setup(e) {
|
|
322
|
+
const { t: n } = Ae();
|
|
323
|
+
return (f, a) => (k(), ee(xe, {
|
|
324
|
+
open: e.modal.open.value,
|
|
325
|
+
"panel-class": "ce-modal",
|
|
326
|
+
"panel-style": "width: min(480px, 95vw)",
|
|
327
|
+
"labelled-by": "schedule-position-title",
|
|
328
|
+
onClose: a[11] || (a[11] = (i) => e.modal.close())
|
|
329
|
+
}, {
|
|
330
|
+
default: T(() => [
|
|
331
|
+
s("div", Te, [
|
|
332
|
+
s("div", Me, g(e.modal.editingId.value ? Q(n)("scheduling.positionModal.editTitle") : Q(n)("scheduling.positionModal.addTitle")), 1),
|
|
333
|
+
U(V, {
|
|
334
|
+
hierarchy: "ghost",
|
|
335
|
+
size: "xs",
|
|
336
|
+
"icon-only": "",
|
|
337
|
+
class: "ce-close-x",
|
|
338
|
+
type: "button",
|
|
339
|
+
"aria-label": "Close",
|
|
340
|
+
onClick: a[0] || (a[0] = (i) => e.modal.close())
|
|
341
|
+
}, {
|
|
342
|
+
default: T(() => [...a[12] || (a[12] = [
|
|
343
|
+
s("svg", {
|
|
344
|
+
width: "20",
|
|
345
|
+
height: "20",
|
|
346
|
+
viewBox: "0 0 20 20",
|
|
347
|
+
fill: "none",
|
|
348
|
+
stroke: "currentColor",
|
|
349
|
+
"stroke-width": "1.8",
|
|
350
|
+
"stroke-linecap": "round",
|
|
351
|
+
"aria-hidden": "true"
|
|
352
|
+
}, [
|
|
353
|
+
s("path", { d: "M5.5 5.5l9 9M14.5 5.5l-9 9" })
|
|
354
|
+
], -1)
|
|
355
|
+
])]),
|
|
356
|
+
_: 1
|
|
357
|
+
})
|
|
358
|
+
]),
|
|
359
|
+
s("div", Oe, [
|
|
360
|
+
e.modal.done.value ? (k(), S("div", He, [
|
|
361
|
+
s("div", Je, [
|
|
362
|
+
a[16] || (a[16] = s("span", {
|
|
363
|
+
class: "cg-done-tick",
|
|
364
|
+
"aria-hidden": "true"
|
|
365
|
+
}, "✓", -1)),
|
|
366
|
+
s("div", Qe, [
|
|
367
|
+
s("b", null, g(e.modal.done.value.name), 1),
|
|
368
|
+
s("small", null, g(e.modal.editingId.value ? "Position updated" : e.modal.done.value.assigned ? `Added to ${e.modal.done.value.assigned} ${e.modal.done.value.assigned === 1 ? "employee" : "employees"}` : "Position added"), 1)
|
|
369
|
+
])
|
|
370
|
+
]),
|
|
371
|
+
e.modal.done.value.failed ? (k(), S("div", Xe, g(e.modal.done.value.failed) + " " + g(e.modal.done.value.failed === 1 ? "employee" : "employees") + " could not be updated. Add the position to them from their profile. ", 1)) : X("", !0)
|
|
372
|
+
])) : (k(), S("div", ze, [
|
|
373
|
+
s("div", De, [
|
|
374
|
+
a[13] || (a[13] = s("label", {
|
|
375
|
+
class: "ce-label",
|
|
376
|
+
for: "skName"
|
|
377
|
+
}, "Position name", -1)),
|
|
378
|
+
re(s("input", {
|
|
379
|
+
id: "skName",
|
|
380
|
+
"onUpdate:modelValue": a[1] || (a[1] = (i) => e.modal.name.value = i),
|
|
381
|
+
class: "sch-input ce-input",
|
|
382
|
+
maxlength: "40",
|
|
383
|
+
placeholder: "e.g. FOH, Kitchen, Manager, Cashier…",
|
|
384
|
+
autocomplete: "off",
|
|
385
|
+
onInput: a[2] || (a[2] = (i) => e.modal.nameError.value = !1),
|
|
386
|
+
onKeyup: a[3] || (a[3] = Ne((i) => e.modal.save(), ["enter"]))
|
|
387
|
+
}, null, 544), [
|
|
388
|
+
[ce, e.modal.name.value]
|
|
389
|
+
]),
|
|
390
|
+
s("div", {
|
|
391
|
+
class: ve(["ce-err", { show: e.modal.nameError.value || e.modal.nameTaken.value }])
|
|
392
|
+
}, g(e.modal.nameTaken.value ? "A position with this name already exists" : "Give the position a name"), 3)
|
|
393
|
+
]),
|
|
394
|
+
s("div", je, [
|
|
395
|
+
s("div", Le, [
|
|
396
|
+
a[14] || (a[14] = s("span", { class: "asg-lbl" }, "Employees with this position", -1)),
|
|
397
|
+
U(V, {
|
|
398
|
+
hierarchy: "ghost",
|
|
399
|
+
size: "sm",
|
|
400
|
+
class: "ce-add-link asg-all",
|
|
401
|
+
type: "button",
|
|
402
|
+
onClick: a[4] || (a[4] = (i) => e.modal.toggleAll())
|
|
403
|
+
}, {
|
|
404
|
+
default: T(() => [
|
|
405
|
+
L(g(e.modal.allPicked.value ? "Clear all" : "Select all"), 1)
|
|
406
|
+
]),
|
|
407
|
+
_: 1
|
|
408
|
+
}),
|
|
409
|
+
s("span", Ve, g(e.modal.pickedIds.value.length) + " selected", 1)
|
|
410
|
+
]),
|
|
411
|
+
re(s("input", {
|
|
412
|
+
"onUpdate:modelValue": a[5] || (a[5] = (i) => e.modal.search.value = i),
|
|
413
|
+
class: "sch-input ce-input asg-search",
|
|
414
|
+
placeholder: "Search team…",
|
|
415
|
+
autocomplete: "off"
|
|
416
|
+
}, null, 512), [
|
|
417
|
+
[ce, e.modal.search.value]
|
|
418
|
+
]),
|
|
419
|
+
s("div", We, [
|
|
420
|
+
(k(!0), S(fe, null, $e(e.modal.visible.value, (i) => (k(), S("label", {
|
|
421
|
+
key: i.employeeId,
|
|
422
|
+
class: "asg-row"
|
|
423
|
+
}, [
|
|
424
|
+
s("input", {
|
|
425
|
+
type: "checkbox",
|
|
426
|
+
class: "sch-checkbox asg-check",
|
|
427
|
+
checked: !!e.modal.picks[i.employeeId],
|
|
428
|
+
onChange: (c) => e.modal.toggle(i.employeeId),
|
|
429
|
+
"data-platform": "desktop"
|
|
430
|
+
}, null, 40, Be),
|
|
431
|
+
s("span", Fe, g(i.initials), 1),
|
|
432
|
+
s("span", Ke, [
|
|
433
|
+
s("span", {
|
|
434
|
+
class: "asg-nm",
|
|
435
|
+
title: i.name
|
|
436
|
+
}, g(i.name), 9, Re),
|
|
437
|
+
s("span", Ue, [
|
|
438
|
+
i.held.length ? (k(), S(fe, { key: 0 }, [
|
|
439
|
+
L(g(i.held.join(", ")), 1)
|
|
440
|
+
], 64)) : (k(), S("i", qe, "No positions added"))
|
|
441
|
+
])
|
|
442
|
+
])
|
|
443
|
+
]))), 128)),
|
|
444
|
+
e.modal.visible.value.length ? X("", !0) : (k(), S("div", Ge, " No one matches. "))
|
|
445
|
+
]),
|
|
446
|
+
a[15] || (a[15] = s("div", { class: "ce-hint" }, "Ticked people can work this position.", -1))
|
|
447
|
+
]),
|
|
448
|
+
s("div", {
|
|
449
|
+
class: ve(["ce-err", { show: !!e.modal.error.value }])
|
|
450
|
+
}, g(e.modal.error.value), 3)
|
|
451
|
+
]))
|
|
452
|
+
]),
|
|
453
|
+
s("div", Ye, [
|
|
454
|
+
a[19] || (a[19] = s("div", { class: "am-cost-preview" }, null, -1)),
|
|
455
|
+
e.modal.done.value ? (k(), S("div", _e, [
|
|
456
|
+
e.modal.editingId.value ? X("", !0) : (k(), ee(V, {
|
|
457
|
+
key: 0,
|
|
458
|
+
hierarchy: "secondary",
|
|
459
|
+
size: "sm",
|
|
460
|
+
class: "am-btn am-btn-sec",
|
|
461
|
+
type: "button",
|
|
462
|
+
onClick: a[9] || (a[9] = (i) => e.modal.another())
|
|
463
|
+
}, {
|
|
464
|
+
default: T(() => [...a[18] || (a[18] = [
|
|
465
|
+
L("Add another", -1)
|
|
466
|
+
])]),
|
|
467
|
+
_: 1
|
|
468
|
+
})),
|
|
469
|
+
U(V, {
|
|
470
|
+
hierarchy: "primary",
|
|
471
|
+
size: "sm",
|
|
472
|
+
class: "am-btn am-btn-primary",
|
|
473
|
+
type: "button",
|
|
474
|
+
onClick: a[10] || (a[10] = (i) => e.modal.close())
|
|
475
|
+
}, {
|
|
476
|
+
default: T(() => [
|
|
477
|
+
L(g(Q(n)("scheduling.common.done")), 1)
|
|
478
|
+
]),
|
|
479
|
+
_: 1
|
|
480
|
+
})
|
|
481
|
+
])) : (k(), S("div", Ze, [
|
|
482
|
+
U(V, {
|
|
483
|
+
hierarchy: "secondary",
|
|
484
|
+
size: "sm",
|
|
485
|
+
class: "am-btn am-btn-sec",
|
|
486
|
+
type: "button",
|
|
487
|
+
onClick: a[6] || (a[6] = (i) => e.modal.close())
|
|
488
|
+
}, {
|
|
489
|
+
default: T(() => [
|
|
490
|
+
L(g(Q(n)("scheduling.common.cancel")), 1)
|
|
491
|
+
]),
|
|
492
|
+
_: 1
|
|
493
|
+
}),
|
|
494
|
+
e.modal.editingId.value ? X("", !0) : (k(), ee(V, {
|
|
495
|
+
key: 0,
|
|
496
|
+
hierarchy: "secondary",
|
|
497
|
+
size: "sm",
|
|
498
|
+
class: "am-btn am-btn-sec",
|
|
499
|
+
type: "button",
|
|
500
|
+
disabled: !e.modal.canSave.value,
|
|
501
|
+
onClick: a[7] || (a[7] = (i) => e.modal.saveAndAnother())
|
|
502
|
+
}, {
|
|
503
|
+
default: T(() => [...a[17] || (a[17] = [
|
|
504
|
+
L(" Save & add another ", -1)
|
|
505
|
+
])]),
|
|
506
|
+
_: 1
|
|
507
|
+
}, 8, ["disabled"])),
|
|
508
|
+
U(V, {
|
|
509
|
+
hierarchy: "primary",
|
|
510
|
+
size: "sm",
|
|
511
|
+
class: "am-btn am-btn-primary",
|
|
512
|
+
type: "button",
|
|
513
|
+
disabled: !e.modal.canSave.value,
|
|
514
|
+
onClick: a[8] || (a[8] = (i) => e.modal.save())
|
|
515
|
+
}, {
|
|
516
|
+
default: T(() => [
|
|
517
|
+
L(g(e.modal.editingId.value ? e.modal.saving.value ? "Saving…" : "Save changes" : e.modal.saving.value ? "Adding…" : "Add position"), 1)
|
|
518
|
+
]),
|
|
519
|
+
_: 1
|
|
520
|
+
}, 8, ["disabled"])
|
|
521
|
+
]))
|
|
522
|
+
])
|
|
523
|
+
]),
|
|
524
|
+
_: 1
|
|
525
|
+
}, 8, ["open"]));
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
export {
|
|
529
|
+
sa as _,
|
|
530
|
+
na as a,
|
|
531
|
+
la as u
|
|
532
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref as w, reactive as B, computed as N, defineComponent as T, createBlock as I, openBlock as p, withCtx as k, createElementVNode as e, createVNode as b, createElementBlock as m, Fragment as L, createTextVNode as H, toDisplayString as h, withDirectives as f, vModelText as g, createCommentVNode as A, renderList as V, onMounted as z, createStaticVNode as Y, unref as l, normalizeClass as U } from "vue";
|
|
2
2
|
import { useRouter as q } from "vue-router";
|
|
3
3
|
import { useSnackbar as F } from "@feedmepos/ui-library";
|
|
4
|
-
import { R as G } from "./app-
|
|
5
|
-
import { b as v, o as $, Q as j, $ as W, p as E, g as J, at as Q, ar as x, av as K, aw as X, ag as Z, as as _ } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { R as G } from "./app-COD0IHk1.js";
|
|
5
|
+
import { b as v, o as $, Q as j, $ as W, p as E, g as J, at as Q, ar as x, av as K, aw as X, ag as Z, as as _ } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-KOLBDv21.js";
|
|
6
6
|
import { useCoreStore as ee } from "@feedmepos/mf-common";
|
|
7
7
|
const se = [
|
|
8
8
|
{ key: "payrates", label: "Pay rates" },
|