mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
Merge pull request #2849 from aignatov-bio/ai-sci-5008-add-before-send-condiiton-for-status-change
Add before send condition for status change [SCI-5008]
This commit is contained in:
commit
13b775e495
2 changed files with 8 additions and 2 deletions
|
@ -258,6 +258,12 @@
|
|||
animateSpinner();
|
||||
$.ajax({
|
||||
url: list.data('link-url'),
|
||||
beforeSend: function(e, ajaxSettings) {
|
||||
if (item.data('beforeSend') instanceof Function) {
|
||||
return item.data('beforeSend')(item, ajaxSettings)
|
||||
}
|
||||
return true
|
||||
},
|
||||
type: 'PATCH',
|
||||
data: { my_module: { status_id: item.data('state-id') } },
|
||||
error: function(e) {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<% unless status.initial_status? %>
|
||||
<% previous_s = status.previous_status %>
|
||||
<% previous_s_errors = previous_s.conditions_errors(my_module) %>
|
||||
<li data-state-id="<%= previous_s.id %>" class="<%= 'disabled' if previous_s_errors.any? %>">
|
||||
<li data-state-id="<%= previous_s.id %>" id="previousStatusSelector" class="<%= 'disabled' if previous_s_errors.any? %>">
|
||||
<span><%= t('my_module_statuses.dropdown.return_label') %></span>
|
||||
<i class="fas fa-long-arrow-alt-right"></i>
|
||||
<div class=" status-container">
|
||||
|
@ -40,7 +40,7 @@
|
|||
<% unless status.final_status? %>
|
||||
<% next_s = status.next_status %>
|
||||
<% next_s_errors = next_s.conditions_errors(my_module) %>
|
||||
<li data-state-id="<%= next_s.id %>" class="<%= 'disabled' if next_s_errors.any? %>">
|
||||
<li data-state-id="<%= next_s.id %>" id="nextStatusSelector" class="<%= 'disabled' if next_s_errors.any? %>">
|
||||
<span><%= t('my_module_statuses.dropdown.move_label') %></span>
|
||||
<i class="fas fa-long-arrow-alt-right"></i>
|
||||
<div class="status-container">
|
||||
|
|
Loading…
Reference in a new issue