Skip to content

Follow-up to #298. Restores editor states (editorValue, editorModelCto, editorAgreementData) to fix undo/redo functionality broken by the share feature merge. #333

Merged
DianaLease merged 13 commits intoaccordproject:mainfrom
teja-pola:teja/i297/Share-Functionality-for-Collaborative-editing
Mar 27, 2025
Merged

Follow-up to #298. Restores editor states (editorValue, editorModelCto, editorAgreementData) to fix undo/redo functionality broken by the share feature merge. #333
DianaLease merged 13 commits intoaccordproject:mainfrom
teja-pola:teja/i297/Share-Functionality-for-Collaborative-editing

Conversation

@teja-pola
Copy link
Contributor

Closes #

This pull request restores the undo/redo functionality that was broken after merging PR #298 (share functionality). It reintroduces editor states (editorValue, editorModelCto, editorAgreementData) to store.ts and updates useUndoRedo and editor components to ensure changes reflect in the preview (agreementHtml) and errors clear appropriately on undo/redo.

Changes

  • Reintroduced editorValue, editorModelCto, and editorAgreementData to store.ts with corresponding setters (setEditorValue, etc.) to manage unsaved editor content and support undo/redo history.
  • Updated useUndoRedo.tsx to include an onSync callback, calling main setters (setTemplateMarkdown, setModelCto, setData) after setValue, undo, or redo to sync editor states with main states and trigger preview rebuild.
  • Modified AgreementData.tsx, TemplateMarkdown.tsx, and TemplateModel.tsx to use both editor setters (e.g., setEditorAgreementData) and main setters (e.g., setData) via useUndoRedo, ensuring preview updates and error clearing on undo/redo.

Flags

Screenshots or Video

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

@teja-pola teja-pola requested a review from a team as a code owner March 26, 2025 16:37
@netlify
Copy link

netlify bot commented Mar 26, 2025

Deploy Preview for ap-template-playground ready!

Name Link
🔨 Latest commit 44f6716
🔍 Latest deploy log https://app.netlify.com/sites/ap-template-playground/deploys/67e473bb27513100089fbd7b
😎 Deploy Preview https://deploy-preview-333--ap-template-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@teja-pola teja-pola force-pushed the teja/i297/Share-Functionality-for-Collaborative-editing branch 6 times, most recently from b9a7f47 to dd40e6a Compare March 26, 2025 21:35
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
@teja-pola teja-pola force-pushed the teja/i297/Share-Functionality-for-Collaborative-editing branch from dd40e6a to 44f6716 Compare March 26, 2025 21:38
@DianaLease DianaLease merged commit abb35be into accordproject:main Mar 27, 2025
7 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.

2 participants