Skip to content

refactor(website): read locationFields from YAML config instead of frontend constants#1123

Draft
fhennig wants to merge 1 commit intomainfrom
refactor-location-fields
Draft

refactor(website): read locationFields from YAML config instead of frontend constants#1123
fhennig wants to merge 1 commit intomainfrom
refactor-location-fields

Conversation

@fhennig
Copy link
Copy Markdown
Contributor

@fhennig fhennig commented Mar 26, 2026

Location fields (which LAPIS fields to use for geographic filtering) were previously hardcoded as constants in OrganismConstants.ts:

  • GENSPECTRUM_LOCULUS_LOCATION_FIELDS = ['country', 'division']
  • PATHOPLEXUS_LOCATION_FIELDS = ['geoLocCountry', 'geoLocAdmin1']
  • COVID used ['region', 'country', 'division'] inline

This refactor moves them to the application YAML config so they are defined alongside the other per-organism LAPIS settings and can be adjusted without touching frontend code.

Changes:

  • config.ts: add locationFields to lapisConfigSchema (Zod)
  • OrganismConstants.ts: FiltersConfig now requires locationFields param; getPathoplexusFilters and getGenspectrumLoculusFilters pass it through; remove now-unused PATHOPLEXUS_LOCATION_FIELDS and GENSPECTRUM_LOCULUS_LOCATION_FIELDS exported constants
  • All 18 organism view files: locationFields moved from property initializer to constructor (reads from organismsConfig.XXX.lapis.locationFields); baselineFilterConfigs likewise moved to constructor so it can reference this.locationFields
  • Both application YAML files: add locationFields to every organism that was missing it (all except denv1-4 in prod and denv1-4 + victoria in staging, which already had it from an earlier commit)

…ontend constants

Location fields (which LAPIS fields to use for geographic filtering) were
previously hardcoded as constants in OrganismConstants.ts:
- GENSPECTRUM_LOCULUS_LOCATION_FIELDS = ['country', 'division']
- PATHOPLEXUS_LOCATION_FIELDS = ['geoLocCountry', 'geoLocAdmin1']
- COVID used ['region', 'country', 'division'] inline

This refactor moves them to the application YAML config so they are defined
alongside the other per-organism LAPIS settings and can be adjusted without
touching frontend code.

Changes:
- config.ts: add locationFields to lapisConfigSchema (Zod)
- OrganismConstants.ts: FiltersConfig now requires locationFields param;
  getPathoplexusFilters and getGenspectrumLoculusFilters pass it through;
  remove now-unused PATHOPLEXUS_LOCATION_FIELDS and
  GENSPECTRUM_LOCULUS_LOCATION_FIELDS exported constants
- All 18 organism view files: locationFields moved from property initializer
  to constructor (reads from organismsConfig.XXX.lapis.locationFields);
  baselineFilterConfigs likewise moved to constructor so it can reference
  this.locationFields
- Both application YAML files: add locationFields to every organism that
  was missing it (all except denv1-4 in prod and denv1-4 + victoria in
  staging, which already had it from an earlier commit)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Mar 26, 2026 3:38pm

Request Review

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.

1 participant