From 89430ef901b98a6b2a52bd77b18c4b8a75afd7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=A4=E6=9C=88?= <17949154+yazhouio@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:57:15 +0800 Subject: [PATCH] feat: Add KUBESPHERE_EDITION constants to globals config (#4308) * feat: Add KUBESPHERE_EDITION constants to globals config Signed-off-by: yazhou * refactor: Update KUBESPHERE_EDITION constants to globals config Signed-off-by: yazhou --------- Signed-off-by: yazhou --- packages/core/src/run.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/src/run.tsx b/packages/core/src/run.tsx index 9564882edcf..502d8b734a2 100644 --- a/packages/core/src/run.tsx +++ b/packages/core/src/run.tsx @@ -8,7 +8,7 @@ import React, { Suspense } from 'react'; import ReactDOM from 'react-dom'; import { Loading } from '@kubed/components'; -import { CacheStoreProvider } from '@ks-console/shared'; +import { CacheStoreProvider, ENV } from '@ks-console/shared'; import Context from './utils/Context'; import { registerInternalExtensions } from './utils/extensions.internal'; import { registerLocalExtensions } from './utils/extensions.local'; @@ -17,10 +17,12 @@ import i18n from './utils/i18n'; import emitter from './utils/emitter'; import App from './App'; -import { isEmpty } from 'lodash'; +import { isEmpty, set } from 'lodash'; -globals.context = new Context(); +set(globals, 'config.isKsEdition', ENV.isKsEdition); +set(globals, 'config.isKseEdition', ENV.isKseEdition); +globals.context = new Context(); if (!isEmpty(globals?.ksConfig?.enabledExtensionModulesStatus)) { Object.entries(globals.ksConfig.enabledExtensionModulesStatus).forEach(([key, value]) => { if ((value as Record).annotations) {