@@ -31,15 +31,6 @@ function DeployableItemsList<T extends DeployableItem, S extends BaseStats>({
31
31
32
32
const { openDeployModal } = useDeployModal ( ) ;
33
33
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
-
43
34
// Handle row click for navigation
44
35
const handleRowClick = ( item : T ) => {
45
36
// Skip navigation if the route is just '#' (for non-navigable items)
@@ -56,92 +47,14 @@ function DeployableItemsList<T extends DeployableItem, S extends BaseStats>({
56
47
} ;
57
48
58
49
// 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 ( {
61
51
environment,
62
52
refreshing,
63
53
onToggleManaged,
64
54
openDeployModal,
65
55
additionalParams
66
- } ) :
67
- generateLegacyColumns ( ) ;
56
+ } )
68
57
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
- }
145
58
146
59
if ( loading ) {
147
60
return (
0 commit comments