added a table for files w/ burnettk

This commit is contained in:
jasquat 2022-11-07 17:41:35 -05:00
parent ff7322f0b8
commit 9a83f1c486

View File

@ -13,6 +13,12 @@ import {
ButtonSet, ButtonSet,
Modal, Modal,
FileUploader, FileUploader,
Table,
TableHead,
TableHeader,
TableRow,
TableCell,
TableBody,
// @ts-ignore // @ts-ignore
} from '@carbon/react'; } from '@carbon/react';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb'; import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
@ -167,38 +173,61 @@ export default function ProcessModelShow() {
primarySuffix = '- Primary File'; primarySuffix = '- Primary File';
} }
constructedTag = ( constructedTag = (
<li key={processModelFile.name}> <TableRow key={processModelFile.name}>
<Link <TableCell key={`${processModelFile.name}-cell`}>
to={`/admin/process-models/${ <Link
(processModel as any).process_group_id to={`/admin/process-models/${
}/${(processModel as any).id}/files/${processModelFile.name}`} (processModel as any).process_group_id
> }/${(processModel as any).id}/files/${processModelFile.name}`}
{processModelFile.name} >
</Link> {processModelFile.name}
{primarySuffix} </Link>
</li> {primarySuffix}
</TableCell>
</TableRow>
); );
} else if (processModelFile.name.match(/\.(json|md)$/)) { } else if (processModelFile.name.match(/\.(json|md)$/)) {
constructedTag = ( constructedTag = (
<li key={processModelFile.name}> <TableRow key={processModelFile.name}>
<Link <TableCell key={`${processModelFile.name}-cell`}>
to={`/admin/process-models/${ <Link
(processModel as any).process_group_id to={`/admin/process-models/${
}/${(processModel as any).id}/form/${processModelFile.name}`} (processModel as any).process_group_id
> }/${(processModel as any).id}/form/${processModelFile.name}`}
{processModelFile.name} >
</Link> {processModelFile.name}
</li> </Link>
</TableCell>
</TableRow>
); );
} else { } else {
constructedTag = ( constructedTag = (
<li key={processModelFile.name}>{processModelFile.name}</li> <TableRow key={processModelFile.name}>
<TableCell key={`${processModelFile.name}-cell`}>
{processModelFile.name}
</TableCell>
</TableRow>
); );
} }
return constructedTag; return constructedTag;
}); });
return <ul>{tags}</ul>; // return <ul>{tags}</ul>;
const headers = ['name', 'Actions'];
return (
<Table size="lg" useZebraStyles={false}>
<TableHead>
<TableRow>
{headers.map((header) => (
<TableHeader id={header} key={header}>
{header}
</TableHeader>
))}
</TableRow>
</TableHead>
<TableBody>{tags}</TableBody>
</Table>
);
}; };
const processInstancesUl = () => { const processInstancesUl = () => {