Skip to content

Revamp the Environments UI and Refactor #1687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0f5440d
Add managed/unmanged filtering on column
iamfaran May 9, 2025
8e0f94b
Add search filter for the objects
iamfaran May 9, 2025
9883336
Improve the Environment Not Found UI
iamfaran May 9, 2025
b6d74d2
create a util function and add tags in Deployment Modal
iamfaran May 12, 2025
bb81f1f
fix endpoint for DS and ql
iamfaran May 14, 2025
b5647a7
updated managed endpoints
iamfaran May 15, 2025
d08218f
fix switch for objects
iamfaran May 15, 2025
c1a74fe
refactor AppsTab component
iamfaran May 15, 2025
0a1879b
Seperate DS tab
iamfaran May 15, 2025
dffc683
Seperate Queries Tab
iamfaran May 15, 2025
7410765
Add seperate workspace and usergroups tab
iamfaran May 15, 2025
6383d7f
remove unnecessary code
iamfaran May 15, 2025
199c869
add audit buttons in tabs
iamfaran May 15, 2025
f4fba8e
Update Apps UI
iamfaran May 15, 2025
c3a770e
update UI for DS and queries
iamfaran May 15, 2025
3e35b5d
update UI for workspaces tab
iamfaran May 16, 2025
548e73b
update UI user groups tab
iamfaran May 16, 2025
7f4d11f
update environment detail header
iamfaran May 16, 2025
9a8329e
create utils for different env colors
iamfaran May 16, 2025
b3799a0
update environments listing page
iamfaran May 16, 2025
933878e
add breadcrumbs component and fix tabs styling
iamfaran May 16, 2025
8880f3e
fix environments icon on listing page
iamfaran May 16, 2025
b97f125
fix refresh buttons
iamfaran May 16, 2025
f3a36d8
fix tabs rendering issue
iamfaran May 16, 2025
4b9f37d
fix refresh button for the environment listing
iamfaran May 16, 2025
2b4a718
setup for new managed-obj endpoint
iamfaran May 16, 2025
7660432
implement new managed obj endpoints
iamfaran May 16, 2025
6fcafe4
update workspace header UI
iamfaran May 17, 2025
009d6fa
fix width issue for Workspace detai page
iamfaran May 19, 2025
cec515c
add managed filter
iamfaran May 19, 2025
cc3e96a
update UI for workspace header banner
iamfaran May 19, 2025
7a311e6
fix search UI for datasources
iamfaran May 19, 2025
66365b3
add managed filter for Workspaces Tab
iamfaran May 19, 2025
359d94d
change action button positions for TABS
iamfaran May 19, 2025
cde8c0c
update breadcrumbs position
iamfaran May 19, 2025
c1c874b
test managed linked object
iamfaran May 19, 2025
23f526d
make a util function to link the managed object
iamfaran May 19, 2025
266def6
Merge branch 'ee-setup' of github.com:lowcoder-org/lowcoder into feat…
iamfaran May 19, 2025
c1d68dc
Merge branch 'ui/environments' into feat/environments
iamfaran May 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
create utils for different env colors
  • Loading branch information
iamfaran committed May 16, 2025
commit 9a8329e68e363f071229d86a8a2e0dda26ed6aa2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import WorkspacesTab from "./components/WorkspacesTab";
import UserGroupsTab from "./components/UserGroupsTab";
import EnvironmentHeader from "./components/EnvironmentHeader";
import ModernBreadcrumbs from "./components/ModernBreadcrumbs";
import { getEnvironmentTagColor } from "./utils/environmentUtils";
const { Title, Text } = Typography;
const { TabPane } = Tabs;

Expand Down Expand Up @@ -74,15 +75,7 @@ const EnvironmentDetail: React.FC = () => {
}
};

// Dropdown menu for environment actions
const actionsMenu = (
<Menu>
<Menu.Item key="edit" icon={<EditOutlined />} onClick={handleEditClick}>
Edit Environment
</Menu.Item>
{/* Add more menu items here if needed */}
</Menu>
);


if (isLoading) {
return (
Expand Down Expand Up @@ -149,18 +142,6 @@ const EnvironmentDetail: React.FC = () => {
title: environment.environmentName
}
];

// Get environment type tag color
const getEnvironmentTypeColor = () => {
switch(environment.environmentType) {
case 'production':
return 'red';
case 'testing':
return 'orange';
default:
return 'blue';
}
};

return (
<div
Expand Down Expand Up @@ -202,7 +183,7 @@ const EnvironmentDetail: React.FC = () => {
</Descriptions.Item>
<Descriptions.Item label="Environment Type">
<Tag
color={getEnvironmentTypeColor()}
color={getEnvironmentTagColor(environment.environmentType)}
style={{ borderRadius: '12px' }}
>
{environment.environmentType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Button, Tag, Typography, Row, Col } from 'antd';
import { EditOutlined, EnvironmentOutlined } from '@ant-design/icons';
import { Environment } from '../types/environment.types';
import { getEnvironmentTagColor, getEnvironmentHeaderGradient } from '../utils/environmentUtils';

const { Title, Text } = Typography;

Expand All @@ -18,36 +19,12 @@ const EnvironmentHeader: React.FC<EnvironmentHeaderProps> = ({
environment,
onEditClick
}) => {
// Determine header gradient based on environment type
const getHeaderGradient = () => {
switch(environment.environmentType) {
case 'production':
return 'linear-gradient(135deg, #f5222d 0%, #fa8c16 100%)';
case 'testing':
return 'linear-gradient(135deg, #fa8c16 0%, #faad14 100%)';
default:
return 'linear-gradient(135deg, #1890ff 0%, #096dd9 100%)';
}
};

// Get environment type tag color
const getEnvironmentTypeColor = () => {
switch(environment.environmentType) {
case 'production':
return 'red';
case 'testing':
return 'orange';
default:
return 'blue';
}
};

return (
<div
className="environment-header"
style={{
marginBottom: "24px",
background: getHeaderGradient(),
background: getEnvironmentHeaderGradient(environment.environmentType),
padding: '20px 24px',
borderRadius: '8px',
color: 'white',
Expand Down Expand Up @@ -78,7 +55,7 @@ const EnvironmentHeader: React.FC<EnvironmentHeaderProps> = ({
ID: {environment.environmentId}
</Text>
<Tag
color={getEnvironmentTypeColor()}
color={getEnvironmentTagColor(environment.environmentType)}
style={{ marginLeft: 0, borderRadius: '12px' }}
>
{environment.environmentType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* Get the appropriate color for an environment tag based on its type
* @param envType The environment type/stage (e.g. 'PROD', 'DEV', 'STAGING')
* @param envType The environment type/stage (DEV, TEST, PREPROD, PROD)
* @returns A color string to use with Ant Design's Tag component
*/
export const getEnvironmentTagColor = (envType: string | undefined): string => {
Expand All @@ -14,27 +14,52 @@ export const getEnvironmentTagColor = (envType: string | undefined): string => {
const type = envType.toUpperCase();

switch (type) {
// Production environment
case 'PROD':
return 'red'; // Red for production - indicates caution

// Pre-production environment
case 'PREPROD':
return 'orange'; // Orange for pre-production

// Test environment
case 'TEST':
return 'purple'; // Purple for test environment

// Development environment
case 'DEV':
return 'green'; // Green for development - safe to use
return 'blue'; // Blue for development

default:
return 'default'; // Default gray for unknown types
}
};

/**
* Get the appropriate background gradient for an environment based on its type
* @param envType The environment type/stage (DEV, TEST, PREPROD, PROD)
* @returns A CSS linear gradient string for the background
*/
export const getEnvironmentHeaderGradient = (envType: string | undefined): string => {
if (!envType) return 'linear-gradient(135deg, #1890ff 0%, #096dd9 100%)';

// Normalize to uppercase for consistent comparison
const type = envType.toUpperCase();

switch (type) {
case 'PROD':
return 'linear-gradient(135deg, #f5222d 0%, #fa8c16 100%)';

case 'PREPROD':
return 'linear-gradient(135deg, #fa8c16 0%, #faad14 100%)';

case 'TEST':
return 'linear-gradient(135deg, #722ed1 0%, #b37feb 100%)';

case 'DEV':
return 'linear-gradient(135deg, #1890ff 0%, #096dd9 100%)';

default:
return 'linear-gradient(135deg, #1890ff 0%, #096dd9 100%)';
}
};

/**
* Format an environment type for display
* @param envType The environment type string
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy