Skip to content

Commit

Permalink
Unique names for query parameters (re #164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short committed Jun 28, 2019
1 parent 9b721c7 commit c39a2d4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions client/app/services/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export class Parameter {
this.useCurrentDateTime = parameter.useCurrentDateTime;
this.global = parameter.global; // backward compatibility in Widget service
this.enumOptions = parameter.enumOptions;
this.queryId = parameter.queryId;
this.parentQueryId = parentQueryId;

// Used for meta-parameters (i.e. dashboard-level params)
Expand Down Expand Up @@ -175,7 +174,7 @@ export class Parameter {
};
}
return {
[`${prefix}${this.name}`]: this.value,
[`${prefix}${this.name}_${this.parentQueryId}`]: this.value,
};
}

Expand All @@ -188,7 +187,7 @@ export class Parameter {
this.setValue([query[keyStart], query[keyEnd]]);
}
} else {
const key = `${prefix}${this.name}`;
const key = `${prefix}${this.name}_${this.parentQueryId}`;
if (has(query, key)) {
this.setValue(query[key]);
}
Expand Down Expand Up @@ -551,7 +550,7 @@ function QueryResource(
extend(params, param.toUrlParams());
});
}
params = map(params, (value, name) => `${encodeURIComponent(name)}=${encodeURIComponent(value)}`).join('&');
params = map(params, (value, name) => `${encodeURIComponent(name)}_${this.id}=${encodeURIComponent(value)}`).join('&');

if (params !== '') {
url += `?${params}`;
Expand Down

0 comments on commit c39a2d4

Please sign in to comment.