1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-18 13:48:58 +02:00

fix: prod guard and flags snapshot

This commit is contained in:
Tymoteusz Czech 2023-10-18 16:46:01 +02:00
parent 7e6ef0539f
commit 2766f446dd
No known key found for this signature in database
GPG Key ID: 133555230D88D75F
4 changed files with 29 additions and 26 deletions

View File

@ -10,7 +10,10 @@ export const ChildrenTooltip: FC<{
tooltip={
<>
{childFeatures.map((child) => (
<StyledLink to={`/projects/${project}/features/${child}`}>
<StyledLink
key={`${project}-${child}`}
to={`/projects/${project}/features/${child}`}
>
<div>{child}</div>
</StyledLink>
))}

View File

@ -49,7 +49,7 @@ export const FeatureToggleSwitch: VFC<FeatureToggleSwitchProps> = ({
? `Disable feature in ${environmentName}`
: `Enable feature in ${environmentName}`
}
checked={isChecked}
checked={value}
environmentId={environmentName}
projectId={projectId}
permission={UPDATE_FEATURE_ENVIRONMENT}

View File

@ -69,12 +69,13 @@ export const useFeatureToggleSwitch: UseFeatureToggleSwitchType = (
return next();
}
if (isProdGuardEnabled(config.environmentType || '')) {
if (!isProdGuardEnabled(config.environmentType || '')) {
return next();
}
setProdGuardModalState({
open: true,
label: `${
!newState ? 'Disable' : 'Enable'
} Environment`,
label: `${!newState ? 'Disable' : 'Enable'} Environment`,
loading: false,
onClose: () => {
setProdGuardModalState((prev) => ({
@ -92,9 +93,6 @@ export const useFeatureToggleSwitch: UseFeatureToggleSwitchType = (
next();
},
});
}
return next();
};
const ensureActiveStrategies: Middleware = (next) => {

View File

@ -90,6 +90,7 @@ exports[`should create default config 1`] = `
"embedProxy": true,
"embedProxyFrontend": true,
"featureNamingPattern": false,
"featureSwitchRefactor": false,
"featuresExportImport": true,
"filterInvalidClientMetrics": false,
"googleAuthEnabled": false,
@ -135,6 +136,7 @@ exports[`should create default config 1`] = `
"embedProxy": true,
"embedProxyFrontend": true,
"featureNamingPattern": false,
"featureSwitchRefactor": false,
"featuresExportImport": true,
"filterInvalidClientMetrics": false,
"googleAuthEnabled": false,