mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: ApiToken should hide envrionment if it is not enabled yet
This commit is contained in:
parent
83ad4041bf
commit
0a2a8d5af5
@ -5,6 +5,8 @@ import { styles as commonStyles } from '../../../component/common';
|
|||||||
import { IApiTokenCreate } from '../../../hooks/api/actions/useApiTokensApi/useApiTokensApi';
|
import { IApiTokenCreate } from '../../../hooks/api/actions/useApiTokensApi/useApiTokensApi';
|
||||||
import useEnvironments from '../../../hooks/api/getters/useEnvironments/useEnvironments';
|
import useEnvironments from '../../../hooks/api/getters/useEnvironments/useEnvironments';
|
||||||
import useProjects from '../../../hooks/api/getters/useProjects/useProjects';
|
import useProjects from '../../../hooks/api/getters/useProjects/useProjects';
|
||||||
|
import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
|
import ConditionallyRender from '../../common/ConditionallyRender';
|
||||||
import Dialogue from '../../common/Dialogue';
|
import Dialogue from '../../common/Dialogue';
|
||||||
import GeneralSelect from '../../common/GeneralSelect/GeneralSelect';
|
import GeneralSelect from '../../common/GeneralSelect/GeneralSelect';
|
||||||
|
|
||||||
@ -41,6 +43,7 @@ const ApiTokenCreate = ({
|
|||||||
const [error, setError] = useState<IDataError>({});
|
const [error, setError] = useState<IDataError>({});
|
||||||
const { projects } = useProjects();
|
const { projects } = useProjects();
|
||||||
const { environments } = useEnvironments();
|
const { environments } = useEnvironments();
|
||||||
|
const { uiConfig } = useUiConfig();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
@ -192,6 +195,8 @@ const ApiTokenCreate = ({
|
|||||||
className={undefined}
|
className={undefined}
|
||||||
classes={undefined}
|
classes={undefined}
|
||||||
/>
|
/>
|
||||||
|
<ConditionallyRender condition={uiConfig?.flags.E} show={
|
||||||
|
<>
|
||||||
<GeneralSelect
|
<GeneralSelect
|
||||||
disabled={data.type === TYPE_ADMIN}
|
disabled={data.type === TYPE_ADMIN}
|
||||||
options={selectableEnvs}
|
options={selectableEnvs}
|
||||||
@ -204,6 +209,8 @@ const ApiTokenCreate = ({
|
|||||||
className={undefined}
|
className={undefined}
|
||||||
classes={undefined}
|
classes={undefined}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
} />
|
||||||
</form>
|
</form>
|
||||||
</Dialogue>
|
</Dialogue>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user