@@ -14,19 +14,18 @@ import {
1414
1515import { EntityStatus } from '../../components/EntityStatusNew/EntityStatus' ;
1616import { VersionsBar } from '../../components/VersionsBar/VersionsBar' ;
17- import { getClusterPath } from '../../routes' ;
1817import type { PreparedCluster } from '../../store/reducers/clusters/types' ;
1918import { EFlag } from '../../types/api/enums' ;
2019import { uiFactory } from '../../uiFactory/uiFactory' ;
2120import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants' ;
2221import { formatNumber , formatStorageValuesToTb } from '../../utils/dataFormatters/dataFormatters' ;
23- import { createDeveloperUIMonitoringPageHref } from '../../utils/developerUI/developerUI' ;
2422import { getCleanBalancerValue } from '../../utils/parseBalancer' ;
2523import { clusterTabsIds } from '../Cluster/utils' ;
2624
2725import { COLUMNS_NAMES , COLUMNS_TITLES } from './constants' ;
2826import i18n from './i18n' ;
2927import { b } from './shared' ;
28+ import { calculateClusterPath } from './utils' ;
3029export const CLUSTERS_COLUMNS_WIDTH_LS_KEY = 'clustersTableColumnsWidth' ;
3130
3231const EMPTY_CELL = < span className = { b ( 'empty-cell' ) } > { EMPTY_DATA_PLACEHOLDER } </ span > ;
@@ -144,23 +143,13 @@ interface ClusterNameProps {
144143}
145144
146145function ClusterName ( { row} : ClusterNameProps ) {
147- const {
148- name : clusterName ,
149- use_embedded_ui : useEmbeddedUi ,
150- preparedBackend : backend ,
151- settings,
152- } = row ;
153- const clusterPath =
154- useEmbeddedUi && backend
155- ? createDeveloperUIMonitoringPageHref ( backend )
156- : getClusterPath (
157- { environment : settings ?. auth_service } ,
158- { backend, clusterName} ,
159- { withBasename : true } ,
160- ) ;
146+ const clusterPath = calculateClusterPath ( row ) ;
147+
161148 return (
162149 < div className = { b ( 'cluster-name' ) } >
163- < ExternalLink href = { clusterPath } > { row . title || row . name } </ ExternalLink >
150+ < ExternalLink href = { clusterPath } target = { row . clusterDomain ? '_blank' : undefined } >
151+ { row . title || row . name }
152+ </ ExternalLink >
164153 </ div >
165154 ) ;
166155}
@@ -358,26 +347,17 @@ interface VersionsProps {
358347}
359348
360349function Versions ( { row} : VersionsProps ) {
361- const {
362- preparedVersions,
363- name : clusterName ,
364- preparedBackend : backend ,
365- settings,
366- use_embedded_ui : useEmbeddedUi ,
367- } = row ;
350+ const { preparedVersions} = row ;
368351 if ( ! preparedVersions . length ) {
369352 return null ;
370353 }
371- const clusterPath =
372- useEmbeddedUi && backend
373- ? createDeveloperUIMonitoringPageHref ( backend )
374- : getClusterPath (
375- { activeTab : clusterTabsIds . versions , environment : settings ?. auth_service } ,
376- { backend, clusterName} ,
377- { withBasename : true } ,
378- ) ;
354+ const clusterPath = calculateClusterPath ( row , clusterTabsIds . versions ) ;
379355 return (
380- < ExternalLink className = { b ( 'cluster-versions' ) } href = { clusterPath } >
356+ < ExternalLink
357+ className = { b ( 'cluster-versions' ) }
358+ href = { clusterPath }
359+ target = { row . clusterDomain ? '_blank' : undefined }
360+ >
381361 < VersionsBar preparedVersions = { preparedVersions } />
382362 </ ExternalLink >
383363 ) ;
0 commit comments