mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 21:06:24 +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
|
data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def formatted_status
|
||||||
|
repository_status_item&.status
|
||||||
|
end
|
||||||
|
|
||||||
def self.add_filter_condition(repository_rows, join_alias, filter_element)
|
def self.add_filter_condition(repository_rows, join_alias, filter_element)
|
||||||
items_join_alias = "#{join_alias}_status_items"
|
items_join_alias = "#{join_alias}_status_items"
|
||||||
repository_rows =
|
repository_rows =
|
||||||
|
|
|
@ -31,6 +31,19 @@ module LabelTemplates
|
||||||
|
|
||||||
private
|
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)
|
def fetch_value(key)
|
||||||
case key
|
case key
|
||||||
when /^c_(.*)/
|
when /^c_(.*)/
|
||||||
|
@ -41,10 +54,7 @@ module LabelTemplates
|
||||||
|
|
||||||
return '' unless @print_mode
|
return '' unless @print_mode
|
||||||
|
|
||||||
repository_cell = @repository_row.repository_cells.joins(:repository_column).find_by(
|
fetch_custom_column_value(name)
|
||||||
repository_columns: { name: name }
|
|
||||||
)
|
|
||||||
repository_cell ? repository_cell.value.formatted : ''
|
|
||||||
when 'ITEM_ID'
|
when 'ITEM_ID'
|
||||||
@repository_row.code
|
@repository_row.code
|
||||||
when 'NAME'
|
when 'NAME'
|
||||||
|
|
Loading…
Add table
Reference in a new issue