Skip to content

Filters: Filter by modality #381

@conradarcturus

Description

@conradarcturus

Some languages are written only, some are spoken only, some a sign languages, some are a mix. People using LangNav may want to filter based on this.

See this annotated screenshot for more:
Image

Instructions

Generally, this will behave very similarly to the feature that filters by Language Scope, you can use that as a template.

First take a look at the LanguageModality enum is here

1: Make a setting

Add a page parameter modalityFilter to store the setting

2: Enable changing the setting

You will create a selector

  • Follow LanguageScopeSelector as a template -- but you can probably ignore getLanguageScopePlural and just return the text.
  • One exception here is that you will only want to show the first 6 options (from written to spoken to sign) for most objectTypes, only for Censuses will you wa
  • Add it to the SidePanel
  • Add it to the FilterPath -- in this case you'll make a mini-selector, see what we do for LanguageScope -- however here you don't need to involve defaultParams -- rather only show it when its non-empty.

If you would like, you can stop here and post the first of 2 PRs since you can verify the setting usage. Next we will implement it.

3: Filter languages with the setting

  • In filter.tsx you will add a new function getFilterByModality -- it will function very similarly to getFilterByLanguageScope
  • Just like getFilterByLanguageScope -- you will only every actively filter languages or locales (based on their languages)
  • Then you will add it to getScopeFilter -- now all major filter usages will use this modality filter!

0: Add it to the filter breakdown

We'll make this a separate task

Sub-issues

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions