mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: redirect to new feature flag creation (#7679)
Currently found only one instance that is using `create-toggle`. So changed behaviour for that.
This commit is contained in:
		
							parent
							
								
									049b26fb77
								
							
						
					
					
						commit
						4df8fd3810
					
				| @ -9,6 +9,7 @@ import { | ||||
| } from 'component/providers/AccessProvider/permissions'; | ||||
| import { useContext } from 'react'; | ||||
| import AccessContext from 'contexts/AccessContext'; | ||||
| import { useUiFlag } from 'hooks/useUiFlag'; | ||||
| 
 | ||||
| const WarningContainer = styled(Box)(({ theme }) => ({ | ||||
|     display: 'flex', | ||||
| @ -108,6 +109,7 @@ type ApplicationIssues = | ||||
| 
 | ||||
| const FeaturesMissing = ({ features }: IFeaturesMissingProps) => { | ||||
|     const { hasAccess } = useContext(AccessContext); | ||||
|     const improveCreateFlagFlow = useUiFlag('improveCreateFlagFlow'); | ||||
|     const length = features.length; | ||||
| 
 | ||||
|     if (length === 0) { | ||||
| @ -128,12 +130,25 @@ const FeaturesMissing = ({ features }: IFeaturesMissingProps) => { | ||||
|                         <ConditionallyRender | ||||
|                             condition={hasAccess(CREATE_FEATURE)} | ||||
|                             show={ | ||||
|                                 <StyledLink | ||||
|                                     key={feature} | ||||
|                                     to={`/projects/default/create-toggle?name=${feature}`} | ||||
|                                 > | ||||
|                                     Create feature flag | ||||
|                                 </StyledLink> | ||||
|                                 <ConditionallyRender | ||||
|                                     condition={improveCreateFlagFlow} | ||||
|                                     show={ | ||||
|                                         <StyledLink | ||||
|                                             key={feature} | ||||
|                                             to={`/projects/default?create=true&name=${feature}`} | ||||
|                                         > | ||||
|                                             Create feature flag | ||||
|                                         </StyledLink> | ||||
|                                     } | ||||
|                                     elseShow={ | ||||
|                                         <StyledLink | ||||
|                                             key={feature} | ||||
|                                             to={`/projects/default/create-toggle?name=${feature}`} | ||||
|                                         > | ||||
|                                             Create feature flag | ||||
|                                         </StyledLink> | ||||
|                                     } | ||||
|                                 /> | ||||
|                             } | ||||
|                         /> | ||||
|                     </IssueRowContainer> | ||||
|  | ||||
| @ -46,6 +46,7 @@ const BreadcrumbNav = () => { | ||||
|                 item !== 'copy' && | ||||
|                 item !== 'features' && | ||||
|                 item !== 'features2' && | ||||
|                 // TODO: this can be removed after new create flag flow goes live
 | ||||
|                 item !== 'create-toggle' && | ||||
|                 item !== 'settings' && | ||||
|                 item !== 'profile' && | ||||
|  | ||||
| @ -197,6 +197,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({ | ||||
|                     </StyledInputDescription> | ||||
|                 } | ||||
|             /> | ||||
|             // TODO: this can be removed after new create flag flow goes live
 | ||||
|             <FeatureProjectSelect | ||||
|                 value={project} | ||||
|                 onChange={(projectId) => { | ||||
| @ -213,7 +214,6 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({ | ||||
|                 IconComponent={KeyboardArrowDownOutlined} | ||||
|                 sx={styledSelectInput} | ||||
|             /> | ||||
| 
 | ||||
|             <StyledInputDescription> | ||||
|                 How would you describe your feature flag? | ||||
|             </StyledInputDescription> | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user