Skip to content

Commit

Permalink
update breadcrumb title for edit connection type page
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt committed Sep 18, 2024
1 parent b5351a7 commit 2b04c03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
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 2b04c03

Please sign in to comment.