Commit 79a465b7 authored by Flavio TARSETTI's avatar Flavio TARSETTI

Merge branch '487-reports-fixes' into 'master'

Bug fixes for the reports app

Closes #487

See merge request !280
parents 30bd2dbf 7a088aae
Pipeline #29136 passed with stages
in 18 minutes and 18 seconds
...@@ -27,13 +27,14 @@ ...@@ -27,13 +27,14 @@
* generating group panels using the GroupsService data, * generating group panels using the GroupsService data,
* and holding the menu for adding a group * and holding the menu for adding a group
*/ */
angular.module('reportApp').directive("groupsLayout", ['GroupsService', 'UrlService', function(GroupsService, UrlService){ angular.module('reportApp').directive("groupsLayout", ['GroupsService', 'UrlService', 'ReportService', function(GroupsService, UrlService, ReportService){
return { return {
scope: { scope: {
}, },
link: function(scope, el, attr){ link: function(scope, el, attr){
scope.GroupsService = GroupsService; scope.GroupsService = GroupsService;
scope.isViewmode = UrlService.isViewmode; scope.isViewmode = UrlService.isViewmode;
scope.isLocked = () => ReportService.status === 'locked';
// drag handle CSS selector // drag handle CSS selector
scope.sortableOptions = { scope.sortableOptions = {
...@@ -41,7 +42,7 @@ angular.module('reportApp').directive("groupsLayout", ['GroupsService', 'UrlServ ...@@ -41,7 +42,7 @@ angular.module('reportApp').directive("groupsLayout", ['GroupsService', 'UrlServ
}; };
}, },
template: ` template: `
<experiments-table></experiments-table> <experiments-table ng-if='!isLocked()'></experiments-table>
<div ng-if='!isViewmode()' group-add-group-menu class='panel'></div> <div ng-if='!isViewmode()' group-add-group-menu class='panel'></div>
<div id='groupsLayout' class='panel-group'> <div id='groupsLayout' class='panel-group'>
......
...@@ -93,10 +93,7 @@ angular.module('reportApp') ...@@ -93,10 +93,7 @@ angular.module('reportApp')
return scope.fieldTypeCache[field]; return scope.fieldTypeCache[field];
let type; let type;
if(field === scope.fields[0]){ let isExpNameCol = field === scope.fields[0] && field === 'Experiment';
type = 'string';
scope.fieldTypeCache[field] = type;
}
let hasFieldObj = Object.values(scope.tableables) let hasFieldObj = Object.values(scope.tableables)
.find(o => o[field]); .find(o => o[field]);
...@@ -107,7 +104,7 @@ angular.module('reportApp') ...@@ -107,7 +104,7 @@ angular.module('reportApp')
type = 'integer'; type = 'integer';
} else if(Number.isFinite(fVal)){ } else if(Number.isFinite(fVal)){
type = 'float'; type = 'float';
} else if(typeof fVal === 'string'){ } else if(typeof fVal === 'string' || isExpNameCol){
type = 'string'; type = 'string';
} else { } else {
type = undefined; type = undefined;
...@@ -129,11 +126,11 @@ angular.module('reportApp') ...@@ -129,11 +126,11 @@ angular.module('reportApp')
if(field === scope.fields[0]){ if(field === scope.fields[0]){
val = alias; val = alias;
} else if(!fVal){ } else if(fVal === undefined){
val = '-'; val = '-';
} else { } else {
let tmp; let tmp;
if(fVal.value){ if(fVal.hasOwnProperty('value')){
tmp = fVal.value; tmp = fVal.value;
} else { } else {
tmp = fVal; tmp = fVal;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment