mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 09:28:51 +00:00
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:
commit
6f26b9638b
@ -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());
|
||||
});
|
||||
|
@ -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);
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user