1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: avoid stale feature strategy enabled status message (#2018)

This commit is contained in:
olav 2022-08-31 15:09:01 +02:00 committed by GitHub
parent 7e77270ba5
commit 6af8f7356f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -4,17 +4,21 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
import { Alert } from '@mui/material';
import { IFeatureToggle } from 'interfaces/featureToggle';
import { formatFeaturePath } from '../FeatureStrategyEdit/FeatureStrategyEdit';
import { useFeature } from 'hooks/api/getters/useFeature/useFeature';
interface IFeatureStrategyEnabledProps {
feature: IFeatureToggle;
projectId: string;
featureId: string;
environmentId: string;
}
export const FeatureStrategyEnabled = ({
feature,
projectId,
featureId,
environmentId,
}: IFeatureStrategyEnabledProps) => {
const featurePagePath = formatFeaturePath(feature.project, feature.name);
const featurePagePath = formatFeaturePath(projectId, featureId);
const { feature } = useFeature(projectId, featureId);
const featurePageLink = (
<Link to={featurePagePath} style={{ color: 'inherit' }}>

View File

@ -126,7 +126,8 @@ export const FeatureStrategyForm = ({
<form className={styles.form} onSubmit={onSubmitWithValidation}>
<div>
<FeatureStrategyEnabled
feature={feature}
projectId={feature.project}
featureId={feature.name}
environmentId={environmentId}
/>
</div>