add breadcrumb to instances page sometimes

This commit is contained in:
burnettk 2022-11-09 22:55:14 -05:00
parent 27c5db2339
commit c6325303d4
1 changed files with 19 additions and 12 deletions

View File

@ -41,6 +41,7 @@ import 'react-bootstrap-typeahead/css/Typeahead.css';
import 'react-bootstrap-typeahead/css/Typeahead.bs5.css'; import 'react-bootstrap-typeahead/css/Typeahead.bs5.css';
import { PaginationObject, ProcessModel } from '../interfaces'; import { PaginationObject, ProcessModel } from '../interfaces';
import ProcessModelSearch from '../components/ProcessModelSearch'; import ProcessModelSearch from '../components/ProcessModelSearch';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
export default function ProcessInstanceList() { export default function ProcessInstanceList() {
const params = useParams(); const params = useParams();
@ -471,26 +472,31 @@ export default function ProcessInstanceList() {
); );
}; };
const processInstanceTitleElement = () => { const processInstanceBreadcrumbElement = () => {
const processModelFullIdentifier = const processModelFullIdentifier =
getProcessModelFullIdentifierFromSearchParams(searchParams); getProcessModelFullIdentifierFromSearchParams(searchParams);
if (processModelFullIdentifier === null) { if (processModelFullIdentifier === null) {
return <h2>Process Instances</h2>; return null;
} }
return ( return (
<h2> <ProcessBreadcrumb
Process Instances for:{' '} hotCrumbs={[
<Link ['Process Groups', '/admin'],
to={`/admin/process-models/${modifyProcessModelPath( [
processModelFullIdentifier `Process Model: ${processModelFullIdentifier}`,
)}`} `process_model:${processModelFullIdentifier}:link`,
> ],
{processModelFullIdentifier} ['Process Instances'],
</Link> ]}
</h2> />
); );
}; };
const processInstanceTitleElement = () => {
return <h2>Process Instances</h2>;
};
const toggleShowFilterOptions = () => { const toggleShowFilterOptions = () => {
setShowFilterOptions(!showFilterOptions); setShowFilterOptions(!showFilterOptions);
}; };
@ -499,6 +505,7 @@ export default function ProcessInstanceList() {
const { page, perPage } = getPageInfoFromSearchParams(searchParams); const { page, perPage } = getPageInfoFromSearchParams(searchParams);
return ( return (
<> <>
{processInstanceBreadcrumbElement()}
{processInstanceTitleElement()} {processInstanceTitleElement()}
<Grid fullWidth> <Grid fullWidth>
<Column <Column