From 384456851b68ccffa1b65816ecd48e445c5911a7 Mon Sep 17 00:00:00 2001 From: Zalenski Egor <63463140+zalenskiSofteq@users.noreply.github.com> Date: Wed, 23 Mar 2022 09:03:25 +0300 Subject: [PATCH 1/4] #RI-2614 - Enablement area pagination doesn't work correctly #RI-2615 - No scroll when all the articles are unfolded --- .../components/LazyInternalPage/LazyInternalPage.tsx | 4 ++-- .../workbench/components/enablement-area/styles.module.scss | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/redisinsight/ui/src/pages/workbench/components/enablement-area/EnablementArea/components/LazyInternalPage/LazyInternalPage.tsx b/redisinsight/ui/src/pages/workbench/components/enablement-area/EnablementArea/components/LazyInternalPage/LazyInternalPage.tsx index fde9f1df84..73d8a6f0ee 100644 --- a/redisinsight/ui/src/pages/workbench/components/enablement-area/EnablementArea/components/LazyInternalPage/LazyInternalPage.tsx +++ b/redisinsight/ui/src/pages/workbench/components/enablement-area/EnablementArea/components/LazyInternalPage/LazyInternalPage.tsx @@ -46,7 +46,7 @@ const LazyInternalPage = ({ onClose, title, path, sourcePath }: Props) => { const dispatch = useDispatch() const fetchService = IS_ABSOLUTE_PATH.test(path) ? axios : resourcesService - const getRelatedPages = useCallback((sourcePath: string): IEnablementAreaItem[] => { + const getRelatedPages = (sourcePath: string): IEnablementAreaItem[] => { const pageInfo = getFileInfo(path) switch (sourcePath) { @@ -57,7 +57,7 @@ const LazyInternalPage = ({ onClose, title, path, sourcePath }: Props) => { default: return [] } - }, [sourcePath, guides, tutorials]) + } const loadContent = async () => { setLoading(true) diff --git a/redisinsight/ui/src/pages/workbench/components/enablement-area/styles.module.scss b/redisinsight/ui/src/pages/workbench/components/enablement-area/styles.module.scss index 1757def52f..1645c42199 100644 --- a/redisinsight/ui/src/pages/workbench/components/enablement-area/styles.module.scss +++ b/redisinsight/ui/src/pages/workbench/components/enablement-area/styles.module.scss @@ -27,6 +27,8 @@ } .areaContentWrapper { + height: 100% !important; + &.minimized { width: 0; visibility: hidden; From 0da5b6919c1b7c3a3246806c3c27de6f00226454 Mon Sep 17 00:00:00 2001 From: Gnanesh Date: Wed, 23 Mar 2022 12:09:33 +0530 Subject: [PATCH 2/4] Change color of empty graph response --- redisinsight/ui/src/packages/redisgraph/src/Graph.tsx | 2 +- .../ui/src/packages/redisgraph/src/styles/styles.less | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx b/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx index e4e9b70ab9..f49f418c0d 100644 --- a/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx +++ b/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx @@ -45,7 +45,7 @@ export default function Graph(props: { graphKey: string, data: any[] }) { let edgeIds = new Set(parsedResponse.edges.map(e => e.id)) if (nodeIds.size === 0 && parsedResponse.nodeIds.length === 0) { - return
No data to visualize. Switch to Text view to see raw information.
+ return
No data to visualize. Switch to Text view to see raw information.
} let data = { diff --git a/redisinsight/ui/src/packages/redisgraph/src/styles/styles.less b/redisinsight/ui/src/packages/redisgraph/src/styles/styles.less index 2f3f9debed..b943025384 100644 --- a/redisinsight/ui/src/packages/redisgraph/src/styles/styles.less +++ b/redisinsight/ui/src/packages/redisgraph/src/styles/styles.less @@ -243,3 +243,9 @@ padding: 12px !important; font-family: monospace !important; } + +.responseInfo { + color: var(--info-color); + padding: 12px !important; + font-family: monospace !important; +} From 6a84092574b4a4e4006c14cf161453e1a0407e50 Mon Sep 17 00:00:00 2001 From: Gnanesh Date: Wed, 23 Mar 2022 12:39:09 +0530 Subject: [PATCH 3/4] Fix parser on no data --- redisinsight/ui/src/packages/redisgraph/src/parser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redisinsight/ui/src/packages/redisgraph/src/parser.ts b/redisinsight/ui/src/packages/redisgraph/src/parser.ts index 0f8e7fa875..c3d4cc7bba 100644 --- a/redisinsight/ui/src/packages/redisgraph/src/parser.ts +++ b/redisinsight/ui/src/packages/redisgraph/src/parser.ts @@ -42,10 +42,10 @@ function responseParser(data: any) { let edges: IEdge[] = [] let types: {[key: string]: number} = {} let labels: {[key: string]: number} = {} - if (data.length === 0) return { + if (data.length < 2) return { nodes, edges, types, labels, headers, nodeIds, edgeIds, } - + const entries = data[1].map((entry: any) => { /* entry -> has headers number of items */ entry.map((item: any) => { From 5993d20f2ba1f9f903b0f7fc0b3254bf03da0c81 Mon Sep 17 00:00:00 2001 From: Gnanesh Date: Wed, 23 Mar 2022 13:09:50 +0530 Subject: [PATCH 4/4] [RedisGraph] Use Id when no `name` and `title` --- redisinsight/ui/src/packages/redisgraph/src/Graph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx b/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx index f49f418c0d..6754ffab48 100644 --- a/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx +++ b/redisinsight/ui/src/packages/redisgraph/src/Graph.tsx @@ -155,7 +155,7 @@ export default function Graph(props: { graphKey: string, data: any[] }) { graphData: graphData, infoPanel: true, // nodeRadius: 25, - onLabelNode: (node) => node.properties?.name || node.properties?.title || (node.labels ? node.labels[0] : ''), + onLabelNode: (node) => node.properties?.name || node.properties?.title || node.id || (node.labels ? node.labels[0] : ''), onNodeClick: (nodeSvg, node, event) => { if (d3.select(nodeSvg).attr('class').indexOf('selected') > 0) { d3.select(nodeSvg)