From 2ff62c42ac823750f2b56d9127b1ad7fddf7affc Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Mon, 28 Jan 2019 12:57:09 +0100 Subject: [PATCH] Prevents query result cleaning when new query trransaction starts --- public/app/features/explore/Logs.tsx | 7 ++++++- public/app/features/explore/LogsContainer.tsx | 3 ++- public/app/features/explore/state/reducers.ts | 8 +------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/public/app/features/explore/Logs.tsx b/public/app/features/explore/Logs.tsx index 30db1ec349c..7e3cdfe9315 100644 --- a/public/app/features/explore/Logs.tsx +++ b/public/app/features/explore/Logs.tsx @@ -49,7 +49,7 @@ function renderMetaItem(value: any, kind: LogsMetaKind) { } interface Props { - data: LogsModel; + data?: LogsModel; exploreId: string; highlighterExpressions: string[]; loading: boolean; @@ -165,6 +165,11 @@ export default class Logs extends PureComponent { scanning, scanRange, } = this.props; + + if (!data) { + return null; + } + const { dedup, deferLogs, hiddenLogLevels, renderAll, showLocalTime, showUtc } = this.state; let { showLabels } = this.state; const hasData = data && data.rows && data.rows.length > 0; diff --git a/public/app/features/explore/LogsContainer.tsx b/public/app/features/explore/LogsContainer.tsx index e58cd2b5e95..76970ef343a 100644 --- a/public/app/features/explore/LogsContainer.tsx +++ b/public/app/features/explore/LogsContainer.tsx @@ -47,12 +47,13 @@ export class LogsContainer extends PureComponent { scanning, scanRange, } = this.props; + return ( { } case ActionTypes.QueryTransactionStart: { - const { datasourceInstance, queryIntervals, queryTransactions } = state; + const { queryTransactions } = state; const { resultType, rowIndex, transaction } = action.payload; // Discarding existing transactions of same type const remainingTransactions = queryTransactions.filter( @@ -288,15 +288,9 @@ export const itemReducer = (state, action: Action): ExploreItemState => { // Append new transaction const nextQueryTransactions: QueryTransaction[] = [...remainingTransactions, transaction]; - const results = calculateResultsFromQueryTransactions( - nextQueryTransactions, - datasourceInstance, - queryIntervals.intervalMs - ); return { ...state, - ...results, queryTransactions: nextQueryTransactions, showingStartPage: false, };