While this bug was already present in the general admin search, the combination of both search and filters was very uncommon. I've only found this combinations in the users section, where you've got the "erased" filter, but in this case searching for erased users doesn't really make sense since their username and email have been deleted and so there's nothing to find. So the hidden content seemed to be the only affected section. However, we're adding the field to every section so we don't have to make sure we add it when we need it (like we did in the SDGManagement section).
35 lines
704 B
Ruby
35 lines
704 B
Ruby
class SDGManagement::Relations::SearchComponent < ApplicationComponent
|
|
include SDG::OptionsForSelect
|
|
attr_reader :label
|
|
|
|
def initialize(label:)
|
|
@label = label
|
|
end
|
|
|
|
private
|
|
|
|
def goal_label
|
|
t("admin.shared.search.advanced_filters.sdg_goals.label")
|
|
end
|
|
|
|
def goal_blank_option
|
|
t("admin.shared.search.advanced_filters.sdg_goals.all")
|
|
end
|
|
|
|
def target_label
|
|
t("admin.shared.search.advanced_filters.sdg_targets.label")
|
|
end
|
|
|
|
def target_blank_option
|
|
t("admin.shared.search.advanced_filters.sdg_targets.all")
|
|
end
|
|
|
|
def goal_options
|
|
super(params[:goal_code])
|
|
end
|
|
|
|
def target_options
|
|
super(params[:target_code])
|
|
end
|
|
end
|