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:
ajugo 2022-10-06 11:53:12 +02:00 committed by GitHub
parent eef93c42d8
commit f87b42d042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -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 =

View file

@ -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'