From 4cd2bce83f2134c173674c4bf0c01d3194e364e8 Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Thu, 11 Feb 2021 12:36:39 +0100 Subject: [PATCH] Fix Move button on Experiment card --- app/assets/javascripts/projects/show.js | 12 ++++++++++++ app/assets/stylesheets/experiments.scss | 1 + app/views/experiments/_move_modal.html.erb | 8 +++++--- app/views/experiments/_new_modal.html.erb | 5 ++++- app/views/projects/show.html.erb | 1 - app/views/projects/show/_toolbar.html.erb | 13 +++++++------ 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/projects/show.js b/app/assets/javascripts/projects/show.js index 357c573e5..1fef0b09a 100644 --- a/app/assets/javascripts/projects/show.js +++ b/app/assets/javascripts/projects/show.js @@ -239,6 +239,17 @@ }); } + function initNewExperimentToolbarButton() { + let forms = '.new-experiment-form'; + $(experimentsPage) + .on('ajax:success', forms, function(ev, data) { + appendActionModal($(data.html)); + }) + .on('ajax:error', forms, function(ev, data) { + HelperModule.flashAlertMsg(data.responseJSON.message, 'danger'); + }); + } + function init() { $('.workflowimg-container').each(function() { let container = $(this); @@ -284,6 +295,7 @@ initExperimentsSelector(); initArchiveRestoreToolbarButtons(); initEditMoveDuplicateToolbarButton(); + initNewExperimentToolbarButton(); initSelectAllCheckbox(); } diff --git a/app/assets/stylesheets/experiments.scss b/app/assets/stylesheets/experiments.scss index 40f793f05..98bc4b117 100644 --- a/app/assets/stylesheets/experiments.scss +++ b/app/assets/stylesheets/experiments.scss @@ -36,6 +36,7 @@ .clone-experiments-form, .move-experiments-form, .archive-experiments-form, + .new-experiments-form, .restore-experiments-form { display: inline-block; } diff --git a/app/views/experiments/_move_modal.html.erb b/app/views/experiments/_move_modal.html.erb index c0cf7fafa..697d87e8a 100644 --- a/app/views/experiments/_move_modal.html.erb +++ b/app/views/experiments/_move_modal.html.erb @@ -1,11 +1,13 @@ -