From 6ba808145ad67a6afc55578786d95f0f02cf4983 Mon Sep 17 00:00:00 2001 From: awildturtok Date: Thu, 27 Aug 2026 12:32:27 +0200 Subject: [PATCH] feat(frontend): gate editor v2 by environment variable --- charts/conquery/templates/deployment.yml | 2 ++ charts/conquery/values.yaml | 3 ++ frontend/.env.e2e | 4 ++- frontend/.env.example | 3 ++ frontend/src/js/app/RightPane.tsx | 43 ++++++++++++++---------- frontend/src/js/environment/index.ts | 4 +++ 6 files changed, 40 insertions(+), 19 deletions(-) diff --git a/charts/conquery/templates/deployment.yml b/charts/conquery/templates/deployment.yml index 462b2bb0f4..a314b8dfc5 100644 --- a/charts/conquery/templates/deployment.yml +++ b/charts/conquery/templates/deployment.yml @@ -33,6 +33,8 @@ spec: value: {{ .Values.frontend.disableLogin | quote }} - name: REACT_APP_LANG value: {{ .Values.frontend.lang }} + - name: REACT_APP_EDITOR_V2_ENABLE + value: {{ .Values.frontend.editorV2.enabled | quote }} - name: REACT_APP_IDP_ENABLE value: {{ .Values.frontend.idp.enabled | quote }} - name: REACT_APP_IDP_URL diff --git a/charts/conquery/values.yaml b/charts/conquery/values.yaml index e31467e604..993da3ff73 100644 --- a/charts/conquery/values.yaml +++ b/charts/conquery/values.yaml @@ -36,6 +36,9 @@ frontend: lang: de # defines if a local login should be presented (for backend basic-auth-realm only) disableLogin: true + # defines if the extended query editor should be available + editorV2: + enabled: true # use external authentication (oauth/openid idp provider) idp: enabled: true diff --git a/frontend/.env.e2e b/frontend/.env.e2e index 1e5b246a4f..45e8bca1ce 100644 --- a/frontend/.env.e2e +++ b/frontend/.env.e2e @@ -14,7 +14,9 @@ REACT_APP_DISABLE_LOGIN=true REACT_APP_LANG=de +REACT_APP_EDITOR_V2_ENABLE=true + REACT_APP_IDP_ENABLE=false REACT_APP_IDP_URL=http://localhost:8080/auth REACT_APP_IDP_REALM=Myrealm -REACT_APP_IDP_CLIENT_ID=frontend \ No newline at end of file +REACT_APP_IDP_CLIENT_ID=frontend diff --git a/frontend/.env.example b/frontend/.env.example index f3763b5599..fbd62b2f86 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -16,6 +16,9 @@ REACT_APP_BASENAME= # also possible: en REACT_APP_LANG=de +# Enable the extended query editor +REACT_APP_EDITOR_V2_ENABLE=true + # Using keycloak as the Identity Provider (IDP) REACT_APP_IDP_ENABLE=false REACT_APP_IDP_URL=http://localhost:8080/auth diff --git a/frontend/src/js/app/RightPane.tsx b/frontend/src/js/app/RightPane.tsx index 1419cdb042..ae58e62abc 100644 --- a/frontend/src/js/app/RightPane.tsx +++ b/frontend/src/js/app/RightPane.tsx @@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next"; import { useSelector } from "react-redux"; import { EditorV2 } from "../editor-v2/EditorV2"; +import { isEditorV2Enabled } from "../environment"; import { ResetableErrorBoundary } from "../error-fallback/ResetableErrorBoundary"; import FormsTab from "../external-forms/FormsTab"; import Pane from "../pane/Pane"; @@ -37,11 +38,15 @@ const RightPane = () => { label: t("rightPane.queryEditor"), tooltip: t("help.tabQueryEditor"), }, - { - key: "editorV2", - label: t("rightPane.editorV2"), - tooltip: t("help.tabEditorV2"), - }, + ...(isEditorV2Enabled + ? [ + { + key: "editorV2", + label: t("rightPane.editorV2"), + tooltip: t("help.tabEditorV2"), + }, + ] + : []), { key: "externalForms", label: t("rightPane.externalForms"), @@ -53,21 +58,23 @@ const RightPane = () => { return ( - + - - - - + {isEditorV2Enabled && ( + + + + )} + diff --git a/frontend/src/js/environment/index.ts b/frontend/src/js/environment/index.ts index 795e5a291d..6ffc0e0032 100644 --- a/frontend/src/js/environment/index.ts +++ b/frontend/src/js/environment/index.ts @@ -16,6 +16,9 @@ const apiUrlEnv = const disableLoginEnv = runtimeVar("REACT_APP_DISABLE_LOGIN") || import.meta.env.REACT_APP_DISABLE_LOGIN; +const enableEditorV2Env = + runtimeVar("REACT_APP_EDITOR_V2_ENABLE") || + import.meta.env.REACT_APP_EDITOR_V2_ENABLE; const enableIDPEnv = runtimeVar("REACT_APP_IDP_ENABLE") || import.meta.env.REACT_APP_IDP_ENABLE; const basenameEnv = @@ -32,6 +35,7 @@ export const isProduction = isProductionEnv === "production" || true; export const language = languageEnv === "de" ? "de" : "en"; export const apiUrl = apiUrlEnv || ""; export const isLoginDisabled = disableLoginEnv === "true"; +export const isEditorV2Enabled = enableEditorV2Env !== "false"; export const isIDPEnabled = enableIDPEnv === "true"; export const basename = basenameEnv || ""; export const idpUrl = idpUrlEnv || "";