@burdenoff/microfe-assethandler 2026.714.2 → 2026.719.1
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/assethandler/AssetHandlerRoutes.d.ts.map +1 -1
- package/dist/assethandler/AssetHandlerRoutes.js +9 -17
- package/dist/assethandler/AssetHandlerRoutes.js.map +1 -1
- package/dist/assethandler/ops/NewWorkOrderDialog.d.ts.map +1 -1
- package/dist/assethandler/ops/NewWorkOrderDialog.js +110 -74
- package/dist/assethandler/ops/NewWorkOrderDialog.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCreatePage.js +189 -126
- package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetDetailPage.js +312 -251
- package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
- package/dist/assethandler/pages/OperationsWorkOrderDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/OperationsWorkOrderDetailPage.js +286 -222
- package/dist/assethandler/pages/OperationsWorkOrderDetailPage.js.map +1 -1
- package/dist/stories/ListEmptyState.stories.d.ts +10 -0
- package/dist/stories/ListEmptyState.stories.d.ts.map +1 -0
- package/dist/stories/SectionHeader.stories.d.ts +10 -0
- package/dist/stories/SectionHeader.stories.d.ts.map +1 -0
- package/dist/stories/StatTile.stories.d.ts +10 -0
- package/dist/stories/StatTile.stories.d.ts.map +1 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +26 -18
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +16 -3
- package/dist/assethandler/pages/EsgDashboardPage.js +0 -423
- package/dist/assethandler/pages/EsgDashboardPage.js.map +0 -1
- package/dist/assethandler/pages/KnowledgeBasePage.js +0 -521
- package/dist/assethandler/pages/KnowledgeBasePage.js.map +0 -1
|
@@ -9,14 +9,14 @@ import { NotFoundState as ee } from "../components/NotFoundState.js";
|
|
|
9
9
|
import { ChartCard as s } from "../components/ChartCard.js";
|
|
10
10
|
import "../components/index.js";
|
|
11
11
|
import { useMemo as te, useState as c } from "react";
|
|
12
|
-
import { ArrowLeft as ne, CheckCircle as l, Loader2 as u, Package as re, Pencil as ie, User as
|
|
13
|
-
import { useParams as
|
|
14
|
-
import { gql as
|
|
15
|
-
import { useMutation as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import { Button as
|
|
12
|
+
import { ArrowLeft as ne, CheckCircle as l, Loader2 as u, Package as re, Pencil as ie, User as ae, Wrench as oe } from "lucide-react";
|
|
13
|
+
import { useParams as se } from "react-router-dom";
|
|
14
|
+
import { gql as d } from "@apollo/client";
|
|
15
|
+
import { useMutation as f, useQuery as ce } from "@apollo/client/react";
|
|
16
|
+
import { Fragment as le, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
17
|
+
import { Button as h, GradientText as ue, Input as g, Label as _, PagePurpose as de, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
|
|
18
18
|
//#region src/assethandler/pages/OperationsWorkOrderDetailPage.tsx
|
|
19
|
-
var
|
|
19
|
+
var fe = d`
|
|
20
20
|
query AssetHandlerWorkOrder($id: ID!) {
|
|
21
21
|
workOrder(id: $id) {
|
|
22
22
|
id
|
|
@@ -30,9 +30,10 @@ var se = p`
|
|
|
30
30
|
createdAt
|
|
31
31
|
updatedAt
|
|
32
32
|
completedAt
|
|
33
|
+
checklist
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
`,
|
|
36
|
+
`, pe = d`
|
|
36
37
|
mutation AssetHandlerCompleteWorkOrder($id: ID!, $input: CompleteWorkOrderInput!) {
|
|
37
38
|
completeWorkOrder(id: $id, input: $input) {
|
|
38
39
|
id
|
|
@@ -40,41 +41,52 @@ var se = p`
|
|
|
40
41
|
completedAt
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
`,
|
|
44
|
+
`, me = d`
|
|
44
45
|
mutation AssetHandlerUpdateWorkOrder($id: ID!, $input: UpdateWorkOrderInput!) {
|
|
45
46
|
updateWorkOrder(id: $id, input: $input) {
|
|
46
47
|
id
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
`,
|
|
50
|
+
`, he = d`
|
|
51
|
+
mutation AssetHandlerSetWorkOrderChecklistItem(
|
|
52
|
+
$workOrderId: ID!
|
|
53
|
+
$index: Int!
|
|
54
|
+
$completed: Boolean!
|
|
55
|
+
) {
|
|
56
|
+
setWorkOrderChecklistItem(workOrderId: $workOrderId, index: $index, completed: $completed) {
|
|
57
|
+
id
|
|
58
|
+
checklist
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`, ge = [
|
|
50
62
|
"CORRECTIVE",
|
|
51
63
|
"PREVENTIVE",
|
|
52
64
|
"PREDICTIVE",
|
|
53
65
|
"EMERGENCY"
|
|
54
|
-
],
|
|
66
|
+
], _e = [
|
|
55
67
|
"DRAFT",
|
|
56
68
|
"SCHEDULED",
|
|
57
69
|
"APPROVED",
|
|
58
70
|
"IN_PROGRESS",
|
|
59
71
|
"COMPLETED",
|
|
60
72
|
"CANCELLED"
|
|
61
|
-
],
|
|
73
|
+
], ve = [
|
|
62
74
|
"CRITICAL",
|
|
63
75
|
"HIGH",
|
|
64
76
|
"MEDIUM",
|
|
65
77
|
"LOW"
|
|
66
|
-
],
|
|
78
|
+
], A = {
|
|
67
79
|
neutral: "bg-bg-sunken text-text-secondary",
|
|
68
80
|
info: "bg-status-info-subtle text-status-info-text",
|
|
69
81
|
warning: "bg-status-warning-subtle text-status-warning-text",
|
|
70
82
|
success: "bg-status-success-subtle text-status-success-text",
|
|
71
83
|
error: "bg-status-error-subtle text-status-error-text"
|
|
72
|
-
},
|
|
84
|
+
}, ye = {
|
|
73
85
|
critical: "error",
|
|
74
86
|
high: "warning",
|
|
75
87
|
medium: "info",
|
|
76
88
|
low: "success"
|
|
77
|
-
},
|
|
89
|
+
}, be = {
|
|
78
90
|
draft: "neutral",
|
|
79
91
|
scheduled: "neutral",
|
|
80
92
|
approved: "info",
|
|
@@ -82,328 +94,380 @@ var se = p`
|
|
|
82
94
|
completed: "success",
|
|
83
95
|
cancelled: "error"
|
|
84
96
|
};
|
|
85
|
-
function
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
className: n("inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-medium capitalize",
|
|
97
|
+
function j({ tone: e, children: t }) {
|
|
98
|
+
return /* @__PURE__ */ p("span", {
|
|
99
|
+
className: n("inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", A[e]),
|
|
88
100
|
children: t
|
|
89
101
|
});
|
|
90
102
|
}
|
|
91
|
-
var
|
|
103
|
+
var M = [
|
|
92
104
|
"draft",
|
|
93
105
|
"scheduled",
|
|
94
106
|
"approved",
|
|
95
107
|
"in_progress",
|
|
96
108
|
"completed"
|
|
97
109
|
];
|
|
98
|
-
function
|
|
99
|
-
let t = e === "cancelled", r =
|
|
100
|
-
return /* @__PURE__ */
|
|
110
|
+
function xe({ status: e }) {
|
|
111
|
+
let t = e === "cancelled", r = M.indexOf(e);
|
|
112
|
+
return /* @__PURE__ */ m("div", {
|
|
101
113
|
className: "flex items-center gap-1 overflow-x-auto pb-1",
|
|
102
|
-
children: [
|
|
114
|
+
children: [M.map((e, i) => {
|
|
103
115
|
let a = !t && r >= 0 && i < r, o = !t && i === r;
|
|
104
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ m("div", {
|
|
105
117
|
className: "flex min-w-0 flex-1 items-center gap-1",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ m("div", {
|
|
107
119
|
className: "flex min-w-0 flex-col items-center gap-1.5",
|
|
108
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ p("span", {
|
|
109
121
|
className: n("flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-[10px] font-bold", a && "bg-status-success-bg text-status-success-text", o && "bg-action-primary-bg text-action-primary-text", !a && !o && "bg-bg-sunken text-text-muted"),
|
|
110
|
-
children: a ? /* @__PURE__ */
|
|
111
|
-
}), /* @__PURE__ */
|
|
122
|
+
children: a ? /* @__PURE__ */ p(l, { className: "h-3.5 w-3.5" }) : i + 1
|
|
123
|
+
}), /* @__PURE__ */ p("span", {
|
|
112
124
|
className: n("whitespace-nowrap text-[11px] capitalize", o ? "font-semibold text-text-primary" : "text-text-secondary"),
|
|
113
125
|
children: e.replace(/_/g, " ")
|
|
114
126
|
})]
|
|
115
|
-
}), i <
|
|
127
|
+
}), i < M.length - 1 ? /* @__PURE__ */ p("span", { className: n("mb-5 h-0.5 flex-1 rounded-full", a ? "bg-status-success-bg" : "bg-border-seam") }) : null]
|
|
116
128
|
}, e);
|
|
117
|
-
}), t ? /* @__PURE__ */
|
|
129
|
+
}), t ? /* @__PURE__ */ p("span", {
|
|
118
130
|
className: "ml-3 shrink-0 rounded-full bg-status-error-subtle px-2.5 py-0.5 text-xs font-medium text-status-error-text",
|
|
119
131
|
children: "Cancelled"
|
|
120
132
|
}) : null]
|
|
121
133
|
});
|
|
122
134
|
}
|
|
123
|
-
var
|
|
124
|
-
function
|
|
125
|
-
let
|
|
126
|
-
variables: { id:
|
|
127
|
-
skip: !
|
|
135
|
+
var N = (e) => e.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
|
|
136
|
+
function P() {
|
|
137
|
+
let d = t(), { workOrderId: A } = se(), { assets: M, refetchBootstrap: P } = e(), { data: F, loading: I, refetch: L } = ce(fe, {
|
|
138
|
+
variables: { id: A ?? "" },
|
|
139
|
+
skip: !A,
|
|
128
140
|
fetchPolicy: "cache-and-network"
|
|
129
|
-
}), [
|
|
141
|
+
}), [Se, R] = c(!1), [Ce, z] = c(!1), [B, V] = c({
|
|
130
142
|
actualCost: "",
|
|
131
143
|
notes: ""
|
|
132
|
-
}), [
|
|
133
|
-
let e = new Map(
|
|
144
|
+
}), [H, U] = c(null), [W, G] = c(null), we = te(() => {
|
|
145
|
+
let e = new Map(M.map((e) => [e.id, e.name]));
|
|
134
146
|
return (t) => t ? e.get(t) ?? t : null;
|
|
135
|
-
}, [
|
|
147
|
+
}, [M]), [Te, { loading: K }] = f(pe, {
|
|
136
148
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
137
149
|
onCompleted: () => {
|
|
138
|
-
r.success("Work order completed", "The job has been signed off."),
|
|
150
|
+
r.success("Work order completed", "The job has been signed off."), R(!1), L();
|
|
139
151
|
},
|
|
140
152
|
onError: (e) => r.error("Could not complete work order", e.message)
|
|
141
|
-
}), [
|
|
153
|
+
}), [Ee, { loading: q }] = f(me, {
|
|
142
154
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
143
155
|
onCompleted: () => {
|
|
144
|
-
r.success("Work order updated", "Your changes have been saved."),
|
|
156
|
+
r.success("Work order updated", "Your changes have been saved."), z(!1), L();
|
|
145
157
|
},
|
|
146
158
|
onError: (e) => r.error("Could not update work order", e.message)
|
|
159
|
+
}), [De] = f(he, {
|
|
160
|
+
onCompleted: () => {
|
|
161
|
+
G(null), L(), P();
|
|
162
|
+
},
|
|
163
|
+
onError: (e) => {
|
|
164
|
+
G(null), r.error("Could not update checklist", e.message);
|
|
165
|
+
}
|
|
147
166
|
});
|
|
148
|
-
if (
|
|
167
|
+
if (I && !F) return /* @__PURE__ */ p("div", {
|
|
149
168
|
className: "space-y-3 p-6",
|
|
150
|
-
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */
|
|
169
|
+
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ p("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
|
|
151
170
|
});
|
|
152
|
-
let
|
|
153
|
-
if (!
|
|
171
|
+
let J = F?.workOrder;
|
|
172
|
+
if (!J) return /* @__PURE__ */ p(ee, {
|
|
154
173
|
entityLabel: "Work order",
|
|
155
174
|
description: "This work order may have been completed or removed. Return to the operations hub to find it.",
|
|
156
175
|
backLabel: "Back to operations",
|
|
157
|
-
onBack: () =>
|
|
176
|
+
onBack: () => d("/operations/operations-hub")
|
|
158
177
|
});
|
|
159
|
-
let
|
|
160
|
-
...
|
|
161
|
-
status:
|
|
162
|
-
priority:
|
|
163
|
-
type:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
178
|
+
let Y = {
|
|
179
|
+
...J,
|
|
180
|
+
status: J.status.toLowerCase(),
|
|
181
|
+
priority: J.priority.toLowerCase(),
|
|
182
|
+
type: J.type.toLowerCase(),
|
|
183
|
+
checklist: (J.checklist ?? []).map((e) => ({
|
|
184
|
+
task: String(e.task ?? "Task"),
|
|
185
|
+
completed: !!e.completed
|
|
186
|
+
}))
|
|
187
|
+
}, Oe = Y.status === "completed" || Y.status === "cancelled", X = we(Y.assetId), Z = Y.checklist.filter((e) => e.completed).length, Q = Y.checklist.length, ke = Q === 0 ? 0 : Math.round(Z / Q * 100), Ae = (e, t) => {
|
|
188
|
+
G(e), De({ variables: {
|
|
189
|
+
workOrderId: Y.id,
|
|
190
|
+
index: e,
|
|
191
|
+
completed: t
|
|
192
|
+
} });
|
|
193
|
+
}, je = () => {
|
|
194
|
+
U({
|
|
195
|
+
title: J.title,
|
|
196
|
+
description: J.description ?? "",
|
|
197
|
+
type: J.type.toUpperCase(),
|
|
198
|
+
priority: J.priority.toUpperCase(),
|
|
199
|
+
status: J.status.toUpperCase(),
|
|
200
|
+
assignedTo: J.assignedTo ?? ""
|
|
201
|
+
}), z(!0);
|
|
202
|
+
}, $ = (e, t) => U((n) => n && {
|
|
174
203
|
...n,
|
|
175
204
|
[e]: t
|
|
176
|
-
}),
|
|
177
|
-
let e = Number(
|
|
178
|
-
|
|
179
|
-
id:
|
|
205
|
+
}), Me = () => {
|
|
206
|
+
let e = Number(B.actualCost);
|
|
207
|
+
Te({ variables: {
|
|
208
|
+
id: Y.id,
|
|
180
209
|
input: {
|
|
181
|
-
actualCost:
|
|
182
|
-
notes:
|
|
210
|
+
actualCost: B.actualCost.trim() !== "" && Number.isFinite(e) ? e : null,
|
|
211
|
+
notes: B.notes.trim() || null
|
|
183
212
|
}
|
|
184
213
|
} });
|
|
185
|
-
},
|
|
186
|
-
if (
|
|
187
|
-
if (!
|
|
214
|
+
}, Ne = () => {
|
|
215
|
+
if (H) {
|
|
216
|
+
if (!H.title.trim()) {
|
|
188
217
|
r.warning("Title required", "A work order must have a title.");
|
|
189
218
|
return;
|
|
190
219
|
}
|
|
191
|
-
|
|
192
|
-
id:
|
|
220
|
+
Ee({ variables: {
|
|
221
|
+
id: Y.id,
|
|
193
222
|
input: {
|
|
194
|
-
title:
|
|
195
|
-
description:
|
|
196
|
-
type:
|
|
197
|
-
priority:
|
|
198
|
-
status:
|
|
199
|
-
assignedTo:
|
|
223
|
+
title: H.title.trim(),
|
|
224
|
+
description: H.description.trim() || null,
|
|
225
|
+
type: H.type,
|
|
226
|
+
priority: H.priority,
|
|
227
|
+
status: H.status,
|
|
228
|
+
assignedTo: H.assignedTo.trim() || null
|
|
200
229
|
}
|
|
201
230
|
} });
|
|
202
231
|
}
|
|
203
|
-
},
|
|
232
|
+
}, Pe = [
|
|
204
233
|
{
|
|
205
234
|
label: "Asset",
|
|
206
|
-
value:
|
|
235
|
+
value: X ? /* @__PURE__ */ p("button", {
|
|
207
236
|
type: "button",
|
|
208
237
|
className: "font-medium text-action-primary-text hover:underline",
|
|
209
|
-
onClick: () =>
|
|
210
|
-
children:
|
|
211
|
-
}) : /* @__PURE__ */
|
|
238
|
+
onClick: () => d("/assets/" + Y.assetId),
|
|
239
|
+
children: X
|
|
240
|
+
}) : /* @__PURE__ */ p("span", {
|
|
212
241
|
className: "text-text-secondary",
|
|
213
242
|
children: "Unassigned"
|
|
214
243
|
})
|
|
215
244
|
},
|
|
216
245
|
{
|
|
217
246
|
label: "Type",
|
|
218
|
-
value: /* @__PURE__ */
|
|
247
|
+
value: /* @__PURE__ */ p("span", {
|
|
219
248
|
className: "capitalize",
|
|
220
|
-
children:
|
|
249
|
+
children: N(Y.type)
|
|
221
250
|
})
|
|
222
251
|
},
|
|
223
252
|
{
|
|
224
253
|
label: "Assigned technician",
|
|
225
|
-
value:
|
|
254
|
+
value: Y.assignedTo || /* @__PURE__ */ p("span", {
|
|
226
255
|
className: "text-text-secondary",
|
|
227
256
|
children: "Unassigned"
|
|
228
257
|
})
|
|
229
258
|
},
|
|
230
259
|
{
|
|
231
260
|
label: "Created",
|
|
232
|
-
value:
|
|
261
|
+
value: Y.createdAt ? new Date(Y.createdAt).toLocaleDateString() : "—"
|
|
233
262
|
},
|
|
234
263
|
{
|
|
235
264
|
label: "Completed",
|
|
236
|
-
value:
|
|
265
|
+
value: Y.completedAt ? new Date(Y.completedAt).toLocaleDateString() : "—"
|
|
237
266
|
}
|
|
238
267
|
];
|
|
239
|
-
return /* @__PURE__ */
|
|
268
|
+
return /* @__PURE__ */ m("div", {
|
|
240
269
|
className: "space-y-6 p-4 sm:p-6",
|
|
241
270
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ m("div", {
|
|
243
272
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ m("div", {
|
|
245
274
|
className: "flex min-w-0 items-start gap-3",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
275
|
+
children: [/* @__PURE__ */ p(h, {
|
|
247
276
|
variant: "ghost",
|
|
248
277
|
size: "icon",
|
|
249
278
|
"aria-label": "Go back",
|
|
250
279
|
className: "shrink-0",
|
|
251
|
-
onClick: () =>
|
|
252
|
-
children: /* @__PURE__ */
|
|
253
|
-
}), /* @__PURE__ */
|
|
280
|
+
onClick: () => d("/operations/operations-hub"),
|
|
281
|
+
children: /* @__PURE__ */ p(ne, { className: "h-4 w-4" })
|
|
282
|
+
}), /* @__PURE__ */ m("div", {
|
|
254
283
|
className: "min-w-0",
|
|
255
284
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ p("p", {
|
|
257
286
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
258
287
|
children: "Maintenance / Work Order Detail"
|
|
259
288
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ p("h1", {
|
|
261
290
|
className: "truncate text-2xl font-bold",
|
|
262
|
-
children: /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ p(ue, { children: Y.title })
|
|
263
292
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ p("p", {
|
|
265
294
|
className: "mt-0.5 font-mono text-xs text-text-secondary",
|
|
266
|
-
children:
|
|
295
|
+
children: Y.id
|
|
267
296
|
})
|
|
268
297
|
]
|
|
269
298
|
})]
|
|
270
|
-
}), /* @__PURE__ */
|
|
299
|
+
}), /* @__PURE__ */ m("div", {
|
|
271
300
|
className: "flex w-full items-center gap-2 sm:w-auto",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ m(h, {
|
|
273
302
|
size: "sm",
|
|
274
303
|
variant: "outline",
|
|
275
304
|
className: "flex-1 sm:flex-none",
|
|
276
|
-
onClick:
|
|
277
|
-
children: [/* @__PURE__ */
|
|
278
|
-
}),
|
|
305
|
+
onClick: je,
|
|
306
|
+
children: [/* @__PURE__ */ p(ie, { className: "mr-2 h-4 w-4" }), "Edit"]
|
|
307
|
+
}), Oe ? null : /* @__PURE__ */ m(h, {
|
|
279
308
|
size: "sm",
|
|
280
309
|
className: "flex-1 sm:flex-none",
|
|
281
|
-
onClick: () =>
|
|
282
|
-
children: [/* @__PURE__ */
|
|
310
|
+
onClick: () => R(!0),
|
|
311
|
+
children: [/* @__PURE__ */ p(l, { className: "mr-2 h-4 w-4" }), "Complete"]
|
|
283
312
|
})]
|
|
284
313
|
})]
|
|
285
314
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ m(s, {
|
|
287
316
|
title: "Status",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ m("div", {
|
|
289
318
|
className: "flex flex-wrap items-center gap-x-8 gap-y-4",
|
|
290
319
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
292
321
|
className: "text-xs uppercase tracking-wide text-text-secondary",
|
|
293
322
|
children: "Priority"
|
|
294
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ p("div", {
|
|
295
324
|
className: "mt-1",
|
|
296
|
-
children: /* @__PURE__ */
|
|
297
|
-
tone:
|
|
298
|
-
children:
|
|
325
|
+
children: /* @__PURE__ */ p(j, {
|
|
326
|
+
tone: ye[Y.priority] ?? "neutral",
|
|
327
|
+
children: Y.priority
|
|
299
328
|
})
|
|
300
329
|
})] }),
|
|
301
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
302
331
|
className: "text-xs uppercase tracking-wide text-text-secondary",
|
|
303
332
|
children: "Status"
|
|
304
|
-
}), /* @__PURE__ */
|
|
333
|
+
}), /* @__PURE__ */ p("div", {
|
|
305
334
|
className: "mt-1",
|
|
306
|
-
children: /* @__PURE__ */
|
|
307
|
-
tone:
|
|
308
|
-
children:
|
|
335
|
+
children: /* @__PURE__ */ p(j, {
|
|
336
|
+
tone: be[Y.status] ?? "neutral",
|
|
337
|
+
children: Y.status.replace(/_/g, " ")
|
|
309
338
|
})
|
|
310
339
|
})] }),
|
|
311
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ m("div", {
|
|
312
341
|
className: "flex items-center gap-2",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ p(ae, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
314
343
|
className: "text-xs uppercase tracking-wide text-text-secondary",
|
|
315
344
|
children: "Technician"
|
|
316
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ p("p", {
|
|
317
346
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
318
|
-
children:
|
|
347
|
+
children: Y.assignedTo || "Unassigned"
|
|
319
348
|
})] })]
|
|
320
349
|
}),
|
|
321
|
-
|
|
350
|
+
X ? /* @__PURE__ */ m("div", {
|
|
322
351
|
className: "flex items-center gap-2",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ p(re, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
324
353
|
className: "text-xs uppercase tracking-wide text-text-secondary",
|
|
325
354
|
children: "Asset"
|
|
326
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ p("button", {
|
|
327
356
|
type: "button",
|
|
328
357
|
className: "mt-0.5 text-sm font-medium text-action-primary-text hover:underline",
|
|
329
|
-
onClick: () =>
|
|
330
|
-
children:
|
|
358
|
+
onClick: () => d("/assets/" + Y.assetId),
|
|
359
|
+
children: X
|
|
331
360
|
})] })]
|
|
332
361
|
}) : null
|
|
333
362
|
]
|
|
334
|
-
}), /* @__PURE__ */
|
|
363
|
+
}), /* @__PURE__ */ p("div", {
|
|
335
364
|
className: "mt-5 border-t border-border-seam pt-4",
|
|
336
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ p(xe, { status: Y.status })
|
|
337
366
|
})]
|
|
338
367
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ m("div", {
|
|
340
369
|
className: "grid gap-6 lg:grid-cols-3",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ m("div", {
|
|
342
371
|
className: "space-y-6 lg:col-span-2",
|
|
343
|
-
children: [
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
372
|
+
children: [
|
|
373
|
+
/* @__PURE__ */ m(s, {
|
|
374
|
+
title: "Details",
|
|
375
|
+
icon: oe,
|
|
376
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h4", {
|
|
377
|
+
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
378
|
+
children: "Description"
|
|
379
|
+
}), /* @__PURE__ */ p("p", {
|
|
380
|
+
className: "mt-1 text-sm text-text-primary",
|
|
381
|
+
children: Y.description || "—"
|
|
382
|
+
})] }), /* @__PURE__ */ p("dl", {
|
|
383
|
+
className: "mt-4 divide-y divide-border-seam text-sm",
|
|
384
|
+
children: Pe.map((e) => /* @__PURE__ */ m("div", {
|
|
385
|
+
className: "flex flex-col gap-0.5 py-2.5 sm:flex-row sm:items-center sm:justify-between",
|
|
386
|
+
children: [/* @__PURE__ */ p("dt", {
|
|
387
|
+
className: "text-text-secondary",
|
|
388
|
+
children: e.label
|
|
389
|
+
}), /* @__PURE__ */ p("dd", {
|
|
390
|
+
className: "font-medium text-text-primary sm:text-right",
|
|
391
|
+
children: e.value
|
|
392
|
+
})]
|
|
393
|
+
}, e.label))
|
|
394
|
+
})]
|
|
395
|
+
}),
|
|
396
|
+
/* @__PURE__ */ p(s, {
|
|
397
|
+
title: `Checklist (${Z}/${Q})`,
|
|
398
|
+
children: Q === 0 ? /* @__PURE__ */ p("p", {
|
|
399
|
+
className: "text-sm text-text-secondary",
|
|
400
|
+
children: "No checklist items for this job."
|
|
401
|
+
}) : /* @__PURE__ */ m(le, { children: [/* @__PURE__ */ p("div", {
|
|
402
|
+
className: "mb-3 h-2 overflow-hidden rounded-full bg-bg-sunken",
|
|
403
|
+
children: /* @__PURE__ */ p("div", {
|
|
404
|
+
className: "h-full rounded-full bg-action-primary-bg transition-all",
|
|
405
|
+
style: { width: `${ke}%` }
|
|
406
|
+
})
|
|
407
|
+
}), /* @__PURE__ */ p("div", {
|
|
408
|
+
className: "space-y-2",
|
|
409
|
+
children: Y.checklist.map((e, t) => /* @__PURE__ */ m("label", {
|
|
410
|
+
className: "flex cursor-pointer items-center gap-3 rounded border border-border-seam p-2.5",
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ p("input", {
|
|
413
|
+
type: "checkbox",
|
|
414
|
+
className: "h-4 w-4 accent-action-primary-bg",
|
|
415
|
+
checked: e.completed,
|
|
416
|
+
disabled: W === t,
|
|
417
|
+
onChange: (e) => Ae(t, e.target.checked)
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ p("span", {
|
|
420
|
+
className: n("text-sm", e.completed && "text-text-secondary line-through"),
|
|
421
|
+
children: e.task
|
|
422
|
+
}),
|
|
423
|
+
W === t ? /* @__PURE__ */ p(u, { className: "ml-auto h-3.5 w-3.5 animate-spin text-text-secondary" }) : null
|
|
424
|
+
]
|
|
425
|
+
}, t))
|
|
426
|
+
})] })
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ p(de, { children: "The full brief for a single work order: what needs doing, on which asset and by whom. Track the job from open to complete and keep the asset's maintenance history accurate." })
|
|
429
|
+
]
|
|
430
|
+
}), /* @__PURE__ */ m("div", {
|
|
367
431
|
className: "space-y-6",
|
|
368
432
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ p(i, {
|
|
370
434
|
entityType: "assethandler-work-order",
|
|
371
|
-
entityId:
|
|
435
|
+
entityId: Y.id
|
|
372
436
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ p(a, {
|
|
374
438
|
entityType: "assethandler-work-order",
|
|
375
|
-
entityId:
|
|
439
|
+
entityId: Y.id
|
|
376
440
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ p(o, { resourceId: Y.id })
|
|
378
442
|
]
|
|
379
443
|
})]
|
|
380
444
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
open:
|
|
383
|
-
onOpenChange:
|
|
384
|
-
children: /* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ p(v, {
|
|
446
|
+
open: Se,
|
|
447
|
+
onOpenChange: R,
|
|
448
|
+
children: /* @__PURE__ */ m(y, { children: [
|
|
449
|
+
/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Complete work order" }), /* @__PURE__ */ p(b, { children: "Record the final cost and any closing notes. This marks the work order as completed." })] }),
|
|
450
|
+
/* @__PURE__ */ m("div", {
|
|
387
451
|
className: "space-y-4",
|
|
388
|
-
children: [/* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ m("div", {
|
|
389
453
|
className: "space-y-2",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ p(_, { children: "Actual Cost" }), /* @__PURE__ */ p(g, {
|
|
391
455
|
type: "number",
|
|
392
456
|
min: "0",
|
|
393
457
|
step: "0.01",
|
|
394
458
|
placeholder: "e.g., 750",
|
|
395
|
-
value:
|
|
396
|
-
onChange: (e) =>
|
|
459
|
+
value: B.actualCost,
|
|
460
|
+
onChange: (e) => V((t) => ({
|
|
397
461
|
...t,
|
|
398
462
|
actualCost: e.target.value
|
|
399
463
|
}))
|
|
400
464
|
})]
|
|
401
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ m("div", {
|
|
402
466
|
className: "space-y-2",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
467
|
+
children: [/* @__PURE__ */ p(_, { children: "Notes" }), /* @__PURE__ */ p(k, {
|
|
404
468
|
placeholder: "What was done to close this out?",
|
|
405
|
-
value:
|
|
406
|
-
onChange: (e) =>
|
|
469
|
+
value: B.notes,
|
|
470
|
+
onChange: (e) => V((t) => ({
|
|
407
471
|
...t,
|
|
408
472
|
notes: e.target.value
|
|
409
473
|
})),
|
|
@@ -411,99 +475,99 @@ function B() {
|
|
|
411
475
|
})]
|
|
412
476
|
})]
|
|
413
477
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
|
|
415
479
|
variant: "outline",
|
|
416
|
-
onClick: () =>
|
|
417
|
-
disabled:
|
|
480
|
+
onClick: () => R(!1),
|
|
481
|
+
disabled: K,
|
|
418
482
|
children: "Cancel"
|
|
419
|
-
}), /* @__PURE__ */
|
|
420
|
-
onClick:
|
|
421
|
-
disabled:
|
|
422
|
-
children: [
|
|
483
|
+
}), /* @__PURE__ */ m(h, {
|
|
484
|
+
onClick: Me,
|
|
485
|
+
disabled: K,
|
|
486
|
+
children: [K ? /* @__PURE__ */ p(u, { className: "mr-2 h-4 w-4 animate-spin" }) : null, K ? "Completing…" : "Complete work order"]
|
|
423
487
|
})] })
|
|
424
488
|
] })
|
|
425
489
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
open:
|
|
428
|
-
onOpenChange:
|
|
429
|
-
children: /* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ p(v, {
|
|
491
|
+
open: Ce,
|
|
492
|
+
onOpenChange: z,
|
|
493
|
+
children: /* @__PURE__ */ m(y, {
|
|
430
494
|
className: "max-h-[85vh] overflow-y-auto sm:max-w-xl",
|
|
431
495
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
|
|
496
|
+
/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Edit work order" }), /* @__PURE__ */ p(b, { children: "Update the work order's details and status." })] }),
|
|
497
|
+
H ? /* @__PURE__ */ m("div", {
|
|
434
498
|
className: "space-y-4",
|
|
435
499
|
children: [
|
|
436
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ m("div", {
|
|
437
501
|
className: "space-y-2",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
439
|
-
value:
|
|
502
|
+
children: [/* @__PURE__ */ p(_, { children: "Title" }), /* @__PURE__ */ p(g, {
|
|
503
|
+
value: H.title,
|
|
440
504
|
onChange: (e) => $("title", e.target.value)
|
|
441
505
|
})]
|
|
442
506
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ m("div", {
|
|
444
508
|
className: "space-y-2",
|
|
445
|
-
children: [/* @__PURE__ */
|
|
446
|
-
value:
|
|
509
|
+
children: [/* @__PURE__ */ p(_, { children: "Description" }), /* @__PURE__ */ p(k, {
|
|
510
|
+
value: H.description,
|
|
447
511
|
onChange: (e) => $("description", e.target.value),
|
|
448
512
|
rows: 2
|
|
449
513
|
})]
|
|
450
514
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ m("div", {
|
|
452
516
|
className: "grid gap-4 md:grid-cols-3",
|
|
453
517
|
children: [
|
|
454
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ m("div", {
|
|
455
519
|
className: "space-y-2",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
457
|
-
value:
|
|
520
|
+
children: [/* @__PURE__ */ p(_, { children: "Type" }), /* @__PURE__ */ m(w, {
|
|
521
|
+
value: H.type,
|
|
458
522
|
onValueChange: (e) => $("type", e),
|
|
459
|
-
children: [/* @__PURE__ */
|
|
523
|
+
children: [/* @__PURE__ */ p(D, { children: /* @__PURE__ */ p(O, {}) }), /* @__PURE__ */ p(T, { children: ge.map((e) => /* @__PURE__ */ p(E, {
|
|
460
524
|
value: e,
|
|
461
|
-
children:
|
|
525
|
+
children: N(e)
|
|
462
526
|
}, e)) })]
|
|
463
527
|
})]
|
|
464
528
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ m("div", {
|
|
466
530
|
className: "space-y-2",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
468
|
-
value:
|
|
531
|
+
children: [/* @__PURE__ */ p(_, { children: "Priority" }), /* @__PURE__ */ m(w, {
|
|
532
|
+
value: H.priority,
|
|
469
533
|
onValueChange: (e) => $("priority", e),
|
|
470
|
-
children: [/* @__PURE__ */
|
|
534
|
+
children: [/* @__PURE__ */ p(D, { children: /* @__PURE__ */ p(O, {}) }), /* @__PURE__ */ p(T, { children: ve.map((e) => /* @__PURE__ */ p(E, {
|
|
471
535
|
value: e,
|
|
472
|
-
children:
|
|
536
|
+
children: N(e)
|
|
473
537
|
}, e)) })]
|
|
474
538
|
})]
|
|
475
539
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ m("div", {
|
|
477
541
|
className: "space-y-2",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
479
|
-
value:
|
|
542
|
+
children: [/* @__PURE__ */ p(_, { children: "Status" }), /* @__PURE__ */ m(w, {
|
|
543
|
+
value: H.status,
|
|
480
544
|
onValueChange: (e) => $("status", e),
|
|
481
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ p(D, { children: /* @__PURE__ */ p(O, {}) }), /* @__PURE__ */ p(T, { children: _e.map((e) => /* @__PURE__ */ p(E, {
|
|
482
546
|
value: e,
|
|
483
|
-
children:
|
|
547
|
+
children: N(e)
|
|
484
548
|
}, e)) })]
|
|
485
549
|
})]
|
|
486
550
|
})
|
|
487
551
|
]
|
|
488
552
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ m("div", {
|
|
490
554
|
className: "space-y-2",
|
|
491
|
-
children: [/* @__PURE__ */
|
|
492
|
-
value:
|
|
555
|
+
children: [/* @__PURE__ */ p(_, { children: "Assigned To" }), /* @__PURE__ */ p(g, {
|
|
556
|
+
value: H.assignedTo,
|
|
493
557
|
onChange: (e) => $("assignedTo", e.target.value)
|
|
494
558
|
})]
|
|
495
559
|
})
|
|
496
560
|
]
|
|
497
561
|
}) : null,
|
|
498
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
|
|
499
563
|
variant: "outline",
|
|
500
|
-
onClick: () =>
|
|
501
|
-
disabled:
|
|
564
|
+
onClick: () => z(!1),
|
|
565
|
+
disabled: q,
|
|
502
566
|
children: "Cancel"
|
|
503
|
-
}), /* @__PURE__ */
|
|
504
|
-
onClick:
|
|
505
|
-
disabled:
|
|
506
|
-
children: [
|
|
567
|
+
}), /* @__PURE__ */ m(h, {
|
|
568
|
+
onClick: Ne,
|
|
569
|
+
disabled: q,
|
|
570
|
+
children: [q ? /* @__PURE__ */ p(u, { className: "mr-2 h-4 w-4 animate-spin" }) : null, q ? "Saving…" : "Save changes"]
|
|
507
571
|
})] })
|
|
508
572
|
]
|
|
509
573
|
})
|
|
@@ -512,6 +576,6 @@ function B() {
|
|
|
512
576
|
});
|
|
513
577
|
}
|
|
514
578
|
//#endregion
|
|
515
|
-
export {
|
|
579
|
+
export { P as OperationsWorkOrderDetailPage };
|
|
516
580
|
|
|
517
581
|
//# sourceMappingURL=OperationsWorkOrderDetailPage.js.map
|