Skip to content

fix(app-admin): resolve $. rule targets inside list items - #5793

Merged
Pavel910 merged 1 commit into
release/6.5.0from
fix/cms-form-list-item-rules
Sep 26, 2026
Merged

Pavel910 merged 1 commit into
release/6.5.0from
fix/cms-form-list-item-rules

Conversation

@Pavel910

Copy link
Copy Markdown
Collaborator

Summary

  • Rules in lists/dynamic zones: $.field rule targets inside object lists and dynamic zone templates never resolved (no item selector in the path), so == rules never matched and != rules always did. List item children now get an index-aware scope path, also used by field.parent() in callbacks.
  • List renderer on single-value field: the CMS form falls back to the single-value renderer instead of crashing (t.map is not a function, e.g. dateTimeInputs without .list()).
  • Datetime subtypes: subtype methods keep the list renderer on list fields; .datetime() defaults to .withTimezone(); DateTimeZ is registered in the main GraphQL schema (model field types are rendered there too).
  • Skill: content-models skill now requires an explicit datetime subtype.
  • Test fixture: extensions/models/RulesCatalog.ts catalogs rule operators across fields, nesting, lists and dynamic zones.

Testing

  • Unit tests for each fix (each fails without its fix).
  • Verified in the admin with the RulesCatalog model: every rule, per-item independence, reorder/delete, and a client-style holiday hours config (save and reload).

🤖 Generated with Claude Code

Rules with `$.field` targets on fields inside object lists and dynamic zone
templates resolved against the list path without an item selector, so the
target was never found: `==` rules never matched and `!=` rules always did.
List item children now get a lazily computed scope path that includes the
item's index, used by `$.` rule targets and `field.parent()` callbacks.

Also fixes the datetime issues surfaced while verifying against a client model:

- CMS form: a list-only renderer (e.g. `dateTimeInputs`) on a single-value
  field falls back to the field type's single-value renderer instead of
  crashing with "t.map is not a function".
- app-admin: datetime subtype methods keep the list renderer on list fields.
- api-headless-cms: `.datetime()` defaults to `.withTimezone()`, so a field
  without an explicit subtype gets a consistent format across GraphQL,
  storage and the Admin UI.
- handler-graphql: register the `DateTimeZ` scalar in the main schema, where
  model field types are also rendered.
- Skill: datetime fields must declare a subtype.

Adds a RulesCatalog extension model covering rule operators, nesting, lists
and dynamic zones, used to verify rule evaluation in the entry form.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ed4c99ac-fd2e-4bf6-ab7f-4a1166c19a12

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@Pavel910 Pavel910 self-assigned this Sep 26, 2026
@Pavel910 Pavel910 added this to the 6.5.0 milestone Sep 26, 2026
@Pavel910
Pavel910 merged commit 3b770f5 into release/6.5.0 Sep 26, 2026
29 of 35 checks passed
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