mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
chore: add flag, show single button if enabled
This commit is contained in:
parent
28cbf7b19e
commit
9fcbe2cec7
@ -21,6 +21,7 @@ import { formatUnknownError } from 'utils/formatUnknownError';
|
|||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import { ReleasePlanReviewDialog } from '../../FeatureView/FeatureOverview/ReleasePlan/ReleasePlanReviewDialog.tsx';
|
import { ReleasePlanReviewDialog } from '../../FeatureView/FeatureOverview/ReleasePlan/ReleasePlanReviewDialog.tsx';
|
||||||
import { FeatureStrategyMenuCards } from './FeatureStrategyMenuCards/FeatureStrategyMenuCards.tsx';
|
import { FeatureStrategyMenuCards } from './FeatureStrategyMenuCards/FeatureStrategyMenuCards.tsx';
|
||||||
|
import { useUiFlag } from 'hooks/useUiFlag.ts';
|
||||||
|
|
||||||
interface IFeatureStrategyMenuProps {
|
interface IFeatureStrategyMenuProps {
|
||||||
label: string;
|
label: string;
|
||||||
@ -160,6 +161,24 @@ export const FeatureStrategyMenu = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledStrategyMenu onClick={(event) => event.stopPropagation()}>
|
<StyledStrategyMenu onClick={(event) => event.stopPropagation()}>
|
||||||
|
{newStrategyModalEnabled ? (
|
||||||
|
<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 strategy
|
||||||
|
</PermissionButton>
|
||||||
|
) : (
|
||||||
<>
|
<>
|
||||||
{displayReleasePlanButton ? (
|
{displayReleasePlanButton ? (
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
@ -173,7 +192,9 @@ export const FeatureStrategyMenu = ({
|
|||||||
sx={{ minWidth: matchWidth ? '282px' : 'auto' }}
|
sx={{ minWidth: matchWidth ? '282px' : 'auto' }}
|
||||||
disabled={Boolean(disableReason)}
|
disabled={Boolean(disableReason)}
|
||||||
tooltipProps={{
|
tooltipProps={{
|
||||||
title: disableReason ? disableReason : undefined,
|
title: disableReason
|
||||||
|
? disableReason
|
||||||
|
: undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Use template
|
Use template
|
||||||
@ -214,6 +235,7 @@ export const FeatureStrategyMenu = ({
|
|||||||
<MoreVert />
|
<MoreVert />
|
||||||
</StyledAdditionalMenuButton>
|
</StyledAdditionalMenuButton>
|
||||||
</>
|
</>
|
||||||
|
)}
|
||||||
<Dialog
|
<Dialog
|
||||||
open={isStrategyMenuDialogOpen}
|
open={isStrategyMenuDialogOpen}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
|
@ -87,6 +87,7 @@ export type UiFlags = {
|
|||||||
customMetrics?: boolean;
|
customMetrics?: boolean;
|
||||||
impactMetrics?: boolean;
|
impactMetrics?: boolean;
|
||||||
lifecycleGraphs?: boolean;
|
lifecycleGraphs?: boolean;
|
||||||
|
newStrategyModal?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IVersionInfo {
|
export interface IVersionInfo {
|
||||||
|
@ -57,7 +57,8 @@ export type IFlagKey =
|
|||||||
| 'lifecycleGraphs'
|
| 'lifecycleGraphs'
|
||||||
| 'etagByEnv'
|
| 'etagByEnv'
|
||||||
| 'fetchMode'
|
| 'fetchMode'
|
||||||
| 'optimizeLifecycle';
|
| 'optimizeLifecycle'
|
||||||
|
| 'newStrategyModal';
|
||||||
|
|
||||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
||||||
|
|
||||||
@ -263,6 +264,10 @@ const flags: IFlags = {
|
|||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
newStrategyModal: parseEnvVarBoolean(
|
||||||
|
process.env.UNLEASH_EXPERIMENTAL_NEW_STRATEGY_MODAL,
|
||||||
|
false,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExperimentalOptions: IExperimentalOptions = {
|
export const defaultExperimentalOptions: IExperimentalOptions = {
|
||||||
|
@ -53,6 +53,7 @@ process.nextTick(async () => {
|
|||||||
customMetrics: true,
|
customMetrics: true,
|
||||||
impactMetrics: true,
|
impactMetrics: true,
|
||||||
lifecycleGraphs: true,
|
lifecycleGraphs: true,
|
||||||
|
newStrategyModal: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
authentication: {
|
authentication: {
|
||||||
|
Loading…
Reference in New Issue
Block a user