Commit 976f1feb authored by Jose Vargas's avatar Jose Vargas

Document getTimeDifferenceMinutes usage

Also added a finally clause to the getGraphsDataWithTime promise
parent a6f9f79b
......@@ -178,11 +178,12 @@ export default {
.then(data => {
this.store.storeMetrics(data);
this.selectedTimeWindow = this.timeWindows[timeFrame];
this.showEmptyState = false;
})
.catch(() => {
this.showEmptyState = false;
Flash(s__('Metrics|Not enough data to display'));
})
.finally(() => {
this.showEmptyState = false;
});
},
onSidebarMutation() {
......
import { timeWindows, msPerMinute } from './constants';
/**
* method that converts a predetermined time window to minutes
* defaults to 8 hours as the default option
* @param {String} timeWindow - The time window to convert to minutes
* @returns {number} The time window in minutes
*/
const getTimeDifferenceMinutes = timeWindow => {
switch (timeWindow) {
case timeWindows.thirtyMinutes:
......
......@@ -224,7 +224,7 @@ describe('Dashboard', () => {
});
});
it('rewnders the time window dropdown with a set of options', done => {
it('renders the time window dropdown with a set of options', done => {
const component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment