Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/akvo/akvo-flow into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Tiele Westra committed Oct 30, 2013
2 parents 76835b5 + 850c1cc commit 2a1479f
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 22 deletions.
40 changes: 20 additions & 20 deletions Dashboard/app/js/lib/views/reports/export-reports-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,57 +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 (!this.get('selectedSurvey')) {
var file, sId = this.get('selectedSurvey');
if (!sId) {
this.showImportWarning(Ember.String.loc('_import_select_survey'));
return;
}
Expand All @@ -193,7 +192,8 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({
},

showComprehensiveOptions: function () {
if (!this.get('selectedSurvey')) {
var sId = this.get('selectedSurvey');
if (!sId) {
this.showWarning();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
34 changes: 34 additions & 0 deletions GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,46 @@ protected RestResponse handleRequest(RestRequest req) throws Exception {
.getAction())) {
List<QuestionAnswerStoreDto> dtoList = new ArrayList<QuestionAnswerStoreDto>();
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
.getSurveyInstanceId());

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 when importing instance id ["
+ importReq.getSurveyInstanceId() + "]");
mDao.save(message);
return null;
}
}

for (Map.Entry<Long, String[]> item : importReq
.getQuestionAnswerMap().entrySet()) {
QuestionAnswerStoreDto qasDto = new QuestionAnswerStoreDto();
Expand Down
27 changes: 27 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a1479f

Please sign in to comment.