Fix KSQLDB breadcrumbs spelling (#1843)
Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
This commit is contained in:
parent
4b907e1005
commit
2a0c8176ab
4 changed files with 17 additions and 5 deletions
|
@ -2,12 +2,17 @@ import React, { useContext } from 'react';
|
|||
import { Link } from 'react-router-dom';
|
||||
import cn from 'classnames';
|
||||
import { clusterPath } from 'lib/paths';
|
||||
import { BREADCRUMB_DEFINITIONS } from 'lib/constants';
|
||||
|
||||
import { BreadcrumbWrapper } from './Breadcrumb.styled';
|
||||
import { BreadcrumbContext } from './Breadcrumb.context';
|
||||
|
||||
const basePathEntriesLength = clusterPath(':clusterName').split('/').length;
|
||||
|
||||
export interface BreadcrumbDefinitions {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
const Breadcrumb: React.FC = () => {
|
||||
const breadcrumbContext = useContext(BreadcrumbContext);
|
||||
|
||||
|
@ -33,7 +38,9 @@ const Breadcrumb: React.FC = () => {
|
|||
<BreadcrumbWrapper role="list">
|
||||
{links.slice(0, links.length - 1).map((link, index) => (
|
||||
<li key={link}>
|
||||
<Link to={getPathPredicate(index)}>{link}</Link>
|
||||
<Link to={getPathPredicate(index)}>
|
||||
{BREADCRUMB_DEFINITIONS[link] || link}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
<li
|
||||
|
|
|
@ -179,12 +179,12 @@ describe('Paths', () => {
|
|||
|
||||
it('clusterKsqlDbPath', () => {
|
||||
expect(paths.clusterKsqlDbPath(clusterName)).toEqual(
|
||||
`${paths.clusterPath(clusterName)}/ksql-db`
|
||||
`${paths.clusterPath(clusterName)}/ksqldb`
|
||||
);
|
||||
});
|
||||
it('clusterKsqlDbPath with default value', () => {
|
||||
expect(paths.clusterKsqlDbPath()).toEqual(
|
||||
`${paths.clusterPath(':clusterName')}/ksql-db`
|
||||
`${paths.clusterPath(':clusterName')}/ksqldb`
|
||||
);
|
||||
});
|
||||
it('clusterKsqlDbQueryPath', () => {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { ConfigurationParameters } from 'generated-sources';
|
||||
import { BreadcrumbDefinitions } from 'components/common/Breadcrumb/Breadcrumb';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
@ -57,3 +58,7 @@ export const GIT_REPO_LATEST_RELEASE_LINK =
|
|||
'https://api.github.com/repos/provectus/kafka-ui/releases/latest';
|
||||
export const GIT_TAG = process.env.REACT_APP_TAG;
|
||||
export const GIT_COMMIT = process.env.REACT_APP_COMMIT;
|
||||
|
||||
export const BREADCRUMB_DEFINITIONS: BreadcrumbDefinitions = {
|
||||
Ksqldb: 'ksqlDB',
|
||||
};
|
||||
|
|
|
@ -127,8 +127,8 @@ export const clusterConnectConnectorConfigPath = (
|
|||
|
||||
// KsqlDb
|
||||
export const clusterKsqlDbPath = (clusterName: ClusterName = ':clusterName') =>
|
||||
`${clusterPath(clusterName)}/ksql-db`;
|
||||
`${clusterPath(clusterName)}/ksqldb`;
|
||||
|
||||
export const clusterKsqlDbQueryPath = (
|
||||
clusterName: ClusterName = ':clusterName'
|
||||
) => `${clusterPath(clusterName)}/ksql-db/query`;
|
||||
) => `${clusterPath(clusterName)}/ksqldb/query`;
|
||||
|
|
Loading…
Add table
Reference in a new issue