From a2f4a20124fd8fe5118283f58d460e92a791c902 Mon Sep 17 00:00:00 2001 From: Jonas Metzener Date: Tue, 24 Oct 2017 13:30:15 +0200 Subject: [PATCH] Fix report export urls (#127) --- app/analysis/controller.js | 15 ++++++++------- app/analysis/template.hbs | 2 +- config/environment.js | 18 ++++++++++++++---- tests/unit/analysis/controller-test.js | 3 ++- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/app/analysis/controller.js b/app/analysis/controller.js index c842c28cd..c1983a8bd 100644 --- a/app/analysis/controller.js +++ b/app/analysis/controller.js @@ -21,30 +21,31 @@ const AnalysisController = Controller.extend(ReportFilterControllerMixin, { exportLinks: config.APP.REPORTEXPORTS, - getTarget(url) { + getTarget(url, params) { let queryString = toQueryString( - cleanParams( - this.getProperties( + cleanParams({ + ...params, + ...this.getProperties( ...this.get('queryParams').filter( key => !['page', 'page_size'].includes(key) ), 'jwt' ) - ) + }) ) - return `${url}&${queryString}` + return `${url}?${queryString}` }, actions: { - download(url) { + download(url, params) { /* istanbul ignore else */ if (testing) { return } /* istanbul ignore next */ - window.location.href = this.getTarget(url) + window.location.href = this.getTarget(url, params) } } }) diff --git a/app/analysis/template.hbs b/app/analysis/template.hbs index f8ea71bb0..88698227d 100644 --- a/app/analysis/template.hbs +++ b/app/analysis/template.hbs @@ -66,7 +66,7 @@

{{#each exportLinks as |link index|}} -