mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-10 08:26:38 +00:00
* Cleaning up icons so they are a little smaller and more consistent. * Always show that action column. * Improve the state managment and layout of the interstitial page.
58 lines
1.6 KiB
TypeScript
58 lines
1.6 KiB
TypeScript
import { useSearchParams } from 'react-router-dom';
|
|
|
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
|
|
import 'react-bootstrap-typeahead/css/Typeahead.css';
|
|
import 'react-bootstrap-typeahead/css/Typeahead.bs5.css';
|
|
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
|
import ProcessInstanceListTable from '../components/ProcessInstanceListTable';
|
|
import { getProcessModelFullIdentifierFromSearchParams } from '../helpers';
|
|
import ProcessInstanceListTabs from '../components/ProcessInstanceListTabs';
|
|
|
|
type OwnProps = {
|
|
variant: string;
|
|
};
|
|
|
|
export default function ProcessInstanceList({ variant }: OwnProps) {
|
|
const [searchParams] = useSearchParams();
|
|
|
|
const processInstanceBreadcrumbElement = () => {
|
|
const processModelFullIdentifier =
|
|
getProcessModelFullIdentifierFromSearchParams(searchParams);
|
|
if (processModelFullIdentifier === null) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<ProcessBreadcrumb
|
|
hotCrumbs={[
|
|
['Process Groups', '/admin'],
|
|
{
|
|
entityToExplode: processModelFullIdentifier,
|
|
entityType: 'process-model-id',
|
|
linkLastItem: true,
|
|
},
|
|
['Process Instances'],
|
|
]}
|
|
/>
|
|
);
|
|
};
|
|
|
|
const processInstanceTitleElement = () => {
|
|
if (variant === 'all') {
|
|
return <h1>All Process Instances</h1>;
|
|
}
|
|
return <h1>My Process Instances</h1>;
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<ProcessInstanceListTabs variant={variant} />
|
|
<br />
|
|
{processInstanceBreadcrumbElement()}
|
|
{processInstanceTitleElement()}
|
|
<ProcessInstanceListTable variant={variant} showActionsColumn />
|
|
</>
|
|
);
|
|
}
|