Skip to content

Commit

Permalink
pkg/ui: properly derive XScale in statement details page
Browse files Browse the repository at this point in the history
Fixes: #121362

#118680 introduced code to
align the timeseries charts on the statement details page to the time
range set by the time picker, instead of the time range that we had
available data for.

The code contained a bug where it would set the start & end of the
XScale to `Moment.prototype.valueOf` instead of the result of *calling*
`Moment.prototype.valueOf()`. This causes the start & end timestamps to
be set to functions, instead of unix timestamps, which broke the charts.

This PR simply invokes the function.

Release note (bug fix): The timeseries graphs shown on the SQL Activity
statement details page in DB Console will now render properly, after
fixing a bug related to setting the time range of the charts.
  • Loading branch information
abarganier committed Mar 29, 2024
1 parent 7d88d50 commit e5a1524
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,9 @@ export class StatementDetails extends React.Component<

const [chartsStart, chartsEnd] = toRoundedDateRange(this.props.timeScale);
const xScale = {
graphTsStartMillis: chartsStart.valueOf,
graphTsEndMillis: chartsEnd.valueOf,
} as unknown as XScale;
graphTsStartMillis: chartsStart.valueOf(),
graphTsEndMillis: chartsEnd.valueOf(),
} as XScale;

return (
<>
Expand Down

0 comments on commit e5a1524

Please sign in to comment.