process model show now only shows my instances

This commit is contained in:
burnettk 2022-12-19 22:37:22 -05:00
parent 5fa6be6651
commit 8a4d8ceeeb
4 changed files with 10 additions and 6 deletions

View File

@ -70,7 +70,6 @@ const REFRESH_INTERVAL = 5;
const REFRESH_TIMEOUT = 600;
type OwnProps = {
apiPath?: string;
filtersEnabled?: boolean;
processModelFullIdentifier?: string;
paginationQueryParamPrefix?: string;
@ -89,7 +88,6 @@ interface dateParameters {
}
export default function ProcessInstanceListTable({
apiPath = '/process-instances',
filtersEnabled = true,
processModelFullIdentifier,
paginationQueryParamPrefix,
@ -102,6 +100,10 @@ export default function ProcessInstanceListTable({
autoReload = false,
variant = 'for-me',
}: OwnProps) {
let apiPath = '/process-instances/for-me';
if (variant === 'all') {
apiPath = '/process-instances';
}
const params = useParams();
const [searchParams] = useSearchParams();
const navigate = useNavigate();
@ -336,6 +338,7 @@ export default function ProcessInstanceListTable({
perPageOptions,
reportIdentifier,
additionalParams,
apiPath,
]);
// This sets the filter data using the saved reports returned from the initial instance_list query.

View File

@ -57,10 +57,8 @@ export default function ProcessInstanceList({ variant }: OwnProps) {
return <h1>My Process Instances</h1>;
};
let apiPath = '/process-instances/for-me';
let selectedTabIndex = 0;
if (variant === 'all') {
apiPath = '/process-instances';
selectedTabIndex = 1;
}
return (
@ -90,7 +88,7 @@ export default function ProcessInstanceList({ variant }: OwnProps) {
<br />
{processInstanceBreadcrumbElement()}
{processInstanceTitleElement()}
<ProcessInstanceListTable apiPath={apiPath} variant={variant} />
<ProcessInstanceListTable variant={variant} />
</>
);
}

View File

@ -143,6 +143,8 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
ability,
targetUris,
searchParams,
taskListPath,
variant,
]);
const deleteProcessInstance = () => {

View File

@ -555,7 +555,7 @@ export default function ProcessModelShow() {
return (
<Grid fullWidth condensed>
<Column sm={{ span: 3 }} md={{ span: 4 }} lg={{ span: 3 }}>
<h2>Process Instances</h2>
<h2>My Process Instances</h2>
</Column>
<Column
sm={{ span: 1, offset: 3 }}
@ -675,6 +675,7 @@ export default function ProcessModelShow() {
{processInstanceListTableButton()}
<ProcessInstanceListTable
filtersEnabled={false}
variant="for-me"
processModelFullIdentifier={processModel.id}
perPageOptions={[2, 5, 25]}
showReports={false}