Skip to content

FORMS-28607: Consume af-core 1.0.10 and cover legacy custom-function access - #2009

Merged
rismehta merged 1 commit into
devfrom
fix-forms-28607-legacy-field-model-access
Oct 23, 2026
Merged

rismehta merged 1 commit into
devfrom
fix-forms-28607-legacy-field-model-access

Conversation

@rismehta

Copy link
Copy Markdown
Collaborator

Description

Update @aemforms/af-core from ^1.0.7 to ^1.0.10, with the lockfile resolving the published 1.0.10 package and its required formatter dependency.

Extend the existing runtime-only custom-function Cypress spec and fixture with a field inside a visible section and a button whose rule invokes:

hideSom._options.parent._setProperty('visible', false);

The test clicks the rendered button and verifies both model visibility and the hidden section in the DOM. It is active without a feature-toggle gate and does not pass a raw model to the custom function.

Use the repository's maintained IT page for this fixture. With the SDK examples page, subsequent previews failed to resolve custom functions; switching to the IT page makes both consecutive previews and the existing custom-function cases work. Select the existing calculation input by name rather than field registration order now that the fixture contains a nested section.

Related Issue

FORMS-28607

Motivation and Context

Consume the released backward-compatibility fix and add end-to-end coverage for legacy private-member access through the field model exposed in custom functions. This is compatibility coverage, not a recommendation to use private properties or methods.

No authoring UI automation, runtime implementation changes, or package publishing are included.

How Has This Been Tested?

Local AEM author at http://localhost:4502, Cypress 13.17.0, Chrome 155 headless. Installed the IT apps/content fixtures and rebuilt/deployed the product runtime clientlib for each runtime version.

Validation Result
Same full runtime custom-function spec with published af-core@1.0.7 and the corrected IT fixture Expected red: 9 passed, 1 failed. Only the new regression failed: the section remained visible.
Same full runtime custom-function spec with published af-core@1.0.10, unchanged fixture and test Green: 10 passed, 0 failed, no pending/skipped tests; retries disabled.
cd ui.frontend && npm run build:prod Passed, including the standard and XFA builds/clientlib generation.
cd ui.frontend && npm test -- --runInBand Passed: 7 suites, 45 tests.
node --check it/apps/src/main/content/jcr_root/apps/forms-core-components-it/clientlibs/clientlib-it-custom-function/js/functions.js Passed.
node --check ui.tests/test-module/specs/ruleeditor/runtime/customFunction.runtime.cy.js Passed.
git diff --check Passed.

Cypress command, run from ui.tests/test-module for each runtime (local AEM authentication supplied through the test environment; log/screenshot artifact paths are omitted):

./node_modules/.bin/cypress run --browser chrome --headless \
  --spec specs/ruleeditor/runtime/customFunction.runtime.cy.js \
  --reporter spec --config retries=0,video=false,trashAssetsBeforeRuns=false

The complete repository test suite and authoring suites were not run. CI status is separate from these local results. The optional no-mistakes CLI is not installed in this environment; validation used the repository's own build and test commands.

Screenshots (if appropriate):

Not required for this runtime-only regression.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

Added a focused runtime regression; aggregate coverage was not measured. The unchecked all-tests/CI items do not negate the targeted passing results above.

Add runtime-only coverage for the legacy _options.parent._setProperty chain. Use the maintained IT page so repeated previews retain working custom-function registration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adobe-bot

Copy link
Copy Markdown

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

1 similar comment
@adobe-bot

Copy link
Copy Markdown

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rismehta
rismehta merged commit f7de780 into dev Oct 23, 2026
10 checks passed
@rismehta
rismehta deleted the fix-forms-28607-legacy-field-model-access branch October 23, 2026 10:59
rismehta added a commit that referenced this pull request Oct 23, 2026
* fix(tests): isolate telephone policy authoring from component insertion

Reuse the existing telephone field with the same default policy, wait for policy save and verify persisted custom patterns before editor navigation, and clean up prepared policy attempts. Keep shared insertion commands unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(tests): synchronize blank-page telephone policy authoring

Preserve insertion of a new telephone field into the blank form. Await policy persistence, actual layer transitions and insertion events; query only the visible insertion dialog and re-query its search input after clearing. Preserve original assertions and wait for the edit dialog to close before cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix shared authoring synchronization and flaky Sites replacement tests

Retry opening the Insert dialog after lost actions, target only visible dialog controls, and wait for layer, insertion and replacement refreshes. Restore the original replace-group policy state using existing editor helpers and named actions.

Add a deterministic lost-Insert-click regression with delayed persistence responses. Validation: five Chrome repeats (25 passing), Electron Sites/Forms replacement tests (11 passing), and PR-branch Chrome replacement/telephone-input tests (11 passing), all with test retries disabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reuse shared insertion flow and make authoring selectors backport-friendly

Replace duplicated telephone policy layer/insertion sequencing with existing helpers. Scope insertion to guideSelectors.insertComponentDialog.dialog and replacement to the Forms content hook; policy controls use cq-dialog and value hooks rather than Coral element tags.

Document shared helper reuse. Validate 10 authoring specs: 67 passing and 2 pre-existing skipped tests. One Button cancel-dialog assertion used its existing retry; a standalone rerun passed all 6 active Button tests on their first attempt. Insertion and layer synchronization checks passed across Forms, Sites, fields, layouts, nested wizard panels and Footer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: consume af-core 1.0.10 and cover legacy custom-function access (#2009)

Add runtime-only coverage for the legacy _options.parent._setProperty chain. Use the maintained IT page so repeated previews retain working custom-function registration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants