Commit 2ff62c42 by Dominik Prokop

Prevents query result cleaning when new query trransaction starts

parent c7e50a79
......@@ -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<Props, State> {
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;
......
......@@ -47,12 +47,13 @@ export class LogsContainer extends PureComponent<LogsContainerProps> {
scanning,
scanRange,
} = this.props;
return (
<Panel label="Logs" loading={loading} isOpen={showingLogs} onToggle={this.onClickLogsButton}>
<Logs
data={logsResult}
exploreId={exploreId}
key={logsResult.id}
key={logsResult && logsResult.id}
highlighterExpressions={logsHighlighterExpressions}
loading={loading}
onChangeTime={onChangeTime}
......
......@@ -278,7 +278,7 @@ export const itemReducer = (state, action: Action): ExploreItemState => {
}
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,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment