Skip to content

Commit

Permalink
Merge pull request #2308 from getredash/fix_params
Browse files Browse the repository at this point in the history
Fix: parameters list was resetting when adding a new parameter
  • Loading branch information
arikfr authored Feb 11, 2018
2 parents 29c675b + 5343dd9 commit 953efc4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/app/services/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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,
});
}));
}
});

Expand Down

0 comments on commit 953efc4

Please sign in to comment.