provide project_identifier_filter

This commit is contained in:
Alexander Meindl 2021-03-09 06:04:39 +01:00
parent 20b9191af0
commit 3bf153a3ac

View File

@ -55,10 +55,24 @@ module AdditionalsQuery
end
end
def sql_for_project_identifier_field(field, operator, values)
value = values.first
values = value.split(',').map(&:strip) if ['=', '!'].include?(operator) && value.include?(',')
sql_for_field field, operator, values, Project.table_name, 'identifier'
end
def sql_for_project_status_field(field, operator, value)
sql_for_field field, operator, value, Project.table_name, 'status'
end
def initialize_project_identifier_filter
return if project
add_available_filter 'project.identifier',
type: :string,
name: l(:label_attribute_of_project, name: l(:field_identifier))
end
def initialize_project_status_filter
return if project&.leaf?