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
DPMMA-2608 Local Autosave and Recovery Feature for GrapesJS Builder #13610
base: 5.x
Are you sure you want to change the base?
DPMMA-2608 Local Autosave and Recovery Feature for GrapesJS Builder #13610
Conversation
* fix: [DPMMA-2600] grapesjs mjml fixes for void elements * fix: [DPMMA-2600] grapesjs-mjml fix self-closing on init and code update
@jos0405 have you tried deleting everything in the cache directory after changing the builder to grapesjs and before clearing the cache?
|
Thank you, that works. /html/app/bundles/CoreBundle/Helper/InputHelper.php:420 at
/html/app/bundles/CoreBundle/Helper/InputHelper.php:142 at Mautic\CoreBundle\Helper\InputHelper :: html ( '<title> {subject} </title>
/html/app/bundles/CoreBundle/Form/EventListener/CleanFormSubscriber.php:35 at Mautic\CoreBundle\Helper\InputHelper :: _ ( array( 'template' => 'blank', 'fromName' => '', 'fromAddress' => '', 'replyToAddress' => '', 'bccAddress' => '', 'useOwnerAsMailer' => '0', 'customHtml' => '<title> {subject} </title>
/html/vendor/symfony/event-dispatcher/EventDispatcher.php:230 at Mautic\CoreBundle\Form\EventListener\CleanFormSubscriber -> preSubmitData ( object(PreSubmitEvent), 'form.pre_submit', object(EventDispatcher) ) /html/vendor/symfony/event-dispatcher/EventDispatcher.php:59 at Symfony\Component\EventDispatcher\EventDispatcher -> callListeners ( array( object(Closure), object(Closure), object(Closure), object(Closure), object(Closure) ), 'form.pre_submit', object(PreSubmitEvent) ) /html/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:33 at Symfony\Component\EventDispatcher\EventDispatcher -> dispatch ( object(PreSubmitEvent), 'form.pre_submit' ) /html/vendor/symfony/form/Form.php:568 at Symfony\Component\EventDispatcher\ImmutableEventDispatcher -> dispatch ( object(PreSubmitEvent), 'form.pre_submit' ) /html/vendor/symfony/form/Extension/HttpFoundation/HttpFoundationRequestHandler.php:110 at Symfony\Component\Form\Form -> submit ( array( 'template' => 'blank', 'fromName' => '', 'fromAddress' => '', 'replyToAddress' => '', 'bccAddress' => '', 'useOwnerAsMailer' => '0', 'customHtml' => '<title> {subject} </title>
/html/vendor/symfony/form/Form.php:503 at Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler -> handleRequest ( object(Form), object(Request) ) /html/app/bundles/CoreBundle/Controller/AbstractFormController.php:164 at Symfony\Component\Form\Form -> handleRequest ( object(Request) ) /html/app/bundles/EmailBundle/Controller/EmailController.php:701 at Mautic\CoreBundle\Controller\AbstractFormController -> isFormValid ( object(Form) ) /html/vendor/symfony/http-kernel/HttpKernel.php:163 at Mautic\EmailBundle\Controller\EmailController -> editAction ( object(Request), object(AssetsHelper), object(Translator), object(Router), object(CoreParametersHelper), '1', false, false ) /html/vendor/symfony/http-kernel/HttpKernel.php:75 at Symfony\Component\HttpKernel\HttpKernel -> handleRaw ( object(Request), 2 ) /html/vendor/symfony/framework-bundle/Controller/AbstractController.php:156 at Symfony\Component\HttpKernel\HttpKernel -> handle ( object(Request), 2 ) /html/app/bundles/CoreBundle/Controller/CommonController.php:415 at Symfony\Bundle\FrameworkBundle\Controller\AbstractController -> forward ( 'Mautic\EmailBundle\Controller\EmailController::editAction', array( 'objectId' => '1', 'objectModel' => '', '_stopwatch_token' => 'f5a626', '_route' => 'mautic_email_action', '_controller' => 'Mautic\EmailBundle\Controller\EmailController::editAction', 'objectAction' => 'edit', '_route_params' => array( 'objectId' => '1', 'objectAction' => 'edit' ), '_firewall_context' => 'security.firewall.map.context.main', '_security_firewall_run' => '_security_mautic' ), array( 'mauticUserLastActive' => '25', 'mauticLastNotificationId' => '' ) ) /html/vendor/symfony/http-kernel/HttpKernel.php:163 at Mautic\CoreBundle\Controller\CommonController -> executeAction ( object(Request), 'edit', '1', 0, '' ) /html/vendor/symfony/http-kernel/HttpKernel.php:75 at Symfony\Component\HttpKernel\HttpKernel -> handleRaw ( object(Request), 1 ) /html/vendor/symfony/http-kernel/Kernel.php:202 at Symfony\Component\HttpKernel\HttpKernel -> handle ( object(Request), 1, true ) /html/app/AppKernel.php:109 at Symfony\Component\HttpKernel\Kernel -> handle ( object(Request), 1, true ) /html/app/middlewares/CORSMiddleware.php:76 at AppKernel -> handle ( object(Request), 1, true ) /html/app/middlewares/HSTSMiddleware.php:39 at Mautic\Middleware\CORSMiddleware -> handle ( object(Request), 1, true ) /html/app/middlewares/CatchExceptionMiddleware.php:28 at Mautic\Middleware\HSTSMiddleware -> handle ( object(Request), 1, true ) /html/app/middlewares/Dev/IpRestrictMiddleware.php:52 at Mautic\Middleware\CatchExceptionMiddleware -> handle ( object(Request), 1, true ) /html/app/middlewares/VersionCheckMiddleware.php:58 at Mautic\Middleware\Dev\IpRestrictMiddleware -> handle ( object(Request), 1, true ) /html/app/middlewares/TrustMiddleware.php:42 at Mautic\Middleware\VersionCheckMiddleware -> handle ( object(Request), 1, true ) /html/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23 at Mautic\Middleware\TrustMiddleware -> handle ( object(Request), 1, true ) /html/index.php:19 at Stack\StackedHttpKernel -> handle ( object(Request) ) |
@jos0405 I've updated the source, as the fix is already on the 5.x branch. After enabling the grapesjs and clearing the cache it should work fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 5.x #13610 +/- ##
=========================================
Coverage 61.38% 61.39%
Complexity 34024 34024
=========================================
Files 2238 2238
Lines 101685 101686 +1
=========================================
+ Hits 62420 62430 +10
+ Misses 39265 39256 -9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works beautifully and I am sure this will be a huge benefit for those moments where something crashes and you haven't hit save in a while!
Thanks so much @patrykgruszka - great work! 🚀
Now that the grapesjs upgrade got merged, you might want to rebase and rebuild the |
Thanks for letting me know @LordRembo. I've updated the code it's now working with the new editor. I've also included a fix that will clear the storage item when a new email or page is saved. |
It is worth mentioning that currently, copies are saved in the browser's local storage and are not tied to a specific user's login session. We could improve this by linking the copies to a user's ID, so that only their copies are loaded. However, all user records will still be visible in the browser's local storage because it's tied to the website's domain. |
Description:
This pull request introduces a local autosave backup and recovery functionality for the GrapesJS builder used in Mautic for emails and pages.
Features:
Steps to test this PR:
This PR includes the commit 6486428e389d6626398558e05c512db4a1fe522b from the 5.0 branch to prevent future conflicts.