From a04045b13f45116e7fd353947c23ef353983e61e Mon Sep 17 00:00:00 2001 From: Hardik Patel Date: Tue, 5 Mar 2024 16:05:49 +0100 Subject: [PATCH] Fix for env variables --- config.js | 5 +++++ .../templates/configjs-configmap.yaml | 12 +++++------- index.html | 2 ++ src/components/ChatWindow/ChatWindow.tsx | 3 +-- src/components/PluginSelector/PluginSelector.tsx | 3 +-- src/config.js | 6 ------ src/context/ThreadContext.tsx | 3 +-- src/global.d.ts | 6 ++++++ src/index.tsx | 4 ++-- 9 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 config.js delete mode 100644 src/config.js create mode 100644 src/global.d.ts diff --git a/config.js b/config.js new file mode 100644 index 0000000..73d9ed2 --- /dev/null +++ b/config.js @@ -0,0 +1,5 @@ +window.config = { + VITE_API_BASE_URL: "http://localhost:8080", + VITE_GOOGLE_CLIENT_ID: + "779787791084-sf0tjf22s5cl3odf9sjg6rch0if9c0qq.apps.googleusercontent.com", +}; diff --git a/helm-charts/infini-connect-ui/templates/configjs-configmap.yaml b/helm-charts/infini-connect-ui/templates/configjs-configmap.yaml index 8fc2f16..603ca3f 100644 --- a/helm-charts/infini-connect-ui/templates/configjs-configmap.yaml +++ b/helm-charts/infini-connect-ui/templates/configjs-configmap.yaml @@ -5,10 +5,8 @@ metadata: namespace: {{ .Values.namespace }} data: config.js: | - var config = (() => { - return { - {{- range $key, $value := .Values.configMapValues }} - {{ $key | quote}}: {{ $value | quote }}, - {{- end }} - }; - })(); + window.config = { + {{- range $key, $value := .Values.configMapValues }} + {{ $key | quote}}: {{ $value | quote }}, + {{- end }} + }; diff --git a/index.html b/index.html index d950aa0..051d90e 100644 --- a/index.html +++ b/index.html @@ -17,6 +17,8 @@
+ +