mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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 useToast from '../../../../hooks/useToast'; | ||||||
| import { getTogglePath } from '../../../../utils/route-path-helpers'; | import { getTogglePath } from '../../../../utils/route-path-helpers'; | ||||||
| import { SyntheticEvent } from 'react-router/node_modules/@types/react'; | import { SyntheticEvent } from 'react-router/node_modules/@types/react'; | ||||||
|  | import useUiConfig from '../../../../hooks/api/getters/useUiConfig/useUiConfig'; | ||||||
| 
 | 
 | ||||||
| interface IFeatureToggleListNewItemProps { | interface IFeatureToggleListNewItemProps { | ||||||
|     name: string; |     name: string; | ||||||
| @ -36,6 +37,8 @@ const FeatureToggleListNewItem = ({ | |||||||
|         projectId, |         projectId, | ||||||
|         name |         name | ||||||
|     ); |     ); | ||||||
|  |     const { uiConfig } = useUiConfig(); | ||||||
|  |      | ||||||
| 
 | 
 | ||||||
|     const styles = useStyles(); |     const styles = useStyles(); | ||||||
|     const history = useHistory(); |     const history = useHistory(); | ||||||
| @ -43,7 +46,7 @@ const FeatureToggleListNewItem = ({ | |||||||
| 
 | 
 | ||||||
|     const onClick = (e: SyntheticEvent) => { |     const onClick = (e: SyntheticEvent) => { | ||||||
|         if (!ref.current?.contains(e.target)) { |         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) => { | export const getTogglePath = (projectId: string, featureToggleName: string, newPath: boolean) => { | ||||||
|     return `/projects/${projectId}/features/${featureToggleName}/strategies`; |     return `/projects/${projectId}/features${newPath ? '2' : ''}/${featureToggleName}/strategies`; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export const getToggleCopyPath = ( | export const getToggleCopyPath = ( | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user