Skip to content

Commit 2fda2b8

Browse files
fix(UserSettings): reword nodes setting and add popup
1 parent 5253c35 commit 2fda2b8

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.ydb-user-settings {
2+
&__item-with-popup {
3+
max-width: 180px;
4+
}
5+
6+
&__popup {
7+
max-width: 370px;
8+
}
9+
}

src/containers/UserSettings/UserSettings.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import {ReactNode} from 'react';
12
import {connect} from 'react-redux';
3+
import cn from 'bem-cn-lite';
24

3-
import {RadioButton, Switch} from '@gravity-ui/uikit';
5+
import {RadioButton, Switch, HelpPopover} from '@gravity-ui/uikit';
46
import {Settings} from '@gravity-ui/navigation';
57

68
import favoriteFilledIcon from '../../assets/icons/star.svg';
@@ -14,6 +16,10 @@ import {
1416

1517
import {setSettingValue} from '../../store/reducers/settings';
1618

19+
import './UserSettings.scss';
20+
21+
const b = cn('ydb-user-settings');
22+
1723
enum Theme {
1824
light = 'light',
1925
dark = 'dark',
@@ -33,6 +39,19 @@ function UserSettings(props: any) {
3339
props.setSettingValue(USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY, String(value));
3440
};
3541

42+
const renderBreakNodesSettingsItem = (title: ReactNode) => {
43+
return (
44+
<div className={b('item-with-popup')}>
45+
{title}
46+
<HelpPopover
47+
content="Use /viewer/json/nodes endpoint for Nodes Tab in diagnostics. It returns incorrect data on older versions"
48+
contentClassName={b('popup')}
49+
hasArrow={true}
50+
/>
51+
</div>
52+
);
53+
};
54+
3655
return (
3756
<Settings>
3857
<Settings.Page
@@ -58,7 +77,10 @@ function UserSettings(props: any) {
5877
onUpdate={_onInvertedDisksChangeHandler}
5978
/>
6079
</Settings.Item>
61-
<Settings.Item title="Use /viewer/json/nodes for Nodes Tab in diagnostics">
80+
<Settings.Item
81+
title="Break the Nodes tab in Diagnostics"
82+
renderTitleComponent={renderBreakNodesSettingsItem}
83+
>
6284
<Switch
6385
checked={props.useNodesEndpointInDiagnostics}
6486
onUpdate={_onNodesEndpointChangeHandler}

0 commit comments

Comments
 (0)