fix a couple tests
This commit is contained in:
parent
3d2578b7a5
commit
c822ecea67
|
@ -144,10 +144,11 @@ describe('process-models', () => {
|
||||||
|
|
||||||
cy.getBySel('process-instance-list-link').click();
|
cy.getBySel('process-instance-list-link').click();
|
||||||
cy.getBySel('process-instance-show-link').click();
|
cy.getBySel('process-instance-show-link').click();
|
||||||
cy.contains('Delete').click();
|
cy.getBySel('process-instance-delete').click();
|
||||||
cy.contains('Are you sure');
|
cy.contains('Are you sure');
|
||||||
cy.getBySel('modal-confirmation-dialog').find('.cds--btn--danger').click();
|
cy.getBySel('modal-confirmation-dialog').find('.cds--btn--danger').click();
|
||||||
cy.contains(`Process Instances for: ${groupId}/${modelId}`);
|
|
||||||
|
// in breadcrumb
|
||||||
cy.contains(modelId).click();
|
cy.contains(modelId).click();
|
||||||
|
|
||||||
cy.contains('Edit process model').click();
|
cy.contains('Edit process model').click();
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useState } from 'react';
|
||||||
import { Button, Modal } from '@carbon/react';
|
import { Button, Modal } from '@carbon/react';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
|
'data-qa'?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
buttonLabel?: string;
|
buttonLabel?: string;
|
||||||
onConfirmation: (..._args: any[]) => any;
|
onConfirmation: (..._args: any[]) => any;
|
||||||
|
@ -18,6 +19,7 @@ export default function ButtonWithConfirmation({
|
||||||
description,
|
description,
|
||||||
buttonLabel,
|
buttonLabel,
|
||||||
onConfirmation,
|
onConfirmation,
|
||||||
|
'data-qa': dataQa,
|
||||||
title = 'Are you sure?',
|
title = 'Are you sure?',
|
||||||
confirmButtonLabel = 'OK',
|
confirmButtonLabel = 'OK',
|
||||||
kind = 'danger',
|
kind = 'danger',
|
||||||
|
@ -58,6 +60,7 @@ export default function ButtonWithConfirmation({
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
|
data-qa={dataQa}
|
||||||
onClick={handleShowConfirmationPrompt}
|
onClick={handleShowConfirmationPrompt}
|
||||||
kind={kind}
|
kind={kind}
|
||||||
renderIcon={renderIcon}
|
renderIcon={renderIcon}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
modifyProcessModelPath,
|
modifyProcessModelPath,
|
||||||
unModifyProcessModelPath,
|
unModifyProcessModelPath,
|
||||||
} from '../helpers';
|
} from '../helpers';
|
||||||
import { ProcessGroup, ProcessModel } from '../interfaces';
|
import { PaginationObject, ProcessGroup, ProcessModel } from '../interfaces';
|
||||||
|
|
||||||
export default function ProcessGroupShow() {
|
export default function ProcessGroupShow() {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
|
@ -19,8 +19,10 @@ export default function ProcessGroupShow() {
|
||||||
const [processGroup, setProcessGroup] = useState<ProcessGroup | null>(null);
|
const [processGroup, setProcessGroup] = useState<ProcessGroup | null>(null);
|
||||||
const [processModels, setProcessModels] = useState([]);
|
const [processModels, setProcessModels] = useState([]);
|
||||||
const [processGroups, setProcessGroups] = useState([]);
|
const [processGroups, setProcessGroups] = useState([]);
|
||||||
const [modelPagination, setModelPagination] = useState(null);
|
const [modelPagination, setModelPagination] =
|
||||||
const [groupPagination, setGroupPagination] = useState(null);
|
useState<PaginationObject | null>(null);
|
||||||
|
const [groupPagination, setGroupPagination] =
|
||||||
|
useState<PaginationObject | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
|
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
|
||||||
|
@ -138,6 +140,7 @@ export default function ProcessGroupShow() {
|
||||||
['', `process_group:${processGroup.id}`],
|
['', `process_group:${processGroup.id}`],
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
<h1>Process Group: {processGroup.display_name}</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<Stack orientation="horizontal" gap={3}>
|
<Stack orientation="horizontal" gap={3}>
|
||||||
<Button
|
<Button
|
||||||
|
@ -160,6 +163,7 @@ export default function ProcessGroupShow() {
|
||||||
</Stack>
|
</Stack>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
{modelPagination && modelPagination.total > 0 && (
|
||||||
<PaginationForTable
|
<PaginationForTable
|
||||||
page={page}
|
page={page}
|
||||||
perPage={perPage}
|
perPage={perPage}
|
||||||
|
@ -167,8 +171,10 @@ export default function ProcessGroupShow() {
|
||||||
tableToDisplay={buildModelTable()}
|
tableToDisplay={buildModelTable()}
|
||||||
path={`/admin/process-groups/${processGroup.id}`}
|
path={`/admin/process-groups/${processGroup.id}`}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
{groupPagination && groupPagination.total > 0 && (
|
||||||
<PaginationForTable
|
<PaginationForTable
|
||||||
page={page}
|
page={page}
|
||||||
perPage={perPage}
|
perPage={perPage}
|
||||||
|
@ -176,6 +182,7 @@ export default function ProcessGroupShow() {
|
||||||
tableToDisplay={buildGroupTable()}
|
tableToDisplay={buildGroupTable()}
|
||||||
path={`/admin/process-groups/${processGroup.id}`}
|
path={`/admin/process-groups/${processGroup.id}`}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -521,6 +521,7 @@ export default function ProcessInstanceShow() {
|
||||||
elements.push(resumeButton(processInstanceToUse));
|
elements.push(resumeButton(processInstanceToUse));
|
||||||
elements.push(
|
elements.push(
|
||||||
<ButtonWithConfirmation
|
<ButtonWithConfirmation
|
||||||
|
data-qa="process-instance-delete"
|
||||||
kind="ghost"
|
kind="ghost"
|
||||||
renderIcon={TrashCan}
|
renderIcon={TrashCan}
|
||||||
iconDescription="Delete"
|
iconDescription="Delete"
|
||||||
|
|
Loading…
Reference in New Issue