7
7
Button ,
8
8
ButtonStyleType ,
9
9
ButtonVariantType ,
10
+ ClusterStatusType ,
10
11
ComponentSizeType ,
11
12
Drawer ,
12
13
FiltersTypeEnum ,
@@ -39,6 +40,27 @@ import EditClusterDrawerContent from './EditClusterDrawerContent'
39
40
const HibernationRulesModal = importComponentFromFELibrary ( 'HibernationRulesModal' , null , 'function' )
40
41
const VirtualClusterForm = importComponentFromFELibrary ( 'VirtualClusterForm' , null , 'function' )
41
42
43
+ export const ClusterIconWithStatus = ( {
44
+ clusterStatus,
45
+ isVirtualCluster,
46
+ } : {
47
+ clusterStatus : ClusterStatusType
48
+ isVirtualCluster : boolean
49
+ } ) => {
50
+ const statusColor = getBulletColorAccToStatus ( clusterStatus )
51
+ return (
52
+ < span className = "dc__position-rel dc__overflow-hidden icon-dim-24" >
53
+ < Icon name = "ic-bg-cluster" color = { null } size = { 24 } />
54
+ { ! isVirtualCluster && (
55
+ < span
56
+ className = { `dc__position-abs dc__top-16 icon-dim-10 dc__border-radius-50-per dc__right-2--neg ${ statusColor } ` }
57
+ style = { { border : '2px solid var(--N0)' } }
58
+ />
59
+ ) }
60
+ </ span >
61
+ )
62
+ }
63
+
42
64
export const ClusterListCellComponent : FunctionComponent <
43
65
TableCellComponentProps < ClusterRowData , FiltersTypeEnum . STATE , { } >
44
66
> = ( {
@@ -83,6 +105,9 @@ export const ClusterListCellComponent: FunctionComponent<
83
105
} )
84
106
break
85
107
case 'delete-cluster' :
108
+ if ( clusterId === DEFAULT_CLUSTER_ID ) {
109
+ break
110
+ }
86
111
push ( {
87
112
pathname : generatePath ( `${ URLS . GLOBAL_CONFIG_CLUSTER } /${ URLS . DELETE_CLUSTER } /:clusterId` , {
88
113
clusterId,
@@ -95,18 +120,12 @@ export const ClusterListCellComponent: FunctionComponent<
95
120
}
96
121
}
97
122
98
- const statusColor = getBulletColorAccToStatus ( status )
99
-
100
123
switch ( field ) {
101
124
case ClusterListFields . ICON :
102
125
return (
103
- < span className = "flex py-8 dc__position-rel dc__overflow-hidden" >
104
- < Icon name = "ic-bg-cluster" color = { null } size = { 24 } />
105
- < span
106
- className = { `dc__position-abs icon-dim-10 dc__border-radius-50-per dc__right-2--neg dc__bottom-7 ${ statusColor } ` }
107
- style = { { border : '2px solid var(--N0)' } }
108
- />
109
- </ span >
126
+ < div className = "flex left py-10" >
127
+ < ClusterIconWithStatus clusterStatus = { status } isVirtualCluster = { isVirtualCluster } />
128
+ </ div >
110
129
)
111
130
case ClusterListFields . CLUSTER_NAME :
112
131
return (
@@ -115,27 +134,37 @@ export const ClusterListCellComponent: FunctionComponent<
115
134
selectedTab : ClusterEnvTabs . ENVIRONMENTS ,
116
135
clusterId,
117
136
} ) }
118
- className = "flex left py-8 dc__truncate "
137
+ className = "flex left py-10 "
119
138
>
120
- { clusterName }
139
+ < Tooltip content = { clusterName } >
140
+ < span className = "dc__truncate" > { clusterName } </ span >
141
+ </ Tooltip >
121
142
</ Link >
122
143
)
123
144
case ClusterListFields . CLUSTER_TYPE :
124
- return < span className = "flex left py-8 " > { clusterType } </ span >
145
+ return < span className = "flex left py-10 " > { clusterType } </ span >
125
146
case ClusterListFields . ENV_COUNT :
126
- return < span className = "flex left py-8 " > { envCount ? `${ envCount } ` : 'No' } Environments</ span >
147
+ return < span className = "flex left py-10 " > { envCount ? `${ envCount } ` : 'No' } Environments</ span >
127
148
case ClusterListFields . CLUSTER_CATEGORY :
128
- return < span className = "flex left py-8 dc__truncate" > { clusterCategory } </ span >
149
+ return (
150
+ < div className = "flex left py-10" >
151
+ < Tooltip content = { clusterCategory } >
152
+ < span className = "dc__truncate" > { clusterCategory } </ span >
153
+ </ Tooltip >
154
+ </ div >
155
+ )
129
156
case ClusterListFields . SERVER_URL :
130
157
return (
131
- < Tooltip content = { serverUrl } >
132
- < span className = "flex left py-8 dc__truncate" > { serverUrl } </ span >
133
- </ Tooltip >
158
+ < div className = "flex left py-10" >
159
+ < Tooltip content = { serverUrl } >
160
+ < span className = "dc__truncate" > { serverUrl } </ span >
161
+ </ Tooltip >
162
+ </ div >
134
163
)
135
164
case ClusterListFields . ACTIONS :
136
165
return (
137
166
< div className = { isRowActive ? '' : 'dc__opacity-hover--child' } >
138
- < div className = "flex dc__gap-8 py-8 " >
167
+ < div className = "flex dc__gap-8 py-10 " >
139
168
< Button
140
169
dataTestId = { `add-env-${ clusterId } ` }
141
170
ariaLabel = { `add-env-${ clusterId } ` }
@@ -144,6 +173,10 @@ export const ClusterListCellComponent: FunctionComponent<
144
173
variant = { ButtonVariantType . borderLess }
145
174
size = { ComponentSizeType . xs }
146
175
onClick = { handleAddEnv }
176
+ showTooltip
177
+ tooltipProps = { {
178
+ content : 'Add Environment' ,
179
+ } }
147
180
/>
148
181
< Button
149
182
dataTestId = { `edit-cluster-${ clusterId } ` }
@@ -154,6 +187,10 @@ export const ClusterListCellComponent: FunctionComponent<
154
187
style = { ButtonStyleType . neutral }
155
188
size = { ComponentSizeType . xs }
156
189
onClick = { handleEditCluster }
190
+ showTooltip
191
+ tooltipProps = { {
192
+ content : 'Edit Cluster' ,
193
+ } }
157
194
/>
158
195
< ActionMenu
159
196
id = "cluster-actions-action-menu"
@@ -269,6 +306,7 @@ export const EditCluster = ({ clusterList, reloadClusterList, handleClose }: Edi
269
306
handleModalClose = { handleClose }
270
307
reload = { reloadClusterList }
271
308
category = { cluster . category }
309
+ isProd = { cluster . isProd }
272
310
/>
273
311
)
274
312
}
@@ -296,9 +334,12 @@ export const DeleteCluster = ({ clusterList, reloadClusterList, handleClose }: E
296
334
export const ClusterEnvLoader = ( ) => (
297
335
< >
298
336
{ Array . from ( { length : 3 } ) . map ( ( _ , idx ) => (
299
- // eslint-disable-next-line react/no-array-index-key
300
- < div key = { idx } className = "px-20 py-8 dc__grid environment-row dc__align-items-center" >
301
- { Array . from ( { length : 5 } ) . map ( ( _ , index ) => (
337
+ < div
338
+ // eslint-disable-next-line react/no-array-index-key
339
+ key = { idx }
340
+ className = { `px-20 py-8 dc__grid environment-row ${ VirtualClusterForm ? 'with-category' : '' } dc__align-items-center` }
341
+ >
342
+ { Array . from ( { length : 5 } ) . map ( ( _val , index ) => (
302
343
// eslint-disable-next-line react/no-array-index-key
303
344
< span key = { index } className = "shimmer" />
304
345
) ) }
0 commit comments