Skip to content

feat: Add parent as a param for Area#669

Draft
gflores-jahia wants to merge 1 commit into
mainfrom
4894-add-area-parent-param
Draft

feat: Add parent as a param for Area#669
gflores-jahia wants to merge 1 commit into
mainfrom
4894-add-area-parent-param

Conversation

@gflores-jahia
Copy link
Copy Markdown
Member

Description

Follow-up alternative fix for this PR #660

Expose optional parent param for Area template that is available in the AreaTag jsp template https://github.com/Jahia/jahia-private/blob/master/taglib/src/main/java/org/jahia/taglibs/template/include/AreaTag.java#L113

This allow areas to be distinctly defined within (multiple) declared component when parent node is passed, rather than shared under current page.

Checklist

Source code

  • I've shared and documented any breaking change
  • I've reviewed and updated the jahia-depends

Tests

  • I've provided Unit and/or Integration Tests
  • I've updated the parent issue with required manual validations

Tip

Documentation to guide the reviews: How to do a code review

Copilot AI review requested due to automatic review settings May 27, 2026 20:13
@gflores-jahia gflores-jahia requested a review from a team as a code owner May 27, 2026 20:13
@gflores-jahia gflores-jahia marked this pull request as draft May 27, 2026 20:13
@github-actions
Copy link
Copy Markdown

🦜 Chachalog

javascript-modules minor
  • Added an optional parent parameter to the Area component, allowing areas to be stored under any existing JCR node instead of only under the current page node.

Create a new entry online or run npx chachalog@0.5.1 prompt to create a new entry locally.

@gflores-jahia gflores-jahia changed the title Add parent as a param for Area feat: Add parent as a param for Area May 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional parent prop to the Area component (mirroring the JSP AreaTag capability), so areas can be stored as subnodes of an arbitrary JCR node rather than always under the current page node. When parent is provided, RenderHelper.renderArea computes an absolute path (parent.getPath() + "/" + name); otherwise the existing template-inheritance behavior is preserved.

Changes:

  • Expose optional parent?: JCRNodeWrapper in Area and forward it to server.render.renderArea.
  • Extend RenderHelper.renderArea to accept parent and build an absolute area path when set; allow parent in AREA_ALLOWED_ATTRIBUTES.
  • Add Cypress test coverage (areaParentTest.cy.ts) and parent-based examples in the testAreas view, plus a changelog entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
javascript-modules-library/src/components/Area.tsx Adds optional parent prop and passes it through to the server render call.
javascript-modules-engine-java/.../RenderHelper.java Allows parent attribute and computes absolute path when provided.
jahia-test-module/.../testAreas/TestAreas.tsx Adds parent-based Area examples (current node, home, site root) to exercise the new prop.
tests/cypress/e2e/ui/areaParentTest.cy.ts New Cypress spec verifying rendering and distinct subnode creation per parent.
.chachalog/MphU2FML.md Changelog entry describing the new optional parent parameter.

@gflores-jahia
Copy link
Copy Markdown
Member Author

Based on @GauBen's comments #660 (comment) and after discussion with @pvollenweider, it seems that <AbsoluteArea> does not work for his use case (using <Area> within an <AbsoluteArea>).

Need to discuss with Gautier if this is an acceptable solution or if we need to further rethink alternative solutions.

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