Change the name of path for Schema Compare versions (#2194)
This commit is contained in:
parent
cc0a98262b
commit
d7a3629470
4 changed files with 12 additions and 12 deletions
|
@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
ClusterSubjectParam,
|
ClusterSubjectParam,
|
||||||
clusterSchemaEditPageRelativePath,
|
clusterSchemaEditPageRelativePath,
|
||||||
clusterSchemaSchemaDiffPageRelativePath,
|
clusterSchemaSchemaComparePageRelativePath,
|
||||||
} from 'lib/paths';
|
} from 'lib/paths';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
||||||
|
@ -90,7 +90,7 @@ const Details: React.FC = () => {
|
||||||
buttonSize="M"
|
buttonSize="M"
|
||||||
buttonType="primary"
|
buttonType="primary"
|
||||||
to={{
|
to={{
|
||||||
pathname: clusterSchemaSchemaDiffPageRelativePath,
|
pathname: clusterSchemaSchemaComparePageRelativePath,
|
||||||
search: `leftVersion=${versions[0]?.version}&rightVersion=${versions[0]?.version}`,
|
search: `leftVersion=${versions[0]?.version}&rightVersion=${versions[0]?.version}`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SchemaSubject } from 'generated-sources';
|
import { SchemaSubject } from 'generated-sources';
|
||||||
import { clusterSchemaSchemaDiffPath, ClusterSubjectParam } from 'lib/paths';
|
import { clusterSchemaSchemaComparePath, ClusterSubjectParam } from 'lib/paths';
|
||||||
import PageLoader from 'components/common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
import DiffViewer from 'components/common/DiffViewer/DiffViewer';
|
import DiffViewer from 'components/common/DiffViewer/DiffViewer';
|
||||||
import { useNavigate, useLocation } from 'react-router-dom';
|
import { useNavigate, useLocation } from 'react-router-dom';
|
||||||
|
@ -86,7 +86,7 @@ const Diff: React.FC<DiffProps> = ({ versions, areVersionsFetched }) => {
|
||||||
}
|
}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
navigate(
|
navigate(
|
||||||
clusterSchemaSchemaDiffPath(clusterName, subject)
|
clusterSchemaSchemaComparePath(clusterName, subject)
|
||||||
);
|
);
|
||||||
searchParams.set('leftVersion', event.toString());
|
searchParams.set('leftVersion', event.toString());
|
||||||
searchParams.set(
|
searchParams.set(
|
||||||
|
@ -127,7 +127,7 @@ const Diff: React.FC<DiffProps> = ({ versions, areVersionsFetched }) => {
|
||||||
}
|
}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
navigate(
|
navigate(
|
||||||
clusterSchemaSchemaDiffPath(clusterName, subject)
|
clusterSchemaSchemaComparePath(clusterName, subject)
|
||||||
);
|
);
|
||||||
searchParams.set(
|
searchParams.set(
|
||||||
'leftVersion',
|
'leftVersion',
|
||||||
|
|
|
@ -2,13 +2,13 @@ import React from 'react';
|
||||||
import Diff, { DiffProps } from 'components/Schemas/Diff/Diff';
|
import Diff, { DiffProps } from 'components/Schemas/Diff/Diff';
|
||||||
import { render, WithRoute } from 'lib/testHelpers';
|
import { render, WithRoute } from 'lib/testHelpers';
|
||||||
import { screen } from '@testing-library/react';
|
import { screen } from '@testing-library/react';
|
||||||
import { clusterSchemaSchemaDiffPath } from 'lib/paths';
|
import { clusterSchemaSchemaComparePath } from 'lib/paths';
|
||||||
|
|
||||||
import { versions } from './fixtures';
|
import { versions } from './fixtures';
|
||||||
|
|
||||||
const defaultClusterName = 'defaultClusterName';
|
const defaultClusterName = 'defaultClusterName';
|
||||||
const defaultSubject = 'defaultSubject';
|
const defaultSubject = 'defaultSubject';
|
||||||
const defaultPathName = clusterSchemaSchemaDiffPath(
|
const defaultPathName = clusterSchemaSchemaComparePath(
|
||||||
defaultClusterName,
|
defaultClusterName,
|
||||||
defaultSubject
|
defaultSubject
|
||||||
);
|
);
|
||||||
|
@ -30,7 +30,7 @@ describe('Diff', () => {
|
||||||
pathname = `${pathname}?${searchParams.toString()}`;
|
pathname = `${pathname}?${searchParams.toString()}`;
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
<WithRoute path={clusterSchemaSchemaDiffPath()}>
|
<WithRoute path={clusterSchemaSchemaComparePath()}>
|
||||||
<Diff
|
<Diff
|
||||||
versions={props.versions}
|
versions={props.versions}
|
||||||
areVersionsFetched={props.areVersionsFetched}
|
areVersionsFetched={props.areVersionsFetched}
|
||||||
|
|
|
@ -72,9 +72,9 @@ export type ClusterGroupParam = {
|
||||||
export const clusterSchemasRelativePath = 'schemas';
|
export const clusterSchemasRelativePath = 'schemas';
|
||||||
export const clusterSchemaNewRelativePath = 'create-new';
|
export const clusterSchemaNewRelativePath = 'create-new';
|
||||||
export const clusterSchemaEditPageRelativePath = `edit`;
|
export const clusterSchemaEditPageRelativePath = `edit`;
|
||||||
export const clusterSchemaSchemaDiffPageRelativePath = `diff`;
|
export const clusterSchemaSchemaComparePageRelativePath = `compare`;
|
||||||
export const clusterSchemaEditRelativePath = `${RouteParams.subject}/${clusterSchemaEditPageRelativePath}`;
|
export const clusterSchemaEditRelativePath = `${RouteParams.subject}/${clusterSchemaEditPageRelativePath}`;
|
||||||
export const clusterSchemaSchemaDiffRelativePath = `${RouteParams.subject}/${clusterSchemaSchemaDiffPageRelativePath}`;
|
export const clusterSchemaSchemaDiffRelativePath = `${RouteParams.subject}/${clusterSchemaSchemaComparePageRelativePath}`;
|
||||||
export const clusterSchemasPath = (
|
export const clusterSchemasPath = (
|
||||||
clusterName: ClusterName = RouteParams.clusterName
|
clusterName: ClusterName = RouteParams.clusterName
|
||||||
) => `${clusterPath(clusterName)}/schemas`;
|
) => `${clusterPath(clusterName)}/schemas`;
|
||||||
|
@ -89,10 +89,10 @@ export const clusterSchemaEditPath = (
|
||||||
clusterName: ClusterName = RouteParams.clusterName,
|
clusterName: ClusterName = RouteParams.clusterName,
|
||||||
subject: SchemaName = RouteParams.subject
|
subject: SchemaName = RouteParams.subject
|
||||||
) => `${clusterSchemasPath(clusterName)}/${subject}/edit`;
|
) => `${clusterSchemasPath(clusterName)}/${subject}/edit`;
|
||||||
export const clusterSchemaSchemaDiffPath = (
|
export const clusterSchemaSchemaComparePath = (
|
||||||
clusterName: ClusterName = RouteParams.clusterName,
|
clusterName: ClusterName = RouteParams.clusterName,
|
||||||
subject: SchemaName = RouteParams.subject
|
subject: SchemaName = RouteParams.subject
|
||||||
) => `${clusterSchemaPath(clusterName, subject)}/diff`;
|
) => `${clusterSchemaPath(clusterName, subject)}/compare`;
|
||||||
|
|
||||||
export type ClusterSubjectParam = {
|
export type ClusterSubjectParam = {
|
||||||
subject: string;
|
subject: string;
|
||||||
|
|
Loading…
Add table
Reference in a new issue