diff --git a/beat/web/experiments/static/experiments/js/utils.js b/beat/web/experiments/static/experiments/js/utils.js index ac71620ef6ed60efe53c7fc3247ae1e0d003caf1..675970cfaf38f7da0cf4b34e99c8d4354f71712a 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();},