Skip to content

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 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 69 commits into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
349fdf1
Add Env Listing Page Structure
iamfaran Apr 10, 2025
cc015e6
Add routing structure for Environments
iamfaran Apr 10, 2025
27451ab
Add Environments Table component
iamfaran Apr 10, 2025
4be0dad
Add Env Detail Page
iamfaran Apr 10, 2025
2e88e9f
Create useEnvironmentDetail Hook and add in Detail Page
iamfaran Apr 10, 2025
eb401ee
add workspaces list
iamfaran Apr 10, 2025
3326214
fix Auth headers
iamfaran Apr 10, 2025
c66a048
Add user groups in Env Detail Page
iamfaran Apr 10, 2025
2d6ec6b
setup workspace detail page
iamfaran Apr 10, 2025
fe7e3c1
add click on workspace list
iamfaran Apr 10, 2025
d39b6a0
fix filtering of apps
iamfaran Apr 10, 2025
f5987e2
setup data sources structure
iamfaran Apr 10, 2025
8c11ef5
fix data source error
iamfaran Apr 10, 2025
d9f7dd5
Add Environment Context
iamfaran Apr 10, 2025
46911b0
Add Workspace and UserGroup hooks
iamfaran Apr 10, 2025
9f2c181
Add useWorkspace hook
iamfaran Apr 10, 2025
bf39d50
refactor workspace detail page
iamfaran Apr 10, 2025
204890a
remove unused files
iamfaran Apr 11, 2025
058db37
add enterprise managed workspaces hook
iamfaran Apr 11, 2025
1348756
fix managed workspaces endpoint
iamfaran Apr 11, 2025
c96b993
add utility function for merge workspaces
iamfaran Apr 11, 2025
19c99c7
add managed/unmanged workspaces
iamfaran Apr 11, 2025
82ce3c3
add app enterprise methods
iamfaran Apr 11, 2025
06b3822
add managed/unmaged for apps
iamfaran Apr 11, 2025
a758d7e
Add environments list in Context
iamfaran Apr 14, 2025
ce9b5ba
Move Workspace/User-Group tabs to the seperate component
iamfaran Apr 14, 2025
a9fbce8
remove button from user-groups
iamfaran Apr 14, 2025
aa27421
remove unnecessary code from the Environment Detail page
iamfaran Apr 14, 2025
2690ddf
add useWorkspaces hook that returns merged workspaces
iamfaran Apr 14, 2025
aafb5f5
remove unnecessary imports
iamfaran Apr 14, 2025
0d87a21
Make a seperate AppsTab components and unified managed/unmanged apps
iamfaran Apr 14, 2025
4280e67
add deploy modal
iamfaran Apr 14, 2025
d8ed715
add datasource functions
iamfaran Apr 14, 2025
a520554
fix data sources tab
iamfaran Apr 14, 2025
10b7140
test generic approach
iamfaran Apr 15, 2025
23b8462
add user groups tab generic
iamfaran Apr 15, 2025
ed1f8da
add generic tab for apps
iamfaran Apr 15, 2025
2934db2
setup data sources generic
iamfaran Apr 15, 2025
b704492
fix data source payload
iamfaran Apr 15, 2025
f2dd6a5
add query services
iamfaran Apr 15, 2025
b4b8c1c
add query service tab
iamfaran Apr 15, 2025
83973af
add DeployModal in context
iamfaran Apr 15, 2025
8527dd9
Add deployment config for Datasource
iamfaran Apr 15, 2025
17bb62a
Add deployment config for Query Library
iamfaran Apr 15, 2025
5f393b0
wrap the provider
iamfaran Apr 16, 2025
d5035d6
Test update environment
iamfaran Apr 16, 2025
c1ab2b4
add edit functionality environment
iamfaran Apr 16, 2025
221be50
remove edit from environments table
iamfaran Apr 16, 2025
1b37846
Add managed tag in the header of workspace detail page
iamfaran Apr 16, 2025
6713592
fix environments table width
iamfaran Apr 16, 2025
4251c75
fix tables UI
iamfaran Apr 16, 2025
aac3868
fix data sources tab
iamfaran Apr 16, 2025
04c1a76
add audit link in environments table
iamfaran Apr 16, 2025
3ad52c0
add audit logs
iamfaran Apr 16, 2025
29c2ae2
Fixed workspace detail page header
iamfaran Apr 16, 2025
de01cd8
move all columns to config
iamfaran Apr 16, 2025
860f5bf
remove legacy columns from Deployitemslist
iamfaran Apr 16, 2025
cae995a
move all columns to config
iamfaran Apr 16, 2025
7a6626c
disable button unless managed
iamfaran Apr 17, 2025
72cfeab
add managed/unmanged tags in workspace table
iamfaran Apr 17, 2025
b40147f
fix breadcrumbs
iamfaran Apr 17, 2025
de46a00
fix back links
iamfaran Apr 17, 2025
0c802d0
show tooltip on the workspace detail page
iamfaran Apr 17, 2025
feb158c
fix error flicker
iamfaran Apr 17, 2025
0f89b5a
fix responsiveness detail page
iamfaran Apr 17, 2025
e15f9b6
fix tabs UI
iamfaran Apr 17, 2025
6c04714
replace edit dropdown with button
iamfaran Apr 17, 2025
a3dac7e
remove unused files/code
iamfaran Apr 18, 2025
fa725fa
Merge branch 'ee-setup' into environments-only
FalkWolsky Apr 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
add workspaces list
  • Loading branch information
iamfaran committed Apr 11, 2025
commit eb401ee94d95126940d0878256851a33d83bf5cb
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import React from "react";
import { useParams } from "react-router-dom";
import {
Spin,
Typography,
Card,
Row,
Col,
Tag,
Tabs,
Alert,
Descriptions,
import {
Spin,
Typography,
Card,
Row,
Col,
Tag,
Tabs,
Alert,
Descriptions,
Button,
Statistic
Statistic,
Divider,
} from "antd";
import {
ReloadOutlined,
LinkOutlined,
ClusterOutlined,
TeamOutlined,
UserOutlined
import {
ReloadOutlined,
LinkOutlined,
ClusterOutlined,
TeamOutlined,
UserOutlined,
SyncOutlined,
} from "@ant-design/icons";
import { useEnvironmentDetail } from './hooks/useEnvironmentDetail';
import { useEnvironmentDetail } from "./hooks/useEnvironmentDetail";
import WorkspacesList from "./components/WorkspacesList";

const { Title, Text } = Typography;
const { TabPane } = Tabs;
Expand All @@ -32,19 +35,37 @@ const { TabPane } = Tabs;
const EnvironmentDetail: React.FC = () => {
// Get environment ID from URL params
const { environmentId: id } = useParams<{ environmentId: string }>();


// Use the custom hook to handle data fetching and state management
// Use the custom hook to handle data fetching and state management
const { environment, loading, error, refresh } = useEnvironmentDetail(id);

const {
environment,
loading,
error,
refresh,
workspaces,
workspacesLoading,
workspacesError,
refreshWorkspaces,
workspaceStats,
} = useEnvironmentDetail(id);
// If loading, show spinner
if (loading) {
return (
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%', padding: '50px' }}>
<div
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
height: "100%",
padding: "50px",
}}
>
<Spin size="large" tip="Loading environment details..." />
</div>
);
}

// If error, show error message
if (error) {
return (
Expand All @@ -53,7 +74,7 @@ const EnvironmentDetail: React.FC = () => {
description={error}
type="error"
showIcon
style={{ margin: '24px' }}
style={{ margin: "24px" }}
action={
<Button type="primary" icon={<ReloadOutlined />} onClick={refresh}>
Try Again
Expand All @@ -62,7 +83,7 @@ const EnvironmentDetail: React.FC = () => {
/>
);
}

// If no environment data, show message
if (!environment) {
return (
Expand All @@ -71,122 +92,219 @@ const EnvironmentDetail: React.FC = () => {
description="The requested environment could not be found"
type="warning"
showIcon
style={{ margin: '24px' }}
style={{ margin: "24px" }}
/>
);
}

return (
<div className="environment-detail-container" style={{ padding: '24px' }}>
<div className="environment-detail-container" style={{ padding: "24px" }}>
{/* Header with environment name and controls */}
<div className="environment-header" style={{ marginBottom: '24px', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div
className="environment-header"
style={{
marginBottom: "24px",
display: "flex",
justifyContent: "space-between",
alignItems: "center",
}}
>
<div>
<Title level={3}>{environment.environmentName || 'Unnamed Environment'}</Title>
<Title level={3}>
{environment.environmentName || "Unnamed Environment"}
</Title>
<Text type="secondary">ID: {environment.environmentId}</Text>
</div>
<Button
icon={<ReloadOutlined />}
onClick={refresh}
>
<Button icon={<ReloadOutlined />} onClick={refresh}>
Refresh
</Button>
</div>

{/* Basic Environment Information Card */}
<Card
title="Environment Overview"
style={{ marginBottom: '24px' }}
<Card
title="Environment Overview"
style={{ marginBottom: "24px" }}
extra={environment.isMaster && <Tag color="green">Master</Tag>}
>
<Descriptions bordered column={{ xxl: 4, xl: 3, lg: 3, md: 2, sm: 1, xs: 1 }}>
<Descriptions
bordered
column={{ xxl: 4, xl: 3, lg: 3, md: 2, sm: 1, xs: 1 }}
>
<Descriptions.Item label="Domain">
{environment.environmentFrontendUrl ? (
<a href={environment.environmentFrontendUrl} target="_blank" rel="noopener noreferrer">
<a
href={environment.environmentFrontendUrl}
target="_blank"
rel="noopener noreferrer"
>
{environment.environmentFrontendUrl} <LinkOutlined />
</a>
) : (
'No domain set'
"No domain set"
)}
</Descriptions.Item>
<Descriptions.Item label="Environment Type">
<Tag color={environment.environmentType === 'production' ? 'red' : environment.environmentType === 'testing' ? 'orange' : 'blue'}>
<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>}
{environment.environmentApikey ? (
<Tag color="green">Configured</Tag>
) : (
<Tag color="red">Not Configured</Tag>
)}
</Descriptions.Item>
<Descriptions.Item label="Master Environment">
{environment.isMaster ? 'Yes' : 'No'}
{environment.isMaster ? "Yes" : "No"}
</Descriptions.Item>
</Descriptions>
</Card>

{/* Tabs for Workspaces and User Groups */}
<Tabs defaultActiveKey="workspaces">
<TabPane
tab={<span><ClusterOutlined /> Workspaces</span>}
<TabPane
tab={
<span>
<ClusterOutlined /> Workspaces
</span>
}
key="workspaces"
>
<Card>
{/* Placeholder for workspace statistics */}
<Row gutter={16} style={{ marginBottom: '24px' }}>
{/* Header with refresh button */}
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
marginBottom: "16px",
}}
>
<Title level={5}>Workspaces in this Environment</Title>
<Button
icon={<SyncOutlined />}
onClick={refreshWorkspaces}
size="small"
loading={workspacesLoading}
>
Refresh Workspaces
</Button>
</div>

{/* Workspace Statistics */}
<Row gutter={16} style={{ marginBottom: "24px" }}>
<Col span={8}>
<Statistic
title="Total Workspaces"
value={0}
prefix={<ClusterOutlined />}
<Statistic
title="Total Workspaces"
value={workspaceStats.total}
prefix={<ClusterOutlined />}
/>
</Col>
<Col span={8}>
<Statistic
title="Managed Workspaces"
value={0}
prefix={<ClusterOutlined />}
<Statistic
title="Managed Workspaces"
value={workspaceStats.managed}
prefix={<ClusterOutlined />}
/>
</Col>
<Col span={8}>
<Statistic
title="Unmanaged Workspaces"
value={0}
prefix={<ClusterOutlined />}
<Statistic
title="Unmanaged Workspaces"
value={workspaceStats.unmanaged}
prefix={<ClusterOutlined />}
/>
</Col>
</Row>

{/* Placeholder for workspace list */}
<Alert
message="Workspace Information"
description="Workspace data will be implemented in the next phase. This section will display workspace details and management options."
type="info"
showIcon

<Divider style={{ margin: "16px 0" }} />

{/* Show error if workspace loading failed */}
{workspacesError && (
<Alert
message="Error loading workspaces"
description={workspacesError}
type="error"
showIcon
style={{ marginBottom: "16px" }}
action={
workspacesError.includes("No API key configured") ? (
<Button size="small" type="primary" disabled>
API Key Required
</Button>
) : (
<Button
size="small"
type="primary"
onClick={refreshWorkspaces}
>
Try Again
</Button>
)
}
/>
)}

{(!environment.environmentApikey ||
!environment.environmentApiServiceUrl) &&
!workspacesError && (
<Alert
message="Configuration Issue"
description={
!environment.environmentApikey
? "An API key is required to fetch workspaces for this environment."
: "An API service URL is required to fetch workspaces for this environment."
}
type="warning"
showIcon
style={{ marginBottom: "16px" }}
/>
)}

{/* Workspaces List */}
<WorkspacesList
workspaces={workspaces}
loading={workspacesLoading && !workspacesError}
error={workspacesError}
/>
</Card>
</TabPane>

<TabPane
tab={<span><TeamOutlined /> User Groups</span>}

<TabPane
tab={
<span>
<TeamOutlined /> User Groups
</span>
}
key="userGroups"
>
<Card>
{/* Placeholder for user group statistics */}
<Row gutter={16} style={{ marginBottom: '24px' }}>
<Row gutter={16} style={{ marginBottom: "24px" }}>
<Col span={8}>
<Statistic
title="Total User Groups"
value={0}
prefix={<TeamOutlined />}
<Statistic
title="Total User Groups"
value={0}
prefix={<TeamOutlined />}
/>
</Col>
<Col span={8}>
<Statistic
title="Total Users"
value={0}
prefix={<UserOutlined />}
<Statistic
title="Total Users"
value={0}
prefix={<UserOutlined />}
/>
</Col>
</Row>

{/* Placeholder for user group list */}
<Alert
message="User Group Information"
Expand Down
Loading