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).
32 lines
600 B
Ruby
32 lines
600 B
Ruby
class SDGManagement::Relations::IndexComponent < ApplicationComponent
|
|
include Header
|
|
attr_reader :records
|
|
|
|
def initialize(records)
|
|
@records = records
|
|
end
|
|
|
|
private
|
|
|
|
def title
|
|
t("sdg_management.menu.#{model_class.table_name}")
|
|
end
|
|
|
|
def model_class
|
|
records.model
|
|
end
|
|
|
|
def edit_path_for(record)
|
|
{
|
|
controller: "sdg_management/relations",
|
|
action: :edit,
|
|
relatable_type: record.class.name.tableize,
|
|
id: record
|
|
}
|
|
end
|
|
|
|
def search_label
|
|
t("admin.shared.search.label.#{model_class.table_name}")
|
|
end
|
|
end
|