Skip to content

Commit

Permalink
ui: fix raft messages graph
Browse files Browse the repository at this point in the history
Previously, when a user attempted to drag-to-zoom on the graph it would
not work properly. This is due to missing props that set the time window
and the time scale. Therefore, this patch updates the props to include
these in order to have the date picker and graph drag-to-zoom working
again.

resolves #79614

Release note (bug fix): Update props on the raft messages page to
include functions to set the time window and time scale in order
to fix date picker and drag-to-zoom functionality.
  • Loading branch information
Santamaura committed Apr 11, 2022
1 parent 5c1ae72 commit 1de4532
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ import {
import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider";
import messagesDashboard from "./messages";
import { getMatchParamByName } from "src/util/query";
import { PayloadAction } from "src/interfaces/action";
import {
TimeWindow,
TimeScale,
setMetricsFixedWindow,
setTimeScale,
} from "src/redux/timeScale";

interface NodeGraphsOwnProps {
refreshNodes: typeof refreshNodes;
Expand All @@ -47,6 +54,8 @@ interface NodeGraphsOwnProps {
livenessQueryValid: boolean;
nodesSummary: NodesSummary;
hoverState: HoverState;
setMetricsFixedWindow: (tw: TimeWindow) => PayloadAction<TimeWindow>;
setTimeScale: (ts: TimeScale) => PayloadAction<TimeScale>;
}

type RaftMessagesProps = NodeGraphsOwnProps & RouteComponentProps;
Expand Down Expand Up @@ -144,7 +153,13 @@ export class RaftMessages extends React.Component<RaftMessagesProps> {
const key = `nodes.raftMessages.${idx}`;
return (
<div key={key}>
<MetricsDataProvider id={key}>
<MetricsDataProvider
id={key}
key={key}
setMetricsFixedWindow={this.props.setMetricsFixedWindow}
setTimeScale={this.props.setTimeScale}
history={this.props.history}
>
{React.cloneElement(graph, { hoverOn, hoverOff, hoverState })}
</MetricsDataProvider>
</div>
Expand Down Expand Up @@ -187,6 +202,8 @@ const mapDispatchToProps = {
refreshLiveness,
hoverOn: hoverOnAction,
hoverOff: hoverOffAction,
setMetricsFixedWindow: setMetricsFixedWindow,
setTimeScale,
};

export default withRouter(
Expand Down

0 comments on commit 1de4532

Please sign in to comment.