mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Fix checklist reordering issue [SCI-7039] (#4298)
This commit is contained in:
parent
a527edd07d
commit
20095067a1
2 changed files with 8 additions and 2 deletions
|
@ -118,6 +118,7 @@
|
|||
disableTextEdit() {
|
||||
if (this.checklistItem.attributes.isNew) {
|
||||
this.removeItem();
|
||||
this.$emit('editEnd');
|
||||
return;
|
||||
}
|
||||
this.editingText = false;
|
||||
|
|
|
@ -6,13 +6,18 @@ class ChecklistSerializer < ActiveModel::Serializer
|
|||
include ApplicationHelper
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
attributes :id, :name, :urls, :icon, :sa_name
|
||||
has_many :checklist_items, serializer: ChecklistItemSerializer
|
||||
attributes :id, :name, :urls, :icon, :sa_name, :checklist_items
|
||||
|
||||
def icon
|
||||
'fa-list-ul'
|
||||
end
|
||||
|
||||
def checklist_items
|
||||
object.checklist_items.map do |item|
|
||||
ChecklistItemSerializer.new(item, scope: { user: scope[:user] || @instance_options[:user] }).as_json
|
||||
end
|
||||
end
|
||||
|
||||
def sa_name
|
||||
@user = scope[:user] || @instance_options[:user]
|
||||
custom_auto_link(object.name,
|
||||
|
|
Loading…
Reference in a new issue