Skip to content
Snippets Groups Projects
Commit 875c962f authored by Jaden Diefenbaugh's avatar Jaden Diefenbaugh
Browse files

rm unused panelExperiments from report view directives

parent 5aebc3de
No related branches found
No related tags found
1 merge request!223Reports overhaul
/*
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
* This file is part of the beat.web module of the BEAT platform.
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/
/*
* groupPanelExperiments
* Desc:
* displays the experiments panel of the group
*/
angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', 'ExperimentsService', 'UrlService', function(GroupsService, ExperimentsService, UrlService){
return {
scope: {
group: '='
},
link: function(scope){
scope.experiments = ExperimentsService.experiments;
scope.expsNotInGroup = () => {
return Object.keys(ExperimentsService.experiments)
// exps not in group
.filter(e => !scope.group.experiments.includes(e))
// exp has compatible analyzer
.filter(e => scope.group.analyzer === '' || ExperimentsService.getAnalyzerFromExpName(e) === scope.group.analyzer)
;
};
scope.getExpDatabases = (expName) => {
let dbs = scope.experiments[expName].declaration.datasets;
return Array.from(new Set(Object.values(dbs).map(db => db.database)));
};
scope.getAnalyzerFromExpName = ExperimentsService.getAnalyzerFromExpName;
scope.getExpUrl = UrlService.getExperimentUrl;
scope.getBlockUrl = UrlService.getBlockUrl;
scope.getDatabaseUrl = UrlService.getDatabaseUrl;
},
template: `
<div id="{{group.name}}-explist-heading" class="panel-heading" role="tab">
<h4 class="panel-title">
<a
role="button"
data-toggle="collapse"
data-parent="#{{group.name}}-explist-heading"
href="#collapse-{{group.name}}-explist"
aria-expanded="true"
aria-controls="collapse-{{group.name}}-explist">
Experiments
</a>
<i style='margin-left: 5px;' ng-if='group.analyzer.length > 0'>
Analyzer: <a href='{{ getBlockUrl(group.analyzer) }}'>{{ group.analyzer }}</a>
</i>
</h4>
</div>
<div id="collapse-{{group.name}}-explist"
class="panel-collapse collapse in"
role="tabpanel"
aria-labelledby="{{group.name}}-explist-heading">
<div class="panel-body">
<table ng-if='group.experiments.length > 0' class="table table-striped table-hover">
<thead>
<tr>
<th>Experiment</th>
<th>Databases</th>
<th>Alias</th>
</tr>
</thead>
<tbody>
<tr ng-repeat='expName in group.experiments' ng-if='experiments[expName]'>
<td><a href='{{ getExpUrl(expName) }}'>{{ expName }}</a></td>
<td>
<span ng-repeat='db in getExpDatabases(expName)'>
<a href='{{ getDatabaseUrl(db) }}'>{{ db }}</a>
&nbsp;
</span>
</td>
<td>{{ group.aliases[expName] }}</td>
</tr>
</tbody>
</table>
</div>
</div>
`
};
}]);
...@@ -128,7 +128,6 @@ ...@@ -128,7 +128,6 @@
<script src="{% fingerprint "reports/app/directives/view/layout.js" %}" type="text/javascript" charset="utf-8"></script> <script src="{% fingerprint "reports/app/directives/view/layout.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/directives/view/itemContainer.js" %}" type="text/javascript" charset="utf-8"></script> <script src="{% fingerprint "reports/app/directives/view/itemContainer.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/directives/view/panelContent.js" %}" type="text/javascript" charset="utf-8"></script> <script src="{% fingerprint "reports/app/directives/view/panelContent.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/directives/view/panelExperiments.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/directives/view/panelItems.js" %}" type="text/javascript" charset="utf-8"></script> <script src="{% fingerprint "reports/app/directives/view/panelItems.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/directives/view/plotItem.js" %}" type="text/javascript" charset="utf-8"></script> <script src="{% fingerprint "reports/app/directives/view/plotItem.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/directives/view/tableItem.js" %}" type="text/javascript" charset="utf-8"></script> <script src="{% fingerprint "reports/app/directives/view/tableItem.js" %}" type="text/javascript" charset="utf-8"></script>
......
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