mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	[Gitar] Cleaning up stale flag: improveCreateFlagFlow with value true (#7895)
[](https://gitar.co) --- This automated PR was generated by [Gitar](https://gitar.co). View [docs](https://gitar.co/docs). --------- Co-authored-by: Gitar <noreply@gitar.co> Co-authored-by: sjaanus <sellinjaanus@gmail.com>
This commit is contained in:
		
							parent
							
								
									30cbde573b
								
							
						
					
					
						commit
						977f969b80
					
				| @ -65,13 +65,13 @@ export const createFeature_UI = ( | |||||||
| 
 | 
 | ||||||
|     cy.wait(300); |     cy.wait(300); | ||||||
| 
 | 
 | ||||||
|     cy.get("[data-testid='CF_NAME_ID'] input").type(name, uiOpts); |     cy.get("[data-testid='FORM_NAME_INPUT'] input").type(name, uiOpts); | ||||||
|     cy.get("[data-testid='CF_DESC_ID'] textarea") |     cy.get("[data-testid='FORM_DESCRIPTION_INPUT'] textarea") | ||||||
|         .first() |         .first() | ||||||
|         .type('hello-world', uiOpts); |         .type('hello-world', uiOpts); | ||||||
|     if (!shouldWait) |     if (!shouldWait) | ||||||
|         return cy.get("[data-testid='CF_CREATE_BTN_ID']").click(uiOpts); |         return cy.get("[data-testid='FORM_CREATE_BUTTON']").click(uiOpts); | ||||||
|     else cy.get("[data-testid='CF_CREATE_BTN_ID']").click(uiOpts); |     else cy.get("[data-testid='FORM_CREATE_BUTTON']").click(uiOpts); | ||||||
|     return cy.wait('@createFeature'); |     return cy.wait('@createFeature'); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -9,7 +9,6 @@ import { | |||||||
| } from 'component/providers/AccessProvider/permissions'; | } from 'component/providers/AccessProvider/permissions'; | ||||||
| import { useContext } from 'react'; | import { useContext } from 'react'; | ||||||
| import AccessContext from 'contexts/AccessContext'; | import AccessContext from 'contexts/AccessContext'; | ||||||
| import { useUiFlag } from 'hooks/useUiFlag'; |  | ||||||
| 
 | 
 | ||||||
| const WarningContainer = styled(Box)(({ theme }) => ({ | const WarningContainer = styled(Box)(({ theme }) => ({ | ||||||
|     display: 'flex', |     display: 'flex', | ||||||
| @ -109,7 +108,6 @@ type ApplicationIssues = | |||||||
| 
 | 
 | ||||||
| const FeaturesMissing = ({ features }: IFeaturesMissingProps) => { | const FeaturesMissing = ({ features }: IFeaturesMissingProps) => { | ||||||
|     const { hasAccess } = useContext(AccessContext); |     const { hasAccess } = useContext(AccessContext); | ||||||
|     const improveCreateFlagFlow = useUiFlag('improveCreateFlagFlow'); |  | ||||||
|     const length = features.length; |     const length = features.length; | ||||||
| 
 | 
 | ||||||
|     if (length === 0) { |     if (length === 0) { | ||||||
| @ -130,25 +128,12 @@ const FeaturesMissing = ({ features }: IFeaturesMissingProps) => { | |||||||
|                         <ConditionallyRender |                         <ConditionallyRender | ||||||
|                             condition={hasAccess(CREATE_FEATURE)} |                             condition={hasAccess(CREATE_FEATURE)} | ||||||
|                             show={ |                             show={ | ||||||
|                                 <ConditionallyRender |                                 <StyledLink | ||||||
|                                     condition={improveCreateFlagFlow} |                                     key={feature} | ||||||
|                                     show={ |                                     to={`/projects/default?create=true&name=${feature}`} | ||||||
|                                         <StyledLink |                                 > | ||||||
|                                             key={feature} |                                     Create feature flag | ||||||
|                                             to={`/projects/default?create=true&name=${feature}`} |                                 </StyledLink> | ||||||
|                                         > |  | ||||||
|                                             Create feature flag |  | ||||||
|                                         </StyledLink> |  | ||||||
|                                     } |  | ||||||
|                                     elseShow={ |  | ||||||
|                                         <StyledLink |  | ||||||
|                                             key={feature} |  | ||||||
|                                             to={`/projects/default/create-toggle?name=${feature}`} |  | ||||||
|                                         > |  | ||||||
|                                             Create feature flag |  | ||||||
|                                         </StyledLink> |  | ||||||
|                                     } |  | ||||||
|                                 /> |  | ||||||
|                             } |                             } | ||||||
|                         /> |                         /> | ||||||
|                     </IssueRowContainer> |                     </IssueRowContainer> | ||||||
|  | |||||||
| @ -16,9 +16,8 @@ import Add from '@mui/icons-material/Add'; | |||||||
| import FileDownload from '@mui/icons-material/FileDownload'; | import FileDownload from '@mui/icons-material/FileDownload'; | ||||||
| import { styled } from '@mui/material'; | import { styled } from '@mui/material'; | ||||||
| import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; | import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; | ||||||
| import { useNavigate, useSearchParams } from 'react-router-dom'; | import { useSearchParams } from 'react-router-dom'; | ||||||
| import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; | import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; | ||||||
| import { getCreateTogglePath } from 'utils/routePathHelpers'; |  | ||||||
| import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; | import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; | ||||||
| import { ExportDialog } from 'component/feature/FeatureToggleList/ExportDialog'; | import { ExportDialog } from 'component/feature/FeatureToggleList/ExportDialog'; | ||||||
| import type { FeatureSchema } from 'openapi'; | import type { FeatureSchema } from 'openapi'; | ||||||
| @ -48,44 +47,25 @@ const FlagCreationButton: FC = () => { | |||||||
|     const showCreateDialog = Boolean(searchParams.get('create')); |     const showCreateDialog = Boolean(searchParams.get('create')); | ||||||
|     const [openCreateDialog, setOpenCreateDialog] = useState(showCreateDialog); |     const [openCreateDialog, setOpenCreateDialog] = useState(showCreateDialog); | ||||||
|     const { loading } = useUiConfig(); |     const { loading } = useUiConfig(); | ||||||
|     const navigate = useNavigate(); |  | ||||||
|     const improveCreateFlagFlow = useUiFlag('improveCreateFlagFlow'); |  | ||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|         <ConditionallyRender |         <> | ||||||
|             condition={improveCreateFlagFlow} |             <StyledResponsiveButton | ||||||
|             show={ |                 onClick={() => setOpenCreateDialog(true)} | ||||||
|                 <> |                 maxWidth='960px' | ||||||
|                     <StyledResponsiveButton |                 Icon={Add} | ||||||
|                         onClick={() => setOpenCreateDialog(true)} |                 projectId={projectId} | ||||||
|                         maxWidth='960px' |                 disabled={loading} | ||||||
|                         Icon={Add} |                 permission={CREATE_FEATURE} | ||||||
|                         projectId={projectId} |                 data-testid='NAVIGATE_TO_CREATE_FEATURE' | ||||||
|                         disabled={loading} |             > | ||||||
|                         permission={CREATE_FEATURE} |                 New feature flag | ||||||
|                         data-testid='NAVIGATE_TO_CREATE_FEATURE' |             </StyledResponsiveButton> | ||||||
|                     > |             <CreateFeatureDialog | ||||||
|                         New feature flag |                 open={openCreateDialog} | ||||||
|                     </StyledResponsiveButton> |                 onClose={() => setOpenCreateDialog(false)} | ||||||
|                     <CreateFeatureDialog |             /> | ||||||
|                         open={openCreateDialog} |         </> | ||||||
|                         onClose={() => setOpenCreateDialog(false)} |  | ||||||
|                     /> |  | ||||||
|                 </> |  | ||||||
|             } |  | ||||||
|             elseShow={ |  | ||||||
|                 <StyledResponsiveButton |  | ||||||
|                     onClick={() => navigate(getCreateTogglePath(projectId))} |  | ||||||
|                     maxWidth='960px' |  | ||||||
|                     Icon={Add} |  | ||||||
|                     projectId={projectId} |  | ||||||
|                     permission={CREATE_FEATURE} |  | ||||||
|                     data-testid='NAVIGATE_TO_CREATE_FEATURE' |  | ||||||
|                 > |  | ||||||
|                     New feature flag |  | ||||||
|                 </StyledResponsiveButton> |  | ||||||
|             } |  | ||||||
|         /> |  | ||||||
|     ); |     ); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -91,7 +91,6 @@ export type UiFlags = { | |||||||
|     resourceLimits?: boolean; |     resourceLimits?: boolean; | ||||||
|     insightsV2?: boolean; |     insightsV2?: boolean; | ||||||
|     integrationEvents?: boolean; |     integrationEvents?: boolean; | ||||||
|     improveCreateFlagFlow?: boolean; |  | ||||||
|     newEventSearch?: boolean; |     newEventSearch?: boolean; | ||||||
|     changeRequestPlayground?: boolean; |     changeRequestPlayground?: boolean; | ||||||
|     archiveProjects?: boolean; |     archiveProjects?: boolean; | ||||||
|  | |||||||
| @ -120,7 +120,6 @@ exports[`should create default config 1`] = ` | |||||||
|       }, |       }, | ||||||
|       "filterInvalidClientMetrics": false, |       "filterInvalidClientMetrics": false, | ||||||
|       "googleAuthEnabled": false, |       "googleAuthEnabled": false, | ||||||
|       "improveCreateFlagFlow": false, |  | ||||||
|       "insightsV2": false, |       "insightsV2": false, | ||||||
|       "integrationEvents": false, |       "integrationEvents": false, | ||||||
|       "killInsightsUI": false, |       "killInsightsUI": false, | ||||||
|  | |||||||
| @ -61,7 +61,6 @@ export type IFlagKey = | |||||||
|     | 'removeUnsafeInlineStyleSrc' |     | 'removeUnsafeInlineStyleSrc' | ||||||
|     | 'insightsV2' |     | 'insightsV2' | ||||||
|     | 'integrationEvents' |     | 'integrationEvents' | ||||||
|     | 'improveCreateFlagFlow' |  | ||||||
|     | 'originMiddleware' |     | 'originMiddleware' | ||||||
|     | 'newEventSearch' |     | 'newEventSearch' | ||||||
|     | 'changeRequestPlayground' |     | 'changeRequestPlayground' | ||||||
| @ -298,10 +297,6 @@ const flags: IFlags = { | |||||||
|         process.env.UNLEASH_EXPERIMENTAL_INTEGRATION_EVENTS, |         process.env.UNLEASH_EXPERIMENTAL_INTEGRATION_EVENTS, | ||||||
|         false, |         false, | ||||||
|     ), |     ), | ||||||
|     improveCreateFlagFlow: parseEnvVarBoolean( |  | ||||||
|         process.env.UNLEASH_EXPERIMENTAL_IMPROVE_CREATE_FLAG_FLOW, |  | ||||||
|         false, |  | ||||||
|     ), |  | ||||||
|     originMiddleware: parseEnvVarBoolean( |     originMiddleware: parseEnvVarBoolean( | ||||||
|         process.env.UNLEASH_EXPERIMENTAL_ORIGIN_MIDDLEWARE, |         process.env.UNLEASH_EXPERIMENTAL_ORIGIN_MIDDLEWARE, | ||||||
|         false, |         false, | ||||||
|  | |||||||
| @ -54,7 +54,6 @@ process.nextTick(async () => { | |||||||
|                         extendedMetrics: true, |                         extendedMetrics: true, | ||||||
|                         insightsV2: true, |                         insightsV2: true, | ||||||
|                         integrationEvents: true, |                         integrationEvents: true, | ||||||
|                         improveCreateFlagFlow: true, |  | ||||||
|                         originMiddleware: true, |                         originMiddleware: true, | ||||||
|                         newEventSearch: true, |                         newEventSearch: true, | ||||||
|                         changeRequestPlayground: true, |                         changeRequestPlayground: true, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user