refactor(website): read locationFields from YAML config instead of frontend constants#1123
Draft
refactor(website): read locationFields from YAML config instead of frontend constants#1123
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Location fields (which LAPIS fields to use for geographic filtering) were previously hardcoded as constants in OrganismConstants.ts:
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: