Content-Length: 4301 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1723.patch
thub.com
From 77ceab5b84b8f677722e24b4cd4eebb26ad5174e Mon Sep 17 00:00:00 2001
From: Faran Javed
Date: Thu, 29 May 2025 18:29:37 +0500
Subject: [PATCH] Fix made env type option in frontend
---
.../src/pages/setting/environments/EnvironmentsList.tsx | 4 ++--
.../setting/environments/components/EnvironmentsTable.tsx | 2 +-
.../src/pages/setting/environments/types/environment.types.ts | 2 +-
.../src/pages/setting/environments/utils/environmentUtils.ts | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/client/packages/lowcoder/src/pages/setting/environments/EnvironmentsList.tsx b/client/packages/lowcoder/src/pages/setting/environments/EnvironmentsList.tsx
index c6f739c51..7b041b81f 100644
--- a/client/packages/lowcoder/src/pages/setting/environments/EnvironmentsList.tsx
+++ b/client/packages/lowcoder/src/pages/setting/environments/EnvironmentsList.tsx
@@ -82,7 +82,7 @@ const EnvironmentsList: React.FC = () => {
// Calculate environment type statistics
const environmentStats = React.useMemo(() => {
const stats = environments.reduce((acc, env) => {
- const type = env.environmentType.toUpperCase();
+ const type = env.environmentType?.toUpperCase() || 'TEST';
acc[type] = (acc[type] || 0) + 1;
return acc;
}, {} as Record);
@@ -145,7 +145,7 @@ const EnvironmentsList: React.FC = () => {
(env.environmentName || "").toLowerCase().includes(searchLower) ||
(env.environmentFrontendUrl || "").toLowerCase().includes(searchLower) ||
env.environmentId.toLowerCase().includes(searchLower) ||
- env.environmentType.toLowerCase().includes(searchLower)
+ (env.environmentType || "").toLowerCase().includes(searchLower)
);
}).sort((a, b) => {
// Sort by license status: licensed environments first
diff --git a/client/packages/lowcoder/src/pages/setting/environments/components/EnvironmentsTable.tsx b/client/packages/lowcoder/src/pages/setting/environments/components/EnvironmentsTable.tsx
index 0a1e9d98e..509cb509a 100644
--- a/client/packages/lowcoder/src/pages/setting/environments/components/EnvironmentsTable.tsx
+++ b/client/packages/lowcoder/src/pages/setting/environments/components/EnvironmentsTable.tsx
@@ -152,7 +152,7 @@ const EnvironmentsTable: React.FC = ({