From 05cd9fd5467928914414279f63b1e675aba901ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Perdomo?= Date: Fri, 18 Oct 2013 13:18:10 +0200 Subject: [PATCH 1/6] Add release notes for v1.6.6 --- RELEASE_NOTES.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 11fa73c6f0..c1e8f6925d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,33 @@ Read more about the [Akvo Platform](http://www.akvo.org/blog/?p=4822). Akvo FLOW Dashboard release notes ---- +# 1.6.6 + +Release Date: 18 October 2013 + +## Enhancements +Thanks to the efforts of the Water for People team, we now have a complete set of Spanish translations of the dashboard. + +## Resolved issues +* Fixed: Chart Builder should clean the previous chart on each question. (#365) +* Fixed: 'No data available' warning still shown when data is available for chart. (#388) +* Fixed: Increase performance of loading questions for charts. (#379) +* Fixed: When showing a surveyGroup with a lot of surveys, scrolling behaviour is strange. (#387) +* Fixed: Make summary count more robust to possible QAS duplicates. (#385) +* Fixed: Trim user email address when creating a new user. (#384, #366) +* Fixed: Make reports support languages other than english. (#381) +* Fixed: Update FLOW logo. (#378) +* Fixed: Move copy survey functionality to backend to avoid timeouts on large surveys. (#377) +* Fixed: Bring back language dropdown and incorporate new spanish translations. (#376) +* Fixed: Update instance creation templates with latest config. (#374) +* Fixed: Improve efficiency in saving of surveyedLocales. (#373) +* Fixed: Translations does not get copied when we copy a Survey. (#357) +* Fixed: Prevent user from going to translations when there are unsaved changes. (#389) +* Fixed: Better implementation of sort functions. (#394) +* Fixed: Opt in a UUID implementation for `generateUniqueIdentifier` (#391) +* Fixed: Fix faulty sort functions (#394) + + # 1.6.5 Release Date: 30 September 2013 From ba42960492b77cfb990a7e0d3925dd4921f70187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Perdomo?= Date: Mon, 28 Oct 2013 17:20:38 +0100 Subject: [PATCH 2/6] Issue #408 - Verifies that surveyId match with survey instance * We send the surveyId in the HTTP request for data cleaning, we now compare if the existing survey instance, has the same surveyId, if they don't match, we log a message and abort the process. --- .../mapping/app/web/RawDataRestServlet.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java index 7fd2503268..19708b53a3 100644 --- a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java +++ b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java @@ -80,12 +80,36 @@ protected RestResponse handleRequest(RestRequest req) throws Exception { .getAction())) { List dtoList = new ArrayList(); boolean isNew = false; + if (importReq.getSurveyInstanceId() == null && importReq.getSurveyId() != null) { // if the instanceID is null, we need to create one createInstance(importReq); isNew = true; } + + if (importReq.getSurveyInstanceId() != null + && importReq.getSurveyId() != null) { + + SurveyInstance si = new SurveyInstanceDAO().getByKey(importReq + .getSurveyedLocaleId()); + + if (si != null + && !si.getSurveyId().equals(importReq.getSurveyId())) { + + MessageDao mDao = new MessageDao(); + Message message = new Message(); + + message.setObjectId(importReq.getSurveyInstanceId()); + message.setActionAbout("importData"); + message.setShortMessage("Wrong survey selected for instance id [" + + importReq.getSurveyInstanceId() + "]"); + mDao.save(message); + + return null; + } + } + for (Map.Entry item : importReq .getQuestionAnswerMap().entrySet()) { QuestionAnswerStoreDto qasDto = new QuestionAnswerStoreDto(); From 270b6db645539067c0ba300b810fb5508f460d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Perdomo?= Date: Tue, 29 Oct 2013 09:35:13 +0100 Subject: [PATCH 3/6] Issue #416 - Fix regression problem with Survey dropdown * The data-binding for the selected survey was changed. We now use the `selectedControl` for picking the surveyId --- Dashboard/app/js/lib/views/reports/export-reports-views.js | 3 ++- Dashboard/app/js/templates/navData/data-cleaning.handlebars | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dashboard/app/js/lib/views/reports/export-reports-views.js b/Dashboard/app/js/lib/views/reports/export-reports-views.js index 3add2bd38a..b150fe94f8 100644 --- a/Dashboard/app/js/lib/views/reports/export-reports-views.js +++ b/Dashboard/app/js/lib/views/reports/export-reports-views.js @@ -129,6 +129,7 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({ selectedSurvey:null, didInsertElement: function () { + FLOW.selectedControl.set('selectedSurvey', null); FLOW.uploader.registerEvents(); }, @@ -176,7 +177,7 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({ importFile: function () { var file; - if (!this.get('selectedSurvey')) { + if (!FLOW.selectedControl.selectedSurvey) { this.showImportWarning(Ember.String.loc('_import_select_survey')); return; } diff --git a/Dashboard/app/js/templates/navData/data-cleaning.handlebars b/Dashboard/app/js/templates/navData/data-cleaning.handlebars index a4d1059376..f1c2ed1257 100644 --- a/Dashboard/app/js/templates/navData/data-cleaning.handlebars +++ b/Dashboard/app/js/templates/navData/data-cleaning.handlebars @@ -12,7 +12,7 @@ {{view Ember.Select contentBinding="FLOW.surveyControl.arrangedContent" - selectionBinding="view.selectedSurvey" + selectionBinding="FLOW.selectedControl.selectedSurvey" optionLabelPath="content.code" optionValuePath="content.keyId" prompt="" From 324afe7355be0a56b5f49bc7224a4cdcc62254da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Perdomo?= Date: Tue, 29 Oct 2013 09:41:12 +0100 Subject: [PATCH 4/6] Issue #408 - Fix wrong get call to property --- .../org/waterforpeople/mapping/app/web/RawDataRestServlet.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java index 19708b53a3..d7afb78ee1 100644 --- a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java +++ b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java @@ -91,8 +91,7 @@ protected RestResponse handleRequest(RestRequest req) throws Exception { if (importReq.getSurveyInstanceId() != null && importReq.getSurveyId() != null) { - SurveyInstance si = new SurveyInstanceDAO().getByKey(importReq - .getSurveyedLocaleId()); + SurveyInstance si = new SurveyInstanceDAO().getByKey(importReq.getSurveyInstanceId()); if (si != null && !si.getSurveyId().equals(importReq.getSurveyId())) { From 75518b8ece4f71a222e6e4e1d2bb1d6b167c9441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Perdomo?= Date: Tue, 29 Oct 2013 10:26:21 +0100 Subject: [PATCH 5/6] Issue #416 - Get the surveyId from the bound object * The user selection is bound to FLOW.selectedControl.selectedSurvey * We use it for getting the id of the survey --- .../lib/views/reports/export-reports-views.js | 39 +++++++++---------- .../navReports/export-reports.handlebars | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Dashboard/app/js/lib/views/reports/export-reports-views.js b/Dashboard/app/js/lib/views/reports/export-reports-views.js index b150fe94f8..a2ec4dee3f 100644 --- a/Dashboard/app/js/lib/views/reports/export-reports-views.js +++ b/Dashboard/app/js/lib/views/reports/export-reports-views.js @@ -126,58 +126,56 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({ showComprehensiveDialog: false, showRawDataImportApplet: false, showGoogleEarthButton: false, - selectedSurvey:null, didInsertElement: function () { FLOW.selectedControl.set('selectedSurvey', null); FLOW.uploader.registerEvents(); }, + selectedSurvey: function () { + return FLOW.selectedControl.selectedSurvey.get('keyId'); + }.property(), + showRawDataReport: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } - FLOW.ReportLoader.load('RAW_DATA', this.selectedSurvey.get('id')); + FLOW.ReportLoader.load('RAW_DATA', sId); }, showRawTextFileExport: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } - FLOW.ReportLoader.load('RAW_DATA_TEXT', this.selectedSurvey.get('id')); + FLOW.ReportLoader.load('RAW_DATA_TEXT', sId); }, showComprehensiveReport: function () { - var opts = {}; + var opts = {}, sId = this.get('selectedSurvey'); this.set('showComprehensiveDialog', false); opts.performRollup = '' + FLOW.editControl.summaryPerGeoArea; opts.nocharts = '' + FLOW.editControl.omitCharts; - FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', this.selectedSurvey.get('id'), opts); - }, - - showGoogleEarthFile: function () { - if (!this.get('selectedSurvey')) { - this.showWarning(); - return; - } - this.renderApplet('showGoogleEarthFileApplet', true); + FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', sId, opts); }, showSurveyForm: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } - FLOW.ReportLoader.load('SURVEY_FORM', this.selectedSurvey.get('id')); + FLOW.ReportLoader.load('SURVEY_FORM', sId); }, importFile: function () { - var file; - if (!FLOW.selectedControl.selectedSurvey) { + var file, sId = this.get('selectedSurvey'); + if (!sId) { this.showImportWarning(Ember.String.loc('_import_select_survey')); return; } @@ -194,7 +192,8 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({ }, showComprehensiveOptions: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } diff --git a/Dashboard/app/js/templates/navReports/export-reports.handlebars b/Dashboard/app/js/templates/navReports/export-reports.handlebars index 71900fa6ad..c703a2df59 100644 --- a/Dashboard/app/js/templates/navReports/export-reports.handlebars +++ b/Dashboard/app/js/templates/navReports/export-reports.handlebars @@ -12,7 +12,7 @@ {{view Ember.Select contentBinding="FLOW.surveyControl.arrangedContent" - selectionBinding="view.selectedSurvey" + selectionBinding="FLOW.selectedControl.selectedSurvey" optionLabelPath="content.code" optionValuePath="content.keyId" prompt="" From 850c1ccd7fc743525190925c0c2ee4b7bed88ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Perdomo?= Date: Tue, 29 Oct 2013 10:31:02 +0100 Subject: [PATCH 6/6] Issue #416 - Add extra verification for the existence of surveyInstance --- .../mapping/app/web/RawDataRestServlet.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java index d7afb78ee1..6e8ff17bcf 100644 --- a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java +++ b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java @@ -91,20 +91,31 @@ protected RestResponse handleRequest(RestRequest req) throws Exception { if (importReq.getSurveyInstanceId() != null && importReq.getSurveyId() != null) { - SurveyInstance si = new SurveyInstanceDAO().getByKey(importReq.getSurveyInstanceId()); + SurveyInstance si = new SurveyInstanceDAO().getByKey(importReq + .getSurveyInstanceId()); - if (si != null - && !si.getSurveyId().equals(importReq.getSurveyId())) { + if (si == null) { + MessageDao mDao = new MessageDao(); + Message message = new Message(); + message.setObjectId(importReq.getSurveyInstanceId()); + message.setActionAbout("importData"); + message.setShortMessage("Survey instance id [" + + importReq.getSurveyInstanceId() + + "] doesn't exist"); + mDao.save(message); + return null; + } + + if (!si.getSurveyId().equals(importReq.getSurveyId())) { MessageDao mDao = new MessageDao(); Message message = new Message(); message.setObjectId(importReq.getSurveyInstanceId()); message.setActionAbout("importData"); - message.setShortMessage("Wrong survey selected for instance id [" + message.setShortMessage("Wrong survey selected when importing instance id [" + importReq.getSurveyInstanceId() + "]"); mDao.save(message); - return null; } }