mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
[Gitar] Cleaning up stale flag: improveCreateFlagFlow with value true (#7895)
[![Gitar](https://raw.githubusercontent.com/gitarcode/.github/main/assets/gitar-banner.svg)](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.get("[data-testid='CF_NAME_ID'] input").type(name, uiOpts);
|
||||
cy.get("[data-testid='CF_DESC_ID'] textarea")
|
||||
cy.get("[data-testid='FORM_NAME_INPUT'] input").type(name, uiOpts);
|
||||
cy.get("[data-testid='FORM_DESCRIPTION_INPUT'] textarea")
|
||||
.first()
|
||||
.type('hello-world', uiOpts);
|
||||
if (!shouldWait)
|
||||
return cy.get("[data-testid='CF_CREATE_BTN_ID']").click(uiOpts);
|
||||
else 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='FORM_CREATE_BUTTON']").click(uiOpts);
|
||||
return cy.wait('@createFeature');
|
||||
};
|
||||
|
||||
|
@ -9,7 +9,6 @@ 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',
|
||||
@ -109,7 +108,6 @@ type ApplicationIssues =
|
||||
|
||||
const FeaturesMissing = ({ features }: IFeaturesMissingProps) => {
|
||||
const { hasAccess } = useContext(AccessContext);
|
||||
const improveCreateFlagFlow = useUiFlag('improveCreateFlagFlow');
|
||||
const length = features.length;
|
||||
|
||||
if (length === 0) {
|
||||
@ -130,25 +128,12 @@ const FeaturesMissing = ({ features }: IFeaturesMissingProps) => {
|
||||
<ConditionallyRender
|
||||
condition={hasAccess(CREATE_FEATURE)}
|
||||
show={
|
||||
<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>
|
||||
}
|
||||
/>
|
||||
<StyledLink
|
||||
key={feature}
|
||||
to={`/projects/default?create=true&name=${feature}`}
|
||||
>
|
||||
Create feature flag
|
||||
</StyledLink>
|
||||
}
|
||||
/>
|
||||
</IssueRowContainer>
|
||||
|
@ -16,9 +16,8 @@ import Add from '@mui/icons-material/Add';
|
||||
import FileDownload from '@mui/icons-material/FileDownload';
|
||||
import { styled } from '@mui/material';
|
||||
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 { getCreateTogglePath } from 'utils/routePathHelpers';
|
||||
import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions';
|
||||
import { ExportDialog } from 'component/feature/FeatureToggleList/ExportDialog';
|
||||
import type { FeatureSchema } from 'openapi';
|
||||
@ -48,44 +47,25 @@ const FlagCreationButton: FC = () => {
|
||||
const showCreateDialog = Boolean(searchParams.get('create'));
|
||||
const [openCreateDialog, setOpenCreateDialog] = useState(showCreateDialog);
|
||||
const { loading } = useUiConfig();
|
||||
const navigate = useNavigate();
|
||||
const improveCreateFlagFlow = useUiFlag('improveCreateFlagFlow');
|
||||
|
||||
return (
|
||||
<ConditionallyRender
|
||||
condition={improveCreateFlagFlow}
|
||||
show={
|
||||
<>
|
||||
<StyledResponsiveButton
|
||||
onClick={() => setOpenCreateDialog(true)}
|
||||
maxWidth='960px'
|
||||
Icon={Add}
|
||||
projectId={projectId}
|
||||
disabled={loading}
|
||||
permission={CREATE_FEATURE}
|
||||
data-testid='NAVIGATE_TO_CREATE_FEATURE'
|
||||
>
|
||||
New feature flag
|
||||
</StyledResponsiveButton>
|
||||
<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>
|
||||
}
|
||||
/>
|
||||
<>
|
||||
<StyledResponsiveButton
|
||||
onClick={() => setOpenCreateDialog(true)}
|
||||
maxWidth='960px'
|
||||
Icon={Add}
|
||||
projectId={projectId}
|
||||
disabled={loading}
|
||||
permission={CREATE_FEATURE}
|
||||
data-testid='NAVIGATE_TO_CREATE_FEATURE'
|
||||
>
|
||||
New feature flag
|
||||
</StyledResponsiveButton>
|
||||
<CreateFeatureDialog
|
||||
open={openCreateDialog}
|
||||
onClose={() => setOpenCreateDialog(false)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -91,7 +91,6 @@ export type UiFlags = {
|
||||
resourceLimits?: boolean;
|
||||
insightsV2?: boolean;
|
||||
integrationEvents?: boolean;
|
||||
improveCreateFlagFlow?: boolean;
|
||||
newEventSearch?: boolean;
|
||||
changeRequestPlayground?: boolean;
|
||||
archiveProjects?: boolean;
|
||||
|
@ -120,7 +120,6 @@ exports[`should create default config 1`] = `
|
||||
},
|
||||
"filterInvalidClientMetrics": false,
|
||||
"googleAuthEnabled": false,
|
||||
"improveCreateFlagFlow": false,
|
||||
"insightsV2": false,
|
||||
"integrationEvents": false,
|
||||
"killInsightsUI": false,
|
||||
|
@ -61,7 +61,6 @@ export type IFlagKey =
|
||||
| 'removeUnsafeInlineStyleSrc'
|
||||
| 'insightsV2'
|
||||
| 'integrationEvents'
|
||||
| 'improveCreateFlagFlow'
|
||||
| 'originMiddleware'
|
||||
| 'newEventSearch'
|
||||
| 'changeRequestPlayground'
|
||||
@ -298,10 +297,6 @@ const flags: IFlags = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_INTEGRATION_EVENTS,
|
||||
false,
|
||||
),
|
||||
improveCreateFlagFlow: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_IMPROVE_CREATE_FLAG_FLOW,
|
||||
false,
|
||||
),
|
||||
originMiddleware: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_ORIGIN_MIDDLEWARE,
|
||||
false,
|
||||
|
@ -54,7 +54,6 @@ process.nextTick(async () => {
|
||||
extendedMetrics: true,
|
||||
insightsV2: true,
|
||||
integrationEvents: true,
|
||||
improveCreateFlagFlow: true,
|
||||
originMiddleware: true,
|
||||
newEventSearch: true,
|
||||
changeRequestPlayground: true,
|
||||
|
Loading…
Reference in New Issue
Block a user