mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 12:09:17 +08:00
Fix step table renaming [SCI-8216]
This commit is contained in:
parent
0beb64511d
commit
ee7abc2912
2 changed files with 16 additions and 15 deletions
|
@ -27,7 +27,7 @@ module StepElements
|
|||
ActiveRecord::Base.transaction do
|
||||
@table.assign_attributes(table_params.except(:metadata))
|
||||
begin
|
||||
@table.metadata = JSON.parse(table_params[:metadata])
|
||||
@table.metadata = JSON.parse(table_params[:metadata]) if table_params[:metadata].present?
|
||||
rescue JSON::ParserError
|
||||
@table.metadata = {}
|
||||
end
|
||||
|
|
|
@ -156,8 +156,13 @@
|
|||
updateTable() {
|
||||
if (this.editingTable == false) return;
|
||||
|
||||
this.update();
|
||||
this.editingTable = false;
|
||||
},
|
||||
update() {
|
||||
this.element.attributes.orderable.contents = JSON.stringify({ data: this.tableObject.getData() });
|
||||
this.element.attributes.orderable.metadata = JSON.stringify({ cells: this.tableObject.getCellsMeta().map(
|
||||
this.element.attributes.orderable.metadata = JSON.stringify({
|
||||
cells: this.tableObject.getCellsMeta().map(
|
||||
(x) => {
|
||||
if (x) {
|
||||
return {
|
||||
|
@ -170,10 +175,6 @@
|
|||
}
|
||||
}).filter(e => { return e !== null })
|
||||
});
|
||||
this.update();
|
||||
this.editingTable = false;
|
||||
},
|
||||
update() {
|
||||
this.$emit('update', this.element)
|
||||
},
|
||||
loadTableData() {
|
||||
|
|
Loading…
Reference in a new issue