ydb-embedded-ui 3.2.1 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.3](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.2.2...v3.2.3) (2023-01-16)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * fix crash on invalid search query ([4d6f551](https://github.com/ydb-platform/ydb-embedded-ui/commit/4d6f551fa4348a05ca3d8d2d6bd8b52ccb6310ee))
9
+
10
+ ## [3.2.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.2.1...v3.2.2) (2023-01-13)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **Tablets:** fix infinite rerender ([79b3c58](https://github.com/ydb-platform/ydb-embedded-ui/commit/79b3c58fb7c3ff7f123e111189b10f42c5272401))
16
+
3
17
  ## [3.2.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.2.0...v3.2.1) (2023-01-12)
4
18
 
5
19
 
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import cn from 'bem-cn-lite';
4
4
  import {connect} from 'react-redux';
5
+ import {escapeRegExp} from 'lodash/fp';
5
6
 
6
7
  import DataTable from '@yandex-cloud/react-data-table';
7
8
  import {Loader, TextInput, Label} from '@gravity-ui/uikit';
@@ -126,7 +127,7 @@ class Nodes extends React.Component {
126
127
 
127
128
  let preparedNodes = searchQuery
128
129
  ? nodes.filter((node) => {
129
- const re = new RegExp(searchQuery, 'i');
130
+ const re = new RegExp(escapeRegExp(searchQuery), 'i');
130
131
  return node.Host ? re.test(node.Host) || re.test(String(node.NodeId)) : true;
131
132
  })
132
133
  : nodes;
@@ -1,4 +1,4 @@
1
- import {useCallback, useEffect, useState} from 'react';
1
+ import {useCallback, useEffect, useMemo, useState} from 'react';
2
2
  import {useDispatch} from 'react-redux';
3
3
  import cn from 'bem-cn-lite';
4
4
  import ReactList from 'react-list';
@@ -45,7 +45,7 @@ export const Tablets = ({path, nodeId, className}: TabletsProps) => {
45
45
  } = useTypedSelector((state) => state.tablets);
46
46
  const {autorefresh} = useTypedSelector((state) => state.schema);
47
47
 
48
- const {TabletStateInfo: tablets = []} = data;
48
+ const tablets = useMemo(() => data?.TabletStateInfo || [], [data]);
49
49
 
50
50
  const fetchData = useCallback(
51
51
  (isBackground) => {
@@ -1,6 +1,7 @@
1
1
  import {useCallback, useEffect, useState} from 'react';
2
2
  import {useDispatch} from 'react-redux';
3
3
  import block from 'bem-cn-lite';
4
+ import { escapeRegExp } from 'lodash/fp';
4
5
 
5
6
  import DataTable, {Column} from '@yandex-cloud/react-data-table';
6
7
 
@@ -73,7 +74,7 @@ export const Consumers = ({path, type}: ConsumersProps) => {
73
74
  const filterConsumersByName = (search: string) => {
74
75
  const filteredConsumers = search
75
76
  ? consumers.filter((consumer) => {
76
- const re = new RegExp(search, 'i');
77
+ const re = new RegExp(escapeRegExp(search), 'i');
77
78
  return re.test(consumer.name);
78
79
  })
79
80
  : consumers;
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import cn from 'bem-cn-lite';
4
4
  import {connect} from 'react-redux';
5
5
  import _ from 'lodash';
6
+ import {escapeRegExp} from 'lodash/fp';
6
7
 
7
8
  import DataTable from '@yandex-cloud/react-data-table';
8
9
  import {Loader, TextInput, Button} from '@gravity-ui/uikit';
@@ -125,7 +126,7 @@ class Tenants extends React.Component {
125
126
  } = this.props;
126
127
 
127
128
  const filteredTenantsBySearch = tenants.filter((item) => {
128
- const re = new RegExp(searchQuery, 'i');
129
+ const re = new RegExp(escapeRegExp(searchQuery), 'i');
129
130
  return re.test(item.Name) || re.test(this.getControlPlaneValue(item));
130
131
  });
131
132
  const filteredTenants = Tenants.filterTenants(filteredTenantsBySearch, filter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "files": [
5
5
  "dist"
6
6
  ],