Skip to content

Commit

Permalink
Merge branch 'release/1.9.27'
Browse files Browse the repository at this point in the history
  • Loading branch information
kymni committed Jan 25, 2018
2 parents 2369755 + f34a5ad commit 768a1ec
Show file tree
Hide file tree
Showing 82 changed files with 342 additions and 6,909 deletions.
15 changes: 9 additions & 6 deletions Dashboard/app/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ a, a:link, a:visited {
&.AddBtn {
display: inline-block !important;
padding: 1em 1% 0.8em 1.5em;
background: url(../images/addbtfullWidthn.png) left center no-repeat;
background: url(../images/addbtn.png) left center no-repeat;
color: rgb(0, 123, 182);
text-align: left;
font-size: 1.1em;
&:hover {}
}
&.clodeDialog {
&.closeDialog {
position: absolute;
top: 10px;
right: 10px;
Expand Down Expand Up @@ -838,10 +838,6 @@ table.dataTable thead tr th a:visited {
display: block;
}

#statisticsDataTable {
width: 400px;
}

/* end addition MTW */

table.dataTable thead tr th a.helpIcon {
Expand Down Expand Up @@ -3300,6 +3296,8 @@ table.dataTable.notificationTable thead tr th {

table.dataTable.notificationTable thead tr th.noArrows {
background: #3A3A3A;
text-align: left;
font-weight: bold;
}

table.dataTable.notificationTable thead tr th a,
Expand Down Expand Up @@ -3392,6 +3390,11 @@ label.collectedTo {
}
}

#monitoringData div.noResults {
color: red;
text-align: center;
}

div.chooseLocationData {
position: relative;
display: block;
Expand Down
1 change: 0 additions & 1 deletion Dashboard/app/js/lib/controllers/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ FLOW.NavReportsController = Ember.Controller.extend();
FLOW.ReportsSubnavController = Em.Controller.extend();
FLOW.ExportReportsController = Ember.ArrayController.extend();
FLOW.ChartReportsController = Ember.Controller.extend();
FLOW.StatisticsController = Ember.Controller.extend();

FLOW.NavMapsController = Ember.Controller.extend();
FLOW.NavUsersController = Ember.Controller.extend();
Expand Down
41 changes: 1 addition & 40 deletions Dashboard/app/js/lib/controllers/data-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -290,7 +251,7 @@ FLOW.SurveyedLocaleController = Ember.ArrayController.extend({
});

this.set('currentContents', mutableContents);
},
}.observes('content', 'content.isLoaded'),

removeLocale: function(locale) {
this.get('currentContents').forEach(function(item, i, currentContents) {
Expand Down
31 changes: 17 additions & 14 deletions Dashboard/app/js/lib/controllers/maps-controllers-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
a placemark counterpart.
**/

FLOW.mapsController = Ember.ArrayController.create({
FLOW.MapsController = Ember.ArrayController.extend({
content: null,
map: null,
marker: null,
Expand Down Expand Up @@ -134,13 +134,13 @@ FLOW.mapsController = Ember.ArrayController.create({

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);
}
}

Expand All @@ -150,13 +150,13 @@ FLOW.mapsController = Ember.ArrayController.create({
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);
}
}
},
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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')

});
12 changes: 0 additions & 12 deletions Dashboard/app/js/lib/controllers/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ FLOW.dialogControl = Ember.Object.create({
delQG: "delQG",
delQ: "delQ",
delUser: "delUser",
delAttr: "delAttr",
delAssignment: "delAssignment",
delDeviceGroup: "delDeviceGroup",
delSI: "delSI",
Expand Down Expand Up @@ -314,12 +313,6 @@ FLOW.dialogControl = Ember.Object.create({
this.set('showDialog', true);
break;

case "delAttr":
this.set('header', Ember.String.loc('_attr_delete_header'));
this.set('message', Ember.String.loc('_this_cant_be_undo'));
this.set('showDialog', true);
break;

case "delAssignment":
this.set('header', Ember.String.loc('_assignment_delete_header'));
this.set('message', Ember.String.loc('_this_cant_be_undo'));
Expand Down Expand Up @@ -390,11 +383,6 @@ FLOW.dialogControl = Ember.Object.create({
view.deleteUser.apply(view, arguments);
break;

case "delAttr":
this.set('showDialog', false);
view.deleteAttribute.apply(view, arguments);
break;

case "delAssignment":
this.set('showDialog', false);
view.deleteSurveyAssignment.apply(view, arguments);
Expand Down
48 changes: 0 additions & 48 deletions Dashboard/app/js/lib/controllers/reports-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

});
22 changes: 22 additions & 0 deletions Dashboard/app/js/lib/controllers/survey-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,28 @@ FLOW.projectControl = Ember.ArrayController.create({
var groups = FLOW.router.approvalGroupListController.get('content');
return groups && groups.filterProperty('keyId', approvalGroupId).get('firstObject');
}.property('this.currentProject.dataApprovalGroupId'),

saveProject: function() {
var currentProject = this.get('currentProject');
var currentForm = FLOW.selectedControl.get('selectedSurvey');

if (currentProject && currentProject.get('isDirty')) {
var name = currentProject.get('name').trim();
currentProject.set('name', name);
currentProject.set('code', name);
currentProject.set('path', this.get('currentProjectPath'));
}

if (currentForm && currentForm.get('isDirty')) {
var name = currentForm.get('name').trim();
currentForm.set('name', name);
currentForm.set('code', name);
var path = this.get('currentProjectPath') + "/" + name;
currentForm.set('path', path);
}

FLOW.store.commit();
}
});


Expand Down
18 changes: 0 additions & 18 deletions Dashboard/app/js/lib/models/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 0 additions & 9 deletions Dashboard/app/js/lib/models/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Loading

0 comments on commit 768a1ec

Please sign in to comment.