Skip to content
Snippets Groups Projects
Commit b69f4881 authored by jaden's avatar jaden
Browse files

fixed unearthed race condition after closing #12

parent 0f17fe46
No related branches found
No related tags found
1 merge request!223Reports overhaul
...@@ -36,6 +36,9 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', ...@@ -36,6 +36,9 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService',
scope.experiments = ExperimentsService.experiments; scope.experiments = ExperimentsService.experiments;
scope.dropdownId = `${scope.group.name}_exp_add_dropdown`; scope.dropdownId = `${scope.group.name}_exp_add_dropdown`;
scope.getExpName = (expName) => scope.experiments[expName] ? expName : expName.split('/').pop();
const getExp = (expName) => scope.experiments[expName] || scope.experiments[expName.split('/').pop()];
// find experiments that are not in the group but are // find experiments that are not in the group but are
// compatible with the existing experiments (if any) // compatible with the existing experiments (if any)
scope.expsNotInGroup = () => { scope.expsNotInGroup = () => {
...@@ -50,7 +53,12 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', ...@@ -50,7 +53,12 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService',
// collects an array of formatted databases & protocols of an experiment // collects an array of formatted databases & protocols of an experiment
// format is "<database name>@<protocol name>" // format is "<database name>@<protocol name>"
scope.getExpDatabases = (expName) => { scope.getExpDatabases = (expName) => {
let dbs = scope.experiments[expName].declaration.datasets; const expObj = getExp(expName);
if(!expObj){
return;
}
let dbs = expObj.declaration.datasets;
return Array.from(new Set(Object.values(dbs).map(db => `${db.database}@${db.protocol}`))); return Array.from(new Set(Object.values(dbs).map(db => `${db.database}@${db.protocol}`)));
}; };
...@@ -108,15 +116,15 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', ...@@ -108,15 +116,15 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService',
<table ng-if='group.experiments.length > 0' class="table table-striped table-hover"> <table ng-if='group.experiments.length > 0' class="table table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th></th> <th ng-if='!isViewmode()'></th>
<th>Alias</th> <th>Alias</th>
<th>Experiment</th> <th>Experiment</th>
<th>Databases/Protocols</th> <th>Databases/Protocols</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat='expName in group.experiments' ng-if='experiments[expName]'> <tr ng-repeat='expName in group.experiments'>
<td> <td ng-if='!isViewmode()'>
<div class='btn-group action-buttons'> <div class='btn-group action-buttons'>
<span <span
style='cursor: pointer;' style='cursor: pointer;'
...@@ -129,7 +137,7 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', ...@@ -129,7 +137,7 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService',
</td> </td>
<td ng-if='!isViewmode()'><input ng-model='group.aliases[expName]'></input></td> <td ng-if='!isViewmode()'><input ng-model='group.aliases[expName]'></input></td>
<td ng-if='isViewmode()'><span>{{ group.aliases[expName] }}</span></td> <td ng-if='isViewmode()'><span>{{ group.aliases[expName] }}</span></td>
<td><a href='{{ getExpUrl(expName) }}'>{{ expName }}</a></td> <td><a href='{{ getExpUrl(expName) }}'>{{ getExpName(expName) }}</a></td>
<td> <td>
<span ng-repeat='db in getExpDatabases(expName)'> <span ng-repeat='db in getExpDatabases(expName)'>
<a href='{{ getDatabaseUrl(db.split("@")[0]) }}'>{{ db }}</a> <a href='{{ getDatabaseUrl(db.split("@")[0]) }}'>{{ db }}</a>
......
...@@ -202,11 +202,9 @@ angular.module('reportApp').factory('ExperimentsService', ['experimentFactory', ...@@ -202,11 +202,9 @@ angular.module('reportApp').factory('ExperimentsService', ['experimentFactory',
} }
}); });
/*
console.log(expData); console.log(expData);
console.log(tableData); console.log(tableData);
console.log(plotData); console.log(plotData);
*/
cleanGroups(rawExpNames); cleanGroups(rawExpNames);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment