Repository navigation
feat(schema): per-component searchable, filterable, sortable and facetable flags - #261
Merged
Merged
Conversation
…table flags Mirrors crystallize-backend ab0c4e40b0 (#940), which added the four Discovery indexing flags to the component base config. The mass-operations worker hands OperationsSchema's parsed output to the converters, and zod strips unknown keys, so until this schema declared them a mass-operation file setting `searchable: false` on a shape component validated fine and the flag was silently dropped before reaching the API. Added to GenericComponentConfigSchema so every component config, input and output, gets them: the structural ones (contentChunk, componentChoice, componentMultipleChoice, piece) and the derived ones (paragraphCollection, itemRelations, numeric, propertiesTable, colors, selection, singleLine, files) included. Optional booleans with no default: unset stays unset, which the backend reads as "on"; `false` is the point.
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.
What
Declares the four per-component Discovery indexing flags on the shared component config base, so every component type's input and output config accepts and keeps them:
searchable,filterable,sortable,facetable— optional booleans,undefinedmeanstrue, query surface only (discoverable: falsestays the master switch; changes take effect at the tenant's next re-ignition).Bumps the package to 6.17.0.
Why
The mass-operations worker validates every file with
OperationsSchemaand hands the parsed result on, and zod strips undeclared keys. So today a file withconfig.singleLine.searchable: falsevalidates and the flag is silently dropped before it reaches the API. The backend side landed in CrystallizeAPI/crystallize#940 (held until this is published and pinned).Tests
tests/mass-operation/component-indexing-flags.test.ts: round trip for all 19 component types, nested inside contentChunk / componentChoice / componentMultipleChoice / piece, variant components, shape and piece create/update/upsert; unset stays unset;falseis kept distinct from unset; non-boolean values andnullare rejected (same contract asrequiredanddiscoverable); the read-sideShapeSchemakeeps the flags.tests/mass-operation/valid-files/mass-ops-shape-indexing-flags.jsoncovering every type.Release
Independent of #260 (selection option
label), merges cleanly with it in either order. #260 has no version bump, so merging both before tagging gives one 6.17.0 covering both. Backend follow-up after publish: bump the pin and name the flags explicitly in the mass-op config input mapper.