mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-14 15:56:06 +08:00
Merge pull request #5777 from wandji20/wb-SCI-8851
Fix issue archiving task result tables and when downloading archived result table
This commit is contained in:
commit
e79c73f8c4
2 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ class ResultTablesController < ApplicationController
|
||||||
@result.table.last_modified_by = current_user
|
@result.table.last_modified_by = current_user
|
||||||
@result.table.team = current_team
|
@result.table.team = current_team
|
||||||
@result.assign_attributes(update_params)
|
@result.assign_attributes(update_params)
|
||||||
@result.table.metadata = JSON.parse(update_params[:table_attributes][:metadata])
|
@result.table.metadata = JSON.parse(update_params[:table_attributes][:metadata]) if update_params[:table_attributes]
|
||||||
flash_success = t("result_tables.update.success_flash",
|
flash_success = t("result_tables.update.success_flash",
|
||||||
module: @my_module.name)
|
module: @my_module.name)
|
||||||
if @result.archived_changed?(from: false, to: true)
|
if @result.archived_changed?(from: false, to: true)
|
||||||
|
@ -108,7 +108,7 @@ class ResultTablesController < ApplicationController
|
||||||
def download
|
def download
|
||||||
_ = JSON.parse @result_table.table.contents
|
_ = JSON.parse @result_table.table.contents
|
||||||
@table_data = _["data"] || []
|
@table_data = _["data"] || []
|
||||||
data = render_to_string partial: 'download.txt.erb'
|
data = render_to_string partial: 'download'
|
||||||
send_data data, filename: @result_table.result.name + '.txt',
|
send_data data, filename: @result_table.result.name + '.txt',
|
||||||
type: 'plain/text'
|
type: 'plain/text'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue