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 { Alert } from '@mui/material';
import { IFeatureToggle } from 'interfaces/featureToggle'; import { IFeatureToggle } from 'interfaces/featureToggle';
import { formatFeaturePath } from '../FeatureStrategyEdit/FeatureStrategyEdit'; import { formatFeaturePath } from '../FeatureStrategyEdit/FeatureStrategyEdit';
import { useFeature } from 'hooks/api/getters/useFeature/useFeature';
interface IFeatureStrategyEnabledProps { interface IFeatureStrategyEnabledProps {
feature: IFeatureToggle; projectId: string;
featureId: string;
environmentId: string; environmentId: string;
} }
export const FeatureStrategyEnabled = ({ export const FeatureStrategyEnabled = ({
feature, projectId,
featureId,
environmentId, environmentId,
}: IFeatureStrategyEnabledProps) => { }: IFeatureStrategyEnabledProps) => {
const featurePagePath = formatFeaturePath(feature.project, feature.name); const featurePagePath = formatFeaturePath(projectId, featureId);
const { feature } = useFeature(projectId, featureId);
const featurePageLink = ( const featurePageLink = (
<Link to={featurePagePath} style={{ color: 'inherit' }}> <Link to={featurePagePath} style={{ color: 'inherit' }}>

View File

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