From b334b037f8f4f0076e0a98543c83e26c52374bc8 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Thu, 22 Sep 2016 09:50:17 +0200 Subject: [PATCH 1/2] Fixes issue with old data in modal fields [fixes SCI-400] --- app/assets/javascripts/experiments/dropdown_actions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/experiments/dropdown_actions.js b/app/assets/javascripts/experiments/dropdown_actions.js index b00ada76a..3a53f036b 100644 --- a/app/assets/javascripts/experiments/dropdown_actions.js +++ b/app/assets/javascripts/experiments/dropdown_actions.js @@ -16,6 +16,7 @@ keyboard: false, }); validateMoveModal(id); + clearModal($(id)); }) .on("ajax:error", function() { animateSpinner(null, false); @@ -26,6 +27,13 @@ }); } + function clearModal(id) { + //Completely remove modal when it gets closed + $(id).on('hidden.bs.modal', function() { + $(id).remove(); + }); + } + // Initialize dropdown actions on experiment: // - edit // - clone From 0dd1196ae528519f0606110c87f24a6da410cf25 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Thu, 22 Sep 2016 15:10:15 +0200 Subject: [PATCH 2/2] Fixes issue with move of experiments between projects [fixes SCI-400] --- app/models/experiment.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/experiment.rb b/app/models/experiment.rb index d37661bbf..052d13a6e 100644 --- a/app/models/experiment.rb +++ b/app/models/experiment.rb @@ -375,9 +375,9 @@ class Experiment < ActiveRecord::Base project.tags << new_tags m.tags << new_tags end - - save - touch(:workflowimg_updated_at) + result = save + touch(:workflowimg_updated_at) if result + result end # Get projects where user is either owner or user in the same organization