Skip to content

Commit 7f19396

Browse files
authored
Merge pull request #2706 from RedisInsight/fe/feature/RI-4828_Rework_Tree_view
#RI-4828 - Rework the Tree view
2 parents da00ce1 + 68b84c9 commit 7f19396

File tree

92 files changed

+3043
-2010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3043
-2010
lines changed

jest.config.cjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ module.exports = {
3939
'json',
4040
],
4141
testEnvironment: 'jest-environment-jsdom',
42-
// type: 'module',
4342
transformIgnorePatterns: [
4443
'node_modules/(?!(monaco-editor|react-monaco-editor)/)',
4544
],
@@ -61,8 +60,5 @@ module.exports = {
6160
functions: 72,
6261
lines: 80,
6362
},
64-
// './redisinsight/ui/src/slices/**/*.ts': {
65-
// statements: 90,
66-
// },
6763
},
6864
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"package:mac": "yarn build:prod && electron-builder build --mac -p never",
3434
"package:mac:arm": "yarn build:prod && electron-builder build --mac --arm64 -p never",
3535
"package:linux": "yarn build:prod && electron-builder build --linux -p never",
36-
"postinstall": "skip-postinstall || (electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./configs/webpack.config.renderer.dev.dll.ts && opencollective-postinstall && yarn-deduplicate yarn.lock)",
36+
"postinstall": "patch-package && skip-postinstall || (electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./configs/webpack.config.renderer.dev.dll.ts && opencollective-postinstall && yarn-deduplicate yarn.lock)",
3737
"start": "ts-node ./scripts/check-port-in-use.js && yarn start:renderer",
3838
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./configs/webpack.config.renderer.dev.ts",
3939
"start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./configs/webpack.config.preload.dev.ts",
@@ -42,7 +42,7 @@
4242
"start:web:public": "cross-env PUBLIC_DEV=true NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./configs/webpack.config.web.dev.ts",
4343
"test": "jest ./redisinsight/ui -w 1",
4444
"test:watch": "jest ./redisinsight/ui --watch -w 1",
45-
"test:cov": "jest ./redisinsight/ui --coverage --no-cache --forceExit -w 3",
45+
"test:cov": "jest ./redisinsight/ui --silent --coverage --no-cache --forceExit -w 3",
4646
"test:cov:unit": "jest ./redisinsight/ui --group=-component --coverage -w 1",
4747
"test:cov:component": "jest ./redisinsight/ui --group=component --coverage -w 1",
4848
"type-check:ui": "tsc --project redisinsight/ui --noEmit"
@@ -204,6 +204,8 @@
204204
"msw": "^1.3.2",
205205
"node-sass": "^8.0.0",
206206
"opencollective-postinstall": "^2.0.3",
207+
"patch-package": "^8.0.0",
208+
"postinstall-postinstall": "^2.1.0",
207209
"react-hot-loader": "^4.13.0",
208210
"react-refresh": "^0.9.0",
209211
"redux-mock-store": "^1.5.4",
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
diff --git a/node_modules/react-vtree/dist/cjs/Tree.js b/node_modules/react-vtree/dist/cjs/Tree.js
2+
index c46ce3e..879f0a6 100644
3+
--- a/node_modules/react-vtree/dist/cjs/Tree.js
4+
+++ b/node_modules/react-vtree/dist/cjs/Tree.js
5+
@@ -33,6 +33,7 @@ var Row = function Row(_ref) {
6+
return /*#__PURE__*/_react.default.createElement(Node, Object.assign({
7+
isScrolling: isScrolling,
8+
style: style,
9+
+ index: index,
10+
treeData: treeData
11+
}, data));
12+
};
13+
diff --git a/node_modules/react-vtree/dist/es/Tree.d.ts b/node_modules/react-vtree/dist/es/Tree.d.ts
14+
index 5e7f57e..b216b36 100644
15+
--- a/node_modules/react-vtree/dist/es/Tree.d.ts
16+
+++ b/node_modules/react-vtree/dist/es/Tree.d.ts
17+
@@ -24,6 +24,8 @@ export declare type NodePublicState<TData extends NodeData> = Readonly<{
18+
data: TData;
19+
setOpen: (state: boolean) => Promise<void>;
20+
}> & {
21+
+ index: number;
22+
+ style: object;
23+
isOpen: boolean;
24+
};
25+
export declare type NodeRecord<TNodePublicState extends NodePublicState<any>> = Readonly<{
26+
diff --git a/node_modules/react-vtree/dist/es/Tree.js b/node_modules/react-vtree/dist/es/Tree.js
27+
index 2b1c7c0..b22e873 100644
28+
--- a/node_modules/react-vtree/dist/es/Tree.js
29+
+++ b/node_modules/react-vtree/dist/es/Tree.js
30+
@@ -19,6 +19,7 @@ export var Row = function Row(_ref) {
31+
return /*#__PURE__*/React.createElement(Node, Object.assign({
32+
isScrolling: isScrolling,
33+
style: style,
34+
+ index: index,
35+
treeData: treeData
36+
}, data));
37+
};
38+
diff --git a/node_modules/react-vtree/dist/lib/Tree.js b/node_modules/react-vtree/dist/lib/Tree.js
39+
index fb824bd..6feba4e 100644
40+
--- a/node_modules/react-vtree/dist/lib/Tree.js
41+
+++ b/node_modules/react-vtree/dist/lib/Tree.js
42+
@@ -17,6 +17,7 @@ export const Row = ({
43+
return /*#__PURE__*/React.createElement(Node, Object.assign({
44+
isScrolling: isScrolling,
45+
style: style,
46+
+ index: index,
47+
treeData: treeData
48+
}, data));
49+
};
Lines changed: 10 additions & 0 deletions
Loading

redisinsight/ui/src/components/keys-summary/KeysSummary.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import React from 'react'
22
import cx from 'classnames'
33
import { isNull } from 'lodash'
44
import { EuiText, EuiTextColor } from '@elastic/eui'
5+
import { useSelector } from 'react-redux'
56

67
import { numberWithSpaces, nullableNumberWithSpaces } from 'uiSrc/utils/numbers'
7-
import ScanMore from '../scan-more'
8+
import { KeyViewType } from 'uiSrc/slices/interfaces/keys'
9+
import { keysSelector } from 'uiSrc/slices/browser/keys'
10+
import { KeyTreeSettings } from 'uiSrc/pages/browser/components/key-tree'
811

12+
import ScanMore from '../scan-more'
913
import styles from './styles.module.scss'
1014

1115
export interface Props {
@@ -41,6 +45,8 @@ const KeysSummary = (props: Props) => {
4145
&& nextCursor !== '0'
4246
? '~' : ''
4347

48+
const { viewType } = useSelector(keysSelector)
49+
4450
return (
4551
<>
4652
{(!!totalItemsCount || isNull(totalItemsCount)) && (
@@ -88,6 +94,9 @@ const KeysSummary = (props: Props) => {
8894
</EuiText>
8995
)}
9096
</EuiText>
97+
{viewType === KeyViewType.Tree && (
98+
<KeyTreeSettings loading={loading} />
99+
)}
91100
</div>
92101
)}
93102
{loading && !totalItemsCount && !isNull(totalItemsCount) && (

redisinsight/ui/src/components/keys-summary/styles.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.content {
2+
display: flex;
3+
}
4+
15
.loading {
26
opacity: 0;
37
}

redisinsight/ui/src/components/virtual-tree/VirtualTree.tsx

Lines changed: 0 additions & 234 deletions
This file was deleted.

0 commit comments

Comments
 (0)