mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +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) {
|
.on("ajax:error", function(e2, data2) {
|
||||||
// Display errors in form
|
// Display errors in form
|
||||||
|
submitBtn[0].disabled = false;
|
||||||
if (data2.status === 422) {
|
if (data2.status === 422) {
|
||||||
$(this).renderFormErrors("protocol", data2.responseJSON);
|
$(this).renderFormErrors("protocol", data2.responseJSON);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -464,7 +464,7 @@ class ProtocolsController < ApplicationController
|
||||||
# Everything good, display flash & render 200
|
# Everything good, display flash & render 200
|
||||||
log_activity(:update_protocol_in_task_from_repository,
|
log_activity(:update_protocol_in_task_from_repository,
|
||||||
@protocol.my_module.experiment.project,
|
@protocol.my_module.experiment.project,
|
||||||
my_module: @my_module.id,
|
my_module: @protocol.my_module.id,
|
||||||
protocol_repository: @protocol.parent.id)
|
protocol_repository: @protocol.parent.id)
|
||||||
flash[:success] = t(
|
flash[:success] = t(
|
||||||
'my_modules.protocols.update_from_parent_flash'
|
'my_modules.protocols.update_from_parent_flash'
|
||||||
|
|
|
@ -704,7 +704,7 @@ class Protocol < ApplicationRecord
|
||||||
def destroy_contents(current_user)
|
def destroy_contents(current_user)
|
||||||
# Calculate total space taken by the protocol
|
# Calculate total space taken by the protocol
|
||||||
st = self.space_taken
|
st = self.space_taken
|
||||||
steps.pluck(:id) do |id|
|
steps.pluck(:id).each do |id|
|
||||||
unless Step.find(id).destroy(current_user)
|
unless Step.find(id).destroy(current_user)
|
||||||
raise ActiveRecord::RecordNotDestroyed
|
raise ActiveRecord::RecordNotDestroyed
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue