Files
nairobi/app/components/sdg_management/relations/index_component.rb
Javi Martín 92941d3304 Keep filters in admin search
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).
2022-08-23 14:33:55 +02:00

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