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

Added preference center blocks to GrapesJS builder #29

Closed

Conversation

julienWebmecanik
Copy link

Preference center finished based on #8.

A few notes :

  • The solution I used here is not optimal (the use of HTML strings to define block contents) but is necessary to ensure that elements are not draggable and thus to prevent user errors (when using the component approach, draggable attributes would reset after closing/re-opening the builder).
  • Translations strings are set up, but I don't know how to include them here ? (I put them in the GrapesJsBuilderBundle for my tests)
  • I have changed icons definition to use fontawesome.

@cla-bot cla-bot bot added the cla-signed label Jun 23, 2022
@kuzmany
Copy link
Member

kuzmany commented Jun 27, 2022

Translations strings are set up, but I don't know how to include them here ? (I put them in the GrapesJsBuilderBundle for my tests)

You need put that strings to https://github.com/mautic/mautic/blob/4.x/plugins/GrapesJsBuilderBundle/Translations/en_US/javascript.ini

@kuzmany
Copy link
Member

kuzmany commented Jul 1, 2022

@julienWebmecanik can you push also PR to official mautic repo with build assets?
Similar like #26 vs mautic/mautic#10782

We need get it to ready to test state. Then I can ask community for testing and merge it

@mautibot
Copy link

mautibot commented Jul 6, 2022

This pull request has been mentioned on Mautic Community Forums. There might be relevant details there:

https://forum.mautic.org/t/changing-style-of-default-unsubscribe-page/21341/6

* Blocks for Preference Center Category
*/
//check if page is for preference center
if (mQuery('#page_isPreferenceCenter_1').is(':checked')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ContentService.isPreferenceCenter should be used here too

@@ -54,8 +53,6 @@ export default class DynamicContentCommands {
convertDynamicContentComponentsToTokens(editor) {
// get all dynamic content elements loaded in the editor
const dynamicContents = editor.DomComponents.getWrapper().find('[data-slot="dynamicContent"]');
this.logger.debug(`DC: ${dynamicContents.length} components found`, { dynamicContents });
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe this was removed by accident?

) {
if (typeof jQuery == 'undefined') {
var jquery = document.createElement('script');
jquery.src = '//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it is a good idea to load the JavaScript dependencies inside the code. We should start using npm to manage our dependencies. I guess the idea of this is to only load it when needed?

Possible option:
Require it using npm and then load it from our codebase.
I guess things like jquery and bootstrap should be loaded anyway already in our codebase.

style: { padding: '50px' },
});

const style = `<style>
Copy link
Collaborator

@adiux adiux Aug 24, 2022

Choose a reason for hiding this comment

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

According to grapesjs doc we should avoid putting styles in blocks. https://grapesjs.com/docs/modules/Blocks.html#important-caveats

would it work if we add it here? https://github.com/mautic/mautic/blob/5.x/plugins/GrapesJsBuilderBundle/Assets/library/js/grapesjs-custom.css
Also not ideal but it might allow the user and theme author to overwrite it

@adiux
Copy link
Collaborator

adiux commented Aug 24, 2022

@julienWebmecanik thanks for this PR. It looks good to me so far. I found a couple of improvements that you could look at. Let me know if I can help.

@RCheesley
Copy link
Member

@julienWebmecanik please can you take a look at the feedback in the PR and address the conflicts? Thanks!

@RCheesley
Copy link
Member

@julienWebmecanik @npracht @kuzmany it would be great to get the conflicts and feedback addressed on this PR so we can test and merge it, any chance this can get some love?

@rastitkac
Copy link

We vote for this to get some love, too ❤️ 🙏🏼

@RCheesley
Copy link
Member

@julienWebmecanik please could you address the conflicts? We have testers waiting to help get this merged! Thank you!

@RCheesley RCheesley added enhancement New feature or request has-conflicts labels Aug 24, 2023
@npracht
Copy link
Member

npracht commented Aug 31, 2023

@RCheesley we'll not carry this anymore. We are on the way to use a different page builder we're building. This one is not good enough for marketeer.
If @adiux want to finish the PR we can keep it open, otherwise we can close it.

@RCheesley
Copy link
Member

@adiux @annamunk Can any of your team pick this up and get it over the line? It would be awesome to have the preference center blocks available in the landing page builder.

@annamunk
Copy link
Member

@RCheesley we are interested in completing this functionality. What remains to be done?

@RCheesley
Copy link
Member

Hey there, I think we need to address the conflicts, and then see were at in terms of the actual PR. I don't know how much was needing to be done because I can't test it with the conflicts. Would you be up for that @annamunk ?

@annamunk
Copy link
Member

@RCheesley thank you! If that's okay, we'll discuss it with the team this week and I'll come back with an answer.

@RCheesley
Copy link
Member

Sure, sounds good! Thanks for being willing to consider it!

@kuzmany
Copy link
Member

kuzmany commented Nov 18, 2023

Close favor to #46

@kuzmany kuzmany closed this Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants