mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
Remove icon from the status repository column at label print time [SCI-7267] (#4471)
* Remove icon from the status repository column at label print time [SCI-7267] * Fix status repository column at label print time [SCI-7267] * Fix status repository column at label print time [SCI-7267]
This commit is contained in:
parent
eef93c42d8
commit
f87b42d042
2 changed files with 18 additions and 4 deletions
|
@ -19,6 +19,10 @@ class RepositoryStatusValue < ApplicationRecord
|
|||
data
|
||||
end
|
||||
|
||||
def formatted_status
|
||||
repository_status_item&.status
|
||||
end
|
||||
|
||||
def self.add_filter_condition(repository_rows, join_alias, filter_element)
|
||||
items_join_alias = "#{join_alias}_status_items"
|
||||
repository_rows =
|
||||
|
|
|
@ -31,6 +31,19 @@ module LabelTemplates
|
|||
|
||||
private
|
||||
|
||||
def fetch_custom_column_value(name)
|
||||
repository_cell = @repository_row.repository_cells.joins(:repository_column).find_by(
|
||||
repository_columns: { name: name }
|
||||
)
|
||||
return '' unless repository_cell
|
||||
|
||||
if repository_cell.value_type == 'RepositoryStatusValue'
|
||||
repository_cell.value.formatted_status
|
||||
else
|
||||
repository_cell.value.formatted
|
||||
end
|
||||
end
|
||||
|
||||
def fetch_value(key)
|
||||
case key
|
||||
when /^c_(.*)/
|
||||
|
@ -41,10 +54,7 @@ module LabelTemplates
|
|||
|
||||
return '' unless @print_mode
|
||||
|
||||
repository_cell = @repository_row.repository_cells.joins(:repository_column).find_by(
|
||||
repository_columns: { name: name }
|
||||
)
|
||||
repository_cell ? repository_cell.value.formatted : ''
|
||||
fetch_custom_column_value(name)
|
||||
when 'ITEM_ID'
|
||||
@repository_row.code
|
||||
when 'NAME'
|
||||
|
|
Loading…
Reference in a new issue