From edcdf5457d6e118384f25c974e09f5a75e6be70e Mon Sep 17 00:00:00 2001 From: Christian Vogt Date: Wed, 18 Sep 2024 10:55:14 -0400 Subject: [PATCH] update breadcrumb title for edit connection type page --- .../__tests__/cypress/cypress/pages/connectionTypes.ts | 2 +- .../manage/ManageConnectionTypeBreadcrumbs.tsx | 8 ++++++-- .../connectionTypes/manage/ManageConnectionTypePage.tsx | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/__tests__/cypress/cypress/pages/connectionTypes.ts b/frontend/src/__tests__/cypress/cypress/pages/connectionTypes.ts index 4d7b8a9252..720df36f54 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/connectionTypes.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/connectionTypes.ts @@ -53,7 +53,7 @@ class CreateConnectionTypePage { visitEditPage(name = 'existing') { cy.visitWithLogin(`/connectionTypes/edit/${name}`); - cy.findAllByText('Create connection type').should('exist'); + cy.findAllByText('Edit connection type').should('exist'); } findConnectionTypeName() { diff --git a/frontend/src/pages/connectionTypes/manage/ManageConnectionTypeBreadcrumbs.tsx b/frontend/src/pages/connectionTypes/manage/ManageConnectionTypeBreadcrumbs.tsx index 28c68a7960..023bb0b27c 100644 --- a/frontend/src/pages/connectionTypes/manage/ManageConnectionTypeBreadcrumbs.tsx +++ b/frontend/src/pages/connectionTypes/manage/ManageConnectionTypeBreadcrumbs.tsx @@ -2,12 +2,16 @@ import * as React from 'react'; import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; -const ManageConnectionTypeBreadcrumbs: React.FunctionComponent = () => ( +type Props = { + name: string; +}; + +const ManageConnectionTypeBreadcrumbs: React.FC = ({ name }) => ( Connection types - Create connection type + {name} ); diff --git a/frontend/src/pages/connectionTypes/manage/ManageConnectionTypePage.tsx b/frontend/src/pages/connectionTypes/manage/ManageConnectionTypePage.tsx index ad7122b836..0de88b0a81 100644 --- a/frontend/src/pages/connectionTypes/manage/ManageConnectionTypePage.tsx +++ b/frontend/src/pages/connectionTypes/manage/ManageConnectionTypePage.tsx @@ -103,6 +103,7 @@ const ManageConnectionTypePage: React.FC = ({ prefill, isEdit, onSave }) navigate('/connectionTypes'); }; + const pageName = isEdit ? 'Edit connection type' : 'Create connection type'; return ( = ({ prefill, isEdit, onSave }) obj={connectionTypeObj} > } + breadcrumb={} headerAction={ isDrawerExpanded ? undefined : (