mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: render new link if enabled
This commit is contained in:
parent
b3f099c034
commit
0dd3ada1ee
@ -15,6 +15,7 @@ import ConditionallyRender from '../../../common/ConditionallyRender';
|
||||
import useToast from '../../../../hooks/useToast';
|
||||
import { getTogglePath } from '../../../../utils/route-path-helpers';
|
||||
import { SyntheticEvent } from 'react-router/node_modules/@types/react';
|
||||
import useUiConfig from '../../../../hooks/api/getters/useUiConfig/useUiConfig';
|
||||
|
||||
interface IFeatureToggleListNewItemProps {
|
||||
name: string;
|
||||
@ -36,6 +37,8 @@ const FeatureToggleListNewItem = ({
|
||||
projectId,
|
||||
name
|
||||
);
|
||||
const { uiConfig } = useUiConfig();
|
||||
|
||||
|
||||
const styles = useStyles();
|
||||
const history = useHistory();
|
||||
@ -43,7 +46,7 @@ const FeatureToggleListNewItem = ({
|
||||
|
||||
const onClick = (e: SyntheticEvent) => {
|
||||
if (!ref.current?.contains(e.target)) {
|
||||
history.push(getTogglePath(projectId, name));
|
||||
history.push(getTogglePath(projectId, name, uiConfig.flags.E));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
export const getTogglePath = (projectId: string, featureToggleName: string) => {
|
||||
return `/projects/${projectId}/features/${featureToggleName}/strategies`;
|
||||
export const getTogglePath = (projectId: string, featureToggleName: string, newPath: boolean) => {
|
||||
return `/projects/${projectId}/features${newPath ? '2' : ''}/${featureToggleName}/strategies`;
|
||||
};
|
||||
|
||||
export const getToggleCopyPath = (
|
||||
|
Loading…
Reference in New Issue
Block a user