ydb-embedded-ui 3.3.0 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.3.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.3.1...v3.3.2) (2023-01-31)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **QueryEditor:** collapse bottom panel if empty ([566db3b](https://github.com/ydb-platform/ydb-embedded-ui/commit/566db3b15c4393555071f058c88ad36b4073cc2d))
9
+ * **VDisk:** use pdiskid field for link ([5ee0705](https://github.com/ydb-platform/ydb-embedded-ui/commit/5ee0705416aa31be9bee4be0776ecb8a61d3e82c))
10
+
11
+ ## [3.3.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.3.0...v3.3.1) (2023-01-31)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **UserSettings:** reword nodes setting and add popup ([2fda2b8](https://github.com/ydb-platform/ydb-embedded-ui/commit/2fda2b815b921a8163f80527c45f788172df4ba8))
17
+
3
18
  ## [3.3.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.2.3...v3.3.0) (2023-01-30)
4
19
 
5
20
 
@@ -123,7 +123,7 @@ export const VDisk = ({data = {}, poolName, nodes, compact}: VDiskProps) => {
123
123
  routes.node,
124
124
  {id: data.NodeId, activeTab: STRUCTURE},
125
125
  {
126
- pdiskId: data.PDisk?.PDiskId,
126
+ pdiskId: data.PDiskId ?? data.PDisk?.PDiskId,
127
127
  vdiskId: stringifyVdiskId(data.VDiskId),
128
128
  },
129
129
  )}
@@ -91,6 +91,8 @@ const initialTenantCommonInfoState = {
91
91
  function QueryEditor(props) {
92
92
  const [resultType, setResultType] = useState(RESULT_TYPES.EXECUTE);
93
93
 
94
+ const [isResultLoaded, setIsResultLoaded] = useState(false);
95
+
94
96
  const [resultVisibilityState, dispatchResultVisibilityState] = useReducer(
95
97
  paneVisibilityToggleReducerCreator(DEFAULT_IS_QUERY_RESULT_COLLAPSED),
96
98
  initialTenantCommonInfoState,
@@ -117,11 +119,12 @@ function QueryEditor(props) {
117
119
  }, []);
118
120
 
119
121
  useEffect(() => {
120
- const {showPreview} = props;
121
- if (showPreview && resultVisibilityState.collapsed) {
122
+ if (props.showPreview || isResultLoaded) {
122
123
  dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerExpand);
124
+ } else {
125
+ dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerCollapse);
123
126
  }
124
- }, [props.showPreview, resultVisibilityState.collapsed]);
127
+ }, [props.showPreview, isResultLoaded]);
125
128
 
126
129
  useEffect(() => {
127
130
  const {
@@ -254,6 +257,7 @@ function QueryEditor(props) {
254
257
 
255
258
  setResultType(RESULT_TYPES.EXECUTE);
256
259
  sendQuery({query: input, database: path, action: runAction});
260
+ setIsResultLoaded(true);
257
261
  setShowPreview(false);
258
262
 
259
263
  const {queries, currentIndex} = history;
@@ -272,6 +276,7 @@ function QueryEditor(props) {
272
276
  } = props;
273
277
  setResultType(RESULT_TYPES.EXPLAIN);
274
278
  getExplainQuery({query: input, database: path});
279
+ setIsResultLoaded(true);
275
280
  setShowPreview(false);
276
281
  dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerExpand);
277
282
  };
@@ -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
+ }
@@ -1,6 +1,8 @@
1
+ import {ReactNode} from 'react';
1
2
  import {connect} from 'react-redux';
3
+ import cn from 'bem-cn-lite';
2
4
 
3
- import {RadioButton, Switch} from '@gravity-ui/uikit';
5
+ import {RadioButton, Switch, HelpPopover} from '@gravity-ui/uikit';
4
6
  import {Settings} from '@gravity-ui/navigation';
5
7
 
6
8
  import favoriteFilledIcon from '../../assets/icons/star.svg';
@@ -14,6 +16,10 @@ import {
14
16
 
15
17
  import {setSettingValue} from '../../store/reducers/settings';
16
18
 
19
+ import './UserSettings.scss';
20
+
21
+ const b = cn('ydb-user-settings');
22
+
17
23
  enum Theme {
18
24
  light = 'light',
19
25
  dark = 'dark',
@@ -33,6 +39,19 @@ function UserSettings(props: any) {
33
39
  props.setSettingValue(USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY, String(value));
34
40
  };
35
41
 
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
+
36
55
  return (
37
56
  <Settings>
38
57
  <Settings.Page
@@ -58,7 +77,10 @@ function UserSettings(props: any) {
58
77
  onUpdate={_onInvertedDisksChangeHandler}
59
78
  />
60
79
  </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
+ >
62
84
  <Switch
63
85
  checked={props.useNodesEndpointInDiagnostics}
64
86
  onUpdate={_onNodesEndpointChangeHandler}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "files": [
5
5
  "dist"
6
6
  ],