Skip to content

Commit

Permalink
update breadcrumb title for edit connection type page (#3220)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt authored Sep 18, 2024
1 parent 3a39387 commit fa9e57f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Props> = ({ name }) => (
<Breadcrumb ouiaId="BasicBreadcrumb">
<BreadcrumbItem>
<Link to="/connectionTypes">Connection types</Link>
</BreadcrumbItem>
<BreadcrumbItem isActive>Create connection type</BreadcrumbItem>
<BreadcrumbItem isActive>{name}</BreadcrumbItem>
</Breadcrumb>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,19 @@ const ManageConnectionTypePage: React.FC<Props> = ({ prefill, isEdit, onSave })
navigate('/connectionTypes');
};

const pageName = isEdit ? 'Edit connection type' : 'Create connection type';
return (
<ConnectionTypePreviewDrawer
isExpanded={isDrawerExpanded}
onClose={() => setIsDrawerExpanded(false)}
obj={connectionTypeObj}
>
<ApplicationsPage
title={isEdit ? 'Edit connection type' : 'Create connection type'}
title={pageName}
loaded
empty={false}
errorMessage="Unable to load connection types"
breadcrumb={<ManageConnectionTypeBreadcrumbs />}
breadcrumb={<ManageConnectionTypeBreadcrumbs name={pageName} />}
headerAction={
isDrawerExpanded ? undefined : (
<Button
Expand Down

0 comments on commit fa9e57f

Please sign in to comment.