mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 10:06:53 +08:00
Merge pull request #5698 from artoscinote/ma_SCI_8774
Fix and amend result table metadata saving [SCI-8774]
This commit is contained in:
commit
cd70625a10
2 changed files with 10 additions and 1 deletions
|
@ -41,11 +41,19 @@
|
|||
contents.attr('value', data);
|
||||
metadata.attr('value', JSON.stringify({cells: hot.getCellsMeta().map(
|
||||
(x) => {
|
||||
const {row, col} = x;
|
||||
const plugins = hot.plugin;
|
||||
const cellId = plugins.utils.translateCellCoords({row, col});
|
||||
const calculated = plugins.matrix.getItem(cellId)?.value ||
|
||||
hot.getDataAtCell(row, col) ||
|
||||
null;
|
||||
|
||||
if (x) {
|
||||
return {
|
||||
col: x.col,
|
||||
row: x.row,
|
||||
className: x.className || ''
|
||||
className: x.className || '',
|
||||
calculated: calculated
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
|
|
|
@ -70,6 +70,7 @@ class ResultTablesController < ApplicationController
|
|||
@result.table.last_modified_by = current_user
|
||||
@result.table.team = current_team
|
||||
@result.assign_attributes(update_params)
|
||||
@result.table.metadata = JSON.parse(update_params[:table_attributes][:metadata])
|
||||
flash_success = t("result_tables.update.success_flash",
|
||||
module: @my_module.name)
|
||||
if @result.archived_changed?(from: false, to: true)
|
||||
|
|
Loading…
Reference in a new issue