From 0a2a8d5af52221ab91ff0dcc1923a19500ffea68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Thu, 21 Oct 2021 22:28:25 +0200 Subject: [PATCH] fix: ApiToken should hide envrionment if it is not enabled yet --- .../ApiTokenCreate/ApiTokenCreate.tsx | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/frontend/src/component/api-token/ApiTokenCreate/ApiTokenCreate.tsx b/frontend/src/component/api-token/ApiTokenCreate/ApiTokenCreate.tsx index a82cd6e1ca..3ae313f3e3 100644 --- a/frontend/src/component/api-token/ApiTokenCreate/ApiTokenCreate.tsx +++ b/frontend/src/component/api-token/ApiTokenCreate/ApiTokenCreate.tsx @@ -5,6 +5,8 @@ import { styles as commonStyles } from '../../../component/common'; import { IApiTokenCreate } from '../../../hooks/api/actions/useApiTokensApi/useApiTokensApi'; import useEnvironments from '../../../hooks/api/getters/useEnvironments/useEnvironments'; 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 GeneralSelect from '../../common/GeneralSelect/GeneralSelect'; @@ -41,6 +43,7 @@ const ApiTokenCreate = ({ const [error, setError] = useState({}); const { projects } = useProjects(); const { environments } = useEnvironments(); + const { uiConfig } = useUiConfig(); useEffect(() => { if ( @@ -192,18 +195,22 @@ const ApiTokenCreate = ({ className={undefined} classes={undefined} /> - + + + + } /> );