Skip to content

Sidebar filter: add Citation search fields to sidebar UI (Home & Missions pages) #301

Description

@ksalamy

Summary

Scientists have requested the ability to search and filter missions by Citation directly from the sidebar filter panel on the Home and Missions pages.

Current State

The backend is fully implemented:

  • citationModelMultipleChoiceFilter on Mission.citations (M2M to Citation model), queryset ordered by DOI
  • citation_searchCharFilter searching citations__doi__icontains OR citations__full_reference__icontains
  • Both fields are included in MissionFilterSidebarHelper and MissionFilterFormHelper
  • Both are listed in the JS filterKeys arrays across all pages

However, the citation multi-select does not currently render as a collapsible checkbox-dropdown in the sidebar (the setupCheckboxDropdowns function in project.js requires .form-check child elements, which ModelMultipleChoiceFilter may not produce with the default widget). The citation_search text field may also not be visible or styled consistently with other sidebar inputs.

Requested Work

  1. citation filter — ensure it renders as a collapsible checkbox-dropdown in the sidebar (matching the style of Vehicle Name, Platform Type, Survey Quality). This may require switching the widget to CheckboxSelectMultiple in filters.py.
  2. citation_search text field — confirm it is visible in the sidebar with correct placeholder text and dark-theme styling consistent with other text inputs.
  3. Home page (map.js) — verify both fields are cloned and displayed in the Home page sidebar (the Home page has its own form-building logic separate from the Missions page).
  4. Clear behavior — ensure both citation fields are cleared correctly when the Clear button is clicked.
  5. URL param round-trip — verify citation and citation_search params are preserved in the URL and restore correctly on page load (sidebar re-open).

Files Likely Affected

  • smdb/smdb/filters.py — possibly add widget=CheckboxSelectMultiple to citation filter
  • smdb/smdb/static/js/map.js — Home page sidebar citation field rendering
  • smdb/smdb/static/js/map_mission_filter.js — Missions page sidebar citation field rendering
  • smdb/smdb/static/js/project.jssetupCheckboxDropdowns may need to handle citation dropdown

Acceptance Criteria

  • Citation dropdown appears in sidebar on both Home and Missions pages, styled as a collapsible checkbox list
  • Citation text search field appears in sidebar with correct placeholder
  • Filtering by citation correctly narrows the mission table and map markers
  • Clear button resets both citation fields
  • Selected citation values are preserved in URL and restored when sidebar reopens

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions