diff --git a/beat/web/reports/static/reports/app/directives/edit/panelExperiments.js b/beat/web/reports/static/reports/app/directives/edit/panelExperiments.js index d1bd6ab9992fb35f54506451071a3b16577a0e24..fabd3db1c6a42794c291c52c5d05473cb796466f 100644 --- a/beat/web/reports/static/reports/app/directives/edit/panelExperiments.js +++ b/beat/web/reports/static/reports/app/directives/edit/panelExperiments.js @@ -32,6 +32,7 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', }, link: function(scope){ scope.isEditable = GroupsService.isEditable; + scope.experiments = ExperimentsService.experiments; scope.dropdownId = `${scope.group.name}_exp_add_dropdown`; scope.expsNotInGroup = () => { return Object.keys(ExperimentsService.experiments) @@ -41,8 +42,15 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', .filter(e => scope.group.analyzer === '' || ExperimentsService.getAnalyzerFromExpName(e) === scope.group.analyzer) ; }; + scope.getExpDatabases = (expName) => { + console.log(scope.experiments[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"> @@ -72,7 +80,9 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', </ul> </div> </div> - <i style='margin-left: 5px;' ng-if='group.analyzer.length > 0'>Analyzer: {{ group.analyzer }}</i> + <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" @@ -85,11 +95,12 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', <tr> <th></th> <th>Experiment</th> + <th>Databases</th> <th>Alias</th> </tr> </thead> <tbody> - <tr ng-repeat='expName in group.experiments'> + <tr ng-repeat='expName in group.experiments' ng-if='experiments[expName]'> <td> <div class='btn-group action-buttons'> <span @@ -101,6 +112,12 @@ angular.module('reportApp').directive("groupPanelExperiments", ['GroupsService', </div> </td> <td><a href='{{ getExpUrl(expName) }}'>{{ expName }}</a></td> + <td> + <span ng-repeat='db in getExpDatabases(expName)'> + <a href='{{ getDatabaseUrl(db) }}'>{{ db }}</a> + + </span> + </td> <td><input ng-disabled='!isEditable' ng-model='group.aliases[expName]'></input></td> </tr> </tbody> diff --git a/beat/web/reports/static/reports/app/directives/edit/textItem.js b/beat/web/reports/static/reports/app/directives/edit/textItem.js index 57296418f73d7eb35cdbc50b2dcadb22b922472f..d031019fa237063df47a115087f555c03e18072d 100644 --- a/beat/web/reports/static/reports/app/directives/edit/textItem.js +++ b/beat/web/reports/static/reports/app/directives/edit/textItem.js @@ -56,7 +56,6 @@ angular.module('reportApp') scope.compileContent = () => { let url = UrlService.getCompileRstUrl(); let content = scope.item.content; - console.log(url); return reportFactory.compileRST(url, content) .then(data => { diff --git a/beat/web/reports/static/reports/app/services/urlService.js b/beat/web/reports/static/reports/app/services/urlService.js index aaddd515274041c9a79286012560c316ea12def2..d386d6e197f06d4f7ee3760e52b085ddef96eb23 100644 --- a/beat/web/reports/static/reports/app/services/urlService.js +++ b/beat/web/reports/static/reports/app/services/urlService.js @@ -41,7 +41,6 @@ angular.module('reportApp').factory('UrlService', [function(){ // extracts info from jQuery's ajaxSettings current URL const extractUsingCurrentUrl = () => { - console.log($.ajaxSettings); const url = $.ajaxSettings.url; const idxSplit = url.indexOf('reports'); const path = url.slice(idxSplit); @@ -63,7 +62,7 @@ angular.module('reportApp').factory('UrlService', [function(){ const apiPath = () => `${prefix}${apiSegment}`; const getExperimentUrl = (experimentName) => `${experimentPath()}${experimentName}/`; - const getBlockUrl = (blockName) => `${blockPath()}${expName}/`; + const getBlockUrl = (blockName) => `${blockPath()}${blockName}/`; const getDatabaseUrl = (databaseName) => `${databasePath()}${databaseName}/`; const getApiUrl = (apiSubpath) => `${apiPath()}${apiSubpath}`;