mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-19 17:52:45 +02:00
chore(AI): addConfiguration flag cleanup (#10628)
This PR cleans up the addConfiguration flag. These changes were automatically generated by AI and should be reviewed carefully. Fixes #10627 ## 🧹 AI Flag Cleanup Summary This change removes the `addConfiguration` feature flag. The feature was discarded, so this cleanup reverts the UI to its state before the `addConfiguration` flag was introduced. The primary change is in the strategy menu, where the single "Add configuration" button is removed and the original "Use template," "Add strategy," and "More" buttons are restored. ### 🚮 Removed - **Flag Definitions** - `addConfiguration` flag from `experimental.ts` on the backend. - `addConfiguration` flag from `uiConfig.ts` on the frontend. - `addConfiguration: true` from the `server-dev.ts` config. - **UI Components & Logic** - The conditional rendering in `FeatureStrategyMenu.tsx` that showed an "Add configuration" button. - The `useUiFlag('addConfiguration')` hook call and its import from `FeatureStrategyMenu.tsx`. ### 🛠 Kept - **UI Components & Logic** - The original set of buttons in `FeatureStrategyMenu.tsx`: "Use template", "Add strategy", and a "More strategies" icon button. This was the code path for when the flag was disabled. ### 📝 Why The `addConfiguration` feature flag was marked as completed with the outcome "discarded". This cleanup removes the flag and all related code, preserving only the intended code path, which is the UI behavior from before the flag was introduced. --------- Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com> Co-authored-by: Nuno Góis <github@nunogois.com>
This commit is contained in:
parent
ea4c0a0941
commit
9540ed6e3d
@ -18,7 +18,6 @@ import { useReleasePlansApi } from 'hooks/api/actions/useReleasePlansApi/useRele
|
||||
import { useReleasePlans } from 'hooks/api/getters/useReleasePlans/useReleasePlans';
|
||||
import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||
import { useUiFlag } from 'hooks/useUiFlag';
|
||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||
import { ReleasePlanReviewDialog } from '../../FeatureView/FeatureOverview/ReleasePlan/ReleasePlanReviewDialog.tsx';
|
||||
|
||||
@ -76,7 +75,6 @@ export const FeatureStrategyMenu = ({
|
||||
const { refetch } = useReleasePlans(projectId, featureId, environmentId);
|
||||
const { addReleasePlanToFeature } = useReleasePlansApi();
|
||||
const { isEnterprise } = useUiConfig();
|
||||
const addConfigurationEnabled = useUiFlag('addConfiguration');
|
||||
const displayReleasePlanButton = isEnterprise();
|
||||
const crProtected = isChangeRequestConfigured(environmentId);
|
||||
|
||||
@ -160,24 +158,6 @@ export const FeatureStrategyMenu = ({
|
||||
|
||||
return (
|
||||
<StyledStrategyMenu onClick={(event) => event.stopPropagation()}>
|
||||
{addConfigurationEnabled ? (
|
||||
<PermissionButton
|
||||
data-testid='ADD_STRATEGY_BUTTON'
|
||||
permission={CREATE_FEATURE_STRATEGY}
|
||||
projectId={projectId}
|
||||
environmentId={environmentId}
|
||||
onClick={openMoreStrategies}
|
||||
aria-labelledby={dialogId}
|
||||
variant={variant}
|
||||
sx={{ minWidth: matchWidth ? '282px' : 'auto' }}
|
||||
disabled={Boolean(disableReason)}
|
||||
tooltipProps={{
|
||||
title: disableReason ? disableReason : undefined,
|
||||
}}
|
||||
>
|
||||
Add configuration
|
||||
</PermissionButton>
|
||||
) : (
|
||||
<>
|
||||
{displayReleasePlanButton ? (
|
||||
<PermissionButton
|
||||
@ -191,9 +171,7 @@ export const FeatureStrategyMenu = ({
|
||||
sx={{ minWidth: matchWidth ? '282px' : 'auto' }}
|
||||
disabled={Boolean(disableReason)}
|
||||
tooltipProps={{
|
||||
title: disableReason
|
||||
? disableReason
|
||||
: undefined,
|
||||
title: disableReason ? disableReason : undefined,
|
||||
}}
|
||||
>
|
||||
Use template
|
||||
@ -234,7 +212,6 @@ export const FeatureStrategyMenu = ({
|
||||
<MoreVert />
|
||||
</StyledAdditionalMenuButton>
|
||||
</>
|
||||
)}
|
||||
<Dialog
|
||||
open={isStrategyMenuDialogOpen}
|
||||
onClose={onClose}
|
||||
|
@ -87,7 +87,6 @@ export type UiFlags = {
|
||||
customMetrics?: boolean;
|
||||
impactMetrics?: boolean;
|
||||
lifecycleGraphs?: boolean;
|
||||
addConfiguration?: boolean;
|
||||
};
|
||||
|
||||
export interface IVersionInfo {
|
||||
|
@ -55,7 +55,6 @@ export type IFlagKey =
|
||||
| 'customMetrics'
|
||||
| 'impactMetrics'
|
||||
| 'lifecycleGraphs'
|
||||
| 'addConfiguration'
|
||||
| 'etagByEnv'
|
||||
| 'fetchMode'
|
||||
| 'optimizeLifecycle';
|
||||
@ -250,10 +249,6 @@ const flags: IFlags = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_LIFECYCLE_GRAPHS,
|
||||
false,
|
||||
),
|
||||
addConfiguration: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_ADD_CONFIGURATION,
|
||||
false,
|
||||
),
|
||||
streaming: {
|
||||
name: 'disabled',
|
||||
enabled: parseEnvVarBoolean(
|
||||
|
@ -53,7 +53,6 @@ process.nextTick(async () => {
|
||||
customMetrics: true,
|
||||
impactMetrics: true,
|
||||
lifecycleGraphs: true,
|
||||
addConfiguration: true,
|
||||
},
|
||||
},
|
||||
authentication: {
|
||||
|
Loading…
Reference in New Issue
Block a user