mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-25 01:04:02 +08:00
Add extra format for exports
This commit is contained in:
parent
824e116cfa
commit
9296f0eb4f
13 changed files with 29 additions and 3 deletions
|
@ -58,4 +58,6 @@ class RepositoryAssetValue < ApplicationRecord
|
|||
value.asset.post_process_file(team)
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -14,8 +14,12 @@ class RepositoryChecklistValue < ApplicationRecord
|
|||
SORTABLE_COLUMN_NAME = 'repository_checklist_items.data'
|
||||
SORTABLE_VALUE_INCLUDE = { repository_checklist_value: :repository_checklist_items }.freeze
|
||||
|
||||
def formatted
|
||||
repository_checklist_items.pluck(:data).join(' | ')
|
||||
def formatted(separator: ' | ')
|
||||
repository_checklist_items.pluck(:data).join(separator)
|
||||
end
|
||||
|
||||
def export_formatted
|
||||
formatted(separator: "\n")
|
||||
end
|
||||
|
||||
def data
|
||||
|
|
|
@ -20,4 +20,6 @@ class RepositoryDateRangeValue < RepositoryDateTimeRangeValueBase
|
|||
value.end_time = Time.zone.parse(data[:end_time])
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -20,4 +20,6 @@ class RepositoryDateTimeRangeValue < RepositoryDateTimeRangeValueBase
|
|||
value.end_time = Time.zone.parse(data[:end_time])
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -15,4 +15,6 @@ class RepositoryDateTimeValue < RepositoryDateTimeValueBase
|
|||
value.data = Time.zone.parse(payload)
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -15,4 +15,6 @@ class RepositoryDateValue < RepositoryDateTimeValueBase
|
|||
value.data = Time.zone.parse(payload)
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -47,4 +47,6 @@ class RepositoryListValue < ApplicationRecord
|
|||
.find(payload)
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -32,4 +32,6 @@ class RepositoryNumberValue < ApplicationRecord
|
|||
value.data = payload.to_f
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -42,4 +42,6 @@ class RepositoryStatusValue < ApplicationRecord
|
|||
.find(payload)
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -33,4 +33,6 @@ class RepositoryTextValue < ApplicationRecord
|
|||
value.data = payload
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -21,4 +21,6 @@ class RepositoryTimeRangeValue < RepositoryDateTimeRangeValueBase
|
|||
value.end_time = Time.zone.parse(data[:end_time])
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -15,4 +15,6 @@ class RepositoryTimeValue < RepositoryDateTimeValueBase
|
|||
value.data = Time.zone.parse(payload)
|
||||
value
|
||||
end
|
||||
|
||||
alias export_formatted formatted
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ module RepositoryZipExport
|
|||
handle_file_name_func.call(cell.value.asset)
|
||||
else
|
||||
SmartAnnotations::TagToText.new(
|
||||
user, team, cell.value.formatted
|
||||
user, team, cell.value.export_formatted
|
||||
).text
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue