Skip to content

feat: add module clone functionality at asponsor page popup - #1036

Open
tomrndom wants to merge 2 commits into
masterfrom
feature/clone-page-module
Open

feat: add module clone functionality at asponsor page popup#1036
tomrndom wants to merge 2 commits into
masterfrom
feature/clone-page-module

Conversation

@tomrndom

@tomrndom tomrndom commented Aug 6, 2026

Copy link
Copy Markdown

ref: https://app.clickup.com/t/9014802374/86bb9kp3v

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

  • New Features
    • Added the ability to clone page modules, creating up to 20 copies at a time.
    • Cloned modules appear directly after the original with fresh identifiers and preserved ordering.
    • Added controls for selecting the number of copies and clear translated labels.
    • Newly selected document files are retained when cloning, while previously uploaded files are cleared.

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48cdd560-9403-4ce1-a679-3982eeb055fb

📥 Commits

Reviewing files that changed from the base of the PR and between d4e1a2f and c0e89c5.

📒 Files selected for processing (1)
  • src/pages/sponsors-global/page-templates/page-template-popup/__tests__/page-template-module-form.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pages/sponsors-global/page-templates/page-template-popup/tests/page-template-module-form.test.js

📝 Walkthrough

Walkthrough

The page template popup now supports cloning modules. It adds bounded copy counts, temporary IDs, clone-specific file handling, insertion and scrolling behavior, translations, and test coverage.

Changes

Module cloning

Layer / File(s) Summary
Clone count control and labels
src/utils/constants.js, src/pages/sponsors-global/page-templates/page-template-popup/module-clone-control.js, src/i18n/en.json
Adds clone-count limits, a controlled clone-count input, clone action handling, and translated labels.
Module clone insertion and state handling
src/pages/sponsors-global/page-templates/page-template-popup/page-template-modules-form.js
Adds clone controls to module headers. Clones receive temporary IDs, are inserted after the source, start collapsed, preserve unsaved document files, and scroll the final clone into view.
Clone behavior validation
src/pages/sponsors-global/page-templates/page-template-popup/__tests__/*
Tests clone ordering, IDs, count limits, accordion state, scrolling, count reset, media fields, and document-file handling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor
  participant ModuleCloneControl
  participant PageTemplateModulesForm
  participant Formik
  Editor->>ModuleCloneControl: Enter copy count and activate clone
  ModuleCloneControl->>PageTemplateModulesForm: Call onClone(count)
  PageTemplateModulesForm->>PageTemplateModulesForm: Create and insert ordered clones
  PageTemplateModulesForm->>Formik: Update module values
  PageTemplateModulesForm->>Editor: Scroll to final clone
Loading

Possibly related PRs

Suggested reviewers: smarcet

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding module clone functionality to the Asponsor page popup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/clone-page-module

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

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.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.

1 participant