1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +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:
Jaanus Sellin 2024-07-26 14:27:02 +03:00 committed by GitHub
parent 049b26fb77
commit 4df8fd3810
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 7 deletions

View File

@ -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>

View File

@ -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' &&

View File

@ -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>