From 16744822856fc04f4396b1a3149de6cb99886196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stellan=20Lagerstr=C3=B6m?= Date: Mon, 11 Dec 2017 13:44:22 +0100 Subject: [PATCH 01/41] [#2315]Unique column names in analysis format even if no variable name. Align param names with external term. --- .../GraphicalSurveySummaryExporter.java | 72 ++++++++++++------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java index 1f3547d41b..59fb3d97c1 100644 --- a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java +++ b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java @@ -1202,6 +1202,14 @@ private void addMetaDataColumnHeader(String columnHeaderName, int columnIdx, Row } + /** + * writes the raw data headers for one question group + * @param sheet + * @param group + * @param questions + * @param startOffset + * @return + */ private int writeRawDataGroupHeaders(Sheet sheet, QuestionGroupDto group, List questions, final int startOffset) { int offset = startOffset; Row row = getRow(doGroupHeaders ? 1 : 0, sheet); @@ -1210,6 +1218,7 @@ private int writeRawDataGroupHeaders(Sheet sheet, QuestionGroupDto group, List retrieveCaddisflyTestsDefinitions() { } private int addPhotoDataColumnHeader(QuestionDto q, Row row, int originalOffset, String questionId, - boolean useQuestionId, final boolean useQID) { + boolean analysisFormat, final boolean useVarName) { int offset = originalOffset; // Always a URL column String header = ""; - if (useQID) { + if (useVarName) { header = questionId; - } else if (useQuestionId) { + } else if (analysisFormat) { header = q.getText().replaceAll("\n", "").trim(); } else { header = q.getKeyId().toString() @@ -1395,7 +1404,7 @@ private int addPhotoDataColumnHeader(QuestionDto q, Row row, int originalOffset, + q.getText().replaceAll("\n", "").trim(); } createCell(row, offset++, header, headerStyle); - if (useQuestionId) { + if (analysisFormat) { // Media gets 3 extra columns: Latitude, Longitude and Accuracy String prefix = "--PHOTO--|"; createCell(row, offset++, @@ -1408,35 +1417,44 @@ private int addPhotoDataColumnHeader(QuestionDto q, Row row, int originalOffset, return offset; } - private int addGeoDataColumnHeader(QuestionDto q, Row row, int originalOffset, String questionId, - boolean useQuestionId, final boolean useQID) { + + + /** + * @param q + * @param row + * @param originalOffset + * @param varName + * @param analysisFormat + * @param useVarName + * @return the new offset + * + */ + private int addGeoDataColumnHeader(QuestionDto q, Row row, int originalOffset, String varName, + boolean analysisFormat, final boolean useVarName) { int offset = originalOffset; - if (useQuestionId) { - createCell( - row, - offset++, - (useQID ? questionId + "_" - : q.getText() + " - ") - + LAT_LABEL, - headerStyle); + if (analysisFormat) { + if (useVarName) { + createCell(row, offset++, varName + "_" + LAT_LABEL, headerStyle); + createCell(row, offset++, varName + "_" + LON_LABEL, headerStyle); + createCell(row, offset++, varName + "_" + ELEV_LABEL, headerStyle); + createCell(row, offset++, varName + "_" + CODE_LABEL.replaceAll("\\s", ""), + headerStyle); + } else { + createCell(row, offset++, q.getText() + " - " + LAT_LABEL, headerStyle); + createCell(row, offset++, q.getText() + " - " + LON_LABEL, headerStyle); + createCell(row, offset++, q.getText() + " - " + ELEV_LABEL, headerStyle); + createCell(row, offset++, q.getText() + " - " + CODE_LABEL, headerStyle); + } } else { - createCell(row, offset++, q.getKeyId() + "|" - + LAT_LABEL, - headerStyle); + createCell(row, offset++, q.getKeyId() + "|" + LAT_LABEL, headerStyle); + createCell(row, offset++, "--GEOLON--|" + LON_LABEL, headerStyle); + createCell(row, offset++, "--GEOELE--|" + ELEV_LABEL, headerStyle); + createCell(row, offset++, "--GEOCODE--|" + CODE_LABEL, headerStyle); } - createCell(row, offset++, (useQID ? questionId - + "_" : "--GEOLON--|") - + LON_LABEL, headerStyle); - createCell(row, offset++, (useQID ? questionId - + "_" : "--GEOELE--|") - + ELEV_LABEL, headerStyle); - String codeLabel = CODE_LABEL; - createCell(row, offset++, useQID ? questionId + "_" - + codeLabel.replaceAll("\\s", "") - : "--GEOCODE--|" + codeLabel, headerStyle); return offset; } + /** * Writes the report as an XLS document */ From 931a92c447dfc4182422400471ff9aa6e3d05874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stellan=20Lagerstr=C3=B6m?= Date: Mon, 11 Dec 2017 14:06:54 +0100 Subject: [PATCH 02/41] [#2315]Make method for header cells. --- .../GraphicalSurveySummaryExporter.java | 63 +++++++++---------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java index 59fb3d97c1..f8535df0c5 100644 --- a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java +++ b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java @@ -1236,7 +1236,7 @@ private int writeRawDataGroupHeaders(Sheet sheet, QuestionGroupDto group, List 0) ? qo.getCode() + ":" : ""; - createCell(row, + createHeaderCell(row, offset++, - "--OPTION--|" + header + qo.getText(), - headerStyle); + "--OPTION--|" + header + qo.getText()); } // add 'other' column if needed if (q.getAllowOtherFlag()) { - createCell(row, + createHeaderCell(row, offset++, - "--OTHER--", - headerStyle); + "--OTHER--"); } optionMap.put(q.getKeyId(), qoList); @@ -1361,17 +1359,16 @@ private int addCaddisflyDataHeaderColumns(QuestionDto q, Row row, int originalOf } else { columnHeader = "--CADDISFLY--|" + columnHeaderSuffix; } - createCell(row, offset++, columnHeader, headerStyle); + createHeaderCell(row, offset++, columnHeader); } if (cr.getHasImage()) { - createCell( + createHeaderCell( row, offset++, "--CADDISFLY--|" + q.getText() + "--" - + IMAGE_LABEL, - headerStyle); + + IMAGE_LABEL); } // store hasImage in hashmap @@ -1403,16 +1400,13 @@ private int addPhotoDataColumnHeader(QuestionDto q, Row row, int originalOffset, + "|" + q.getText().replaceAll("\n", "").trim(); } - createCell(row, offset++, header, headerStyle); + createHeaderCell(row, offset++, header); if (analysisFormat) { // Media gets 3 extra columns: Latitude, Longitude and Accuracy String prefix = "--PHOTO--|"; - createCell(row, offset++, - prefix + LAT_LABEL, headerStyle); - createCell(row, offset++, - prefix + LON_LABEL, headerStyle); - createCell(row, offset++, - prefix + ACC_LABEL, headerStyle); + createHeaderCell(row, offset++, prefix + LAT_LABEL); + createHeaderCell(row, offset++, prefix + LON_LABEL); + createHeaderCell(row, offset++, prefix + ACC_LABEL); } return offset; } @@ -1434,22 +1428,21 @@ private int addGeoDataColumnHeader(QuestionDto q, Row row, int originalOffset, S int offset = originalOffset; if (analysisFormat) { if (useVarName) { - createCell(row, offset++, varName + "_" + LAT_LABEL, headerStyle); - createCell(row, offset++, varName + "_" + LON_LABEL, headerStyle); - createCell(row, offset++, varName + "_" + ELEV_LABEL, headerStyle); - createCell(row, offset++, varName + "_" + CODE_LABEL.replaceAll("\\s", ""), - headerStyle); + createHeaderCell(row, offset++, varName + "_" + LAT_LABEL); + createHeaderCell(row, offset++, varName + "_" + LON_LABEL); + createHeaderCell(row, offset++, varName + "_" + ELEV_LABEL); + createHeaderCell(row, offset++, varName + "_" + CODE_LABEL.replaceAll("\\s", "")); } else { - createCell(row, offset++, q.getText() + " - " + LAT_LABEL, headerStyle); - createCell(row, offset++, q.getText() + " - " + LON_LABEL, headerStyle); - createCell(row, offset++, q.getText() + " - " + ELEV_LABEL, headerStyle); - createCell(row, offset++, q.getText() + " - " + CODE_LABEL, headerStyle); + createHeaderCell(row, offset++, q.getText() + " - " + LAT_LABEL); + createHeaderCell(row, offset++, q.getText() + " - " + LON_LABEL); + createHeaderCell(row, offset++, q.getText() + " - " + ELEV_LABEL); + createHeaderCell(row, offset++, q.getText() + " - " + CODE_LABEL); } - } else { - createCell(row, offset++, q.getKeyId() + "|" + LAT_LABEL, headerStyle); - createCell(row, offset++, "--GEOLON--|" + LON_LABEL, headerStyle); - createCell(row, offset++, "--GEOELE--|" + ELEV_LABEL, headerStyle); - createCell(row, offset++, "--GEOCODE--|" + CODE_LABEL, headerStyle); + } else { //Import currently relies on the --GEO headers + createHeaderCell(row, offset++, q.getKeyId() + "|" + LAT_LABEL); + createHeaderCell(row, offset++, "--GEOLON--|" + LON_LABEL); + createHeaderCell(row, offset++, "--GEOELE--|" + ELEV_LABEL); + createHeaderCell(row, offset++, "--GEOCODE--|" + CODE_LABEL); } return offset; } @@ -1688,6 +1681,10 @@ protected Cell createCell(Row row, int col, String value) { return createCell(row, col, value, null, -1); } + protected Cell createHeaderCell(Row row, int col, String value) { + return createCell(row, col, value, headerStyle, -1); + } + protected Cell createCell(Row row, int col, String value, CellStyle style) { return createCell(row, col, value, style, -1); } From f94777905bb9be897cab891adc17fdcc695878aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stellan=20Lagerstr=C3=B6m?= Date: Mon, 11 Dec 2017 16:55:30 +0100 Subject: [PATCH 03/41] [#2367]Hide and discard geocode on export and import. --- .../dataexport/GraphicalSurveySummaryExporter.java | 8 ++------ .../mapping/dataexport/RawDataExporter.java | 4 ++-- .../mapping/dataexport/RawDataSpreadsheetImporter.java | 4 +--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java index f8535df0c5..de7e115274 100644 --- a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java +++ b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java @@ -133,7 +133,6 @@ public class GraphicalSurveySummaryExporter extends SurveySummaryExporter { private static final String IMAGE_LABEL = "Image"; private static final String ELEV_LABEL = "Elevation"; private static final String ACC_LABEL = "Accuracy (m)"; - private static final String CODE_LABEL = "Geo Code"; private static final String IDENTIFIER_LABEL = "Identifier"; private static final String DISPLAY_NAME_LABEL = "Display Name"; private static final String DEVICE_IDENTIFIER_LABEL = "Device identifier"; @@ -788,11 +787,11 @@ private static List geoCellValues(String value) { String[] geoParts = value.split("\\|"); List cells = new ArrayList<>(); int count = 0; - for (count = 0; count < geoParts.length; count++) { + for (count = 0; count < Math.min(geoParts.length,3); count++) { //discard any geocode cells.add(geoParts[count]); } // now handle any missing fields - for (int j = count; j < 4; j++) { + for (int j = count; j < 3; j++) { cells.add(""); } @@ -1431,18 +1430,15 @@ private int addGeoDataColumnHeader(QuestionDto q, Row row, int originalOffset, S createHeaderCell(row, offset++, varName + "_" + LAT_LABEL); createHeaderCell(row, offset++, varName + "_" + LON_LABEL); createHeaderCell(row, offset++, varName + "_" + ELEV_LABEL); - createHeaderCell(row, offset++, varName + "_" + CODE_LABEL.replaceAll("\\s", "")); } else { createHeaderCell(row, offset++, q.getText() + " - " + LAT_LABEL); createHeaderCell(row, offset++, q.getText() + " - " + LON_LABEL); createHeaderCell(row, offset++, q.getText() + " - " + ELEV_LABEL); - createHeaderCell(row, offset++, q.getText() + " - " + CODE_LABEL); } } else { //Import currently relies on the --GEO headers createHeaderCell(row, offset++, q.getKeyId() + "|" + LAT_LABEL); createHeaderCell(row, offset++, "--GEOLON--|" + LON_LABEL); createHeaderCell(row, offset++, "--GEOELE--|" + ELEV_LABEL); - createHeaderCell(row, offset++, "--GEOCODE--|" + CODE_LABEL); } return offset; } diff --git a/GAE/src/org/waterforpeople/mapping/dataexport/RawDataExporter.java b/GAE/src/org/waterforpeople/mapping/dataexport/RawDataExporter.java index 8f03b69191..d5c6bb46c8 100644 --- a/GAE/src/org/waterforpeople/mapping/dataexport/RawDataExporter.java +++ b/GAE/src/org/waterforpeople/mapping/dataexport/RawDataExporter.java @@ -196,14 +196,14 @@ private void exportInstances(Writer pw, List idList) if (qdto != null && QuestionType.GEO == qdto.getType()) { String[] geoParts = val.split("\\|"); int count = 0; - for (count = 0; count < geoParts.length; count++) { + for (count = 0; count < Math.min(geoParts.length, 3); count++) { if (count > 0) { pw.write("\t"); } pw.write(geoParts[count]); } // now handle any missing fields - for (int j = count; j < 4; j++) { + for (int j = count; j < 3; j++) { pw.write("\t"); } } else { diff --git a/GAE/src/org/waterforpeople/mapping/dataexport/RawDataSpreadsheetImporter.java b/GAE/src/org/waterforpeople/mapping/dataexport/RawDataSpreadsheetImporter.java index 8aef996768..4383845c24 100644 --- a/GAE/src/org/waterforpeople/mapping/dataexport/RawDataSpreadsheetImporter.java +++ b/GAE/src/org/waterforpeople/mapping/dataexport/RawDataSpreadsheetImporter.java @@ -659,10 +659,8 @@ private void getIterationResponse(Row iterationRow, .getCell(columnIndex + 1)); String elevation = ExportImportUtils.parseCellAsString(iterationRow .getCell(columnIndex + 2)); - String geoCode = ExportImportUtils.parseCellAsString(iterationRow - .getCell(columnIndex + 3)); if (latitude != "" && longitude != "") { //We want both else ignore - val = latitude + "|" + longitude + "|" + elevation + "|" + geoCode; + val = latitude + "|" + longitude + "|" + elevation; } break; case CASCADE: From d4ab0f8a0bc2c5545704929d5dc77a152b9a2695 Mon Sep 17 00:00:00 2001 From: Charles Kimani Date: Wed, 20 Dec 2017 15:16:52 +0300 Subject: [PATCH 04/41] [#2275] use extend intead of create maps arrayController --- Dashboard/app/js/lib/controllers/maps-controllers-common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dashboard/app/js/lib/controllers/maps-controllers-common.js b/Dashboard/app/js/lib/controllers/maps-controllers-common.js index cc178a2ac2..9af4eedae0 100644 --- a/Dashboard/app/js/lib/controllers/maps-controllers-common.js +++ b/Dashboard/app/js/lib/controllers/maps-controllers-common.js @@ -6,7 +6,7 @@ a placemark counterpart. **/ -FLOW.mapsController = Ember.ArrayController.create({ +FLOW.MapsController = Ember.ArrayController.extend({ content: null, map: null, marker: null, @@ -268,7 +268,7 @@ FLOW.mapsController = Ember.ArrayController.create({ dataLayer.setInteraction(true); dataLayer.on('featureClick', function(e, latlng, pos, data) { - FLOW.mapsController.set('markerCoordinates', [data.lat, data.lon]); + self.set('markerCoordinates', [data.lat, data.lon]); //get survey instance FLOW.placemarkDetailController.set( 'si', FLOW.store.find(FLOW.SurveyInstance, data.id)); From 0fe9f028e1a02bf280fd1902003d8a2eedba434b Mon Sep 17 00:00:00 2001 From: Charles Kimani Date: Wed, 20 Dec 2017 15:19:00 +0300 Subject: [PATCH 05/41] [#2275] call mapsController via router --- .../controllers/maps-controllers-common.js | 27 ++++++++++--------- .../lib/views/maps/map-views-common-public.js | 4 +-- .../app/js/lib/views/maps/map-views-common.js | 16 +++++------ Dashboard/app/js/lib/views/views.js | 4 +-- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Dashboard/app/js/lib/controllers/maps-controllers-common.js b/Dashboard/app/js/lib/controllers/maps-controllers-common.js index 9af4eedae0..01baf3ebc7 100644 --- a/Dashboard/app/js/lib/controllers/maps-controllers-common.js +++ b/Dashboard/app/js/lib/controllers/maps-controllers-common.js @@ -134,13 +134,13 @@ FLOW.MapsController = Ember.ArrayController.extend({ function onMarkerClick(marker){ // first deselect others - if (!Ember.none(FLOW.mapsController.get('selectedMarker'))) { - if (FLOW.mapsController.selectedMarker.target.options.placemarkId != marker.target.options.placemarkId) { - FLOW.mapsController.selectedMarker.target.options.selected = false; - FLOW.mapsController.selectedMarker.target.setStyle({ + if (!Ember.none(FLOW.router.mapsController.get('selectedMarker'))) { + if (FLOW.router.mapsController.selectedMarker.target.options.placemarkId != marker.target.options.placemarkId) { + FLOW.router.mapsController.selectedMarker.target.options.selected = false; + FLOW.router.mapsController.selectedMarker.target.setStyle({ color:'#d46f12', fillColor:'#edb660'}); - FLOW.mapsController.set('selectedMarker',null); + FLOW.router.mapsController.set('selectedMarker',null); } } @@ -150,13 +150,13 @@ FLOW.MapsController = Ember.ArrayController.extend({ color:'#d46f12', fillColor:'#edb660'}); marker.target.options.selected = false; - FLOW.mapsController.set('selectedMarker',null); + FLOW.router.mapsController.set('selectedMarker',null); } else { marker.target.setStyle({ color:'#d46f12', fillColor:'#433ec9'}); marker.target.options.selected = true; - FLOW.mapsController.set('selectedMarker',marker); + FLOW.router.mapsController.set('selectedMarker',marker); } } }, @@ -351,11 +351,14 @@ FLOW.placemarkDetailController = Ember.ArrayController.create({ handlePlacemarkSelection: function () { var selectedPlacemarkId = null; - if (!Ember.none(FLOW.mapsController.get('selectedMarker'))) { - selectedPlacemarkId = FLOW.mapsController.selectedMarker.target.options.placemarkId; - this.set('collectionDate',FLOW.mapsController.selectedMarker.target.options.collectionDate); + if (!Ember.none(FLOW.router.get('mapsController'))) { + var mapsController = FLOW.router.get('mapsController'); + if (!Ember.none(mapsController.get('selectedMarker'))) { + selectedPlacemarkId = mapsController.selectedMarker.target.options.placemarkId; + this.set('collectionDate',mapsController.selectedMarker.target.options.collectionDate); + } + this.populate(selectedPlacemarkId); } - this.populate(selectedPlacemarkId); - }.observes('FLOW.mapsController.selectedMarker') + }.observes('FLOW.router.mapsController.selectedMarker') }); diff --git a/Dashboard/app/js/lib/views/maps/map-views-common-public.js b/Dashboard/app/js/lib/views/maps/map-views-common-public.js index 84e7763541..2963594885 100644 --- a/Dashboard/app/js/lib/views/maps/map-views-common-public.js +++ b/Dashboard/app/js/lib/views/maps/map-views-common-public.js @@ -39,7 +39,7 @@ FLOW.NavMapsView = FLOW.View.extend({ var bestBB = this.geoModel.best_bbox_search_cells(bb); // adapt the points shown on the map - FLOW.mapsController.adaptMap(bestBB, this.map.getZoom()); + FLOW.router.mapsController.adaptMap(bestBB, this.map.getZoom()); }, /** @@ -83,7 +83,7 @@ FLOW.NavMapsView = FLOW.View.extend({ self.redoMap(); }); - FLOW.mapsController.set('map', this.map); + FLOW.router.mapsController.set('map', this.map); this.geoModel = create_geomodel(); //load points for the visible map diff --git a/Dashboard/app/js/lib/views/maps/map-views-common.js b/Dashboard/app/js/lib/views/maps/map-views-common.js index fc0facfb82..6e6f71312a 100644 --- a/Dashboard/app/js/lib/views/maps/map-views-common.js +++ b/Dashboard/app/js/lib/views/maps/map-views-common.js @@ -46,7 +46,7 @@ FLOW.NavMapsView = FLOW.View.extend({ var bestBB = this.geoModel.best_bbox_search_cells(bb); // adapt the points shown on the map - FLOW.mapsController.adaptMap(bestBB, this.map.getZoom()); + FLOW.router.mapsController.adaptMap(bestBB, this.map.getZoom()); }, /** @@ -67,7 +67,7 @@ FLOW.NavMapsView = FLOW.View.extend({ this.map.on('moveend', function (e) { self.redoMap(); }); - FLOW.mapsController.set('map', this.map); + FLOW.router.mapsController.set('map', this.map); this.geoModel = create_geomodel(); //load points for the visible map this.redoMap(); @@ -172,7 +172,7 @@ FLOW.NavMapsView = FLOW.View.extend({ L.control.layers(baseLayers).addTo(this.map); - FLOW.mapsController.set('map', this.map); + FLOW.router.mapsController.set('map', this.map); this.map.on('click', function(e) { self.clearMap(); //remove any previously loaded point data @@ -260,15 +260,15 @@ FLOW.NavMapsView = FLOW.View.extend({ surveySelection: function () { this.clearMap(); - FLOW.mapsController.clearSurveyDataLayer(); + FLOW.router.mapsController.clearSurveyDataLayer(); if (!Ember.none(this.get('selectedSurvey'))) { - FLOW.mapsController.loadNamedMap(this.selectedSurvey.get('keyId')); + FLOW.router.mapsController.loadNamedMap(this.selectedSurvey.get('keyId')); } }.observes('this.selectedSurvey'), surveyGroupSelection: function () { this.clearMap(); - FLOW.mapsController.clearSurveyDataLayer(); + FLOW.router.mapsController.clearSurveyDataLayer(); }.observes('FLOW.selectedControl.selectedSurveyGroup'), /** @@ -370,11 +370,11 @@ FLOW.NavMapsView = FLOW.View.extend({ iconUrl: 'images/marker.svg', iconSize: [10, 10] }); - this.marker = new L.marker(FLOW.mapsController.get('markerCoordinates'), {icon: markerIcon}); + this.marker = new L.marker(FLOW.router.mapsController.get('markerCoordinates'), {icon: markerIcon}); this.map.addLayer(this.marker); this.showDetailsPane(); - }.observes('FLOW.mapsController.markerCoordinates'), + }.observes('FLOW.router.mapsController.markerCoordinates'), detailsPaneShowHide: function(){ var button = this.$('#mapDetailsHideShow'); diff --git a/Dashboard/app/js/lib/views/views.js b/Dashboard/app/js/lib/views/views.js index 23e6d0cc5a..287129a30c 100644 --- a/Dashboard/app/js/lib/views/views.js +++ b/Dashboard/app/js/lib/views/views.js @@ -122,7 +122,7 @@ Ember.Handlebars.registerHelper('placemarkDetail', function () { questionType, imageSrcAttr, signatureJson, photoJson, cartoQuestionType, self=this; if (FLOW.Env.mapsProvider === 'cartodb') { - FLOW.mapsController.questions.forEach(function(qItem){ + FLOW.router.mapsController.questions.forEach(function(qItem){ if (qItem.get("keyId") == Ember.get(self, 'questionID')) { cartoQuestionType = qItem.get("type"); } @@ -215,7 +215,7 @@ Ember.Handlebars.registerHelper('placemarkDetail', function () { Ember.Handlebars.registerHelper('drawGeoshapes', function () { var cartoQuestionType, questionType, self=this; if (FLOW.Env.mapsProvider === 'cartodb') { - FLOW.mapsController.questions.forEach(function(qItem){ + FLOW.router.mapsController.questions.forEach(function(qItem){ if (qItem.get("keyId") == Ember.get(self, 'questionID')) { cartoQuestionType = qItem.get("type"); } From f2af369749bed54bca6a2883b734fe0fa8c564f2 Mon Sep 17 00:00:00 2001 From: Valeria Rogatchevskikh Date: Thu, 21 Dec 2017 11:48:19 +0100 Subject: [PATCH 06/41] [#2398] Update en.properties --- GAE/src/locale/en.properties | 2 +- GAE/src/locale/ui-strings.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GAE/src/locale/en.properties b/GAE/src/locale/en.properties index 8cad4fd3eb..4c211916f0 100644 --- a/GAE/src/locale/en.properties +++ b/GAE/src/locale/en.properties @@ -224,7 +224,7 @@ Import\ cascade\ data = Import cascade data Import\ cascade\ file = Import cascade file Import\ clean\ data = Import clean data Import\ data = Import data -Import\ will\ override\ the\ existing\ data.The\ file\ must\ be\ in\ .xlsx\ or\ .xls\ format. = Import will override the existing data.The file must be in .xlsx or .xls format. +Import\ will\ override\ the\ existing\ data.\ The\ file\ must\ be\ in\ .xlsx\ or\ .xls\ format. = Import will override the existing data. The file must be in .xlsx or .xls format. Imports\ a\ CSV\ file\ containing\ the\ cascade\ resource\ definition.\ Please\ notice\ that\ importing\ a\ CSV\ file\ overwrites\ your\ current\ definition. = Imports a CSV file containing the cascade resource definition. Please notice that importing a CSV file overwrites your current definition. In\ many\ cases\ you\ want\ to\ make\ sure\ that\ the\ collected\ information\ is\ correct,\ for\ example\ in\ the\ case\ of\ an\ email\ address,\ phone\ number\ or\ identification\ number,\ where\ it\ is\ easy\ to\ make\ mistakes\ when\ typing.\ Requiring\ the\ same\ answer\ to\ be\ entered\ twice\ ensures\ it\ is\ verified. = In many cases you want to make sure that the collected information is correct, for example in the case of an email address, phone number or identification number, where it is easy to make mistakes when typing. Requiring the same answer to be entered twice ensures it is verified. Include\ DB\ Instructions? = Include DB Instructions? diff --git a/GAE/src/locale/ui-strings.properties b/GAE/src/locale/ui-strings.properties index c62c35143b..78b5d696a3 100644 --- a/GAE/src/locale/ui-strings.properties +++ b/GAE/src/locale/ui-strings.properties @@ -242,7 +242,7 @@ _import_cascade_number_levels = You must enter a valid number of levels to impor _import_clean_data = Import clean data _import_data = Import data _import_help_text = Imports a CSV file containing the cascade resource definition. Please notice that importing a CSV file overwrites your current definition. -_import_raw_data_applet_text_short_ = Import will override the existing data.The file must be in .xlsx or .xls format. +_import_raw_data_applet_text_short_ = Import will override the existing data. The file must be in .xlsx or .xls format. _import_select_cascade_file = You must select a CSV (.csv) file to import _import_select_file = You must select a RAW DATA REPORT (.xlsx) to import _import_select_survey = You must select a survey for running the import process From b8705e8c474d4186a692daf107ab58fc177833b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stellan=20Lagerstr=C3=B6m?= Date: Thu, 21 Dec 2017 15:14:50 +0100 Subject: [PATCH 07/41] [#2279]Select different features for numeric and option. --- .../GraphicalSurveySummaryExporter.java | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java index 1f3547d41b..e161a49c63 100644 --- a/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java +++ b/GAE/src/org/waterforpeople/mapping/dataexport/GraphicalSurveySummaryExporter.java @@ -1462,6 +1462,7 @@ private void writeSummaryReport( } } } + CreationHelper creationHelper = wb.getCreationHelper(); Drawing patriarch = sheet.createDrawingPatriarch(); int curRow = 0; @@ -1471,22 +1472,30 @@ private void writeSummaryReport( } else { createCell(row, 0, sector + " " + REPORT_HEADER, headerStyle); } + for (QuestionGroupDto group : orderedGroupList) { if (questionMap.get(group) != null) { + boolean doDescriptiveStats = false; + boolean doChart = false; + boolean doDataTable = false; + for (QuestionDto question : questionMap.get(group)) { - if (!(QuestionType.OPTION == question.getType() //TODO: add cascade - || QuestionType.NUMBER == question.getType())) { + if (QuestionType.OPTION == question.getType() { + boolean doChart = true; + boolean doDataTable = true; + } else if (QuestionType.NUMBER == question.getType()) { + doDescriptiveStats = true; + } else { //TODO: add cascade continue; - } else { - if (summaryModel.getResponseCountsForQuestion( - question.getKeyId(), sector).size() == 0) { - // if there is no data, skip the question - continue; - } } - // for both options and numeric, we want a pie chart and - // data table. for numeric, we also want descriptive - // statistics. + + if (summaryModel.getResponseCountsForQuestion( + question.getKeyId(), sector).size() == 0) { + // if there is no data, skip the question + continue; + } + + //We want a header, spanned across 2 columns int tableTopRow = curRow++; int tableBottomRow = curRow; row = getRow(tableTopRow, sheet); @@ -1497,6 +1506,10 @@ private void writeSummaryReport( 0, question.getText(), headerStyle); + + // For numeric, we only want descriptive statistics. + if ( QuestionType.NUMBER == question.getType()) { + DescriptiveStats stats = summaryModel .getDescriptiveStatsForQuestion( question.getKeyId(), sector); @@ -1609,7 +1622,9 @@ private void writeSummaryReport( } } curRow = tableBottomRow; - if (labels.size() > 0) { + + //Pie chart, but skip for numbers, phone numbers etc get ridiculous + if (QuestionType.NUMBER != question.getType() && labels.size() > 0) { boolean hasVals = false; if (values != null) { for (String val : values) { @@ -1657,7 +1672,6 @@ private void writeSummaryReport( // flush the sheet so far to disk; we will not go back up ((SXSSFSheet) sheet).flushRows(0); // retain 0 last rows and // flush all others - } } } @@ -1846,8 +1860,8 @@ public static void main(String[] args) { Map criteria = new HashMap(); Map options = new HashMap(); // options.put(TYPE_OPT, DATA_CLEANING_TYPE); - options.put(TYPE_OPT, DATA_ANALYSIS_TYPE); -// options.put(TYPE_OPT, COMPREHENSIVE_TYPE); +// options.put(TYPE_OPT, DATA_ANALYSIS_TYPE); + options.put(TYPE_OPT, COMPREHENSIVE_TYPE); options.put(LAST_COLLECTION_OPT, "false"); options.put(EMAIL_OPT, "email@example.com"); options.put(FROM_OPT, null); From 3a6941fde503c098e4864beec8c25cc75ffdfaa1 Mon Sep 17 00:00:00 2001 From: stellanl Date: Tue, 2 Jan 2018 18:18:42 +0100 Subject: [PATCH 08/41] [#2397]Remove attributes and statistics from UI. --- .../js/lib/controllers/data-controllers.js | 39 ------- .../js/lib/controllers/reports-controllers.js | 48 --------- Dashboard/app/js/lib/models/fixtures.js | 18 ---- Dashboard/app/js/lib/models/models.js | 9 -- Dashboard/app/js/lib/router/router.js | 26 ----- .../js/lib/views/data/data-attribute-views.js | 74 ------------- .../app/js/lib/views/reports/report-views.js | 24 ----- .../app/js/lib/views/surveys/question-view.js | 35 ------ Dashboard/app/js/lib/views/views.js | 22 ---- .../templates/navData/data-subnav.handlebars | 5 - .../templates/navData/inspect-data.handlebars | 1 - .../navData/manage-attributes.handlebars | 101 ------------------ .../navReports/reports-subnav.handlebars | 6 -- .../navReports/statistics.handlebars | 53 --------- .../navSurveys/question-view.handlebars | 41 ------- 15 files changed, 502 deletions(-) delete mode 100644 Dashboard/app/js/lib/views/data/data-attribute-views.js delete mode 100644 Dashboard/app/js/templates/navData/manage-attributes.handlebars delete mode 100644 Dashboard/app/js/templates/navReports/statistics.handlebars diff --git a/Dashboard/app/js/lib/controllers/data-controllers.js b/Dashboard/app/js/lib/controllers/data-controllers.js index 03d5fd7f19..e92afc8024 100644 --- a/Dashboard/app/js/lib/controllers/data-controllers.js +++ b/Dashboard/app/js/lib/controllers/data-controllers.js @@ -4,45 +4,6 @@ function capitaliseFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } -FLOW.attributeTypeControl = Ember.Object.create({ - content: [ - Ember.Object.create({ - label: "text", - value: "String" - }), Ember.Object.create({ - label: "number", - value: "Double" - }) - ] -}); - -FLOW.attributeControl = Ember.ArrayController.create({ - sortProperties: null, - sortAscending: true, - content: null, - - setFilteredContent: function () { - this.set('content', FLOW.store.filter(FLOW.Metric, function (item) { - return true; - })); - }, - - // load all Survey Groups - populate: function () { - if (FLOW.Env.showStatisticsFeature) { - FLOW.store.find(FLOW.Metric); - } - this.setFilteredContent(); - this.set('sortProperties', ['name']); - this.set('sortAscending', true); - }, - - getSortInfo: function () { - this.set('sortProperties', FLOW.tableColumnControl.get('sortProperties')); - this.set('sortAscending', FLOW.tableColumnControl.get('sortAscending')); - } -}); - FLOW.cascadeResourceControl = Ember.ArrayController.create({ content:null, published:null, diff --git a/Dashboard/app/js/lib/controllers/reports-controllers.js b/Dashboard/app/js/lib/controllers/reports-controllers.js index caf105d1f2..ee826e7808 100644 --- a/Dashboard/app/js/lib/controllers/reports-controllers.js +++ b/Dashboard/app/js/lib/controllers/reports-controllers.js @@ -31,51 +31,3 @@ FLOW.chartTypeControl = Ember.Object.create({ }) ] }); - -FLOW.statisticsControl = Ember.ArrayController.create({ - selectedSurvey: null, - allreadyTriggered: false, - content:null, - QAcontent:null, - sortProperties: ['name'], - sortAscending: true, - totalsSurveys:[], - total:null, - - computeTotal: function(){ - this.set('total',Math.max.apply(Math, this.get('totalsSurveys'))); - }, - - getMetrics: function(){ - if (!Ember.none(this.get('selectedSurvey'))){ - this.set('totalsSurveys',[]); - this.set('total',null); - this.set('alreadyTriggered',false); - this.set('content',FLOW.store.findQuery(FLOW.Metric,{ - surveyId: this.selectedSurvey.get('keyId') - })); - } - }.observes('this.selectedSurvey'), - - resetSurvey: function(){ - this.set('selectedSurvey',null); - this.set('totalsSurveys',[]); - this.set('total',null); - this.set('content',null); - }.observes('FLOW.selectedControl.selectedSurveyGroup'), - - getQA: function(){ - if (!Ember.none(this.get('content') && !this.get('allreadyTriggered'))){ - this.set('totalsSurveys',[]); - this.set('total',null); - // for each metric, get all the QuestionAnswerSummery objects of the questions - // this could be a single call: give me all he QA summ for questions with a metric. - this.set('QAcontent',FLOW.store.findQuery(FLOW.SurveyQuestionSummary,{ - surveyId:this.selectedSurvey.get('keyId'), - metricOnly:"true" - })); - allreadyTriggered = true; - } - }.observes('this.content.isLoaded') - -}); \ No newline at end of file diff --git a/Dashboard/app/js/lib/models/fixtures.js b/Dashboard/app/js/lib/models/fixtures.js index 6ff436a556..2c3e19f782 100644 --- a/Dashboard/app/js/lib/models/fixtures.js +++ b/Dashboard/app/js/lib/models/fixtures.js @@ -1192,24 +1192,6 @@ FLOW.SurveyInstance.FIXTURES = [{ }]; -FLOW.Metric.FIXTURES = [{ - name:'metric 1', - questionId: 1, - id:1, - keyId:1 -},{ - name:'metric 2', - questionId: 1, - id:2, - keyId:2 -},{ - name:'metric 2', - questionId: 1, - id:1, - keyId:1 -}]; - - FLOW.SurveyQuestionSummary.FIXTURES = [{ id: 1, keyId: 1, diff --git a/Dashboard/app/js/lib/models/models.js b/Dashboard/app/js/lib/models/models.js index fb3efbaa67..0007e60a37 100644 --- a/Dashboard/app/js/lib/models/models.js +++ b/Dashboard/app/js/lib/models/models.js @@ -448,15 +448,6 @@ FLOW.UserConfig = FLOW.BaseModel.extend({ userId: DS.attr('number') }); -// this is called attribute in the dashboard, but metric in the backend, for historic reasons. -FLOW.Metric = FLOW.BaseModel.extend({ - organization: DS.attr('string'), - name: DS.attr('string'), - group: DS.attr('string'), - valueType: DS.attr('string'), - questionId: DS.attr('number') -}); - FLOW.Message = FLOW.BaseModel.extend({ objectId: DS.attr('number'), lastUpdateDateTime: DS.attr('number'), diff --git a/Dashboard/app/js/lib/router/router.js b/Dashboard/app/js/lib/router/router.js index 14b5b2efc9..9de3b31d04 100644 --- a/Dashboard/app/js/lib/router/router.js +++ b/Dashboard/app/js/lib/router/router.js @@ -105,7 +105,6 @@ FLOW.Router = Ember.Router.extend({ FLOW.selectedControl.set('selectedSurvey', null); FLOW.selectedControl.set('selectedQuestion', null); FLOW.questionControl.set('OPTIONcontent', null); - FLOW.attributeControl.populate(); } }), @@ -257,9 +256,6 @@ FLOW.Router = Ember.Router.extend({ doInspectData: function (router, event) { router.transitionTo('navData.inspectData'); }, - doManageAttributes: function (router, event) { - router.transitionTo('navData.manageAttributes'); - }, doBulkUpload: function (router, event) { router.transitionTo('navData.bulkUpload'); }, @@ -291,15 +287,6 @@ FLOW.Router = Ember.Router.extend({ } }), - manageAttributes: Ember.Route.extend({ - route: '/manageattributes', - connectOutlets: function (router, context) { - router.get('navDataController').connectOutlet('manageAttributes'); - router.set('datasubnavController.selected', 'manageAttributes'); - FLOW.attributeControl.populate(); - } - }), - bulkUpload: Ember.Route.extend({ route: '/bulkupload', connectOutlets: function (router, context) { @@ -415,10 +402,6 @@ FLOW.Router = Ember.Router.extend({ router.transitionTo('navReports.chartReports'); }, - doStatistics: function(router, event) { - router.transitionTo('navReports.statistics'); - }, - index: Ember.Route.extend({ route: '/', redirectsTo: 'exportReports' @@ -440,15 +423,6 @@ FLOW.Router = Ember.Router.extend({ router.get('navReportsController').connectOutlet('chartReports'); router.set('reportsSubnavController.selected', 'chartReports'); } - }), - statistics: Ember.Route.extend({ - route: '/statistics', - connectOutlets: function(router, context) { - router.resetState(); - router.get('navReportsController').connectOutlet('statistics'); - router.set('reportsSubnavController.selected', 'statistics'); - FLOW.surveyGroupControl.populate(); - } }) }), diff --git a/Dashboard/app/js/lib/views/data/data-attribute-views.js b/Dashboard/app/js/lib/views/data/data-attribute-views.js deleted file mode 100644 index 995bd3f8bc..0000000000 --- a/Dashboard/app/js/lib/views/data/data-attribute-views.js +++ /dev/null @@ -1,74 +0,0 @@ -FLOW.ManageAttributesTableView = FLOW.View.extend({ - showAddAttributeDialogBool: false, - showEditAttributeDialogBool: false, - newAttributeName: null, - newAttributeGroup: null, - newAttributeType: null, - - showAddAttributeDialog: function () { - this.set('showAddAttributeDialogBool', true); - }, - - doAddAttribute: function () { - if (this.get('newAttributeName') !== null && this.get('newAttributeType') !== null) { - FLOW.store.createRecord(FLOW.Metric, { - "name": this.get('newAttributeName'), - "group": this.get('newAttributeGroup'), - "valueType": this.newAttributeType.get('value') - }); - FLOW.store.commit(); - } - this.set('showAddAttributeDialogBool', false); - }, - - cancelAddAttribute: function () { - this.set('showAddAttributeDialogBool', false); - }, - - showEditAttributeDialog: function (event) { - var attrType = null; - - FLOW.editControl.set('editAttributeName', event.context.get('name')); - FLOW.editControl.set('editAttributeGroup', event.context.get('group')); - FLOW.editControl.set('editAttributeId', event.context.get('keyId')); - - FLOW.attributeTypeControl.get('content').forEach(function (item) { - if (item.get('value') == event.context.get('valueType')) { - attrType = item; - } - }); - - FLOW.editControl.set('editAttributeType', attrType); - this.set('showEditAttributeDialogBool', true); - }, - - doEditAttribute: function () { - var attribute; - attribute = FLOW.store.find(FLOW.Metric, FLOW.editControl.get('editAttributeId')); - attribute.set('name', FLOW.editControl.get('editAttributeName')); - attribute.set('group', FLOW.editControl.get('editAttributeGroup')); - - if (FLOW.editControl.editAttributeType !== null) { - attribute.set('valueType', FLOW.editControl.editAttributeType.get('value')); - } - - FLOW.store.commit(); - this.set('showEditAttributeDialogBool', false); - }, - - cancelEditAttribute: function () { - this.set('showEditAttributeDialogBool', false); - } -}); - -FLOW.AttributeView = FLOW.View.extend({ - tagName: 'span', - - deleteAttribute: function () { - var attrDeleteId, attribute; - attrDeleteId = this.content.get('keyId'); - attribute = FLOW.store.find(FLOW.Metric, attrDeleteId); - attribute.deleteRecord(); - FLOW.store.commit(); - } -}); diff --git a/Dashboard/app/js/lib/views/reports/report-views.js b/Dashboard/app/js/lib/views/reports/report-views.js index d2ceedcb62..35d1cabe98 100644 --- a/Dashboard/app/js/lib/views/reports/report-views.js +++ b/Dashboard/app/js/lib/views/reports/report-views.js @@ -1,30 +1,6 @@ /*global deleteChart, createDoughnutChart, createHBarChart, createVBarChart*/ -FLOW.StatisticsMetricView = FLOW.View.extend({ - answers: null, - - fillAnswers: function(){ - var qId, total, percentage; - qId = this.content.get('questionId'); - SQS = FLOW.store.filter(FLOW.SurveyQuestionSummary,function(item){ - return (item.get('questionId') == qId); - }); - this.set('answers',SQS); - total = 0; - SQS.forEach(function(item){ - total += item.get('count'); - }); - SQS.forEach(function(item){ - percentage = 100 * item.get('count')/total - item.set('percentage',percentage.toFixed(1)); - }); - FLOW.statisticsControl.get('totalsSurveys').push(total); - FLOW.statisticsControl.computeTotal(); - }.observes('FLOW.statisticsControl.QAcontent.content.isLoaded') -}), - - FLOW.chartView = FLOW.View.extend({ noChoiceBool: false, noDataBool: false, diff --git a/Dashboard/app/js/lib/views/surveys/question-view.js b/Dashboard/app/js/lib/views/surveys/question-view.js index 425cc228af..a06fa5d8e1 100644 --- a/Dashboard/app/js/lib/views/surveys/question-view.js +++ b/Dashboard/app/js/lib/views/surveys/question-view.js @@ -24,10 +24,6 @@ FLOW.QuestionView = FLOW.View.extend({ dependentFlag: false, dependentQuestion: null, includeInMap: null, - showAddAttributeDialogBool: false, - newAttributeName: null, - newAttributeGroup: null, - newAttributeType: null, allowPoints: true, allowLine: true, allowPolygon: true, @@ -239,14 +235,6 @@ FLOW.QuestionView = FLOW.View.extend({ } } - // set the attribute to the original choice - FLOW.attributeControl.get('content').forEach(function (item) { - if (item.get('keyId') == FLOW.selectedControl.selectedQuestion.get('metricId')) { - attribute = item; - } - }); - this.set('attribute', attribute); - // set the type to the original choice FLOW.questionTypeControl.get('content').forEach(function (item) { if (item.get('value') == FLOW.selectedControl.selectedQuestion.get('type')) { @@ -420,10 +408,6 @@ FLOW.QuestionView = FLOW.View.extend({ FLOW.selectedControl.selectedQuestion.set('dependentQuestionAnswer', null); } - if (this.get('attribute')) { - FLOW.selectedControl.selectedQuestion.set('metricId', this.attribute.get('keyId')); - } - if (this.get('type')) { FLOW.selectedControl.selectedQuestion.set('type', this.type.get('value')); } @@ -839,25 +823,6 @@ FLOW.QuestionView = FLOW.View.extend({ doQuestionMoveCancel: function () { FLOW.selectedControl.set('selectedForMoveQuestion', null); }, - showAddAttributeDialog: function () { - this.set('showAddAttributeDialogBool', true); - }, - - doAddAttribute: function () { - if ((this.get('newAttributeName') !== null) && (this.get('newAttributeType') !== null)) { - FLOW.store.createRecord(FLOW.Metric, { - "name": this.get('newAttributeName'), - "group": this.get('newAttributeGroup'), - "valueType": this.newAttributeType.get('value') - }); - FLOW.store.commit(); - } - this.set('showAddAttributeDialogBool', false); - }, - - cancelAddAttribute: function () { - this.set('showAddAttributeDialogBool', false); - }, validateQuestionObserver: function () { this.set('questionValidationFailure', (this.text != null && this.text.length > 500)); diff --git a/Dashboard/app/js/lib/views/views.js b/Dashboard/app/js/lib/views/views.js index 23e6d0cc5a..fdf1d8e8f8 100644 --- a/Dashboard/app/js/lib/views/views.js +++ b/Dashboard/app/js/lib/views/views.js @@ -11,7 +11,6 @@ require('akvo-flow/views/surveys/survey-group-views'); require('akvo-flow/views/surveys/survey-details-views'); require('akvo-flow/views/surveys/form-view'); require('akvo-flow/views/data/inspect-data-table-views'); -require('akvo-flow/views/data/data-attribute-views'); require('akvo-flow/views/data/bulk-upload-view'); require('akvo-flow/views/data/monitoring-data-table-view'); require('akvo-flow/views/data/cascade-resources-view'); @@ -292,21 +291,6 @@ Ember.Handlebars.registerHelper('toPointType', function (value) { return label; }); -// translates values to labels for attributeTypes -Ember.Handlebars.registerHelper('toAttributeType', function (value) { - var label, valueLoc; - label = ""; - valueLoc = Ember.get(this, value); - - FLOW.attributeTypeControl.get('content').forEach(function (item) { - if (item.get('value') == valueLoc) { - label = item.get('label'); - } - }); - return label; -}); - - // add space to vertical bar helper Ember.Handlebars.registerHelper('addSpace', function (property) { return Ember.get(this, property).replace(/\|/g, ' | '); @@ -741,10 +725,6 @@ FLOW.InspectDataView = Ember.View.extend({ templateName: 'navData/inspect-data' }); -FLOW.ManageAttributesView = Ember.View.extend({ - templateName: 'navData/manage-attributes' -}); - FLOW.BulkUploadView = Ember.View.extend({ templateName: 'navData/bulk-upload' }); @@ -921,8 +901,6 @@ FLOW.ColumnView = Ember.View.extend({ FLOW.deviceControl.getSortInfo(); } else if (this.get('type') === 'assignment') { FLOW.surveyAssignmentControl.getSortInfo(); - } else if (this.get('type') === 'attribute') { - FLOW.attributeControl.getSortInfo(); } else if (this.get('type') === 'message') { FLOW.messageControl.getSortInfo(); } diff --git a/Dashboard/app/js/templates/navData/data-subnav.handlebars b/Dashboard/app/js/templates/navData/data-subnav.handlebars index 1611b927e2..9b92addec9 100644 --- a/Dashboard/app/js/templates/navData/data-subnav.handlebars +++ b/Dashboard/app/js/templates/navData/data-subnav.handlebars @@ -2,11 +2,6 @@ {{#view view.NavItemView item="inspectData" }} {{t _inspect_data}} {{/view}} - {{#if FLOW.Env.showStatisticsFeature}} - {{#view view.NavItemView item="manageAttributes" }} - {{t _manage_attributes}} - {{/view}} - {{/if}} {{#view view.NavItemView item="bulkUpload" }} {{t _bulk_upload_data}} {{/view}} diff --git a/Dashboard/app/js/templates/navData/inspect-data.handlebars b/Dashboard/app/js/templates/navData/inspect-data.handlebars index 075d29f728..c0fa0f8fc3 100644 --- a/Dashboard/app/js/templates/navData/inspect-data.handlebars +++ b/Dashboard/app/js/templates/navData/inspect-data.handlebars @@ -28,7 +28,6 @@
- {{#if FLOW.Env.showStatisticsFeature}} {{view Ember.Select contentBinding="FLOW.countryController.content" selectionBinding="FLOW.locationControl.selectedCountry" optionLabelPath="content.label" prompt="select country" promptBinding="Ember.STRINGS._select_country"}} {{view Ember.Select contentBinding="FLOW.locationControl.level1Content" selectionBinding="FLOW.locationControl.selectedLevel1" optionLabelPath="content.name" prompt="select sublevel 1" promptBinding="Ember.STRINGS._select_sublevel_1"}} {{view Ember.Select contentBinding="FLOW.locationControl.level2Content" selectionBinding="FLOW.locationControl.selectedLevel2" optionLabelPath="content.name" prompt="select sublevel 2" promptBinding="Ember.STRINGS._select_sublevel_2"}} {{/if}} {{t _find}}
diff --git a/Dashboard/app/js/templates/navData/manage-attributes.handlebars b/Dashboard/app/js/templates/navData/manage-attributes.handlebars deleted file mode 100644 index 0cad6a5a27..0000000000 --- a/Dashboard/app/js/templates/navData/manage-attributes.handlebars +++ /dev/null @@ -1,101 +0,0 @@ -
-{{#view FLOW.ManageAttributesTableView}} - {{t _add_new_attribute}} - - - - - {{#view FLOW.ColumnView item="keyId" type="attribute"}} - {{t _id}} - {{/view}} - {{#view FLOW.ColumnView item="name" type="attribute"}} - {{t _attribute_name}} - {{/view}} - {{#view FLOW.ColumnView item="group" type="attribute"}} - {{t _tag}} - {{/view}} - {{#view FLOW.ColumnView item="valueType" type="attribute"}} - {{t _value_type}} - {{/view}} - - - - - - {{#each attribute in FLOW.attributeControl}} - - - - - - - - - {{/each}} - -
{{t _action}}
{{attribute.keyId}}{{attribute.name}}{{attribute.group}}{{#with attribute}}{{toAttributeType valueType}}{{/with}} - {{#view FLOW.AttributeView contentBinding="attribute"}} - {{t _remove}} {{/view}} {{t _edit}}
- - -
-
-
- -
-

{{t _add_new_attribute}}

-

{{t _please_provide_a_name_}}

-
- {{view Ember.TextField valueBinding="view.newAttributeName" id="newAttributeName" size=40}} - {{view Ember.TextField valueBinding="view.newAttributeGroup" id="newAttributeGroup" size=40}} - - {{view Ember.Select - contentBinding="FLOW.attributeTypeControl.content" - selectionBinding="view.newAttributeType" - optionLabelPath="content.label" - optionValuePath="content.value" - prompt="" - promptBinding="Ember.STRINGS._select_value_type"}} - - -
-
-
- - -
-
-
- -
-

{{t _edit_attribute}}

-

{{t _please_edit_the_attribute_name_}}.

- {{view Ember.TextField valueBinding="FLOW.editControl.editAttributeName" id="editUserName" size=40}}
- {{view Ember.TextField valueBinding="FLOW.editControl.editAttributeGroup" id="editEmail" size=40}}
- - {{view Ember.Select - contentBinding="FLOW.attributeTypeControl.content" - selectionBinding="FLOW.editControl.editAttributeType" - optionLabelPath="content.label" - optionValuePath="content.value" - prompt="" - promptBinding="Ember.STRINGS._select_attribute_type"}} - - -
-
-
- - - {{/view}} -
\ No newline at end of file diff --git a/Dashboard/app/js/templates/navReports/reports-subnav.handlebars b/Dashboard/app/js/templates/navReports/reports-subnav.handlebars index 3c2c0a3277..8205cf5105 100644 --- a/Dashboard/app/js/templates/navReports/reports-subnav.handlebars +++ b/Dashboard/app/js/templates/navReports/reports-subnav.handlebars @@ -5,10 +5,4 @@ {{#view view.NavItemView item="chartReports" }} {{t _charts}} {{/view}} - {{#if FLOW.Env.showStatisticsFeature}} - {{#view view.NavItemView item="statistics" }} - {{t _statistics}} - {{/view}} - {{/if}} - diff --git a/Dashboard/app/js/templates/navReports/statistics.handlebars b/Dashboard/app/js/templates/navReports/statistics.handlebars deleted file mode 100644 index 43c20c74b4..0000000000 --- a/Dashboard/app/js/templates/navReports/statistics.handlebars +++ /dev/null @@ -1,53 +0,0 @@ -
-
-

{{t _statistics}}

- -
- {{view Ember.Select - contentBinding="FLOW.surveyGroupControl.arrangedContent" - selectionBinding="FLOW.selectedControl.selectedSurveyGroup" - optionLabelPath="content.code" - optionValuePath="content.keyId" - prompt="" - promptBinding="Ember.STRINGS._select_survey_group"}} - - {{view Ember.Select - contentBinding="FLOW.surveyControl.arrangedContent" - selectionBinding="FLOW.statisticsControl.selectedSurvey" - optionLabelPath="content.name" - optionValuePath="content.keyId" - prompt="" - promptBinding="Ember.STRINGS._select_survey"}} -
-
-

{{t _select_survey_to_view_stats_}}

- - - - - - - - - - - - - {{#each metric in FLOW.statisticsControl.arrangedContent}} - - - - - {{#view FLOW.StatisticsMetricView contentBinding="metric"}} - {{#each answer in view.answers}} -        {{answer.response}}:     {{answer.count}}    ({{answer.percentage}}%)
- {{/each}} - {{/view}} - {{/each}} - - -
{{t _metric}}{{t _value}}
Respondents{{FLOW.statisticsControl.total}}
{{metric.name}}
- -
-
-
diff --git a/Dashboard/app/js/templates/navSurveys/question-view.handlebars b/Dashboard/app/js/templates/navSurveys/question-view.handlebars index 77eba5bde0..88fc57b733 100644 --- a/Dashboard/app/js/templates/navSurveys/question-view.handlebars +++ b/Dashboard/app/js/templates/navSurveys/question-view.handlebars @@ -22,18 +22,6 @@ - {{#if FLOW.Env.showStatisticsFeature}} - - {{#if view.attribute}}{{/if}} - {{/if}} -