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 @@
* generating group panels using the GroupsService data,
* 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 {
scope: {
},
link: function(scope, el, attr){
scope.GroupsService = GroupsService;
scope.isViewmode = UrlService.isViewmode;
scope.isLocked = () => ReportService.status === 'locked';
// drag handle CSS selector
scope.sortableOptions = {
......@@ -41,7 +42,7 @@ angular.module('reportApp').directive("groupsLayout", ['GroupsService', 'UrlServ
};
},
template: `
<experiments-table></experiments-table>
<experiments-table ng-if='!isLocked()'></experiments-table>
<div ng-if='!isViewmode()' group-add-group-menu class='panel'></div>
<div id='groupsLayout' class='panel-group'>
......
......@@ -93,10 +93,7 @@ angular.module('reportApp')
return scope.fieldTypeCache[field];
let type;
if(field === scope.fields[0]){
type = 'string';
scope.fieldTypeCache[field] = type;
}
let isExpNameCol = field === scope.fields[0] && field === 'Experiment';
let hasFieldObj = Object.values(scope.tableables)
.find(o => o[field]);
......@@ -107,7 +104,7 @@ angular.module('reportApp')
type = 'integer';
} else if(Number.isFinite(fVal)){
type = 'float';
} else if(typeof fVal === 'string'){
} else if(typeof fVal === 'string' || isExpNameCol){
type = 'string';
} else {
type = undefined;
......@@ -129,11 +126,11 @@ angular.module('reportApp')
if(field === scope.fields[0]){
val = alias;
} else if(!fVal){
} else if(fVal === undefined){
val = '-';
} else {
let tmp;
if(fVal.value){
if(fVal.hasOwnProperty('value')){
tmp = fVal.value;
} else {
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