Skip to content

Commit 2a1479f

Browse files
author
Mark Tiele Westra
committed
Merge branch 'develop' of https://github.com/akvo/akvo-flow into develop
2 parents 76835b5 + 850c1cc commit 2a1479f

File tree

5 files changed

+83
-22
lines changed

5 files changed

+83
-22
lines changed

Dashboard/app/js/lib/views/reports/export-reports-views.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -126,57 +126,56 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({
126126
showComprehensiveDialog: false,
127127
showRawDataImportApplet: false,
128128
showGoogleEarthButton: false,
129-
selectedSurvey:null,
130129

131130
didInsertElement: function () {
131+
FLOW.selectedControl.set('selectedSurvey', null);
132132
FLOW.uploader.registerEvents();
133133
},
134134

135+
selectedSurvey: function () {
136+
return FLOW.selectedControl.selectedSurvey.get('keyId');
137+
}.property(),
138+
135139
showRawDataReport: function () {
136-
if (!this.get('selectedSurvey')) {
140+
var sId = this.get('selectedSurvey');
141+
if (!sId) {
137142
this.showWarning();
138143
return;
139144
}
140-
FLOW.ReportLoader.load('RAW_DATA', this.selectedSurvey.get('id'));
145+
FLOW.ReportLoader.load('RAW_DATA', sId);
141146
},
142147

143148
showRawTextFileExport: function () {
144-
if (!this.get('selectedSurvey')) {
149+
var sId = this.get('selectedSurvey');
150+
if (!sId) {
145151
this.showWarning();
146152
return;
147153
}
148-
FLOW.ReportLoader.load('RAW_DATA_TEXT', this.selectedSurvey.get('id'));
154+
FLOW.ReportLoader.load('RAW_DATA_TEXT', sId);
149155
},
150156

151157
showComprehensiveReport: function () {
152-
var opts = {};
158+
var opts = {}, sId = this.get('selectedSurvey');
153159
this.set('showComprehensiveDialog', false);
154160

155161
opts.performRollup = '' + FLOW.editControl.summaryPerGeoArea;
156162
opts.nocharts = '' + FLOW.editControl.omitCharts;
157163

158-
FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', this.selectedSurvey.get('id'), opts);
159-
},
160-
161-
showGoogleEarthFile: function () {
162-
if (!this.get('selectedSurvey')) {
163-
this.showWarning();
164-
return;
165-
}
166-
this.renderApplet('showGoogleEarthFileApplet', true);
164+
FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', sId, opts);
167165
},
168166

169167
showSurveyForm: function () {
170-
if (!this.get('selectedSurvey')) {
168+
var sId = this.get('selectedSurvey');
169+
if (!sId) {
171170
this.showWarning();
172171
return;
173172
}
174-
FLOW.ReportLoader.load('SURVEY_FORM', this.selectedSurvey.get('id'));
173+
FLOW.ReportLoader.load('SURVEY_FORM', sId);
175174
},
176175

177176
importFile: function () {
178-
var file;
179-
if (!this.get('selectedSurvey')) {
177+
var file, sId = this.get('selectedSurvey');
178+
if (!sId) {
180179
this.showImportWarning(Ember.String.loc('_import_select_survey'));
181180
return;
182181
}
@@ -193,7 +192,8 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({
193192
},
194193

195194
showComprehensiveOptions: function () {
196-
if (!this.get('selectedSurvey')) {
195+
var sId = this.get('selectedSurvey');
196+
if (!sId) {
197197
this.showWarning();
198198
return;
199199
}

Dashboard/app/js/templates/navData/data-cleaning.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
{{view Ember.Select
1414
contentBinding="FLOW.surveyControl.arrangedContent"
15-
selectionBinding="view.selectedSurvey"
15+
selectionBinding="FLOW.selectedControl.selectedSurvey"
1616
optionLabelPath="content.code"
1717
optionValuePath="content.keyId"
1818
prompt=""

Dashboard/app/js/templates/navReports/export-reports.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
{{view Ember.Select
1414
contentBinding="FLOW.surveyControl.arrangedContent"
15-
selectionBinding="view.selectedSurvey"
15+
selectionBinding="FLOW.selectedControl.selectedSurvey"
1616
optionLabelPath="content.code"
1717
optionValuePath="content.keyId"
1818
prompt=""

GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,46 @@ protected RestResponse handleRequest(RestRequest req) throws Exception {
8080
.getAction())) {
8181
List<QuestionAnswerStoreDto> dtoList = new ArrayList<QuestionAnswerStoreDto>();
8282
boolean isNew = false;
83+
8384
if (importReq.getSurveyInstanceId() == null
8485
&& importReq.getSurveyId() != null) {
8586
// if the instanceID is null, we need to create one
8687
createInstance(importReq);
8788
isNew = true;
8889
}
90+
91+
if (importReq.getSurveyInstanceId() != null
92+
&& importReq.getSurveyId() != null) {
93+
94+
SurveyInstance si = new SurveyInstanceDAO().getByKey(importReq
95+
.getSurveyInstanceId());
96+
97+
if (si == null) {
98+
MessageDao mDao = new MessageDao();
99+
Message message = new Message();
100+
101+
message.setObjectId(importReq.getSurveyInstanceId());
102+
message.setActionAbout("importData");
103+
message.setShortMessage("Survey instance id ["
104+
+ importReq.getSurveyInstanceId()
105+
+ "] doesn't exist");
106+
mDao.save(message);
107+
return null;
108+
}
109+
110+
if (!si.getSurveyId().equals(importReq.getSurveyId())) {
111+
MessageDao mDao = new MessageDao();
112+
Message message = new Message();
113+
114+
message.setObjectId(importReq.getSurveyInstanceId());
115+
message.setActionAbout("importData");
116+
message.setShortMessage("Wrong survey selected when importing instance id ["
117+
+ importReq.getSurveyInstanceId() + "]");
118+
mDao.save(message);
119+
return null;
120+
}
121+
}
122+
89123
for (Map.Entry<Long, String[]> item : importReq
90124
.getQuestionAnswerMap().entrySet()) {
91125
QuestionAnswerStoreDto qasDto = new QuestionAnswerStoreDto();

RELEASE_NOTES.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ Read more about the [Akvo Platform](http://www.akvo.org/blog/?p=4822).
77

88
Akvo FLOW Dashboard release notes
99
----
10+
# 1.6.6
11+
12+
Release Date: 18 October 2013
13+
14+
## Enhancements
15+
Thanks to the efforts of the Water for People team, we now have a complete set of Spanish translations of the dashboard.
16+
17+
## Resolved issues
18+
* Fixed: Chart Builder should clean the previous chart on each question. (#365)
19+
* Fixed: 'No data available' warning still shown when data is available for chart. (#388)
20+
* Fixed: Increase performance of loading questions for charts. (#379)
21+
* Fixed: When showing a surveyGroup with a lot of surveys, scrolling behaviour is strange. (#387)
22+
* Fixed: Make summary count more robust to possible QAS duplicates. (#385)
23+
* Fixed: Trim user email address when creating a new user. (#384, #366)
24+
* Fixed: Make reports support languages other than english. (#381)
25+
* Fixed: Update FLOW logo. (#378)
26+
* Fixed: Move copy survey functionality to backend to avoid timeouts on large surveys. (#377)
27+
* Fixed: Bring back language dropdown and incorporate new spanish translations. (#376)
28+
* Fixed: Update instance creation templates with latest config. (#374)
29+
* Fixed: Improve efficiency in saving of surveyedLocales. (#373)
30+
* Fixed: Translations does not get copied when we copy a Survey. (#357)
31+
* Fixed: Prevent user from going to translations when there are unsaved changes. (#389)
32+
* Fixed: Better implementation of sort functions. (#394)
33+
* Fixed: Opt in a UUID implementation for `generateUniqueIdentifier` (#391)
34+
* Fixed: Fix faulty sort functions (#394)
35+
36+
1037
# 1.6.5
1138

1239
Release Date: 30 September 2013

0 commit comments

Comments
 (0)