Merge pull request #2769 from kravets-levko/bug/dashboard-parameters-not-updated

Date/time params not working as global param
This commit is contained in:
Arik Fraimovich 2018-08-29 09:50:11 +03:00 committed by GitHub
commit 6f26b9638b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -136,7 +136,7 @@ function ParametersDirective($location, $uibModal) {
if (scope.changed) {
scope.changed({});
}
const params = {};
const params = extend({}, $location.search());
scope.parameters.forEach((param) => {
extend(params, param.toUrlParams());
});

View File

@ -109,7 +109,7 @@ function DashboardCtrl(
.filter(p => p.global)
.forEach((param) => {
const defaults = {};
defaults[param.name] = _.create(Object.getPrototypeOf(param), param);
defaults[param.name] = param.clone();
defaults[param.name].locals = [];
globalParams = _.defaults(globalParams, defaults);
globalParams[param.name].locals.push(param);

View File

@ -57,10 +57,10 @@ class Parameter {
// validate value and init internal state
this.setValue(parameter.value);
}
// explicitly bind it to `this` to allow passing it as callback to Ant's
// DatePicker component
this.setValue = this.setValue.bind(this);
clone() {
return new Parameter(this);
}
get isEmpty() {