Skip to content

Commit

Permalink
Ui/http request fixes (#7128)
Browse files Browse the repository at this point in the history
* ensure dropdown updates selected item

* ensure no duplicate ticks

* handle case where counters are Dates instead of strings so bar chart filters in Storybook
  • Loading branch information
Noelle Daley authored Jul 16, 2019
1 parent d3f527d commit f9268b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/app/components/http-requests-bar-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default Component.extend({
// scale and render the axes
const yAxis = d3Axis
.axisRight(yScale)
.ticks(3, '.0s')
.ticks(3, '~s')
.tickSizeOuter(0);
const xAxis = d3Axis
.axisBottom(xScale)
Expand Down
4 changes: 2 additions & 2 deletions ui/app/components/http-requests-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default Component.extend({
}

filteredCounters = counters.filter(counter => {
const year = counter.start_time.substr(0, 4);
return year === timeWindow;
const year = new Date(counter.start_time).getUTCFullYear();
return year.toString() === timeWindow;
});
return filteredCounters;
}),
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/http-requests-dropdown.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<option value="All" selected={{eq timeWindow "All"}}>All</option>/>
<option value="Last 12 Months" selected={{eq timeWindow "Last 12 Months"}}>Last 12 Months</option>
{{#each options as |op|}}
<option value={{op}} selected={{eq timeWindow op}}>{{op}}</option>
<option value={{op}} selected={{eq timeWindow.value op}}>{{op}}</option>
{{/each}}
</select>
</div>

0 comments on commit f9268b8

Please sign in to comment.