mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
Fix bug with update protocol from repository and modal disable button [SCI-3284] (#1631)
* Fix bug with update protocol from repository and modal disable button
This commit is contained in:
parent
b679eb4a58
commit
e034a0c055
3 changed files with 3 additions and 2 deletions
|
@ -133,6 +133,7 @@ function initCopyToRepository() {
|
|||
})
|
||||
.on("ajax:error", function(e2, data2) {
|
||||
// Display errors in form
|
||||
submitBtn[0].disabled = false;
|
||||
if (data2.status === 422) {
|
||||
$(this).renderFormErrors("protocol", data2.responseJSON);
|
||||
} else {
|
||||
|
|
|
@ -464,7 +464,7 @@ class ProtocolsController < ApplicationController
|
|||
# Everything good, display flash & render 200
|
||||
log_activity(:update_protocol_in_task_from_repository,
|
||||
@protocol.my_module.experiment.project,
|
||||
my_module: @my_module.id,
|
||||
my_module: @protocol.my_module.id,
|
||||
protocol_repository: @protocol.parent.id)
|
||||
flash[:success] = t(
|
||||
'my_modules.protocols.update_from_parent_flash'
|
||||
|
|
|
@ -704,7 +704,7 @@ class Protocol < ApplicationRecord
|
|||
def destroy_contents(current_user)
|
||||
# Calculate total space taken by the protocol
|
||||
st = self.space_taken
|
||||
steps.pluck(:id) do |id|
|
||||
steps.pluck(:id).each do |id|
|
||||
unless Step.find(id).destroy(current_user)
|
||||
raise ActiveRecord::RecordNotDestroyed
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue