You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(facets): translate the four facet dimensions as one set (#524)
* refactor(facets): translate the four facet dimensions as one set
`referentiecomponent` -> referenceComponent, `standaard` -> standard,
`applicatieservice` -> applicationService, `domein` -> domain. 84
substitutions across 10 files.
All four or none. They are the endpoint's query parameters AND its response
keys, and FacetController, FacetService, the frontend FACET_DIMENSIONS, the
store and the gemma-faceted-search e2e spec each hold their own copy.
Translating one of four silently broke filtering in tranche 1: a filter on
a dimension nobody sends renders a page with no filters and no error.
Whole quoted tokens only, so `standaard_gemma` and `standaarden` — which
are different words — are untouched.
TWO FILES DELIBERATELY EXCLUDED, both of which a blanket rename would have
corrupted:
* SettingsService's only match is `'domein' => $emailSettings
['mailgunDomain']` — Mailgun's domain, nothing to do with facets.
* RenameDutchCatalogColumns is a column MAP; its `'standaard' =>
'standard'` entry is data, and rewriting it would leave `'standard' =>
'standard'`, an identity that migrates nothing while reporting success.
That map is also the evidence this rename was overdue: the COLUMN moved to
`standard` already, so the facet dimension had been lagging behind the
property it filters on.
Checked before renaming: none of the four is a schema key (so no
ImportHandler slug migration is involved) and none feeds a derived
`<type>_schema` config key — FacetService resolves those through
SettingsService::LEGACY_SCHEMA_KEY, not from the dimension name.
Unit suite failing set IDENTICAL to development (1 both sides, 0
introduced); the 22 Facet tests pass.
* fix(facets): move the dimension in every shape, not just quoted tokens
The first pass renamed whole QUOTED tokens, which left three shapes behind
and CI's jest run found them:
* bare object keys — `activeFilters.referentiecomponent`, `domein: []`
* the URL-ENCODED form — `referentiecomponent%5B%5D=A` inside a longer
string literal
* the route-query form `_gf_referentiecomponent`. `\b` does NOT match
after an underscore, so the word-boundary pass skipped every one of
them, and `setFiltersFromQuery` returned {} — the store silently
restored no filters at all.
The real schema fields are deliberately NOT the dimension names and stay
put: `referentieComponenten` and `standaardVersies` are different
identifiers, which the negative lookahead protects.
Also restores a HISTORICAL comment the rename made self-contradictory. It
described the tranche-1 bug — frontend sending `standard[]` to a backend
reading `standaard[]` — and translating its Dutch spelling turned it into
"sending standard[] to a backend that only reads standard[]". The Dutch
words are the point of that sentence.
jest 120/120; the 22 Facet PHPUnit tests pass.
* style: prettier the facet store spec
Format-only; the rename left a call spanning lines prettier joins. jest
23/23 on that file.
---------
Co-authored-by: Conduction Release Bot <release-bot@conduction.nl>
0 commit comments