-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix for button click tracking not working #14
Fix for button click tracking not working #14
Conversation
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.
Superficial review for grammar etc.
A few suggestions to make sure the messages we show to users/output to logs are consistent with our style guide. Main things to look for (as some I could not update with this review) are:
- Capitalise the first word
- Capitalise any Mautic features, for example Dynamic Content, and ensure they are written out fully and correctly (a few places have used DynamicContent without a space)
- Capitalise any abbreviations such as HTML and MJML
dist/commands.js
Outdated
}); // {token} to slot | ||
editor.Commands.add('preset-mautic:dynamic-content-components-to-tokens', { | ||
run: edtr => dynamicContentCmd.convertDynamicContentComponentsToTokens(edtr) | ||
}); // Link store to compoennt |
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.
}); // Link store to compoennt | |
}); // Link store to component |
|
||
dynamicContent.set('content', dynConToken); | ||
if (!decId) { | ||
this.logger.debug('Expected a dynamic content component', { |
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.
this.logger.debug('Expected a dynamic content component', { | |
this.logger.debug('Expected a Dynamic Content component', { |
this.logger.debug('Expected a dynamic content component', { | ||
dynamicContent | ||
}); | ||
throw new Error('no dynamic content component'); |
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.
throw new Error('no dynamic content component'); | |
throw new Error('No Dynamic Content component'); |
this.logger.debug('Created a new dynamic content item', { | ||
dcName, | ||
component.set('content', `Dynamic Content ${decId}`); | ||
this.logger.debug('Created a new dynamic content item in store', { |
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.
this.logger.debug('Created a new dynamic content item in store', { | |
this.logger.debug('Created a new Dynamic Content item in store', { |
dist/mjml/mjml.service.js
Outdated
@@ -46,12 +49,14 @@ export default class MjmlService { | |||
|
|||
static mjmlToHtml(mjml) { | |||
try { | |||
if (typeof mjml !== 'string') { | |||
if (typeof mjml !== 'string' || !mjml.includes('<mjml>')) { | |||
throw new Error('no valid mjml string'); |
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.
throw new Error('no valid mjml string'); | |
throw new Error('No valid MJML string'); |
dist/buttons/buttonClose.command.js
Outdated
@@ -18,7 +18,7 @@ export default class ButtonCloseCommands { | |||
throw new Error('no email-html editor'); |
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.
throw new Error('no email-html editor'); | |
throw new Error('No email-HTML editor'); |
dist/buttons/buttonClose.command.js
Outdated
@@ -31,7 +31,7 @@ export default class ButtonCloseCommands { | |||
throw new Error('no email-mjml editor'); |
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.
throw new Error('no email-mjml editor'); | |
throw new Error('No email-MJML editor'); |
const dynConToken = `{dynamiccontent="${dynConName}"}`; // Clear id because it's reloaded by Mautic and this prevent slot to be destroyed by GrapesJs destroy event on close. | ||
// dynamicContent.addAttributes({ 'data-param-dec-id': '' }); | ||
|
||
this.logger.debug('Replaced components content with its token', { |
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.
this.logger.debug('Replaced components content with its token', { | |
this.logger.debug('Replaced component's content with its token', { |
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.
Looks good to me! Appreciate the comments in the code so that it's easier for future contributors to see what's going on 👍🏼
Suggestions applied by Adrian
fixes: mautic/mautic#10323