Skip to content

Commit 398df6e

Browse files
fix(ClusterInfo): change cluster default name (#478)
1 parent 696d43a commit 398df6e

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

src/containers/Cluster/ClusterInfo/ClusterInfo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type {TClusterInfo} from '../../../types/api/cluster';
1818
import {backend, customBackend} from '../../../store';
1919
import {formatStorageValues} from '../../../utils';
2020
import {useSetting, useTypedSelector} from '../../../utils/hooks';
21-
import {CLUSTER_INFO_HIDDEN_KEY, DEVELOPER_UI} from '../../../utils/constants';
21+
import {CLUSTER_DEFAULT_TITLE, CLUSTER_INFO_HIDDEN_KEY, DEVELOPER_UI_TITLE} from '../../../utils/constants';
2222

2323
import {VersionsBar} from '../VersionsBar/VersionsBar';
2424
import {ClusterInfoSkeleton} from '../ClusterInfoSkeleton/ClusterInfoSkeleton';
@@ -148,7 +148,7 @@ export const ClusterInfo = ({
148148
const {info = [], links = []} = additionalClusterProps;
149149

150150
const clusterInfo = getInfo(cluster, versionsValues, info, [
151-
{title: DEVELOPER_UI, url: internalLink},
151+
{title: DEVELOPER_UI_TITLE, url: internalLink},
152152
...links,
153153
]);
154154

@@ -173,7 +173,7 @@ export const ClusterInfo = ({
173173
<EntityStatus
174174
size="m"
175175
status={cluster?.Overall}
176-
name={cluster?.Name ?? 'Unknown cluster'}
176+
name={cluster?.Name ?? CLUSTER_DEFAULT_TITLE}
177177
className={b('title')}
178178
/>
179179
);

src/containers/Header/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {ExternalLinkWithIcon} from '../../components/ExternalLinkWithIcon/Extern
1010
import {backend, customBackend} from '../../store';
1111
import {getClusterInfo} from '../../store/reducers/cluster/cluster';
1212
import {useTypedSelector} from '../../utils/hooks';
13-
import {DEVELOPER_UI} from '../../utils/constants';
13+
import {DEVELOPER_UI_TITLE} from '../../utils/constants';
1414
import {parseQuery} from '../../routes';
1515

1616
import {RawBreadcrumbItem, getBreadcrumbs} from './breadcrumbs';
@@ -105,7 +105,7 @@ function Header({mainPage}: HeaderProps) {
105105
</div>
106106

107107
<ExternalLinkWithIcon
108-
title={DEVELOPER_UI}
108+
title={DEVELOPER_UI_TITLE}
109109
url={getInternalLink(singleClusterMode)}
110110
/>
111111
</header>

src/containers/Header/breadcrumbs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
TENANT_PAGES_IDS,
1717
} from '../../store/reducers/tenant/constants';
1818
import routes, {createHref} from '../../routes';
19+
import {CLUSTER_DEFAULT_TITLE} from '../../utils/constants';
1920

2021
import {getClusterPath} from '../Cluster/utils';
2122
import {TenantTabsGroups, getTenantPath} from '../Tenant/TenantPages';
@@ -39,7 +40,7 @@ const getClusterBreadcrumbs = (
3940

4041
return [
4142
{
42-
text: clusterName || 'Cluster',
43+
text: clusterName || CLUSTER_DEFAULT_TITLE,
4344
link: getClusterPath(clusterTab, query),
4445
icon: nodesRightIcon,
4546
},

src/containers/Tablet/Tablet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {getTablet, getTabletDescribe, clearTabletData} from '../../store/reducer
99
import {setHeaderBreadcrumbs} from '../../store/reducers/header/header';
1010

1111
import {useAutofetcher, useTypedSelector} from '../../utils/hooks';
12-
import {DEVELOPER_UI} from '../../utils/constants';
12+
import {DEVELOPER_UI_TITLE} from '../../utils/constants';
1313
import '../../services/api';
1414
import {parseQuery} from '../../routes';
1515

@@ -113,7 +113,7 @@ export const Tablet = () => {
113113

114114
const externalLinks = [
115115
{
116-
name: `${DEVELOPER_UI} - tablet`,
116+
name: `${DEVELOPER_UI_TITLE} - tablet`,
117117
path: `/tablets?TabletID=${TabletId}`,
118118
},
119119
];

src/utils/constants.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ export const COLORS_PRIORITY = {
7575
grey: 1,
7676
};
7777

78-
export const DEVELOPER_UI = 'Developer UI';
78+
// ==== Titles ====
79+
export const DEVELOPER_UI_TITLE = 'Developer UI';
80+
export const CLUSTER_DEFAULT_TITLE = 'Cluster';
7981

82+
// ==== Settings ====
8083
export const THEME_KEY = 'theme';
8184
export const INVERTED_DISKS_KEY = 'invertedDisks';
8285
export const USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY = 'useNodesEndpointInDiagnostics';

0 commit comments

Comments
 (0)