mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-28 22:21:30 +01:00
Fix barchart bugs (#7063)
* ensure dropdown works in storybook by handling Dates and strings * camelcase fix * ensure tooltip doesn't blink
This commit is contained in:
parent
d9113f1668
commit
1760c321db
@ -34,9 +34,9 @@ export default Component.extend({
|
||||
let filteredCounters = [];
|
||||
if (timeWindow === 'Last 12 Months') {
|
||||
const today = new Date();
|
||||
const TwelveMonthsAgo = addMonths(today, -12);
|
||||
const twelveMonthsAgo = addMonths(today, -12);
|
||||
filteredCounters = counters.filter(counter => {
|
||||
return isWithinRange(counter.start_time, TwelveMonthsAgo, today);
|
||||
return isWithinRange(counter.start_time, twelveMonthsAgo, today);
|
||||
});
|
||||
|
||||
return filteredCounters;
|
||||
|
||||
@ -27,7 +27,12 @@ export default Component.extend({
|
||||
let counters = this.counters || [];
|
||||
let options = [];
|
||||
if (counters.length) {
|
||||
const years = counters.map(counter => counter.start_time.substr(0, 4)).uniq();
|
||||
const years = counters
|
||||
.map(counter => {
|
||||
const year = new Date(counter.start_time);
|
||||
return year.getUTCFullYear();
|
||||
})
|
||||
.uniq();
|
||||
years.sort().reverse();
|
||||
options = options.concat(years);
|
||||
}
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
background: $grey;
|
||||
color: $ui-gray-010;
|
||||
border-radius: 2px;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
/* Creates a small triangle extender for the tooltip */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user