feat: asked-field envelope, standalone form components, branched forms
This commit is contained in:
parent
0d43b0e8fb
commit
f27be044b4
26 changed files with 3651 additions and 104 deletions
|
|
@ -179,40 +179,67 @@ export default function AdminTab() {
|
|||
</Table.Tr>
|
||||
</Table.Thead>
|
||||
<Table.Tbody>
|
||||
{flows.map((f) =>
|
||||
(versions[f.id] ?? []).map((v, i) => (
|
||||
<Table.Tr key={v.id}>
|
||||
{flows.map((f) => {
|
||||
const list = versions[f.id] ?? [];
|
||||
const latest = list[list.length - 1];
|
||||
if (!latest) {
|
||||
return (
|
||||
<Table.Tr key={f.id}>
|
||||
<Table.Td>
|
||||
<strong>{f.name}</strong>{" "}
|
||||
<Text size="xs" c="dimmed" component="span">
|
||||
{f.source_path ? `(${f.source_path})` : "(API)"}
|
||||
</Text>
|
||||
</Table.Td>
|
||||
<Table.Td>–</Table.Td>
|
||||
<Table.Td>
|
||||
<StatusBadge status="pending" />
|
||||
</Table.Td>
|
||||
<Table.Td>–</Table.Td>
|
||||
<Table.Td />
|
||||
</Table.Tr>
|
||||
);
|
||||
}
|
||||
const live = [...list]
|
||||
.reverse()
|
||||
.find((v) => v.deployed_at && v.id !== latest.id);
|
||||
return (
|
||||
<Table.Tr key={latest.id}>
|
||||
<Table.Td>
|
||||
{i === 0 && (
|
||||
<>
|
||||
<strong>{f.name}</strong>{" "}
|
||||
<Text size="xs" c="dimmed" component="span">
|
||||
{f.source_path ? `(${f.source_path})` : "(API)"}
|
||||
</Text>
|
||||
</>
|
||||
<strong>{f.name}</strong>{" "}
|
||||
<Text size="xs" c="dimmed" component="span">
|
||||
{f.source_path ? `(${f.source_path})` : "(API)"}
|
||||
</Text>
|
||||
</Table.Td>
|
||||
<Table.Td>
|
||||
v{latest.version_no}
|
||||
{live && (
|
||||
<Text size="xs" c="dimmed" component="span">
|
||||
{" "}
|
||||
(live: v{live.version_no})
|
||||
</Text>
|
||||
)}
|
||||
</Table.Td>
|
||||
<Table.Td>v{v.version_no}</Table.Td>
|
||||
<Table.Td>
|
||||
{v.deployed_at ? (
|
||||
{latest.deployed_at ? (
|
||||
<StatusBadge status="deployed" />
|
||||
) : (
|
||||
<StatusBadge status="pending" />
|
||||
)}
|
||||
</Table.Td>
|
||||
<Table.Td>{v.author || "–"}</Table.Td>
|
||||
<Table.Td>{latest.author || "–"}</Table.Td>
|
||||
<Table.Td>
|
||||
<Button
|
||||
size="compact-sm"
|
||||
variant="light"
|
||||
onClick={() => void onDeploy(f.id, v.version_no)}
|
||||
onClick={() => void onDeploy(f.id, latest.version_no)}
|
||||
>
|
||||
Deployen
|
||||
</Button>
|
||||
</Table.Td>
|
||||
</Table.Tr>
|
||||
)),
|
||||
)}
|
||||
);
|
||||
})}
|
||||
</Table.Tbody>
|
||||
</Table>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue