From 4c54efd07809171a83051def91cc0c32d739edb0 Mon Sep 17 00:00:00 2001 From: kchepikava Date: Fri, 26 Jul 2024 18:32:03 +0200 Subject: [PATCH 1/2] RI-5910 fixed connection status display --- .../statistics/target-connections/TargetConnections.tsx | 4 ++-- redisinsight/ui/src/slices/interfaces/rdi.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/redisinsight/ui/src/pages/rdi/statistics/target-connections/TargetConnections.tsx b/redisinsight/ui/src/pages/rdi/statistics/target-connections/TargetConnections.tsx index ab3ec17aad..fc52088c37 100644 --- a/redisinsight/ui/src/pages/rdi/statistics/target-connections/TargetConnections.tsx +++ b/redisinsight/ui/src/pages/rdi/statistics/target-connections/TargetConnections.tsx @@ -1,7 +1,7 @@ import { EuiBasicTableColumn, EuiIcon, EuiToolTip } from '@elastic/eui' import React from 'react' -import { IConnections } from 'uiSrc/slices/interfaces' +import { IConnections, StatisticsConnectionStatus } from 'uiSrc/slices/interfaces' import { formatLongName } from 'uiSrc/utils' import Accordion from '../components/accordion' import Panel from '../components/panel' @@ -22,7 +22,7 @@ const columns: EuiBasicTableColumn[] = [ field: 'status', width: '80px', render: (status: string) => - (status === 'good' ? ( + (status === StatisticsConnectionStatus.connected ? ( ) : ( diff --git a/redisinsight/ui/src/slices/interfaces/rdi.ts b/redisinsight/ui/src/slices/interfaces/rdi.ts index 869952546c..4a02f6b481 100644 --- a/redisinsight/ui/src/slices/interfaces/rdi.ts +++ b/redisinsight/ui/src/slices/interfaces/rdi.ts @@ -51,11 +51,16 @@ export interface IRdiPipelineStrategies { data: IRdiPipelineStrategy[] } +export enum StatisticsConnectionStatus { + notYetUsed = 'not yet used', + connected = 'connected' +} + export interface IConnections { [key: string]: { host: string port: number - status: string + status: StatisticsConnectionStatus type: string database: string user: string From 94ba2e65af241eb33b7b921047814a91b3913454 Mon Sep 17 00:00:00 2001 From: ArtemHoruzhenko Date: Fri, 2 Aug 2024 08:55:45 +0300 Subject: [PATCH 2/2] hide refresh buttons --- .../src/pages/rdi/statistics/StatisticsPage.spec.tsx | 12 ++++++------ .../ui/src/pages/rdi/statistics/clients/Clients.tsx | 1 + .../rdi/statistics/data-streams/DataStreams.tsx | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/redisinsight/ui/src/pages/rdi/statistics/StatisticsPage.spec.tsx b/redisinsight/ui/src/pages/rdi/statistics/StatisticsPage.spec.tsx index f059a56e4e..e46f69f5cd 100644 --- a/redisinsight/ui/src/pages/rdi/statistics/StatisticsPage.spec.tsx +++ b/redisinsight/ui/src/pages/rdi/statistics/StatisticsPage.spec.tsx @@ -161,7 +161,7 @@ describe('StatisticsPage', () => { }) }) - it('should call proper telemetry event when refresh is clicked for data streams section', () => { + xit('should call proper telemetry event when refresh is clicked for data streams section', () => { render() fireEvent.click(screen.getByTestId('data-streams-refresh-btn')) @@ -175,7 +175,7 @@ describe('StatisticsPage', () => { }) }) - it('should call proper telemetry event when refresh is clicked for clients section', () => { + xit('should call proper telemetry event when refresh is clicked for clients section', () => { render() fireEvent.click(screen.getByTestId('clients-refresh-btn')) @@ -228,7 +228,7 @@ describe('StatisticsPage', () => { }) }) - it('should call proper telemetry event when auto refresh is enabled for data streams section', async () => { + xit('should call proper telemetry event when auto refresh is enabled for data streams section', async () => { render() const testid = 'data-streams' @@ -247,7 +247,7 @@ describe('StatisticsPage', () => { }) }) - it('should call proper telemetry event when auto refresh is disabled for data streams section', async () => { + xit('should call proper telemetry event when auto refresh is disabled for data streams section', async () => { render() const testid = 'data-streams' @@ -267,7 +267,7 @@ describe('StatisticsPage', () => { }) }) - it('should call proper telemetry event when auto refresh is enabled for clients section', async () => { + xit('should call proper telemetry event when auto refresh is enabled for clients section', async () => { render() const testid = 'clients' @@ -286,7 +286,7 @@ describe('StatisticsPage', () => { }) }) - it('should call proper telemetry event when auto refresh is disabled for clients section', async () => { + xit('should call proper telemetry event when auto refresh is disabled for clients section', async () => { render() const testid = 'clients' diff --git a/redisinsight/ui/src/pages/rdi/statistics/clients/Clients.tsx b/redisinsight/ui/src/pages/rdi/statistics/clients/Clients.tsx index a070faf10a..96be190845 100644 --- a/redisinsight/ui/src/pages/rdi/statistics/clients/Clients.tsx +++ b/redisinsight/ui/src/pages/rdi/statistics/clients/Clients.tsx @@ -70,6 +70,7 @@ const Clients = ({ data, loading, onRefresh, onRefreshClicked, onChangeAutoRefre