Skip to content

Commit 860f5bf

Browse files
committed
remove legacy columns from Deployitemslist
1 parent de01cd8 commit 860f5bf

File tree

2 files changed

+3
-90
lines changed

2 files changed

+3
-90
lines changed

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

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ function DeployableItemsList<T extends DeployableItem, S extends BaseStats>({
3131

3232
const { openDeployModal } = useDeployModal();
3333

34-
// Open audit page
35-
const openAuditPage = (item: T, e: React.MouseEvent) => {
36-
e.stopPropagation();
37-
if (config.audit?.getAuditUrl) {
38-
const auditUrl = config.audit.getAuditUrl(item, environment, additionalParams);
39-
window.open(auditUrl, '_blank');
40-
}
41-
};
42-
4334
// Handle row click for navigation
4435
const handleRowClick = (item: T) => {
4536
// Skip navigation if the route is just '#' (for non-navigable items)
@@ -56,92 +47,14 @@ function DeployableItemsList<T extends DeployableItem, S extends BaseStats>({
5647
};
5748

5849
// Determine columns - Use new getColumns method if available, fall back to old approach
59-
const columns = config.getColumns ?
60-
config.getColumns({
50+
const columns = config.getColumns({
6151
environment,
6252
refreshing,
6353
onToggleManaged,
6454
openDeployModal,
6555
additionalParams
66-
}) :
67-
generateLegacyColumns();
56+
})
6857

69-
// Legacy column generation for backward compatibility
70-
function generateLegacyColumns() {
71-
let legacyColumns = [...config.columns];
72-
73-
// Add managed column if enabled
74-
if (config.enableManaged) {
75-
legacyColumns.push({
76-
title: 'Managed',
77-
key: 'managed',
78-
render: (_, record: T) => (
79-
<Space>
80-
<Tag color={record.managed ? 'green' : 'default'}>
81-
{record.managed ? 'Managed' : 'Unmanaged'}
82-
</Tag>
83-
{onToggleManaged && (
84-
<Switch
85-
size="small"
86-
checked={!!record.managed}
87-
loading={refreshing}
88-
onClick={(checked, e) => {
89-
e.stopPropagation(); // Stop row click event
90-
onToggleManaged(record, checked);
91-
}}
92-
onChange={() => {}}
93-
/>
94-
)}
95-
</Space>
96-
),
97-
});
98-
}
99-
100-
// Add deploy action column if enabled
101-
if (config.deploy?.enabled) {
102-
legacyColumns.push({
103-
title: 'Actions',
104-
key: 'actions',
105-
render: (_, record: T) => (
106-
<Space>
107-
<Tooltip title={`Deploy this ${config.singularLabel.toLowerCase()} to another environment`}>
108-
<Button
109-
icon={<CloudUploadOutlined />}
110-
onClick={(e) => {
111-
e.stopPropagation(); // Prevent row click navigation
112-
openDeployModal(record, config, environment);
113-
}}
114-
type="primary"
115-
ghost
116-
>
117-
Deploy
118-
</Button>
119-
</Tooltip>
120-
</Space>
121-
),
122-
});
123-
}
124-
125-
// Add audit column if enabled
126-
if (config.audit?.enabled) {
127-
legacyColumns.push({
128-
title: 'Audit',
129-
key: 'audit',
130-
render: (_, record: T) => (
131-
<Tooltip title={config.audit?.tooltip || `View audit logs`}>
132-
<Button
133-
icon={config.audit?.icon}
134-
onClick={(e) => openAuditPage(record, e)}
135-
>
136-
{config.audit?.label || 'Audit'}
137-
</Button>
138-
</Tooltip>
139-
),
140-
});
141-
}
142-
143-
return legacyColumns;
144-
}
14558

14659
if (loading) {
14760
return (

client/packages/lowcoder/src/pages/setting/environments/types/deployable-item.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export interface DeployableItemConfig<T extends DeployableItem, S extends BaseSt
7676
columns: ColumnType<T>[];
7777

7878
// New method to generate columns
79-
getColumns?: (params: {
79+
getColumns: (params: {
8080
environment: Environment;
8181
refreshing: boolean;
8282
onToggleManaged?: (item: T, checked: boolean) => Promise<boolean>;

0 commit comments

Comments
 (0)