This commit is contained in:
burnettk 2022-11-09 17:48:50 -05:00
parent c0f76b2880
commit e87b954793
3 changed files with 12 additions and 37 deletions

View File

@ -25,36 +25,3 @@ test('renders hotCrumbs', () => {
const nextElement = screen.getByText(/Process Group: hey/); const nextElement = screen.getByText(/Process Group: hey/);
expect(nextElement).toBeInTheDocument(); expect(nextElement).toBeInTheDocument();
}); });
// FIXME: update to use hotcrumbs
// test('renders process group when given processGroupId', async () => {
// render(
// <BrowserRouter>
// <ProcessBreadcrumb processGroupId="group-a" />
// </BrowserRouter>
// );
// const processGroupElement = screen.getByText(/group-a/);
// expect(processGroupElement).toBeInTheDocument();
// const processGroupBreadcrumbs = await screen.findAllByText(
// /Process Group: group-a/
// );
// expect(processGroupBreadcrumbs[0]).toHaveClass('breadcrumb-item active');
// });
//
// test('renders process model when given processModelId', async () => {
// render(
// <BrowserRouter>
// <ProcessBreadcrumb processGroupId="group-b" processModelId="model-c" />
// </BrowserRouter>
// );
// const processGroupElement = screen.getByText(/group-b/);
// expect(processGroupElement).toBeInTheDocument();
// const processModelBreadcrumbs = await screen.findAllByText(
// /Process Model: model-c/
// );
// expect(processModelBreadcrumbs[0]).toHaveClass('breadcrumb-item active');
// const processGroupBreadcrumbs = await screen.findAllByText(
// /Process Group: group-b/
// );
// expect(processGroupBreadcrumbs[0]).toBeInTheDocument();
// });

View File

@ -5,7 +5,11 @@ import { Button, Table, Stack } from '@carbon/react';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb'; import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
import PaginationForTable from '../components/PaginationForTable'; import PaginationForTable from '../components/PaginationForTable';
import HttpService from '../services/HttpService'; import HttpService from '../services/HttpService';
import {getPageInfoFromSearchParams, modifyProcessModelPath, unModifyProcessModelPath} from '../helpers'; import {
getPageInfoFromSearchParams,
modifyProcessModelPath,
unModifyProcessModelPath,
} from '../helpers';
import { ProcessGroup } from '../interfaces'; import { ProcessGroup } from '../interfaces';
export default function ProcessGroupShow() { export default function ProcessGroupShow() {
@ -82,7 +86,9 @@ export default function ProcessGroupShow() {
return null; return null;
} }
const rows = processGroups.map((row) => { const rows = processGroups.map((row) => {
const modifiedProcessGroupId: String = modifyProcessModelPath((row as any).id); const modifiedProcessGroupId: String = modifyProcessModelPath(
(row as any).id
);
return ( return (
<tr key={(row as any).id}> <tr key={(row as any).id}>
<td> <td>
@ -115,7 +121,9 @@ export default function ProcessGroupShow() {
if (processGroup && pagination) { if (processGroup && pagination) {
const { page, perPage } = getPageInfoFromSearchParams(searchParams); const { page, perPage } = getPageInfoFromSearchParams(searchParams);
const modifiedProcessGroupId = modifyProcessModelPath((processGroup as any).id); const modifiedProcessGroupId = modifyProcessModelPath(
(processGroup as any).id
);
return ( return (
<> <>
<ProcessBreadcrumb <ProcessBreadcrumb