mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
chore: strategy variant flag removed (#4603)
This commit is contained in:
parent
8aace7f93f
commit
45e089f27f
@ -258,7 +258,6 @@ export const FeatureStrategyForm = ({
|
||||
<StyledHr />
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
Boolean(uiConfig?.flags?.strategyVariant) &&
|
||||
strategy.parameters != null &&
|
||||
'stickiness' in strategy.parameters
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import PermissionIconButton from 'component/common/PermissionIconButton/Permissi
|
||||
import { Edit } from '@mui/icons-material';
|
||||
import { VariantInfoAlert } from 'component/common/VariantInfoAlert/VariantInfoAlert';
|
||||
import { StrategyVariantsPreferredAlert } from 'component/common/StrategyVariantsUpgradeAlert/StrategyVariantsUpgradeAlert';
|
||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||
|
||||
const StyledButtonContainer = styled('div')(({ theme }) => ({
|
||||
display: 'flex',
|
||||
@ -37,7 +36,6 @@ const StyledButtonContainer = styled('div')(({ theme }) => ({
|
||||
}));
|
||||
|
||||
export const FeatureEnvironmentVariants = () => {
|
||||
const { uiConfig } = useUiConfig();
|
||||
const { setToastData, setToastApiError } = useToast();
|
||||
const theme = useTheme();
|
||||
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
|
||||
@ -267,11 +265,7 @@ export const FeatureEnvironmentVariants = () => {
|
||||
}
|
||||
>
|
||||
<VariantInfoAlert mode="feature" />
|
||||
<ConditionallyRender
|
||||
condition={Boolean(uiConfig?.flags?.strategyVariant)}
|
||||
show={<StrategyVariantsPreferredAlert />}
|
||||
/>
|
||||
|
||||
<StrategyVariantsPreferredAlert />
|
||||
{environments.map(environment => {
|
||||
const otherEnvsWithVariants = environments.filter(
|
||||
({ name, variants }) =>
|
||||
|
@ -182,7 +182,6 @@ export const ProjectDefaultStrategyForm = ({
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
Boolean(uiConfig?.flags?.strategyVariant) &&
|
||||
strategy.parameters != null &&
|
||||
'stickiness' in strategy.parameters
|
||||
}
|
||||
|
@ -97,7 +97,6 @@ exports[`should create default config 1`] = `
|
||||
"proPlanAutoCharge": false,
|
||||
"responseTimeWithAppNameKillSwitch": false,
|
||||
"slackAppAddon": false,
|
||||
"strategyVariant": false,
|
||||
"strictSchemaValidation": false,
|
||||
},
|
||||
},
|
||||
@ -132,7 +131,6 @@ exports[`should create default config 1`] = `
|
||||
"proPlanAutoCharge": false,
|
||||
"responseTimeWithAppNameKillSwitch": false,
|
||||
"slackAppAddon": false,
|
||||
"strategyVariant": false,
|
||||
"strictSchemaValidation": false,
|
||||
},
|
||||
"externalResolver": {
|
||||
|
@ -253,9 +253,7 @@ export default class FeatureToggleClientStore
|
||||
parameters: mapValues(row.parameters || {}, ensureStringValue),
|
||||
sortOrder: row.sort_order,
|
||||
};
|
||||
if (this.flagResolver.isEnabled('strategyVariant')) {
|
||||
strategy.variants = row.strategy_variants || [];
|
||||
}
|
||||
strategy.variants = row.strategy_variants || [];
|
||||
return strategy;
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,7 @@ let app: IUnleashTest;
|
||||
let db: ITestDb;
|
||||
|
||||
beforeAll(async () => {
|
||||
db = await dbInit('advanced_playground', getLogger, {
|
||||
experimental: { flags: { strategyVariant: true } },
|
||||
});
|
||||
db = await dbInit('advanced_playground', getLogger);
|
||||
app = await setupAppWithCustomConfig(
|
||||
db.stores,
|
||||
{
|
||||
|
@ -398,12 +398,10 @@ class FeatureToggleService {
|
||||
disabled: featureStrategy.disabled,
|
||||
constraints: featureStrategy.constraints || [],
|
||||
parameters: featureStrategy.parameters,
|
||||
sortOrder: featureStrategy.sortOrder,
|
||||
segments: segments.map((segment) => segment.id) ?? [],
|
||||
};
|
||||
|
||||
if (this.flagResolver.isEnabled('strategyVariant')) {
|
||||
result.sortOrder = featureStrategy.sortOrder;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -460,39 +458,37 @@ class FeatureToggleService {
|
||||
);
|
||||
}),
|
||||
);
|
||||
if (this.flagResolver.isEnabled('strategyVariant')) {
|
||||
const newOrder = (
|
||||
await this.getStrategiesForEnvironment(
|
||||
project,
|
||||
featureName,
|
||||
environment,
|
||||
)
|
||||
)
|
||||
.sort((strategy1, strategy2) => {
|
||||
if (
|
||||
typeof strategy1.sortOrder === 'number' &&
|
||||
typeof strategy2.sortOrder === 'number'
|
||||
) {
|
||||
return strategy1.sortOrder - strategy2.sortOrder;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
.map((strategy) => strategy.id);
|
||||
|
||||
const eventData: StrategyIds = { strategyIds: newOrder };
|
||||
|
||||
const tags = await this.tagStore.getAllTagsForFeature(featureName);
|
||||
const event = new StrategiesOrderChangedEvent({
|
||||
const newOrder = (
|
||||
await this.getStrategiesForEnvironment(
|
||||
project,
|
||||
featureName,
|
||||
environment,
|
||||
project,
|
||||
createdBy,
|
||||
preData: eventPreData,
|
||||
data: eventData,
|
||||
tags: tags,
|
||||
});
|
||||
await this.eventStore.store(event);
|
||||
}
|
||||
)
|
||||
)
|
||||
.sort((strategy1, strategy2) => {
|
||||
if (
|
||||
typeof strategy1.sortOrder === 'number' &&
|
||||
typeof strategy2.sortOrder === 'number'
|
||||
) {
|
||||
return strategy1.sortOrder - strategy2.sortOrder;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
.map((strategy) => strategy.id);
|
||||
|
||||
const eventData: StrategyIds = { strategyIds: newOrder };
|
||||
|
||||
const tags = await this.tagStore.getAllTagsForFeature(featureName);
|
||||
const event = new StrategiesOrderChangedEvent({
|
||||
featureName,
|
||||
environment,
|
||||
project,
|
||||
createdBy,
|
||||
preData: eventPreData,
|
||||
data: eventData,
|
||||
tags: tags,
|
||||
});
|
||||
await this.eventStore.store(event);
|
||||
}
|
||||
|
||||
async createStrategy(
|
||||
@ -1226,7 +1222,7 @@ class FeatureToggleService {
|
||||
segments: [],
|
||||
title: strategy.title,
|
||||
disabled: strategy.disabled,
|
||||
// FIXME: Should we return sortOrder here, or adjust OpenAPI?
|
||||
sortOrder: strategy.sortOrder,
|
||||
};
|
||||
|
||||
if (segments && segments.length > 0) {
|
||||
|
@ -20,7 +20,6 @@ export type IFlagKey =
|
||||
| 'disableBulkToggle'
|
||||
| 'disableNotifications'
|
||||
| 'advancedPlayground'
|
||||
| 'strategyVariant'
|
||||
| 'slackAppAddon'
|
||||
| 'filterInvalidClientMetrics'
|
||||
| 'lastSeenByEnvironment'
|
||||
@ -96,10 +95,6 @@ const flags: IFlags = {
|
||||
process.env.DISABLE_NOTIFICATIONS,
|
||||
false,
|
||||
),
|
||||
strategyVariant: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_STRATEGY_VARIANT,
|
||||
false,
|
||||
),
|
||||
slackAppAddon: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_SLACK_APP_ADDON,
|
||||
false,
|
||||
|
@ -37,7 +37,6 @@ process.nextTick(async () => {
|
||||
embedProxyFrontend: true,
|
||||
anonymiseEventLog: false,
|
||||
responseTimeWithAppNameKillSwitch: false,
|
||||
strategyVariant: true,
|
||||
slackAppAddon: true,
|
||||
lastSeenByEnvironment: true,
|
||||
newApplicationList: true,
|
||||
|
Loading…
Reference in New Issue
Block a user