From a320e942a6a000527fbad05fe0e970fa3c7ac620 Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 27 Apr 2022 07:47:33 -0500 Subject: [PATCH] Explore Split Logs - use unique IDs and save state vals to unique place (#48300) * Explore Split Logs - use unique IDs and save state vals to unique place * Remove exploreID from store --- public/app/features/explore/Logs.test.tsx | 2 ++ public/app/features/explore/Logs.tsx | 11 +++++++---- public/app/features/explore/LogsContainer.tsx | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/app/features/explore/Logs.test.tsx b/public/app/features/explore/Logs.test.tsx index c63c4e909a2..fcac21c1ce5 100644 --- a/public/app/features/explore/Logs.test.tsx +++ b/public/app/features/explore/Logs.test.tsx @@ -2,6 +2,7 @@ import { render, screen, fireEvent } from '@testing-library/react'; import React from 'react'; import { LoadingState, LogLevel, LogRowModel, MutableDataFrame, toUtc } from '@grafana/data'; +import { ExploreId } from 'app/types'; import { Logs } from './Logs'; @@ -15,6 +16,7 @@ describe('Logs', () => { return render( boolean; onChangeTime: (range: AbsoluteTimeRange) => void; onClickFilterLabel?: (key: string, value: string) => void; @@ -271,6 +273,7 @@ class UnthemedLogs extends PureComponent { logsQueries, clearCache, addResultsToCache, + exploreId, } = this.props; const { @@ -324,7 +327,7 @@ class UnthemedLogs extends PureComponent { onChange={this.onChangeTime} className={styles.horizontalInlineSwitch} transparent - id="show-time" + id={`show-time_${exploreId}`} /> @@ -333,7 +336,7 @@ class UnthemedLogs extends PureComponent { onChange={this.onChangeLabels} className={styles.horizontalInlineSwitch} transparent - id="unique-labels" + id={`unique-labels_${exploreId}`} /> @@ -342,7 +345,7 @@ class UnthemedLogs extends PureComponent { onChange={this.onChangewrapLogMessage} className={styles.horizontalInlineSwitch} transparent - id="wrap-lines" + id={`wrap-lines_${exploreId}`} /> @@ -351,7 +354,7 @@ class UnthemedLogs extends PureComponent { onChange={this.onChangePrettifyLogMessage} className={styles.horizontalInlineSwitch} transparent - id="prettify" + id={`prettify_${exploreId}`} /> diff --git a/public/app/features/explore/LogsContainer.tsx b/public/app/features/explore/LogsContainer.tsx index fb27a793e0d..cc9660f7d82 100644 --- a/public/app/features/explore/LogsContainer.tsx +++ b/public/app/features/explore/LogsContainer.tsx @@ -127,6 +127,7 @@ class LogsContainer extends PureComponent {