Skip to content

CHI-4045: Add categories multi-select filter to USCH resource search - #4898

Open
gpaoloni wants to merge 2 commits into
CHI-4045-extract-checkbox-filterfrom
CHI-4045-usch-category-filter
Open

gpaoloni wants to merge 2 commits into
CHI-4045-extract-checkbox-filterfrom
CHI-4045-usch-category-filter

Conversation

@gpaoloni

Copy link
Copy Markdown
Collaborator

Description

Adds a Categories multi-select filter to the USCH resource search. It is stacked on #4897.

  • Loading the options. Categories are loaded from HRM with list-string-attributes/categories. The importer stores one key per category (categories/0, categories/1, …), so getDistinctStringAttributes gets an optional allowDescendantKeys flag. HRM already supports this flag.
  • The filter. It uses the shared CheckboxMultiSelectFilter. The checkbox area now scrolls after about 5 rows; KHP's filters have at most 3 rows, so they look the same.
  • Search. Selected categories are sent to /search as filters.categories, and a resource matches if it has any of them (OR).
  • Results summary. It shows how many categories are selected ("Categories selected: N").
  • Loading code. The USCH filters component now loads all its reference lists in one loop instead of repeating the same block for each list.

HRM dependency (not blocking). techmatters/hrm#1210 maps categories to an exact terms filter on categoriesName. Without that PR the filter still works, but categories are matched as free-text phrases across all fields, so results are looser. No reindex is needed.

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

Verification steps

  1. On a USCH environment, open resource search. A Categories box appears below Location, listing the categories from the database, and it scrolls after about 5 rows.
  2. Select one or more categories and search. Results include only resources with at least one selected category (exact match once HRM Startup optimisation #1210 is deployed), and the summary shows "Categories selected: N".
  3. Clear all categories. The filter is removed from the request and the summary line disappears.
  • Automated checks: the new and updated tests in ___tests__/states/resources/filterSelectionState/usch.test.ts and ___tests__/components/resources/ pass, and so do tsc and npm run lint. The full npm test suite was not run locally; please rely on CI for that. The UI has not been checked in a browser against a USCH account yet.

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

🤖 Generated with Claude Code

gpaoloni and others added 2 commits November 26, 2026 13:58
Load the distinct category values (stored under categories/<index>
keys) and let counsellors filter by one or more of them. The checkbox
filter becomes scrollable after ~5 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants