Ui/http request fixes (#7128)

* ensure dropdown updates selected item

* ensure no duplicate ticks

* handle case where counters are Dates instead of strings so bar chart filters in Storybook
This commit is contained in:
Noelle Daley
2019-07-16 16:26:49 -07:00
committed by GitHub
parent d3f527da62
commit f9268b8d09
3 changed files with 4 additions and 4 deletions

View File

@@ -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)

View File

@@ -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;
}),

View File

@@ -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>