mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-17 01:17:29 +02:00
fix: wrong environment name in strategy creation
This commit is contained in:
parent
f4681a3883
commit
93fb9fb66a
@ -61,7 +61,7 @@ const FeatureToggleListNewItem = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleToggle = (env: IEnvironments, e: SyntheticEvent) => {
|
const handleToggle = (env: IEnvironments) => {
|
||||||
toggleFeatureByEnvironment(env.name, env.enabled)
|
toggleFeatureByEnvironment(env.name, env.enabled)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
setToastData({
|
setToastData({
|
||||||
@ -73,7 +73,6 @@ const FeatureToggleListNewItem = ({
|
|||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
if (e.message === ENVIRONMENT_STRATEGY_ERROR) {
|
if (e.message === ENVIRONMENT_STRATEGY_ERROR) {
|
||||||
setEnvironmentName(env.name);
|
|
||||||
setShowInfoBox(true);
|
setShowInfoBox(true);
|
||||||
} else {
|
} else {
|
||||||
setToastData({
|
setToastData({
|
||||||
@ -150,7 +149,10 @@ const FeatureToggleListNewItem = ({
|
|||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
permission={UPDATE_FEATURE}
|
permission={UPDATE_FEATURE}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
onClick={handleToggle.bind(this, env)}
|
onClick={() => {
|
||||||
|
handleToggle(env);
|
||||||
|
setEnvironmentName(env.name);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
@ -62,7 +62,6 @@ const FeatureStrategiesEnvironments = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (addStrategy) {
|
if (addStrategy) {
|
||||||
setExpandedSidebar(true);
|
setExpandedSidebar(true);
|
||||||
history.replace(history.location.pathname);
|
|
||||||
}
|
}
|
||||||
if (!feature) return;
|
if (!feature) return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user