Skip to content

Commit 768a1ec

Browse files
author
kymni
committed
Merge branch 'release/1.9.27'
2 parents 2369755 + f34a5ad commit 768a1ec

File tree

82 files changed

+342
-6909
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+342
-6909
lines changed

Dashboard/app/css/main.scss

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ a, a:link, a:visited {
267267
&.AddBtn {
268268
display: inline-block !important;
269269
padding: 1em 1% 0.8em 1.5em;
270-
background: url(../images/addbtfullWidthn.png) left center no-repeat;
270+
background: url(../images/addbtn.png) left center no-repeat;
271271
color: rgb(0, 123, 182);
272272
text-align: left;
273273
font-size: 1.1em;
274274
&:hover {}
275275
}
276-
&.clodeDialog {
276+
&.closeDialog {
277277
position: absolute;
278278
top: 10px;
279279
right: 10px;
@@ -838,10 +838,6 @@ table.dataTable thead tr th a:visited {
838838
display: block;
839839
}
840840

841-
#statisticsDataTable {
842-
width: 400px;
843-
}
844-
845841
/* end addition MTW */
846842

847843
table.dataTable thead tr th a.helpIcon {
@@ -3300,6 +3296,8 @@ table.dataTable.notificationTable thead tr th {
33003296

33013297
table.dataTable.notificationTable thead tr th.noArrows {
33023298
background: #3A3A3A;
3299+
text-align: left;
3300+
font-weight: bold;
33033301
}
33043302

33053303
table.dataTable.notificationTable thead tr th a,
@@ -3392,6 +3390,11 @@ label.collectedTo {
33923390
}
33933391
}
33943392

3393+
#monitoringData div.noResults {
3394+
color: red;
3395+
text-align: center;
3396+
}
3397+
33953398
div.chooseLocationData {
33963399
position: relative;
33973400
display: block;

Dashboard/app/js/lib/controllers/controllers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ FLOW.NavReportsController = Ember.Controller.extend();
5959
FLOW.ReportsSubnavController = Em.Controller.extend();
6060
FLOW.ExportReportsController = Ember.ArrayController.extend();
6161
FLOW.ChartReportsController = Ember.Controller.extend();
62-
FLOW.StatisticsController = Ember.Controller.extend();
6362

6463
FLOW.NavMapsController = Ember.Controller.extend();
6564
FLOW.NavUsersController = Ember.Controller.extend();

Dashboard/app/js/lib/controllers/data-controllers.js

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,6 @@ function capitaliseFirstLetter(string) {
44
return string.charAt(0).toUpperCase() + string.slice(1);
55
}
66

7-
FLOW.attributeTypeControl = Ember.Object.create({
8-
content: [
9-
Ember.Object.create({
10-
label: "text",
11-
value: "String"
12-
}), Ember.Object.create({
13-
label: "number",
14-
value: "Double"
15-
})
16-
]
17-
});
18-
19-
FLOW.attributeControl = Ember.ArrayController.create({
20-
sortProperties: null,
21-
sortAscending: true,
22-
content: null,
23-
24-
setFilteredContent: function () {
25-
this.set('content', FLOW.store.filter(FLOW.Metric, function (item) {
26-
return true;
27-
}));
28-
},
29-
30-
// load all Survey Groups
31-
populate: function () {
32-
if (FLOW.Env.showStatisticsFeature) {
33-
FLOW.store.find(FLOW.Metric);
34-
}
35-
this.setFilteredContent();
36-
this.set('sortProperties', ['name']);
37-
this.set('sortAscending', true);
38-
},
39-
40-
getSortInfo: function () {
41-
this.set('sortProperties', FLOW.tableColumnControl.get('sortProperties'));
42-
this.set('sortAscending', FLOW.tableColumnControl.get('sortAscending'));
43-
}
44-
});
45-
467
FLOW.cascadeResourceControl = Ember.ArrayController.create({
478
content:null,
489
published:null,
@@ -290,7 +251,7 @@ FLOW.SurveyedLocaleController = Ember.ArrayController.extend({
290251
});
291252

292253
this.set('currentContents', mutableContents);
293-
},
254+
}.observes('content', 'content.isLoaded'),
294255

295256
removeLocale: function(locale) {
296257
this.get('currentContents').forEach(function(item, i, currentContents) {

Dashboard/app/js/lib/controllers/maps-controllers-common.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
a placemark counterpart.
77
**/
88

9-
FLOW.mapsController = Ember.ArrayController.create({
9+
FLOW.MapsController = Ember.ArrayController.extend({
1010
content: null,
1111
map: null,
1212
marker: null,
@@ -134,13 +134,13 @@ FLOW.mapsController = Ember.ArrayController.create({
134134

135135
function onMarkerClick(marker){
136136
// first deselect others
137-
if (!Ember.none(FLOW.mapsController.get('selectedMarker'))) {
138-
if (FLOW.mapsController.selectedMarker.target.options.placemarkId != marker.target.options.placemarkId) {
139-
FLOW.mapsController.selectedMarker.target.options.selected = false;
140-
FLOW.mapsController.selectedMarker.target.setStyle({
137+
if (!Ember.none(FLOW.router.mapsController.get('selectedMarker'))) {
138+
if (FLOW.router.mapsController.selectedMarker.target.options.placemarkId != marker.target.options.placemarkId) {
139+
FLOW.router.mapsController.selectedMarker.target.options.selected = false;
140+
FLOW.router.mapsController.selectedMarker.target.setStyle({
141141
color:'#d46f12',
142142
fillColor:'#edb660'});
143-
FLOW.mapsController.set('selectedMarker',null);
143+
FLOW.router.mapsController.set('selectedMarker',null);
144144
}
145145
}
146146

@@ -150,13 +150,13 @@ FLOW.mapsController = Ember.ArrayController.create({
150150
color:'#d46f12',
151151
fillColor:'#edb660'});
152152
marker.target.options.selected = false;
153-
FLOW.mapsController.set('selectedMarker',null);
153+
FLOW.router.mapsController.set('selectedMarker',null);
154154
} else {
155155
marker.target.setStyle({
156156
color:'#d46f12',
157157
fillColor:'#433ec9'});
158158
marker.target.options.selected = true;
159-
FLOW.mapsController.set('selectedMarker',marker);
159+
FLOW.router.mapsController.set('selectedMarker',marker);
160160
}
161161
}
162162
},
@@ -268,7 +268,7 @@ FLOW.mapsController = Ember.ArrayController.create({
268268
dataLayer.setInteraction(true);
269269

270270
dataLayer.on('featureClick', function(e, latlng, pos, data) {
271-
FLOW.mapsController.set('markerCoordinates', [data.lat, data.lon]);
271+
self.set('markerCoordinates', [data.lat, data.lon]);
272272

273273
//get survey instance
274274
FLOW.placemarkDetailController.set( 'si', FLOW.store.find(FLOW.SurveyInstance, data.id));
@@ -351,11 +351,14 @@ FLOW.placemarkDetailController = Ember.ArrayController.create({
351351

352352
handlePlacemarkSelection: function () {
353353
var selectedPlacemarkId = null;
354-
if (!Ember.none(FLOW.mapsController.get('selectedMarker'))) {
355-
selectedPlacemarkId = FLOW.mapsController.selectedMarker.target.options.placemarkId;
356-
this.set('collectionDate',FLOW.mapsController.selectedMarker.target.options.collectionDate);
354+
if (!Ember.none(FLOW.router.get('mapsController'))) {
355+
var mapsController = FLOW.router.get('mapsController');
356+
if (!Ember.none(mapsController.get('selectedMarker'))) {
357+
selectedPlacemarkId = mapsController.selectedMarker.target.options.placemarkId;
358+
this.set('collectionDate',mapsController.selectedMarker.target.options.collectionDate);
359+
}
360+
this.populate(selectedPlacemarkId);
357361
}
358-
this.populate(selectedPlacemarkId);
359-
}.observes('FLOW.mapsController.selectedMarker')
362+
}.observes('FLOW.router.mapsController.selectedMarker')
360363

361364
});

Dashboard/app/js/lib/controllers/permissions.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ FLOW.dialogControl = Ember.Object.create({
267267
delQG: "delQG",
268268
delQ: "delQ",
269269
delUser: "delUser",
270-
delAttr: "delAttr",
271270
delAssignment: "delAssignment",
272271
delDeviceGroup: "delDeviceGroup",
273272
delSI: "delSI",
@@ -314,12 +313,6 @@ FLOW.dialogControl = Ember.Object.create({
314313
this.set('showDialog', true);
315314
break;
316315

317-
case "delAttr":
318-
this.set('header', Ember.String.loc('_attr_delete_header'));
319-
this.set('message', Ember.String.loc('_this_cant_be_undo'));
320-
this.set('showDialog', true);
321-
break;
322-
323316
case "delAssignment":
324317
this.set('header', Ember.String.loc('_assignment_delete_header'));
325318
this.set('message', Ember.String.loc('_this_cant_be_undo'));
@@ -390,11 +383,6 @@ FLOW.dialogControl = Ember.Object.create({
390383
view.deleteUser.apply(view, arguments);
391384
break;
392385

393-
case "delAttr":
394-
this.set('showDialog', false);
395-
view.deleteAttribute.apply(view, arguments);
396-
break;
397-
398386
case "delAssignment":
399387
this.set('showDialog', false);
400388
view.deleteSurveyAssignment.apply(view, arguments);

Dashboard/app/js/lib/controllers/reports-controllers.js

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -31,51 +31,3 @@ FLOW.chartTypeControl = Ember.Object.create({
3131
})
3232
]
3333
});
34-
35-
FLOW.statisticsControl = Ember.ArrayController.create({
36-
selectedSurvey: null,
37-
allreadyTriggered: false,
38-
content:null,
39-
QAcontent:null,
40-
sortProperties: ['name'],
41-
sortAscending: true,
42-
totalsSurveys:[],
43-
total:null,
44-
45-
computeTotal: function(){
46-
this.set('total',Math.max.apply(Math, this.get('totalsSurveys')));
47-
},
48-
49-
getMetrics: function(){
50-
if (!Ember.none(this.get('selectedSurvey'))){
51-
this.set('totalsSurveys',[]);
52-
this.set('total',null);
53-
this.set('alreadyTriggered',false);
54-
this.set('content',FLOW.store.findQuery(FLOW.Metric,{
55-
surveyId: this.selectedSurvey.get('keyId')
56-
}));
57-
}
58-
}.observes('this.selectedSurvey'),
59-
60-
resetSurvey: function(){
61-
this.set('selectedSurvey',null);
62-
this.set('totalsSurveys',[]);
63-
this.set('total',null);
64-
this.set('content',null);
65-
}.observes('FLOW.selectedControl.selectedSurveyGroup'),
66-
67-
getQA: function(){
68-
if (!Ember.none(this.get('content') && !this.get('allreadyTriggered'))){
69-
this.set('totalsSurveys',[]);
70-
this.set('total',null);
71-
// for each metric, get all the QuestionAnswerSummery objects of the questions
72-
// this could be a single call: give me all he QA summ for questions with a metric.
73-
this.set('QAcontent',FLOW.store.findQuery(FLOW.SurveyQuestionSummary,{
74-
surveyId:this.selectedSurvey.get('keyId'),
75-
metricOnly:"true"
76-
}));
77-
allreadyTriggered = true;
78-
}
79-
}.observes('this.content.isLoaded')
80-
81-
});

Dashboard/app/js/lib/controllers/survey-controllers.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,28 @@ FLOW.projectControl = Ember.ArrayController.create({
567567
var groups = FLOW.router.approvalGroupListController.get('content');
568568
return groups && groups.filterProperty('keyId', approvalGroupId).get('firstObject');
569569
}.property('this.currentProject.dataApprovalGroupId'),
570+
571+
saveProject: function() {
572+
var currentProject = this.get('currentProject');
573+
var currentForm = FLOW.selectedControl.get('selectedSurvey');
574+
575+
if (currentProject && currentProject.get('isDirty')) {
576+
var name = currentProject.get('name').trim();
577+
currentProject.set('name', name);
578+
currentProject.set('code', name);
579+
currentProject.set('path', this.get('currentProjectPath'));
580+
}
581+
582+
if (currentForm && currentForm.get('isDirty')) {
583+
var name = currentForm.get('name').trim();
584+
currentForm.set('name', name);
585+
currentForm.set('code', name);
586+
var path = this.get('currentProjectPath') + "/" + name;
587+
currentForm.set('path', path);
588+
}
589+
590+
FLOW.store.commit();
591+
}
570592
});
571593

572594

Dashboard/app/js/lib/models/fixtures.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,24 +1192,6 @@ FLOW.SurveyInstance.FIXTURES = [{
11921192
}];
11931193

11941194

1195-
FLOW.Metric.FIXTURES = [{
1196-
name:'metric 1',
1197-
questionId: 1,
1198-
id:1,
1199-
keyId:1
1200-
},{
1201-
name:'metric 2',
1202-
questionId: 1,
1203-
id:2,
1204-
keyId:2
1205-
},{
1206-
name:'metric 2',
1207-
questionId: 1,
1208-
id:1,
1209-
keyId:1
1210-
}];
1211-
1212-
12131195
FLOW.SurveyQuestionSummary.FIXTURES = [{
12141196
id: 1,
12151197
keyId: 1,

Dashboard/app/js/lib/models/models.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,6 @@ FLOW.UserConfig = FLOW.BaseModel.extend({
448448
userId: DS.attr('number')
449449
});
450450

451-
// this is called attribute in the dashboard, but metric in the backend, for historic reasons.
452-
FLOW.Metric = FLOW.BaseModel.extend({
453-
organization: DS.attr('string'),
454-
name: DS.attr('string'),
455-
group: DS.attr('string'),
456-
valueType: DS.attr('string'),
457-
questionId: DS.attr('number')
458-
});
459-
460451
FLOW.Message = FLOW.BaseModel.extend({
461452
objectId: DS.attr('number'),
462453
lastUpdateDateTime: DS.attr('number'),

0 commit comments

Comments
 (0)