mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-14 00:54:32 +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.asset.post_process_file(team)
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,8 +14,12 @@ class RepositoryChecklistValue < ApplicationRecord
|
||||||
SORTABLE_COLUMN_NAME = 'repository_checklist_items.data'
|
SORTABLE_COLUMN_NAME = 'repository_checklist_items.data'
|
||||||
SORTABLE_VALUE_INCLUDE = { repository_checklist_value: :repository_checklist_items }.freeze
|
SORTABLE_VALUE_INCLUDE = { repository_checklist_value: :repository_checklist_items }.freeze
|
||||||
|
|
||||||
def formatted
|
def formatted(separator: ' | ')
|
||||||
repository_checklist_items.pluck(:data).join(' | ')
|
repository_checklist_items.pluck(:data).join(separator)
|
||||||
|
end
|
||||||
|
|
||||||
|
def export_formatted
|
||||||
|
formatted(separator: "\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
def data
|
def data
|
||||||
|
|
|
@ -20,4 +20,6 @@ class RepositoryDateRangeValue < RepositoryDateTimeRangeValueBase
|
||||||
value.end_time = Time.zone.parse(data[:end_time])
|
value.end_time = Time.zone.parse(data[:end_time])
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,4 +20,6 @@ class RepositoryDateTimeRangeValue < RepositoryDateTimeRangeValueBase
|
||||||
value.end_time = Time.zone.parse(data[:end_time])
|
value.end_time = Time.zone.parse(data[:end_time])
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,4 +15,6 @@ class RepositoryDateTimeValue < RepositoryDateTimeValueBase
|
||||||
value.data = Time.zone.parse(payload)
|
value.data = Time.zone.parse(payload)
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,4 +15,6 @@ class RepositoryDateValue < RepositoryDateTimeValueBase
|
||||||
value.data = Time.zone.parse(payload)
|
value.data = Time.zone.parse(payload)
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -47,4 +47,6 @@ class RepositoryListValue < ApplicationRecord
|
||||||
.find(payload)
|
.find(payload)
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,4 +32,6 @@ class RepositoryNumberValue < ApplicationRecord
|
||||||
value.data = payload.to_f
|
value.data = payload.to_f
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,4 +42,6 @@ class RepositoryStatusValue < ApplicationRecord
|
||||||
.find(payload)
|
.find(payload)
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,4 +33,6 @@ class RepositoryTextValue < ApplicationRecord
|
||||||
value.data = payload
|
value.data = payload
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,4 +21,6 @@ class RepositoryTimeRangeValue < RepositoryDateTimeRangeValueBase
|
||||||
value.end_time = Time.zone.parse(data[:end_time])
|
value.end_time = Time.zone.parse(data[:end_time])
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,4 +15,6 @@ class RepositoryTimeValue < RepositoryDateTimeValueBase
|
||||||
value.data = Time.zone.parse(payload)
|
value.data = Time.zone.parse(payload)
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias export_formatted formatted
|
||||||
end
|
end
|
||||||
|
|
|
@ -66,7 +66,7 @@ module RepositoryZipExport
|
||||||
handle_file_name_func.call(cell.value.asset)
|
handle_file_name_func.call(cell.value.asset)
|
||||||
else
|
else
|
||||||
SmartAnnotations::TagToText.new(
|
SmartAnnotations::TagToText.new(
|
||||||
user, team, cell.value.formatted
|
user, team, cell.value.export_formatted
|
||||||
).text
|
).text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue