From eed03affc451aa2bd95b8db37d0843d906f262f7 Mon Sep 17 00:00:00 2001
From: Jaden Diefenbaugh <blakcap@users.noreply.github.com>
Date: Thu, 9 Mar 2017 15:33:57 +0100
Subject: [PATCH] after add exps, button to go to report

---
 beat/web/experiments/static/experiments/js/utils.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/beat/web/experiments/static/experiments/js/utils.js b/beat/web/experiments/static/experiments/js/utils.js
index ac71620ef..675970cfa 100644
--- a/beat/web/experiments/static/experiments/js/utils.js
+++ b/beat/web/experiments/static/experiments/js/utils.js
@@ -1954,8 +1954,9 @@ beat.experiments.utils.modal_add_to_report = function (names, report_list_url) {
               var type = BootstrapDialog.TYPE_PRIMARY;
               var title = '<i class="fa fa-check"></i> Report changes';
               var btn_type = 'btn-primary';
+              let viewReportUrl = `${$.ajaxSettings.url.split('/experiments')[0]}${select.val().replace('add/', '').replace(/api\/v.\//, '')}`;
               if (successful == sent) {
-                description.text('Successfully added ' + sent + ' experiment(s) to report');
+                description.text(`Successfully added ${sent} experiment(s) to report`);
               }
               else {
                 description.text('Added ' + successful + ' (out of ' + sent + ' in total) experiment(s) to report');
@@ -1971,6 +1972,11 @@ beat.experiments.utils.modal_add_to_report = function (names, report_list_url) {
                 size: size,
                 type: type,
                 buttons: [{
+                  label: 'View Report',
+                  cssClass: btn_type,
+                  action: function(dialog){dialog.close(); window.open(viewReportUrl, '_blank');},
+                },
+		{
                   label: 'OK',
                   cssClass: btn_type,
                   action: function(dialog){dialog.close();},
-- 
GitLab