feat(adhoc filters): good progress on ad hoc filters and sync from to url, #6038

This commit is contained in:
Torkel Ödegaard
2016-09-20 11:57:43 +02:00
parent cb522d58cd
commit 6e429b8575
14 changed files with 351 additions and 287 deletions

View File

@@ -34,10 +34,6 @@ function (angular, _, $) {
$location.search(urlParams);
});
$scope.onAppEvent('template-variable-value-updated', function() {
self.updateUrlParamsWithCurrentVariables();
});
$scope.onAppEvent('$routeUpdate', function() {
var urlState = self.getQueryStringState();
if (self.needsSync(urlState)) {
@@ -57,22 +53,6 @@ function (angular, _, $) {
this.expandRowForPanel();
}
DashboardViewState.prototype.updateUrlParamsWithCurrentVariables = function() {
// update url
var params = $location.search();
// remove variable params
_.each(params, function(value, key) {
if (key.indexOf('var-') === 0) {
delete params[key];
}
});
// add new values
templateSrv.fillVariableValuesForUrl(params);
// update url
$location.search(params);
};
DashboardViewState.prototype.expandRowForPanel = function() {
if (!this.state.panelId) { return; }