mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
conditional message for change request strategy form (#2465)
This commit is contained in:
parent
42eadef8da
commit
c9c5cf5364
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { FC } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||
import { Alert } from '@mui/material';
|
||||
@ -12,11 +12,12 @@ interface IFeatureStrategyEnabledProps {
|
||||
environmentId: string;
|
||||
}
|
||||
|
||||
export const FeatureStrategyEnabled = ({
|
||||
export const FeatureStrategyEnabled: FC<IFeatureStrategyEnabledProps> = ({
|
||||
projectId,
|
||||
featureId,
|
||||
environmentId,
|
||||
}: IFeatureStrategyEnabledProps) => {
|
||||
children,
|
||||
}) => {
|
||||
const featurePagePath = formatFeaturePath(projectId, featureId);
|
||||
const { feature } = useFeature(projectId, featureId);
|
||||
|
||||
@ -29,14 +30,7 @@ export const FeatureStrategyEnabled = ({
|
||||
return (
|
||||
<ConditionallyRender
|
||||
condition={isFeatureEnabledInEnvironment(feature, environmentId)}
|
||||
show={
|
||||
<Alert severity="success">
|
||||
This feature toggle is currently enabled in the{' '}
|
||||
<strong>{environmentId}</strong> environment. Any changes
|
||||
made here will be available to users as soon as you hit{' '}
|
||||
<strong>save</strong>.
|
||||
</Alert>
|
||||
}
|
||||
show={children}
|
||||
elseShow={
|
||||
<Alert severity="warning">
|
||||
This feature toggle is currently disabled in the{' '}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useState, useContext } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Button } from '@mui/material';
|
||||
import { Alert, Button } from '@mui/material';
|
||||
import {
|
||||
IFeatureStrategy,
|
||||
IFeatureStrategyParameters,
|
||||
@ -141,7 +141,27 @@ export const FeatureStrategyForm = ({
|
||||
projectId={feature.project}
|
||||
featureId={feature.name}
|
||||
environmentId={environmentId}
|
||||
/>
|
||||
>
|
||||
<ConditionallyRender
|
||||
condition={Boolean(isChangeRequest)}
|
||||
show={
|
||||
<Alert severity="success">
|
||||
This feature toggle is currently enabled in the{' '}
|
||||
<strong>{environmentId}</strong> environment. Any
|
||||
changes made here will be available to users as soon
|
||||
as these changes are approved and applied.
|
||||
</Alert>
|
||||
}
|
||||
elseShow={
|
||||
<Alert severity="success">
|
||||
This feature toggle is currently enabled in the{' '}
|
||||
<strong>{environmentId}</strong> environment. Any
|
||||
changes made here will be available to users as soon
|
||||
as you hit <strong>save</strong>.
|
||||
</Alert>
|
||||
}
|
||||
/>
|
||||
</FeatureStrategyEnabled>
|
||||
<hr className={styles.hr} />
|
||||
<ConditionallyRender
|
||||
condition={Boolean(uiConfig.flags.SE)}
|
||||
|
Loading…
Reference in New Issue
Block a user