mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Merge pull request #2312 from okriuchykhin/ok_SCI_4237
Improve user experience for repository saving and fix checklist saving [SCI-4237]
This commit is contained in:
commit
967acb0af3
|
@ -94,16 +94,15 @@ var RepositoryDatatableRowEditor = (function() {
|
|||
let $table = $(TABLE.table().node());
|
||||
|
||||
$table.on('ajax:success', '.repository-row-edit-form', function(ev, data) {
|
||||
TABLE.ajax.reload();
|
||||
HelperModule.flashAlertMsg(data.flash, 'success');
|
||||
TABLE.ajax.reload(() => {
|
||||
animateSpinner(null, false);
|
||||
HelperModule.flashAlertMsg(data.flash, 'success');
|
||||
});
|
||||
});
|
||||
|
||||
$table.on('ajax:error', '.repository-row-edit-form', function(ev, data) {
|
||||
HelperModule.flashAlertMsg(data.responseJSON.flash, 'danger');
|
||||
});
|
||||
|
||||
$table.on('ajax:complete', '.repository-row-edit-form', function() {
|
||||
animateSpinner(null, false);
|
||||
HelperModule.flashAlertMsg(data.responseJSON.flash, 'danger');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -44,11 +44,9 @@ class RepositoryChecklistValue < ApplicationRecord
|
|||
|
||||
def self.new_with_payload(payload, attributes)
|
||||
value = new(attributes)
|
||||
value.repository_cell
|
||||
.repository_column
|
||||
.repository_checklist_items.where(id: JSON.parse(payload)).find_each do |item|
|
||||
value.repository_checklist_items_values.new(repository_checklist_item: item)
|
||||
end
|
||||
value.repository_checklist_items = value.repository_cell
|
||||
.repository_column
|
||||
.repository_checklist_items.where(id: JSON.parse(payload))
|
||||
value
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue