@burdenoff/microfe-labsofscience 2026.717.3 → 2026.720.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/labsofscience/LabsOfScienceRoutes.d.ts.map +1 -1
- package/dist/labsofscience/LabsOfScienceRoutes.js +50 -49
- package/dist/labsofscience/LabsOfScienceRoutes.js.map +1 -1
- package/dist/labsofscience/components/BottomNav.d.ts +4 -0
- package/dist/labsofscience/components/BottomNav.d.ts.map +1 -0
- package/dist/labsofscience/components/BottomNav.js +141 -0
- package/dist/labsofscience/components/BottomNav.js.map +1 -0
- package/dist/labsofscience/components/index.d.ts +1 -0
- package/dist/labsofscience/components/index.d.ts.map +1 -1
- package/dist/labsofscience/hooks/index.d.ts +1 -0
- package/dist/labsofscience/hooks/index.d.ts.map +1 -1
- package/dist/labsofscience/hooks/useLabActorNames.d.ts +18 -0
- package/dist/labsofscience/hooks/useLabActorNames.d.ts.map +1 -0
- package/dist/labsofscience/hooks/useLabActorNames.js +17 -0
- package/dist/labsofscience/hooks/useLabActorNames.js.map +1 -0
- package/dist/labsofscience/pages/experiments/ExperimentDetailPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js +109 -95
- package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentsListPage.js +68 -59
- package/dist/labsofscience/pages/experiments/ExperimentsListPage.js.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentDetailPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js +72 -59
- package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentsListPage.js +62 -52
- package/dist/labsofscience/pages/instruments/InstrumentsListPage.js.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectDetailPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectDetailPage.js +88 -83
- package/dist/labsofscience/pages/projects/ProjectDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectsListPage.js +69 -59
- package/dist/labsofscience/pages/projects/ProjectsListPage.js.map +1 -1
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +2 -1
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,31 +8,32 @@ import { ExperimentFormDialog as c } from "./ExperimentFormDialog.js";
|
|
|
8
8
|
import { EmptyState as l } from "../../components/EmptyState.js";
|
|
9
9
|
import { BackLink as u, DetailField as d, DetailSection as f, JsonBlock as p, TagList as m } from "../shared/DetailComponents.js";
|
|
10
10
|
import h from "../../components/DiscussionPanel.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import { useLabActorNames as g } from "../../hooks/useLabActorNames.js";
|
|
12
|
+
import { CompleteRunDialog as _, StartRunDialog as v } from "./RunDialogs.js";
|
|
13
|
+
import { useState as y } from "react";
|
|
14
|
+
import { CheckCircle2 as b, FlaskConical as x, FolderKanban as S, Pencil as C, Play as w } from "lucide-react";
|
|
15
|
+
import { useParams as T } from "react-router-dom";
|
|
16
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
17
|
+
import { Button as k, ResponsiveTable as A, Select as j, SelectContent as M, SelectItem as N, SelectTrigger as P, SelectValue as F } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/labsofscience/pages/experiments/ExperimentDetailPage.tsx
|
|
18
|
-
var
|
|
19
|
+
var I = [
|
|
19
20
|
"DESIGN",
|
|
20
21
|
"RUNNING",
|
|
21
22
|
"ANALYSIS",
|
|
22
23
|
"COMPLETE",
|
|
23
24
|
"ABANDONED"
|
|
24
|
-
],
|
|
25
|
+
], L = new Set([
|
|
25
26
|
"SUCCEEDED",
|
|
26
27
|
"FAILED",
|
|
27
28
|
"CANCELLED"
|
|
28
29
|
]);
|
|
29
|
-
function
|
|
30
|
-
let { id:
|
|
30
|
+
function R() {
|
|
31
|
+
let { id: R } = T(), { navigateTo: z } = e(), B = i(R), V = a(), [H, U] = y(!1), [W, G] = y(!1), [K, q] = y(null), J = B.data, { nameOf: Y } = g([J?.leadResearcherId, ...J?.runs.map((e) => e.performedById) ?? []]), X = [
|
|
31
32
|
{
|
|
32
33
|
key: "runNumber",
|
|
33
34
|
header: "Run",
|
|
34
35
|
priority: "primary",
|
|
35
|
-
cell: (e) => /* @__PURE__ */
|
|
36
|
+
cell: (e) => /* @__PURE__ */ O("span", {
|
|
36
37
|
className: "font-medium text-text-primary",
|
|
37
38
|
children: ["#", e.runNumber]
|
|
38
39
|
})
|
|
@@ -41,13 +42,22 @@ function L() {
|
|
|
41
42
|
key: "status",
|
|
42
43
|
header: "Status",
|
|
43
44
|
priority: "primary",
|
|
44
|
-
cell: (e) => /* @__PURE__ */
|
|
45
|
+
cell: (e) => /* @__PURE__ */ D(n, { status: e.status })
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: "performedBy",
|
|
49
|
+
header: "Performed by",
|
|
50
|
+
priority: "hidden-on-mobile",
|
|
51
|
+
cell: (e) => /* @__PURE__ */ D("span", {
|
|
52
|
+
className: "text-text-secondary",
|
|
53
|
+
children: Y(e.performedById)
|
|
54
|
+
})
|
|
45
55
|
},
|
|
46
56
|
{
|
|
47
57
|
key: "startedAt",
|
|
48
58
|
header: "Started",
|
|
49
59
|
priority: "hidden-on-mobile",
|
|
50
|
-
cell: (e) => /* @__PURE__ */
|
|
60
|
+
cell: (e) => /* @__PURE__ */ D("span", {
|
|
51
61
|
className: "text-text-secondary",
|
|
52
62
|
children: e.startedAt ? o(e.startedAt) : "—"
|
|
53
63
|
})
|
|
@@ -56,174 +66,178 @@ function L() {
|
|
|
56
66
|
key: "completedAt",
|
|
57
67
|
header: "Completed",
|
|
58
68
|
priority: "hidden-on-mobile",
|
|
59
|
-
cell: (e) => /* @__PURE__ */
|
|
69
|
+
cell: (e) => /* @__PURE__ */ D("span", {
|
|
60
70
|
className: "text-text-secondary",
|
|
61
71
|
children: e.completedAt ? o(e.completedAt) : "—"
|
|
62
72
|
})
|
|
63
73
|
}
|
|
64
|
-
],
|
|
65
|
-
!
|
|
66
|
-
id:
|
|
74
|
+
], Z = async (e) => {
|
|
75
|
+
!J || e === J.status || await V.mutateAsync({
|
|
76
|
+
id: J.id,
|
|
67
77
|
status: e
|
|
68
78
|
});
|
|
69
79
|
};
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
title:
|
|
72
|
-
description:
|
|
73
|
-
actions:
|
|
80
|
+
return /* @__PURE__ */ O(t, {
|
|
81
|
+
title: J?.title ?? "Experiment",
|
|
82
|
+
description: J?.project?.name ?? void 0,
|
|
83
|
+
actions: J ? /* @__PURE__ */ O("div", {
|
|
74
84
|
className: "flex items-center gap-2",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ O(k, {
|
|
76
86
|
variant: "outline",
|
|
77
|
-
onClick: () =>
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
-
}), /* @__PURE__ */
|
|
80
|
-
onClick: () =>
|
|
81
|
-
children: [/* @__PURE__ */
|
|
87
|
+
onClick: () => U(!0),
|
|
88
|
+
children: [/* @__PURE__ */ D(C, { className: "mr-2 h-4 w-4" }), "Edit"]
|
|
89
|
+
}), /* @__PURE__ */ O(k, {
|
|
90
|
+
onClick: () => G(!0),
|
|
91
|
+
children: [/* @__PURE__ */ D(w, { className: "mr-2 h-4 w-4" }), "Start run"]
|
|
82
92
|
})]
|
|
83
93
|
}) : void 0,
|
|
84
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ O("div", {
|
|
85
95
|
className: "space-y-4",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ D(u, {
|
|
87
97
|
label: "Experiments",
|
|
88
|
-
onClick: () =>
|
|
89
|
-
}), /* @__PURE__ */
|
|
90
|
-
isLoading:
|
|
91
|
-
isError:
|
|
92
|
-
error:
|
|
93
|
-
onRetry: () => void
|
|
98
|
+
onClick: () => z("experiments")
|
|
99
|
+
}), /* @__PURE__ */ D(r, {
|
|
100
|
+
isLoading: B.isLoading,
|
|
101
|
+
isError: B.isError,
|
|
102
|
+
error: B.error,
|
|
103
|
+
onRetry: () => void B.refetch(),
|
|
94
104
|
loadingLabel: "Loading experiment…",
|
|
95
|
-
children:
|
|
105
|
+
children: J ? /* @__PURE__ */ O("div", {
|
|
96
106
|
className: "space-y-6",
|
|
97
107
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ D(f, {
|
|
99
109
|
title: "Design",
|
|
100
|
-
action: /* @__PURE__ */
|
|
110
|
+
action: /* @__PURE__ */ O("div", {
|
|
101
111
|
className: "flex items-center gap-2",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ D("span", {
|
|
103
113
|
className: "text-xs text-text-tertiary",
|
|
104
114
|
children: "Status"
|
|
105
|
-
}), /* @__PURE__ */
|
|
106
|
-
value:
|
|
107
|
-
onValueChange: (e) => void
|
|
108
|
-
disabled:
|
|
109
|
-
children: [/* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ O(j, {
|
|
116
|
+
value: J.status,
|
|
117
|
+
onValueChange: (e) => void Z(e),
|
|
118
|
+
disabled: V.isPending,
|
|
119
|
+
children: [/* @__PURE__ */ D(P, {
|
|
110
120
|
className: "h-11 w-full sm:w-36 md:h-8",
|
|
111
121
|
"aria-label": "Change experiment status",
|
|
112
|
-
children: /* @__PURE__ */
|
|
113
|
-
}), /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ D(F, {})
|
|
123
|
+
}), /* @__PURE__ */ D(M, { children: I.map((e) => /* @__PURE__ */ D(N, {
|
|
114
124
|
value: e,
|
|
115
125
|
children: s(e)
|
|
116
126
|
}, e)) })]
|
|
117
127
|
})]
|
|
118
128
|
}),
|
|
119
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ O("dl", {
|
|
120
130
|
className: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
121
131
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ D(d, {
|
|
123
133
|
label: "Status",
|
|
124
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ D(n, { status: J.status })
|
|
125
135
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ D(d, {
|
|
127
137
|
label: "Protocol",
|
|
128
|
-
children:
|
|
138
|
+
children: J.protocolId ? /* @__PURE__ */ D("button", {
|
|
129
139
|
type: "button",
|
|
130
140
|
className: "text-text-link hover:underline",
|
|
131
|
-
onClick: () =>
|
|
141
|
+
onClick: () => z(`protocols/${J.protocolId}`),
|
|
132
142
|
children: "View protocol"
|
|
133
143
|
}) : "—"
|
|
134
144
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ D(d, {
|
|
136
146
|
label: "Project",
|
|
137
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ O("button", {
|
|
138
148
|
type: "button",
|
|
139
149
|
className: "inline-flex items-center gap-1 text-text-link hover:underline",
|
|
140
|
-
onClick: () =>
|
|
141
|
-
children: [/* @__PURE__ */
|
|
150
|
+
onClick: () => z(`projects/${J.projectId}`),
|
|
151
|
+
children: [/* @__PURE__ */ D(S, { className: "h-3.5 w-3.5" }), J.project?.name ?? "Open project"]
|
|
142
152
|
})
|
|
143
153
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ D(d, {
|
|
155
|
+
label: "Lead researcher",
|
|
156
|
+
children: Y(J.leadResearcherId)
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ D(d, {
|
|
145
159
|
label: "Hypothesis",
|
|
146
160
|
className: "sm:col-span-2 lg:col-span-3",
|
|
147
|
-
children:
|
|
161
|
+
children: J.hypothesis ?? "—"
|
|
148
162
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ D(d, {
|
|
150
164
|
label: "Description",
|
|
151
165
|
className: "sm:col-span-2 lg:col-span-3",
|
|
152
|
-
children:
|
|
166
|
+
children: J.description ?? "—"
|
|
153
167
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ D(d, {
|
|
155
169
|
label: "Variables",
|
|
156
170
|
className: "sm:col-span-2 lg:col-span-3",
|
|
157
|
-
children: /* @__PURE__ */
|
|
158
|
-
value:
|
|
171
|
+
children: /* @__PURE__ */ D(p, {
|
|
172
|
+
value: J.variables,
|
|
159
173
|
emptyLabel: "No variables defined"
|
|
160
174
|
})
|
|
161
175
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ D(d, {
|
|
163
177
|
label: "Tags",
|
|
164
178
|
className: "sm:col-span-2 lg:col-span-3",
|
|
165
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ D(m, { tags: J.tags })
|
|
166
180
|
})
|
|
167
181
|
]
|
|
168
182
|
})
|
|
169
183
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
title: `Runs (${
|
|
172
|
-
action: /* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ D(f, {
|
|
185
|
+
title: `Runs (${J.runs.length})`,
|
|
186
|
+
action: /* @__PURE__ */ O(k, {
|
|
173
187
|
size: "sm",
|
|
174
|
-
onClick: () =>
|
|
175
|
-
children: [/* @__PURE__ */
|
|
188
|
+
onClick: () => G(!0),
|
|
189
|
+
children: [/* @__PURE__ */ D(w, { className: "mr-1.5 h-4 w-4" }), "Start run"]
|
|
176
190
|
}),
|
|
177
|
-
children:
|
|
191
|
+
children: J.runs.length === 0 ? /* @__PURE__ */ D("p", {
|
|
178
192
|
className: "py-6 text-center text-sm text-text-secondary",
|
|
179
193
|
children: "No runs yet. Start a run to execute this experiment."
|
|
180
|
-
}) : /* @__PURE__ */
|
|
181
|
-
columns:
|
|
182
|
-
data: [...
|
|
194
|
+
}) : /* @__PURE__ */ D(A, {
|
|
195
|
+
columns: X,
|
|
196
|
+
data: [...J.runs].sort((e, t) => t.runNumber - e.runNumber),
|
|
183
197
|
rowKey: (e) => e.id,
|
|
184
|
-
rowActions: (e) =>
|
|
198
|
+
rowActions: (e) => L.has(e.status) ? null : /* @__PURE__ */ O(k, {
|
|
185
199
|
variant: "ghost",
|
|
186
200
|
size: "sm",
|
|
187
201
|
onClick: (t) => {
|
|
188
|
-
t.stopPropagation(),
|
|
202
|
+
t.stopPropagation(), q(e);
|
|
189
203
|
},
|
|
190
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ D(b, { className: "mr-1.5 h-4 w-4" }), "Complete"]
|
|
191
205
|
})
|
|
192
206
|
})
|
|
193
207
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ D(h, {
|
|
195
209
|
entityType: "lab-experiment",
|
|
196
|
-
entityId:
|
|
210
|
+
entityId: J.id
|
|
197
211
|
})
|
|
198
212
|
]
|
|
199
|
-
}) : /* @__PURE__ */
|
|
200
|
-
icon: /* @__PURE__ */
|
|
213
|
+
}) : /* @__PURE__ */ D(l, {
|
|
214
|
+
icon: /* @__PURE__ */ D(x, { className: "h-10 w-10" }),
|
|
201
215
|
title: "Experiment not found",
|
|
202
216
|
description: "This experiment may have been removed or is outside your workspace."
|
|
203
217
|
})
|
|
204
218
|
})]
|
|
205
|
-
}),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
open:
|
|
208
|
-
onOpenChange:
|
|
209
|
-
experiment:
|
|
219
|
+
}), J && /* @__PURE__ */ O(E, { children: [
|
|
220
|
+
/* @__PURE__ */ D(c, {
|
|
221
|
+
open: H,
|
|
222
|
+
onOpenChange: U,
|
|
223
|
+
experiment: J
|
|
210
224
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
open:
|
|
213
|
-
onOpenChange:
|
|
214
|
-
experimentId:
|
|
225
|
+
/* @__PURE__ */ D(v, {
|
|
226
|
+
open: W,
|
|
227
|
+
onOpenChange: G,
|
|
228
|
+
experimentId: J.id
|
|
215
229
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
open:
|
|
230
|
+
/* @__PURE__ */ D(_, {
|
|
231
|
+
open: K !== null,
|
|
218
232
|
onOpenChange: (e) => {
|
|
219
|
-
e ||
|
|
233
|
+
e || q(null);
|
|
220
234
|
},
|
|
221
|
-
run:
|
|
235
|
+
run: K
|
|
222
236
|
})
|
|
223
237
|
] })]
|
|
224
238
|
});
|
|
225
239
|
}
|
|
226
240
|
//#endregion
|
|
227
|
-
export {
|
|
241
|
+
export { R as ExperimentDetailPage };
|
|
228
242
|
|
|
229
243
|
//# sourceMappingURL=ExperimentDetailPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExperimentDetailPage.js","names":[],"sources":["../../../../src/labsofscience/pages/experiments/ExperimentDetailPage.tsx"],"sourcesContent":["/**\n * Experiment detail page\n * @module labsofscience/pages/experiments\n *\n * Shows the experiment design, a lifecycle transition control\n * (`labTransitionExperiment`), and the experiment's runs with start/complete\n * actions (`labStartRun` / `labCompleteRun`).\n */\n\nimport { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { FlaskConical, Pencil, Play, CheckCircle2, FolderKanban } from 'lucide-react';\nimport {\n Button,\n ResponsiveTable,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { QueryBoundary } from '../../components/QueryStates';\nimport { DiscussionPanel } from '../../components/DiscussionPanel';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useExperiment, useTransitionExperiment } from '../../hooks/useLabsOfScienceApi';\nimport type { LabExperimentRun, LabExperimentStatus, LabRunStatus } from '../../types';\nimport { formatDate, titleCase } from '../../utils/formatters';\nimport {\n DetailField,\n DetailSection,\n BackLink,\n TagList,\n JsonBlock,\n} from '../shared/DetailComponents';\nimport { ExperimentFormDialog } from './ExperimentFormDialog';\nimport { StartRunDialog, CompleteRunDialog } from './RunDialogs';\n\nconst EXPERIMENT_STATUSES: LabExperimentStatus[] = [\n 'DESIGN',\n 'RUNNING',\n 'ANALYSIS',\n 'COMPLETE',\n 'ABANDONED',\n];\n\nconst TERMINAL_RUN_STATUSES = new Set<LabRunStatus>(['SUCCEEDED', 'FAILED', 'CANCELLED']);\n\nexport function ExperimentDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigateTo } = useLabsOfScience();\n const query = useExperiment(id);\n const transition = useTransitionExperiment();\n\n const [editOpen, setEditOpen] = useState(false);\n const [startRunOpen, setStartRunOpen] = useState(false);\n const [completeRun, setCompleteRun] = useState<LabExperimentRun | null>(null);\n\n const experiment = query.data;\n\n const runColumns: ResponsiveTableColumn<LabExperimentRun>[] = [\n {\n key: 'runNumber',\n header: 'Run',\n priority: 'primary',\n cell: (row) => <span className=\"font-medium text-text-primary\">#{row.runNumber}</span>,\n },\n {\n key: 'status',\n header: 'Status',\n priority: 'primary',\n cell: (row) => <StatusBadge status={row.status} />,\n },\n {\n key: 'startedAt',\n header: 'Started',\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">\n {row.startedAt ? formatDate(row.startedAt) : '—'}\n </span>\n ),\n },\n {\n key: 'completedAt',\n header: 'Completed',\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">\n {row.completedAt ? formatDate(row.completedAt) : '—'}\n </span>\n ),\n },\n ];\n\n const handleTransition = async (next: LabExperimentStatus) => {\n if (!experiment || next === experiment.status) return;\n await transition.mutateAsync({ id: experiment.id, status: next });\n };\n\n return (\n <PageLayout\n title={experiment?.title ?? 'Experiment'}\n description={experiment?.project?.name ?? undefined}\n actions={\n experiment ? (\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" onClick={() => setEditOpen(true)}>\n <Pencil className=\"mr-2 h-4 w-4\" />\n Edit\n </Button>\n <Button onClick={() => setStartRunOpen(true)}>\n <Play className=\"mr-2 h-4 w-4\" />\n Start run\n </Button>\n </div>\n ) : undefined\n }\n >\n <div className=\"space-y-4\">\n <BackLink label=\"Experiments\" onClick={() => navigateTo('experiments')} />\n\n <QueryBoundary\n isLoading={query.isLoading}\n isError={query.isError}\n error={query.error}\n onRetry={() => void query.refetch()}\n loadingLabel=\"Loading experiment…\"\n >\n {!experiment ? (\n <EmptyState\n icon={<FlaskConical className=\"h-10 w-10\" />}\n title=\"Experiment not found\"\n description=\"This experiment may have been removed or is outside your workspace.\"\n />\n ) : (\n <div className=\"space-y-6\">\n <DetailSection\n title=\"Design\"\n action={\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs text-text-tertiary\">Status</span>\n <Select\n value={experiment.status}\n onValueChange={(value) => void handleTransition(value as LabExperimentStatus)}\n disabled={transition.isPending}\n >\n <SelectTrigger\n className=\"h-11 w-full sm:w-36 md:h-8\"\n aria-label=\"Change experiment status\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {EXPERIMENT_STATUSES.map((option) => (\n <SelectItem key={option} value={option}>\n {titleCase(option)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n }\n >\n <dl className=\"grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2 lg:grid-cols-3\">\n <DetailField label=\"Status\">\n <StatusBadge status={experiment.status} />\n </DetailField>\n <DetailField label=\"Protocol\">\n {experiment.protocolId ? (\n <button\n type=\"button\"\n className=\"text-text-link hover:underline\"\n onClick={() => navigateTo(`protocols/${experiment.protocolId}`)}\n >\n View protocol\n </button>\n ) : (\n '—'\n )}\n </DetailField>\n <DetailField label=\"Project\">\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 text-text-link hover:underline\"\n onClick={() => navigateTo(`projects/${experiment.projectId}`)}\n >\n <FolderKanban className=\"h-3.5 w-3.5\" />\n {experiment.project?.name ?? 'Open project'}\n </button>\n </DetailField>\n <DetailField label=\"Hypothesis\" className=\"sm:col-span-2 lg:col-span-3\">\n {experiment.hypothesis ?? '—'}\n </DetailField>\n <DetailField label=\"Description\" className=\"sm:col-span-2 lg:col-span-3\">\n {experiment.description ?? '—'}\n </DetailField>\n <DetailField label=\"Variables\" className=\"sm:col-span-2 lg:col-span-3\">\n <JsonBlock value={experiment.variables} emptyLabel=\"No variables defined\" />\n </DetailField>\n <DetailField label=\"Tags\" className=\"sm:col-span-2 lg:col-span-3\">\n <TagList tags={experiment.tags} />\n </DetailField>\n </dl>\n </DetailSection>\n\n <DetailSection\n title={`Runs (${experiment.runs.length})`}\n action={\n <Button size=\"sm\" onClick={() => setStartRunOpen(true)}>\n <Play className=\"mr-1.5 h-4 w-4\" />\n Start run\n </Button>\n }\n >\n {experiment.runs.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-secondary\">\n No runs yet. Start a run to execute this experiment.\n </p>\n ) : (\n <ResponsiveTable\n columns={runColumns}\n data={[...experiment.runs].sort((a, b) => b.runNumber - a.runNumber)}\n rowKey={(row) => row.id}\n rowActions={(row) =>\n TERMINAL_RUN_STATUSES.has(row.status) ? null : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(event) => {\n event.stopPropagation();\n setCompleteRun(row);\n }}\n >\n <CheckCircle2 className=\"mr-1.5 h-4 w-4\" />\n Complete\n </Button>\n )\n }\n />\n )}\n </DetailSection>\n\n <DiscussionPanel entityType=\"lab-experiment\" entityId={experiment.id} />\n </div>\n )}\n </QueryBoundary>\n </div>\n\n {experiment && (\n <>\n <ExperimentFormDialog\n open={editOpen}\n onOpenChange={setEditOpen}\n experiment={experiment}\n />\n <StartRunDialog\n open={startRunOpen}\n onOpenChange={setStartRunOpen}\n experimentId={experiment.id}\n />\n <CompleteRunDialog\n open={completeRun !== null}\n onOpenChange={(open) => {\n if (!open) setCompleteRun(null);\n }}\n run={completeRun}\n />\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,IAAM,IAA6C;CACjD;CACA;CACA;CACA;CACA;CACD,EAEK,IAAwB,IAAI,IAAkB;CAAC;CAAa;CAAU;CAAY,CAAC;AAEzF,SAAgB,IAAuB;CACrC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,kBAAe,GAAkB,EACnC,IAAQ,EAAc,EAAG,EACzB,IAAa,GAAyB,EAEtC,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAa,KAAkB,EAAkC,KAAK,EAEvE,IAAa,EAAM,MAEnB,IAAwD;EAC5D;GACE,KAAK;GACL,QAAQ;GACR,UAAU;GACV,OAAO,MAAQ,kBAAC,QAAD;IAAM,WAAU;cAAhB,CAAgD,KAAE,EAAI,UAAiB;;GACvF;EACD;GACE,KAAK;GACL,QAAQ;GACR,UAAU;GACV,OAAO,MAAQ,kBAAC,GAAD,EAAa,QAAQ,EAAI,QAAU,CAAA;GACnD;EACD;GACE,KAAK;GACL,QAAQ;GACR,UAAU;GACV,OAAO,MACL,kBAAC,QAAD;IAAM,WAAU;cACb,EAAI,YAAY,EAAW,EAAI,UAAU,GAAG;IACxC,CAAA;GAEV;EACD;GACE,KAAK;GACL,QAAQ;GACR,UAAU;GACV,OAAO,MACL,kBAAC,QAAD;IAAM,WAAU;cACb,EAA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AAM,CAAC,GAAG,EAAW,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,UAAU;QACpE,SAAS,MAAQ,EAAI;QACrB,aAAa,MACX,EAAsB,IAAI,EAAI,OAAO,GAAG,OACtC,kBAAC,GAAD;SACE,SAAQ;SACR,MAAK;SACL,UAAU,MAAU;AAElB,UADA,EAAM,iBAAiB,EACvB,EAAe,EAAI;;mBALvB,CAQE,kBAAC,GAAD,EAAc,WAAU,kBAAmB,CAAA,EAAA,WAEpC;;QAGb,CAAA;OAEU,CAAA;MAEhB,kBAAC,GAAD;OAAiB,YAAW;OAAiB,UAAU,EAAW;OAAM,CAAA;MACpE;SAlHN,kBAAC,GAAD;KACE,MAAM,kBAAC,GAAD,EAAc,WAAU,aAAc,CAAA;KAC5C,OAAM;KACN,aAAY;KACZ,CAAA;IAgHU,CAAA,CACZ;MAEL,KACC,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD;IACE,MAAM;IACN,cAAc;IACF;IACZ,CAAA;GACF,kBAAC,GAAD;IACE,MAAM;IACN,cAAc;IACd,cAAc,EAAW;IACzB,CAAA;GACF,kBAAC,GAAD;IACE,MAAM,MAAgB;IACtB,eAAe,MAAS;AACtB,KAAK,KAAM,EAAe,KAAK;;IAEjC,KAAK;IACL,CAAA;GACD,EAAA,CAAA,CAEM"}
|
|
1
|
+
{"version":3,"file":"ExperimentDetailPage.js","names":[],"sources":["../../../../src/labsofscience/pages/experiments/ExperimentDetailPage.tsx"],"sourcesContent":["/**\n * Experiment detail page\n * @module labsofscience/pages/experiments\n *\n * Shows the experiment design, a lifecycle transition control\n * (`labTransitionExperiment`), and the experiment's runs with start/complete\n * actions (`labStartRun` / `labCompleteRun`).\n */\n\nimport { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { FlaskConical, Pencil, Play, CheckCircle2, FolderKanban } from 'lucide-react';\nimport {\n Button,\n ResponsiveTable,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { QueryBoundary } from '../../components/QueryStates';\nimport { DiscussionPanel } from '../../components/DiscussionPanel';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useExperiment, useTransitionExperiment } from '../../hooks/useLabsOfScienceApi';\nimport { useLabActorNames } from '../../hooks/useLabActorNames';\nimport type { LabExperimentRun, LabExperimentStatus, LabRunStatus } from '../../types';\nimport { formatDate, titleCase } from '../../utils/formatters';\nimport {\n DetailField,\n DetailSection,\n BackLink,\n TagList,\n JsonBlock,\n} from '../shared/DetailComponents';\nimport { ExperimentFormDialog } from './ExperimentFormDialog';\nimport { StartRunDialog, CompleteRunDialog } from './RunDialogs';\n\nconst EXPERIMENT_STATUSES: LabExperimentStatus[] = [\n 'DESIGN',\n 'RUNNING',\n 'ANALYSIS',\n 'COMPLETE',\n 'ABANDONED',\n];\n\nconst TERMINAL_RUN_STATUSES = new Set<LabRunStatus>(['SUCCEEDED', 'FAILED', 'CANCELLED']);\n\nexport function ExperimentDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigateTo } = useLabsOfScience();\n const query = useExperiment(id);\n const transition = useTransitionExperiment();\n\n const [editOpen, setEditOpen] = useState(false);\n const [startRunOpen, setStartRunOpen] = useState(false);\n const [completeRun, setCompleteRun] = useState<LabExperimentRun | null>(null);\n\n const experiment = query.data;\n const { nameOf } = useLabActorNames([\n experiment?.leadResearcherId,\n ...(experiment?.runs.map((run) => run.performedById) ?? []),\n ]);\n\n const runColumns: ResponsiveTableColumn<LabExperimentRun>[] = [\n {\n key: 'runNumber',\n header: 'Run',\n priority: 'primary',\n cell: (row) => <span className=\"font-medium text-text-primary\">#{row.runNumber}</span>,\n },\n {\n key: 'status',\n header: 'Status',\n priority: 'primary',\n cell: (row) => <StatusBadge status={row.status} />,\n },\n {\n key: 'performedBy',\n header: 'Performed by',\n priority: 'hidden-on-mobile',\n cell: (row) => <span className=\"text-text-secondary\">{nameOf(row.performedById)}</span>,\n },\n {\n key: 'startedAt',\n header: 'Started',\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">\n {row.startedAt ? formatDate(row.startedAt) : '—'}\n </span>\n ),\n },\n {\n key: 'completedAt',\n header: 'Completed',\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">\n {row.completedAt ? formatDate(row.completedAt) : '—'}\n </span>\n ),\n },\n ];\n\n const handleTransition = async (next: LabExperimentStatus) => {\n if (!experiment || next === experiment.status) return;\n await transition.mutateAsync({ id: experiment.id, status: next });\n };\n\n return (\n <PageLayout\n title={experiment?.title ?? 'Experiment'}\n description={experiment?.project?.name ?? undefined}\n actions={\n experiment ? (\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" onClick={() => setEditOpen(true)}>\n <Pencil className=\"mr-2 h-4 w-4\" />\n Edit\n </Button>\n <Button onClick={() => setStartRunOpen(true)}>\n <Play className=\"mr-2 h-4 w-4\" />\n Start run\n </Button>\n </div>\n ) : undefined\n }\n >\n <div className=\"space-y-4\">\n <BackLink label=\"Experiments\" onClick={() => navigateTo('experiments')} />\n\n <QueryBoundary\n isLoading={query.isLoading}\n isError={query.isError}\n error={query.error}\n onRetry={() => void query.refetch()}\n loadingLabel=\"Loading experiment…\"\n >\n {!experiment ? (\n <EmptyState\n icon={<FlaskConical className=\"h-10 w-10\" />}\n title=\"Experiment not found\"\n description=\"This experiment may have been removed or is outside your workspace.\"\n />\n ) : (\n <div className=\"space-y-6\">\n <DetailSection\n title=\"Design\"\n action={\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs text-text-tertiary\">Status</span>\n <Select\n value={experiment.status}\n onValueChange={(value) => void handleTransition(value as LabExperimentStatus)}\n disabled={transition.isPending}\n >\n <SelectTrigger\n className=\"h-11 w-full sm:w-36 md:h-8\"\n aria-label=\"Change experiment status\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {EXPERIMENT_STATUSES.map((option) => (\n <SelectItem key={option} value={option}>\n {titleCase(option)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n }\n >\n <dl className=\"grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2 lg:grid-cols-3\">\n <DetailField label=\"Status\">\n <StatusBadge status={experiment.status} />\n </DetailField>\n <DetailField label=\"Protocol\">\n {experiment.protocolId ? (\n <button\n type=\"button\"\n className=\"text-text-link hover:underline\"\n onClick={() => navigateTo(`protocols/${experiment.protocolId}`)}\n >\n View protocol\n </button>\n ) : (\n '—'\n )}\n </DetailField>\n <DetailField label=\"Project\">\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 text-text-link hover:underline\"\n onClick={() => navigateTo(`projects/${experiment.projectId}`)}\n >\n <FolderKanban className=\"h-3.5 w-3.5\" />\n {experiment.project?.name ?? 'Open project'}\n </button>\n </DetailField>\n <DetailField label=\"Lead researcher\">\n {nameOf(experiment.leadResearcherId)}\n </DetailField>\n <DetailField label=\"Hypothesis\" className=\"sm:col-span-2 lg:col-span-3\">\n {experiment.hypothesis ?? '—'}\n </DetailField>\n <DetailField label=\"Description\" className=\"sm:col-span-2 lg:col-span-3\">\n {experiment.description ?? '—'}\n </DetailField>\n <DetailField label=\"Variables\" className=\"sm:col-span-2 lg:col-span-3\">\n <JsonBlock value={experiment.variables} emptyLabel=\"No variables defined\" />\n </DetailField>\n <DetailField label=\"Tags\" className=\"sm:col-span-2 lg:col-span-3\">\n <TagList tags={experiment.tags} />\n </DetailField>\n </dl>\n </DetailSection>\n\n <DetailSection\n title={`Runs (${experiment.runs.length})`}\n action={\n <Button size=\"sm\" onClick={() => setStartRunOpen(true)}>\n <Play className=\"mr-1.5 h-4 w-4\" />\n Start run\n </Button>\n }\n >\n {experiment.runs.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-secondary\">\n No runs yet. Start a run to execute this experiment.\n </p>\n ) : (\n <ResponsiveTable\n columns={runColumns}\n data={[...experiment.runs].sort((a, b) => b.runNumber - a.runNumber)}\n rowKey={(row) => row.id}\n rowActions={(row) =>\n TERMINAL_RUN_STATUSES.has(row.status) ? null : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(event) => {\n event.stopPropagation();\n setCompleteRun(row);\n }}\n >\n <CheckCircle2 className=\"mr-1.5 h-4 w-4\" />\n Complete\n </Button>\n )\n }\n />\n )}\n </DetailSection>\n\n <DiscussionPanel entityType=\"lab-experiment\" entityId={experiment.id} />\n </div>\n )}\n </QueryBoundary>\n </div>\n\n {experiment && (\n <>\n <ExperimentFormDialog\n open={editOpen}\n onOpenChange={setEditOpen}\n experiment={experiment}\n />\n <StartRunDialog\n open={startRunOpen}\n onOpenChange={setStartRunOpen}\n experimentId={experiment.id}\n />\n <CompleteRunDialog\n open={completeRun !== null}\n onOpenChange={(open) => {\n if (!open) setCompleteRun(null);\n }}\n run={completeRun}\n />\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,IAAM,IAA6C;CACjD;CACA;CACA;CACA;CACA;CACD,EAEK,IAAwB,IAAI,IAAkB;CAAC;CAAa;CAAU;CAAY,CAAC;AAEzF,SAAgB,IAAuB;CACrC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,kBAAe,GAAkB,EACnC,IAAQ,EAAc,EAAG,EACzB,IAAa,GAAyB,EAEtC,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAa,KAAkB,EAAkC,KAAK,EAEvE,IAAa,EAAM,MACnB,EAAE,cAAW,EAAiB,CAClC,GAAY,kBACZ,GAAI,GAAY,KAAK,KAAK,MAAQ,EAAI,cAAc,IAAI,EAAE,CAC3D,CAAC,EAEI,IAAwD;EAC5D;GACE,KAAK;GACL,QAAQ;GACR,UAAU;GACV,OAAO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AA;GACF,kBAAC,GAAD;IACE,MAAM;IACN,cAAc;IACd,cAAc,EAAW;IACzB,CAAA;GACF,kBAAC,GAAD;IACE,MAAM,MAAgB;IACtB,eAAe,MAAS;AACtB,KAAK,KAAM,EAAe,KAAK;;IAEjC,KAAK;IACL,CAAA;GACD,EAAA,CAAA,CAEM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExperimentsListPage.d.ts","sourceRoot":"","sources":["../../../../src/labsofscience/pages/experiments/ExperimentsListPage.tsx"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"ExperimentsListPage.d.ts","sourceRoot":"","sources":["../../../../src/labsofscience/pages/experiments/ExperimentsListPage.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAqCH,wBAAgB,mBAAmB,gCAmJlC"}
|
|
@@ -8,88 +8,89 @@ import { ExperimentFormDialog as s } from "./ExperimentFormDialog.js";
|
|
|
8
8
|
import { EmptyState as c } from "../../components/EmptyState.js";
|
|
9
9
|
import { ListSearchInput as l } from "../../components/ListSearchInput.js";
|
|
10
10
|
import { useDebouncedValue as u } from "../../utils/useDebouncedValue.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { useLabActorNames as d } from "../../hooks/useLabActorNames.js";
|
|
12
|
+
import { useState as f } from "react";
|
|
13
|
+
import { FlaskConical as p, Plus as m } from "lucide-react";
|
|
14
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
|
+
import { Button as v, Pagination as y, ResponsiveTable as b, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T } from "@burdenoff/fe-libs/ui";
|
|
15
16
|
//#region src/labsofscience/pages/experiments/ExperimentsListPage.tsx
|
|
16
|
-
var
|
|
17
|
+
var E = 20, D = [
|
|
17
18
|
"DESIGN",
|
|
18
19
|
"RUNNING",
|
|
19
20
|
"ANALYSIS",
|
|
20
21
|
"COMPLETE",
|
|
21
22
|
"ABANDONED"
|
|
22
23
|
];
|
|
23
|
-
function
|
|
24
|
-
let { navigateTo:
|
|
25
|
-
status:
|
|
26
|
-
search:
|
|
24
|
+
function O() {
|
|
25
|
+
let { navigateTo: O } = e(), [k, A] = f(1), [j, M] = f("ALL"), [N, P] = f(""), [F, I] = f(!1), L = u(N.trim()), R = i({
|
|
26
|
+
status: j === "ALL" ? void 0 : j,
|
|
27
|
+
search: L || void 0,
|
|
27
28
|
pagination: {
|
|
28
|
-
limit:
|
|
29
|
-
offset: (
|
|
29
|
+
limit: E,
|
|
30
|
+
offset: (k - 1) * E
|
|
30
31
|
}
|
|
31
|
-
}),
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
}), z = R.data?.items ?? [], B = R.data?.pageInfo.hasMore ?? !1, { nameOf: V } = d(z.map((e) => e.leadResearcherId));
|
|
33
|
+
return /* @__PURE__ */ _(t, {
|
|
33
34
|
title: "Experiments",
|
|
34
35
|
description: "Designed studies that produce reproducible runs.",
|
|
35
|
-
actions: /* @__PURE__ */
|
|
36
|
-
onClick: () =>
|
|
37
|
-
children: [/* @__PURE__ */
|
|
36
|
+
actions: /* @__PURE__ */ _(v, {
|
|
37
|
+
onClick: () => I(!0),
|
|
38
|
+
children: [/* @__PURE__ */ g(m, { className: "mr-2 h-4 w-4" }), "New experiment"]
|
|
38
39
|
}),
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ _("div", {
|
|
40
41
|
className: "space-y-4",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ _("div", {
|
|
42
43
|
className: "flex flex-wrap items-center gap-3",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
-
value:
|
|
44
|
+
children: [/* @__PURE__ */ g(l, {
|
|
45
|
+
value: N,
|
|
45
46
|
ariaLabel: "Search experiments",
|
|
46
47
|
placeholder: "Search experiments…",
|
|
47
48
|
onChange: (e) => {
|
|
48
|
-
|
|
49
|
+
P(e), A(1);
|
|
49
50
|
}
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
-
value:
|
|
51
|
+
}), /* @__PURE__ */ _(x, {
|
|
52
|
+
value: j,
|
|
52
53
|
onValueChange: (e) => {
|
|
53
|
-
|
|
54
|
+
M(e), A(1);
|
|
54
55
|
},
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ g(w, {
|
|
56
57
|
className: "w-full sm:w-48",
|
|
57
58
|
"aria-label": "Filter by status",
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
}), /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ g(T, { placeholder: "All statuses" })
|
|
60
|
+
}), /* @__PURE__ */ _(S, { children: [/* @__PURE__ */ g(C, {
|
|
60
61
|
value: "ALL",
|
|
61
62
|
children: "All statuses"
|
|
62
|
-
}),
|
|
63
|
+
}), D.map((e) => /* @__PURE__ */ g(C, {
|
|
63
64
|
value: e,
|
|
64
65
|
children: o(e)
|
|
65
66
|
}, e))] })]
|
|
66
67
|
})]
|
|
67
|
-
}), /* @__PURE__ */
|
|
68
|
-
isLoading:
|
|
69
|
-
isError:
|
|
70
|
-
error:
|
|
71
|
-
onRetry: () => void
|
|
68
|
+
}), /* @__PURE__ */ g(r, {
|
|
69
|
+
isLoading: R.isLoading,
|
|
70
|
+
isError: R.isError,
|
|
71
|
+
error: R.error,
|
|
72
|
+
onRetry: () => void R.refetch(),
|
|
72
73
|
loadingLabel: "Loading experiments…",
|
|
73
|
-
children:
|
|
74
|
-
icon: /* @__PURE__ */
|
|
74
|
+
children: z.length === 0 ? /* @__PURE__ */ g(c, {
|
|
75
|
+
icon: /* @__PURE__ */ g(p, { className: "h-10 w-10" }),
|
|
75
76
|
title: "No experiments found",
|
|
76
77
|
description: "Design an experiment within a project to start running it.",
|
|
77
|
-
action: /* @__PURE__ */
|
|
78
|
-
onClick: () =>
|
|
79
|
-
children: [/* @__PURE__ */
|
|
78
|
+
action: /* @__PURE__ */ _(v, {
|
|
79
|
+
onClick: () => I(!0),
|
|
80
|
+
children: [/* @__PURE__ */ g(m, { className: "mr-2 h-4 w-4" }), "New experiment"]
|
|
80
81
|
})
|
|
81
|
-
}) : /* @__PURE__ */
|
|
82
|
+
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(b, {
|
|
82
83
|
columns: [
|
|
83
84
|
{
|
|
84
85
|
key: "title",
|
|
85
86
|
header: "Experiment",
|
|
86
87
|
priority: "primary",
|
|
87
|
-
cell: (e) => /* @__PURE__ */
|
|
88
|
+
cell: (e) => /* @__PURE__ */ _("div", {
|
|
88
89
|
className: "min-w-0",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ g("p", {
|
|
90
91
|
className: "truncate font-medium text-text-primary",
|
|
91
92
|
children: e.title
|
|
92
|
-
}), e.hypothesis && /* @__PURE__ */
|
|
93
|
+
}), e.hypothesis && /* @__PURE__ */ g("p", {
|
|
93
94
|
className: "truncate text-xs text-text-tertiary",
|
|
94
95
|
children: e.hypothesis
|
|
95
96
|
})]
|
|
@@ -99,13 +100,21 @@ function D() {
|
|
|
99
100
|
key: "status",
|
|
100
101
|
header: "Status",
|
|
101
102
|
priority: "primary",
|
|
102
|
-
cell: (e) => /* @__PURE__ */
|
|
103
|
+
cell: (e) => /* @__PURE__ */ g(n, { status: e.status })
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: "leadResearcher",
|
|
107
|
+
header: "Lead researcher",
|
|
108
|
+
cell: (e) => /* @__PURE__ */ g("span", {
|
|
109
|
+
className: "text-text-secondary",
|
|
110
|
+
children: V(e.leadResearcherId)
|
|
111
|
+
})
|
|
103
112
|
},
|
|
104
113
|
{
|
|
105
114
|
key: "protocol",
|
|
106
115
|
header: "Protocol",
|
|
107
116
|
priority: "hidden-on-mobile",
|
|
108
|
-
cell: (e) => /* @__PURE__ */
|
|
117
|
+
cell: (e) => /* @__PURE__ */ g("span", {
|
|
109
118
|
className: "text-text-secondary",
|
|
110
119
|
children: e.protocolId ? "Linked" : "—"
|
|
111
120
|
})
|
|
@@ -114,32 +123,32 @@ function D() {
|
|
|
114
123
|
key: "updatedAt",
|
|
115
124
|
header: "Updated",
|
|
116
125
|
priority: "hidden-on-mobile",
|
|
117
|
-
cell: (e) => /* @__PURE__ */
|
|
126
|
+
cell: (e) => /* @__PURE__ */ g("span", {
|
|
118
127
|
className: "text-text-secondary",
|
|
119
128
|
children: a(e.updatedAt)
|
|
120
129
|
})
|
|
121
130
|
}
|
|
122
131
|
],
|
|
123
|
-
data:
|
|
132
|
+
data: z,
|
|
124
133
|
rowKey: (e) => e.id,
|
|
125
|
-
onRowClick: (e) =>
|
|
126
|
-
}), /* @__PURE__ */
|
|
127
|
-
page:
|
|
128
|
-
pageSize:
|
|
129
|
-
hasNextPage:
|
|
130
|
-
hasPreviousPage:
|
|
131
|
-
loading:
|
|
132
|
-
onPageChange:
|
|
134
|
+
onRowClick: (e) => O(`experiments/${e.id}`)
|
|
135
|
+
}), /* @__PURE__ */ g(y, {
|
|
136
|
+
page: k,
|
|
137
|
+
pageSize: E,
|
|
138
|
+
hasNextPage: B,
|
|
139
|
+
hasPreviousPage: k > 1,
|
|
140
|
+
loading: R.isFetching,
|
|
141
|
+
onPageChange: A
|
|
133
142
|
})] })
|
|
134
143
|
})]
|
|
135
|
-
}), /* @__PURE__ */
|
|
136
|
-
open:
|
|
137
|
-
onOpenChange:
|
|
138
|
-
onSaved: (e) =>
|
|
144
|
+
}), /* @__PURE__ */ g(s, {
|
|
145
|
+
open: F,
|
|
146
|
+
onOpenChange: I,
|
|
147
|
+
onSaved: (e) => O(`experiments/${e.id}`)
|
|
139
148
|
})]
|
|
140
149
|
});
|
|
141
150
|
}
|
|
142
151
|
//#endregion
|
|
143
|
-
export {
|
|
152
|
+
export { O as ExperimentsListPage };
|
|
144
153
|
|
|
145
154
|
//# sourceMappingURL=ExperimentsListPage.js.map
|