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:
aignatov-bio 2020-09-17 09:16:14 +02:00 committed by GitHub
commit 13b775e495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -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) {

View file

@ -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">