mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
explore: fix issues when loading and both graph/table are collapsed (#17113)
Removes the functionality of being able to collapse/expand the logs container. When both graph and table are collapsed and you reload the page then the start page should not be displayed. When both graph and table are collapsed and you reload the page then the graph and table panels should be displayed. Fix so that reducer tests are run. On of the test used fit() instead of it() which had the consequence of only 1 reducer test was executed and the rest skipped. There was some failing tests that now is updated and now passes. Fixes #17098
This commit is contained in:
committed by
GitHub
parent
32cdab4cbf
commit
1a80885180
@@ -7,7 +7,7 @@ import { ExploreId, ExploreItemState } from 'app/types/explore';
|
||||
import { LogsModel, LogsDedupStrategy } from 'app/core/logs_model';
|
||||
import { StoreState } from 'app/types';
|
||||
|
||||
import { toggleLogs, changeDedupStrategy, changeTime } from './state/actions';
|
||||
import { changeDedupStrategy, changeTime } from './state/actions';
|
||||
import Logs from './Logs';
|
||||
import Panel from './Panel';
|
||||
import { toggleLogLevelAction } from 'app/features/explore/state/actionTypes';
|
||||
@@ -27,8 +27,6 @@ interface LogsContainerProps {
|
||||
timeZone: TimeZone;
|
||||
scanning?: boolean;
|
||||
scanRange?: RawTimeRange;
|
||||
showingLogs: boolean;
|
||||
toggleLogs: typeof toggleLogs;
|
||||
toggleLogLevelAction: typeof toggleLogLevelAction;
|
||||
changeDedupStrategy: typeof changeDedupStrategy;
|
||||
dedupStrategy: LogsDedupStrategy;
|
||||
@@ -48,10 +46,6 @@ export class LogsContainer extends PureComponent<LogsContainerProps> {
|
||||
changeTime(exploreId, range);
|
||||
};
|
||||
|
||||
onClickLogsButton = () => {
|
||||
this.props.toggleLogs(this.props.exploreId, this.props.showingLogs);
|
||||
};
|
||||
|
||||
handleDedupStrategyChange = (dedupStrategy: LogsDedupStrategy) => {
|
||||
this.props.changeDedupStrategy(this.props.exploreId, dedupStrategy);
|
||||
};
|
||||
@@ -76,7 +70,6 @@ export class LogsContainer extends PureComponent<LogsContainerProps> {
|
||||
onStopScanning,
|
||||
range,
|
||||
timeZone,
|
||||
showingLogs,
|
||||
scanning,
|
||||
scanRange,
|
||||
width,
|
||||
@@ -84,7 +77,7 @@ export class LogsContainer extends PureComponent<LogsContainerProps> {
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Panel label="Logs" loading={loading} isOpen={showingLogs} onToggle={this.onClickLogsButton}>
|
||||
<Panel label="Logs" loading={loading} isOpen>
|
||||
<Logs
|
||||
dedupStrategy={this.props.dedupStrategy || LogsDedupStrategy.none}
|
||||
data={logsResult}
|
||||
@@ -115,7 +108,7 @@ function mapStateToProps(state: StoreState, { exploreId }) {
|
||||
const item: ExploreItemState = explore[exploreId];
|
||||
const { logsHighlighterExpressions, logsResult, logIsLoading, scanning, scanRange, range } = item;
|
||||
const loading = logIsLoading;
|
||||
const { showingLogs, dedupStrategy } = exploreItemUIStateSelector(item);
|
||||
const { dedupStrategy } = exploreItemUIStateSelector(item);
|
||||
const hiddenLogLevels = new Set(item.hiddenLogLevels);
|
||||
const dedupedResult = deduplicatedLogsSelector(item);
|
||||
const timeZone = getTimeZone(state.user);
|
||||
@@ -126,7 +119,6 @@ function mapStateToProps(state: StoreState, { exploreId }) {
|
||||
logsResult,
|
||||
scanning,
|
||||
scanRange,
|
||||
showingLogs,
|
||||
range,
|
||||
timeZone,
|
||||
dedupStrategy,
|
||||
@@ -136,7 +128,6 @@ function mapStateToProps(state: StoreState, { exploreId }) {
|
||||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
toggleLogs,
|
||||
changeDedupStrategy,
|
||||
toggleLogLevelAction,
|
||||
changeTime,
|
||||
|
||||
Reference in New Issue
Block a user