Merge pull request #2308 from getredash/fix_params

Fix: parameters list was resetting when adding a new parameter
This commit is contained in:
Arik Fraimovich 2018-02-11 11:55:47 +02:00 committed by GitHub
commit 953efc472f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,6 +102,8 @@ class Parameters {
parameters = uniq(collectParams(parts));
} catch (e) {
logger('Failed parsing parameters: ', e);
// Return current parameters so we don't reset the list
parameters = pluck(this.query.options.parameters, 'name');
}
return parameters;
}
@ -123,13 +125,13 @@ class Parameters {
parameterNames.forEach((param) => {
if (!has(parametersMap, param)) {
this.query.options.parameters.push({
this.query.options.parameters.push(new Parameter({
title: param,
name: param,
type: 'text',
value: null,
global: false,
});
}));
}
});