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:
parent
7e77270ba5
commit
6af8f7356f
@ -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' }}>
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user