Repository navigation
Restrict the UI and styles of the components a group takes - #613
Merged
Merged
Conversation
ComponentGroup.allowedComponentUi, keyed by component collection IRI, lists the uiComponent values and uiClassNames entries a group's components may have. Placing a disallowed component, or changing a placed component's UI or styles to a disallowed value, is a 422. The fixture builder, generate-fixtures and make:rename-component carry it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #613 +/- ##
============================================
+ Coverage 97.19% 97.22% +0.02%
- Complexity 5513 5579 +66
============================================
Files 455 459 +4
Lines 14174 14316 +142
============================================
+ Hits 13777 13919 +142
Misses 397 397
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Bundle side of components-web-app/cwa-nuxt-module#488.
Contract
ComponentGroup.allowedComponentUi(nullable JSON, the same serialization groups asallowedComponents, which is unchanged):allowedComponentsstores them.uilists alloweduiComponentvalues,stylesalloweduiClassNamesentries, both matched exactly;null(primary UI) only when listed; every style must be listed. An omittedui/styles, or an unlisted type, is unrestricted.nullor{}is stored asnull.allowedComponentUifor: a key that is not the collection IRI of a concrete component resource, a rule that is not an object of onlyui/styles(an empty rule{}included), auithat is not a list of strings or nulls,stylesthat is not a list of strings, and an emptyuiorstyles.Enforcement
ComponentPositionValidator, only when the position is new or itscomponent/componentGroupchanged): 422 oncomponent. Covers position POST/PATCH, clone, the add flow (componentPositions[i].component) and a dynamic position's fallback;/movereports it asto.componentGroup.#[ComponentUiAllowedInGroups]onAbstractComponent): changinguiComponentoruiClassNamesto a value any group holding the component disallows is a 422 on that field. Only the changed field is checked. One query (ComponentGroupRepository::findRestrictingUiOf()). A draft of a published component is compared with and checked against its published component; a never-published draft against its own positions.Follow-through
CwaFixtureBuilder->group(..., allowUi: [Class::class => [...]])on layouts, pages and components, set only when the builder creates the group.generate-fixtureswritesallowUi:aftermax:; unmatched keys are reported.make:rename-componentmigrations renameallowed_component_uikeys.Also
tests/Functional/assets/schema/page.schema.jsonhad#definitions/…in a$ref;justinrainbow/json-schema6.15.1 refuses it, so threePageTestcases errored locally. Fixed to#/definitions/….🤖 Generated with Claude Code