mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
Prevents query result cleaning when new query trransaction starts
This commit is contained in:
parent
c7e50a79d7
commit
2ff62c42ac
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user