From 5343dd9acff4cc7ed6e14f82fe2f9a99f078ee85 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 11 Feb 2018 11:48:12 +0200 Subject: [PATCH] Fix: parameters list was resetting when adding a new parameter --- client/app/services/query.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/app/services/query.js b/client/app/services/query.js index 81ad534f..e1345ca5 100644 --- a/client/app/services/query.js +++ b/client/app/services/query.js @@ -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, - }); + })); } });