Fixed bug with auto refresh option being reset when changing relative time when now delay is configured, Fixes #2042

This commit is contained in:
Torkel Ödegaard 2015-05-26 16:48:23 +02:00
parent 921d672a2c
commit 99556057d1
2 changed files with 7 additions and 1 deletions

View File

@ -93,7 +93,7 @@ define([
_.extend(this.time, time);
// disable refresh if we have an absolute time
if (time.to !== 'now') {
if (time.to && time.to.indexOf('now') === -1) {
this.old_refresh = this.dashboard.refresh || this.old_refresh;
this.set_interval(false);
}

View File

@ -90,6 +90,12 @@ define([
ctx.service.setTime({from: '2011-01-01', to: 'now' });
expect(_dashboard.refresh).to.be('10s');
});
it('should keep refresh after relative time range is changed and now delay exists', function() {
_dashboard.refresh = '10s';
ctx.service.setTime({from: 'now-1h', to: 'now-10s' });
expect(_dashboard.refresh).to.be('10s');
});
});
});