From 6caeae77c6d8ad5d5e00fd405268e4d6f3092ccd Mon Sep 17 00:00:00 2001
From: jaden <noreply@example.com>
Date: Mon, 12 Jun 2017 16:47:59 +0200
Subject: [PATCH] add alias to report exp table in viewmode if 1 group, closes
 #47

---
 .../reports/app/directives/experimentsTable.js | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/beat/web/reports/static/reports/app/directives/experimentsTable.js b/beat/web/reports/static/reports/app/directives/experimentsTable.js
index a60963e38..7ff2edbfb 100644
--- a/beat/web/reports/static/reports/app/directives/experimentsTable.js
+++ b/beat/web/reports/static/reports/app/directives/experimentsTable.js
@@ -44,11 +44,13 @@ angular.module('reportApp')
 			scope.getBlockUrl = UrlService.getBlockUrl;
 			scope.getDatabaseUrl = UrlService.getDatabaseUrl;
 			scope.getExperimentListPath = UrlService.getExperimentListPath;
-			scope.isByName = UrlService.getNameSegment() ? true : false;
+			scope.isViewmode = UrlService.isViewmode;
 
 			scope.expNames = ExperimentsService.experimentNames;
 			scope.exps = ExperimentsService.experiments;
 
+			scope.groups = GroupsService.groups;
+
 			// collects an array of formatted databases & protocols of an experiment
 			// format is "<database name>@<protocol name>"
 			scope.getExpDatabases = (expName) => {
@@ -83,7 +85,8 @@ angular.module('reportApp')
 			<table ng-if='expNames.length > 0' class="table table-striped table-hover">
 				<thead>
 					<tr>
-						<th ng-if='isByName'></th>
+						<th ng-if='!isViewmode()'></th>
+						<th ng-if='isViewmode() && groups.length == 1'>Alias</th>
 						<th>Experiment</th>
 						<th>Databases/Protocols</th>
 						<th>Analyzer</th>
@@ -91,17 +94,24 @@ angular.module('reportApp')
 				</thead>
 				<tbody>
 					<tr ng-repeat='expName in expNames'>
-						<td ng-if='isByName'>
+						<td ng-if='!isViewmode()'>
 							<div class='btn-group action-buttons'>
 								<span
 									ng-click='deleteExpFromReport(expName)'
 									style='cursor: pointer;'
 									class="btn-delete"
-									data-toggle="tooltip" data-placement="top" title="Remove Experiment from Report">
+									data-toggle="tooltip"
+									data-placement="top"
+									title="Remove Experiment from Report">
 									<i class="fa fa-times fa-lg"></i>
 								</span>
 							</div>
 						</td>
+						<td ng-if='isViewmode() && groups.length == 1'>
+							<span ng-if='groups[0].experiments.includes(expName)'>
+								{{ groups[0].aliases[expName] }}
+							</span>
+						</td>
 						<td><a href='{{ getExpUrl(expName) }}'>{{ expName }}</a></td>
 						<td>
 							<span ng-repeat='db in getExpDatabases(expName)'>
-- 
GitLab