- Notifications
You must be signed in to change notification settings - Fork254
Environments UI Screens#1606
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
69 commits Select commitHold shift + click to select a range
349fdf1
Add Env Listing Page Structure
iamfarancc015e6
Add routing structure for Environments
iamfaran27451ab
Add Environments Table component
iamfaran4be0dad
Add Env Detail Page
iamfaran2e88e9f
Create useEnvironmentDetail Hook and add in Detail Page
iamfaraneb401ee
add workspaces list
iamfaran3326214
fix Auth headers
iamfaranc66a048
Add user groups in Env Detail Page
iamfaran2d6ec6b
setup workspace detail page
iamfaranfe7e3c1
add click on workspace list
iamfarand39b6a0
fix filtering of apps
iamfaranf5987e2
setup data sources structure
iamfaran8c11ef5
fix data source error
iamfarand9f7dd5
Add Environment Context
iamfaran46911b0
Add Workspace and UserGroup hooks
iamfaran9f2c181
Add useWorkspace hook
iamfaranbf39d50
refactor workspace detail page
iamfaran204890a
remove unused files
iamfaran058db37
add enterprise managed workspaces hook
iamfaran1348756
fix managed workspaces endpoint
iamfaranc96b993
add utility function for merge workspaces
iamfaran19c99c7
add managed/unmanged workspaces
iamfaran82ce3c3
add app enterprise methods
iamfaran06b3822
add managed/unmaged for apps
iamfarana758d7e
Add environments list in Context
iamfarance9b5ba
Move Workspace/User-Group tabs to the seperate component
iamfarana9fbce8
remove button from user-groups
iamfaranaa27421
remove unnecessary code from the Environment Detail page
iamfaran2690ddf
add useWorkspaces hook that returns merged workspaces
iamfaranaafb5f5
remove unnecessary imports
iamfaran0d87a21
Make a seperate AppsTab components and unified managed/unmanged apps
iamfaran4280e67
add deploy modal
iamfarand8ed715
add datasource functions
iamfarana520554
fix data sources tab
iamfaran10b7140
test generic approach
iamfaran23b8462
add user groups tab generic
iamfaraned1f8da
add generic tab for apps
iamfaran2934db2
setup data sources generic
iamfaranb704492
fix data source payload
iamfaranf2dd6a5
add query services
iamfaranb4b8c1c
add query service tab
iamfaran83973af
add DeployModal in context
iamfaran8527dd9
Add deployment config for Datasource
iamfaran17bb62a
Add deployment config for Query Library
iamfaran5f393b0
wrap the provider
iamfarand5035d6
Test update environment
iamfaranc1ab2b4
add edit functionality environment
iamfaran221be50
remove edit from environments table
iamfaran1b37846
Add managed tag in the header of workspace detail page
iamfaran6713592
fix environments table width
iamfaran4251c75
fix tables UI
iamfaranaac3868
fix data sources tab
iamfaran04c1a76
add audit link in environments table
iamfaran3ad52c0
add audit logs
iamfaran29c2ae2
Fixed workspace detail page header
iamfarande01cd8
move all columns to config
iamfaran860f5bf
remove legacy columns from Deployitemslist
iamfarancae995a
move all columns to config
iamfaran7a6626c
disable button unless managed
iamfaran72cfeab
add managed/unmanged tags in workspace table
iamfaranb40147f
fix breadcrumbs
iamfarande46a00
fix back links
iamfaran0c802d0
show tooltip on the workspace detail page
iamfaranfeb158c
fix error flicker
iamfaran0f89b5a
fix responsiveness detail page
iamfarane15f9b6
fix tabs UI
iamfaran6c04714
replace edit dropdown with button
iamfarana3dac7e
remove unused files/code
iamfaranfa725fa
Merge branch 'ee-setup' into environments-only
FalkWolskyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletionsclient/packages/lowcoder/src/constants/routesURL.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
249 changes: 249 additions & 0 deletionsclient/packages/lowcoder/src/pages/setting/environments/EnvironmentDetail.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
import React, {useState} from "react"; | ||
import { useParams } from "react-router-dom"; | ||
import { | ||
Spin, | ||
Typography, | ||
Card, | ||
Tag, | ||
Tabs, | ||
Alert, | ||
Descriptions, | ||
Dropdown, | ||
Menu, | ||
Button, | ||
Breadcrumb, | ||
} from "antd"; | ||
import { | ||
ReloadOutlined, | ||
LinkOutlined, | ||
ClusterOutlined, | ||
TeamOutlined, | ||
UserOutlined, | ||
SyncOutlined, | ||
EditOutlined, | ||
EllipsisOutlined, | ||
MoreOutlined, | ||
HomeOutlined | ||
} from "@ant-design/icons"; | ||
import { useEnvironmentContext } from "./context/EnvironmentContext"; | ||
import { workspaceConfig } from "./config/workspace.config"; | ||
import { userGroupsConfig } from "./config/usergroups.config"; | ||
import DeployableItemsTab from "./components/DeployableItemsTab"; | ||
import EditEnvironmentModal from "./components/EditEnvironmentModal"; | ||
import { Environment } from "./types/environment.types"; | ||
import history from "@lowcoder-ee/util/history"; | ||
const { Title, Text } = Typography; | ||
const { TabPane } = Tabs; | ||
/** | ||
* Environment Detail Page Component | ||
* Shows detailed information about a specific environment | ||
*/ | ||
const EnvironmentDetail: React.FC = () => { | ||
// Get environment ID from URL params | ||
const { | ||
environment, | ||
isLoadingEnvironment, | ||
error, | ||
updateEnvironmentData | ||
} = useEnvironmentContext(); | ||
const [isEditModalVisible, setIsEditModalVisible] = useState(false); | ||
const [isUpdating, setIsUpdating] = useState(false); | ||
// Handle edit menu item click | ||
const handleEditClick = () => { | ||
setIsEditModalVisible(true); | ||
}; | ||
// Handle modal close | ||
const handleCloseModal = () => { | ||
setIsEditModalVisible(false); | ||
}; | ||
// Handle save environment | ||
const handleSaveEnvironment = async (environmentId: string, data: Partial<Environment>) => { | ||
setIsUpdating(true); | ||
try { | ||
await updateEnvironmentData(environmentId, data); | ||
handleCloseModal(); | ||
} catch (error) { | ||
console.error('Failed to update environment:', error); | ||
} finally { | ||
setIsUpdating(false); | ||
} | ||
}; | ||
// 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> | ||
); | ||
debugger | ||
if (isLoadingEnvironment) { | ||
return ( | ||
<div style={{ display: 'flex', justifyContent: 'center', padding: '50px' }}> | ||
<Spin size="large" tip="Loading environment..." /> | ||
</div> | ||
); | ||
} | ||
if (error || !environment) { | ||
return ( | ||
<Alert | ||
message="Error loading environment" | ||
description={error || "Environment not found"} | ||
type="error" | ||
showIcon | ||
/> | ||
); | ||
} | ||
return ( | ||
<div | ||
className="environment-detail-container" | ||
style={{ padding: "24px", flex: 1 }} | ||
> | ||
<Breadcrumb style={{ marginBottom: "16px" }}> | ||
<Breadcrumb.Item> | ||
<span | ||
style={{ cursor: "pointer" }} | ||
onClick={() => history.push("/setting/environments")} | ||
> | ||
<HomeOutlined /> Environments | ||
</span> | ||
</Breadcrumb.Item> | ||
<Breadcrumb.Item>{environment.environmentName}</Breadcrumb.Item> | ||
</Breadcrumb> | ||
{/* Header with environment name and controls */} | ||
{/* Header with environment name and controls */} | ||
<div | ||
className="environment-header" | ||
style={{ | ||
marginBottom: "24px", | ||
display: "flex", | ||
justifyContent: "space-between", | ||
alignItems: "flex-start", | ||
flexWrap: "wrap", | ||
gap: "16px", | ||
}} | ||
> | ||
<div style={{ flex: "1 1 auto", minWidth: "200px" }}> | ||
<Title level={3} style={{ margin: 0, wordBreak: "break-word" }}> | ||
{environment.environmentName || "Unnamed Environment"} | ||
</Title> | ||
<Text type="secondary">ID: {environment.environmentId}</Text> | ||
</div> | ||
<div style={{ flexShrink: 0 }}> | ||
<Button | ||
icon={<EditOutlined />} | ||
onClick={handleEditClick} | ||
type="primary" | ||
> | ||
Edit Environment | ||
</Button> | ||
</div> | ||
</div> | ||
{/* Basic Environment Information Card - improved responsiveness */} | ||
<Card | ||
title="Environment Overview" | ||
style={{ marginBottom: "24px" }} | ||
extra={environment.isMaster && <Tag color="green">Master</Tag>} | ||
> | ||
<Descriptions | ||
bordered | ||
layout="vertical" // Change to vertical layout on smaller screens | ||
column={{ xxl: 4, xl: 3, lg: 3, md: 2, sm: 1, xs: 1 }} | ||
size="small" // Use smaller size on mobile | ||
> | ||
<Descriptions.Item label="Domain"> | ||
{environment.environmentFrontendUrl ? ( | ||
<a | ||
href={environment.environmentFrontendUrl} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{environment.environmentFrontendUrl} <LinkOutlined /> | ||
</a> | ||
) : ( | ||
"No domain set" | ||
)} | ||
</Descriptions.Item> | ||
<Descriptions.Item label="Environment Type"> | ||
<Tag | ||
color={ | ||
environment.environmentType === "production" | ||
? "red" | ||
: environment.environmentType === "testing" | ||
? "orange" | ||
: "blue" | ||
} | ||
> | ||
{environment.environmentType} | ||
</Tag> | ||
</Descriptions.Item> | ||
<Descriptions.Item label="API Key Status"> | ||
{environment.environmentApikey ? ( | ||
<Tag color="green">Configured</Tag> | ||
) : ( | ||
<Tag color="red">Not Configured</Tag> | ||
)} | ||
</Descriptions.Item> | ||
<Descriptions.Item label="Master Environment"> | ||
{environment.isMaster ? "Yes" : "No"} | ||
</Descriptions.Item> | ||
</Descriptions> | ||
</Card> | ||
{/* Tabs for Workspaces and User Groups */} | ||
<Tabs defaultActiveKey="workspaces"> | ||
<TabPane tab="Workspaces" key="workspaces"> | ||
{/* Using our new generic component with the workspace config */} | ||
<DeployableItemsTab | ||
environment={environment} | ||
config={workspaceConfig} | ||
title="Workspaces in this Environment" | ||
/> | ||
</TabPane> | ||
<TabPane | ||
tab={ | ||
<span> | ||
<TeamOutlined /> User Groups | ||
</span> | ||
} | ||
key="userGroups" | ||
> | ||
{/* Using our new generic component with the user group config */} | ||
<DeployableItemsTab | ||
environment={environment} | ||
config={userGroupsConfig} | ||
title="User Groups in this Environment" | ||
/> | ||
</TabPane> | ||
</Tabs> | ||
{/* Edit Environment Modal */} | ||
{environment && ( | ||
<EditEnvironmentModal | ||
visible={isEditModalVisible} | ||
environment={environment} | ||
onClose={handleCloseModal} | ||
onSave={handleSaveEnvironment} | ||
loading={isUpdating} | ||
/> | ||
)} | ||
</div> | ||
); | ||
}; | ||
export default EnvironmentDetail; |
37 changes: 34 additions & 3 deletionsclient/packages/lowcoder/src/pages/setting/environments/Environments.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
import React from "react"; | ||
import { Switch, Route } from "react-router-dom"; | ||
import { EnvironmentProvider } from "./context/EnvironmentContext"; | ||
import EnvironmentsList from "./EnvironmentsList"; | ||
import EnvironmentScopedRoutes from "./components/EnvironmentScopedRoutes"; | ||
import { | ||
ENVIRONMENT_SETTING, | ||
ENVIRONMENT_DETAIL | ||
} from "@lowcoder-ee/constants/routesURL"; | ||
/** | ||
* Top-level Environments component that wraps all environment-related routes | ||
* with the EnvironmentProvider for shared state management | ||
*/ | ||
const Environments: React.FC = () => { | ||
return ( | ||
<EnvironmentProvider> | ||
<Switch> | ||
{/* Route that shows the list of environments */} | ||
<Route exact path={ENVIRONMENT_SETTING}> | ||
<EnvironmentsList /> | ||
</Route> | ||
{/* All other routes under /environments/:envId */} | ||
<Route path={ENVIRONMENT_DETAIL}> | ||
<EnvironmentScopedRoutes /> | ||
</Route> | ||
</Switch> | ||
</EnvironmentProvider> | ||
); | ||
}; | ||
export default Environments; |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.