Skip to content

Commit fe7e3c1

Browse files
committed
add click on workspace list
1 parent 2d6ec6b commit fe7e3c1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

client/packages/lowcoder/src/pages/setting/environments/EnvironmentDetail.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ const EnvironmentDetail: React.FC = () => {
281281
workspaces={workspaces}
282282
loading={workspacesLoading && !workspacesError}
283283
error={workspacesError}
284+
environmentId={environment.environmentId}
284285
/>
285286
</Card>
286287
</TabPane>

client/packages/lowcoder/src/pages/setting/environments/components/WorkspacesList.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import React from 'react';
22
import { Table, Tag, Empty, Spin } from 'antd';
33
import { Workspace } from '../types/workspace.types';
4+
import history from '@lowcoder-ee/util/history';
5+
import { buildEnvironmentWorkspaceId } from '@lowcoder-ee/constants/routesURL';
46

57
interface WorkspacesListProps {
68
workspaces: Workspace[];
79
loading: boolean;
810
error?: string | null;
11+
environmentId: string
912
}
1013

1114
/**
@@ -15,6 +18,7 @@ const WorkspacesList: React.FC<WorkspacesListProps> = ({
1518
workspaces,
1619
loading,
1720
error,
21+
environmentId
1822
}) => {
1923
// Format timestamp to date string
2024
const formatDate = (timestamp?: number): string => {
@@ -23,6 +27,10 @@ const WorkspacesList: React.FC<WorkspacesListProps> = ({
2327
return `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;
2428
};
2529

30+
const handleRowClick = (workspace: Workspace) => {
31+
history.push(`${buildEnvironmentWorkspaceId(environmentId, workspace.id)}`);
32+
};
33+
2634
// Table columns definition
2735
const columns = [
2836
{
@@ -87,6 +95,10 @@ const WorkspacesList: React.FC<WorkspacesListProps> = ({
8795
rowKey="id"
8896
pagination={{ pageSize: 10 }}
8997
size="middle"
98+
onRow={(record) => ({
99+
onClick: () => handleRowClick(record),
100+
style: { cursor: 'pointer' } // Add pointer cursor to indicate clickable rows
101+
})}
90102
/>
91103
);
92104
};

0 commit comments

Comments
 (0)