diff --git a/client/app/components/parameters.js b/client/app/components/parameters.js index 9a3dd66169..6dd2a42942 100644 --- a/client/app/components/parameters.js +++ b/client/app/components/parameters.js @@ -123,7 +123,7 @@ function ParametersDirective($location, $uibModal) { } scope.parameters.forEach((param) => { if (param.value !== null || param.value !== '') { - $location.search(`p_${param.name}`, param.value); + $location.search(`p_${param.name}_${param.queryId}`, param.value); } }); }, true); diff --git a/client/app/services/query.js b/client/app/services/query.js index 935b8cba1b..67bccd1605 100644 --- a/client/app/services/query.js +++ b/client/app/services/query.js @@ -138,12 +138,12 @@ class Parameters { const parameterExists = p => contains(parameterNames, p.name); this.query.options.parameters = this.query.options.parameters .filter(parameterExists) - .map(p => new Parameter(p)); + .map(p => new Parameter(Object.assign({queryId: this.query.id}, p))); } initFromQueryString(queryString) { this.get().forEach((param) => { - const queryStringName = `p_${param.name}`; + const queryStringName = `p_${param.name}_${this.query.id}`; if (has(queryString, queryStringName)) { param.value = queryString[queryStringName]; } @@ -335,7 +335,7 @@ function QueryResource($resource, $http, $q, $location, currentUser, QueryResult params += '&'; } - params += `p_${encodeURIComponent(name)}=${encodeURIComponent(value)}`; + params += `p_${encodeURIComponent(name)}_${this.id}=${encodeURIComponent(value)}`; }); }