Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move editor insert logic to useSpecialContent composable #9444

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

scmmishra
Copy link
Member

This PR makes the following changes

  1. Move createState to a editorHelpers, we didn't need it inside the component anyway
  2. Remove insertMentionNode, insertCannedResponse and insertVariable and replace with with a composable with abstracted insertion logic
  3. Add useSpecialContent composable along with tests for it

Motivation

The editor is one of the most complicated UI components we have, however it is too big of a component to be maintained meaningfully, and is largely untested. Refactoring it piece by piece will minimise the risk as well as get it ready for Vue 3 migration

@scmmishra
Copy link
Member Author

@chatwoot/frontend hey folks, need your review on this. PTAL and let me know if there are any avenues for improvement, the plan is to rewrite this component completely in 4 to 5 iterations and ensure good tests

@vishnu-narayanan vishnu-narayanan temporarily deployed to chatwoot-pr-9444 May 9, 2024 13:26 Inactive
@scmmishra
Copy link
Member Author

@pranavrajs PTAL

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.

None yet

2 participants