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

Update grapesjs compatibility (Mautic 4) #50

Open
wants to merge 49 commits into
base: 4.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
95c617a
Add compatibility with CKEditor 5
mollux Oct 3, 2023
ac11df5
Save button works well
volha-pivavarchyk Oct 3, 2023
b038211
Build dist files
volha-pivavarchyk Oct 4, 2023
681d5b1
fix breaking change grapesjs 0.20.1, for registering custom components
LordRembo Jan 19, 2024
58c214b
rebuild
LordRembo Jan 19, 2024
04c218e
run prettier
LordRembo Jan 22, 2024
38fee2b
Merge pull request #44 from mollux/ckeditor5
escopecz Jan 24, 2024
5d460ca
Merge branch 'ckeditor5' into 5.x
mollux Jan 27, 2024
2c31f3d
fix breaking change grapesjs 0.20.1, for registering custom components
LordRembo Jan 19, 2024
f431238
rebuild
LordRembo Jan 19, 2024
4b0c951
run prettier
LordRembo Jan 22, 2024
f160354
add fallback if no list of fonts found, use options instead
LordRembo Jan 29, 2024
0bd56ab
remove duplicates
LordRembo Jan 29, 2024
aef624a
if no list of fonts found, use the 'options' property instead
LordRembo Jan 30, 2024
6148098
rebuild
LordRembo Jan 30, 2024
b1ee678
Merge pull request #45 from volha-pivavarchyk/fix/save-buton-always-s…
mollux Jan 31, 2024
6527a27
fix breaking change grapesjs 0.20.1, for registering custom components
LordRembo Jan 19, 2024
bddac06
rebuild
LordRembo Jan 19, 2024
53af154
run prettier
LordRembo Jan 22, 2024
d43ae89
add fallback if no list of fonts found, use options instead
LordRembo Jan 29, 2024
9b50ba6
remove duplicates
LordRembo Jan 29, 2024
0c35e22
Merge branch 'update-grapesjs-compatibility-m5' of github.com:LordRem…
LordRembo Jan 31, 2024
7c4b893
fix issue with non-existing node being appended when builder loads
LordRembo Mar 22, 2024
25b627c
rebuild
LordRembo Mar 22, 2024
bc86dab
replace font icons by svgs from custom blocks
LordRembo Mar 22, 2024
c592112
rebuild
LordRembo Mar 22, 2024
5cc1128
override button icons in top bar of the Editor
LordRembo Mar 22, 2024
9c9713a
rebuild
LordRembo Mar 22, 2024
1c2a461
undo our previous conditionals and just use the correct class for the…
LordRembo Mar 22, 2024
c3d9822
move the general constants together, for the Settings Sector logic, i…
LordRembo Mar 22, 2024
c2599b8
rebuild
LordRembo Mar 22, 2024
c9eab80
reformat the stopDynamicContentPopup function to fix linting
LordRembo Mar 29, 2024
fb67e3e
correction in syntax
LordRembo Mar 29, 2024
f4ee355
move isComponent check to where it should be + improve condition check
LordRembo Mar 29, 2024
720a1da
move comment to correct place
LordRembo Mar 29, 2024
ede518b
replace Dynamic Content icon with an svg to be consistent with the ot…
LordRembo Apr 5, 2024
ac2f4c0
fix spelling of function name to add Dynamic content block
LordRembo Apr 8, 2024
4b6f8d4
Fix for block getting removed when Editor opens
LordRembo Apr 8, 2024
6218ab7
put back merging of default model properties with the dynamic content…
LordRembo Apr 8, 2024
334bf3e
load default block styling for dynamic content block instead of tryin…
LordRembo Apr 8, 2024
df78c9d
Fix for block getting removed when Editor opens
LordRembo Apr 8, 2024
84ea898
move todos to the correct part of the code
LordRembo Apr 8, 2024
764feb2
don't try to remove item that does not exist
LordRembo Apr 8, 2024
e69c7d4
reformat onRender function for clarity
LordRembo Apr 8, 2024
c9f2aa1
format logger variable back to old way of writing but prevent linting…
LordRembo Apr 8, 2024
524ca93
make the preview block render in full width so it visually matches th…
LordRembo Apr 8, 2024
253d1d6
rebuild
LordRembo Apr 8, 2024
faeed09
Merge branch 'update-grapesjs-compatibility-m5' into update-grapesjs-…
LordRembo Apr 18, 2024
6927ea8
rebuild
LordRembo Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Build dist files
volha-pivavarchyk committed Oct 4, 2023
commit b0382112193a88a45e611f05a245a401693fba32
14 changes: 8 additions & 6 deletions dist/buttons/buttonApply.command.js
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@ import MjmlService from '../mjml/mjml.service';
import ButtonCloseCommands from './buttonClose.command';
import ButtonsService from './buttons.service';
export default class ButtonApplyCommand {
/**
* The command name
*/

/**
* Command saves the email into Database
*
@@ -65,7 +61,7 @@ export default class ButtonApplyCommand {
if (response.route) {
// update URL in address bar
MauticVars.manualStateChange = false;
History.pushState(null, 'Mautic', response.route);
history.pushState(null, 'Mautic', response.route);

// update Title
Mautic.generatePageTitle(response.route);
@@ -122,19 +118,25 @@ export default class ButtonApplyCommand {
if (mode === ContentService.modeEmailHtml || mode === ContentService.modeEmailMjml) {
let formEmailSubject = ButtonsService.getElementValue('emailform_subject');
let formEmailName = ButtonsService.getElementValue('emailform_name');
if (formEmailSubject.lenght === 0) {
if (formEmailSubject.length === 0) {
formEmailSubject = ButtonsService.getDefaultValue(mode.split('-')[0]);
ButtonsService.setElementValue('emailform_subject', formEmailSubject);
}
if (formEmailName.length === 0) {
formEmailName = ButtonsService.getDefaultValue(mode.split('-')[0]);
ButtonsService.setElementValue('emailform_name', formEmailName);
}
}
if (mode === ContentService.modePageHtml) {
let formPageTitle = ButtonsService.getElementValue('page_title');
if (formPageTitle.length === 0) {
formPageTitle = ButtonsService.getDefaultValue(mode.split('-')[0]);
ButtonsService.setElementValue('page_title', formPageTitle);
}
}
}
}
/**
* The command name
*/
_defineProperty(ButtonApplyCommand, "name", 'preset-mautic:apply-form');
13 changes: 13 additions & 0 deletions dist/buttons/buttons.service.js
Original file line number Diff line number Diff line change
@@ -21,6 +21,19 @@ export default class ButtonService {
return field.value;
}

/**
* Set a form fields value by ID
* @param elementId
* @param value
*/
static setElementValue(elementId, value) {
const field = document.getElementById(elementId);
if (!field) {
throw new Error(`Element '${elementId}' not found`);
}
field.value = value;
}

/**
* Get the email|page id to open preview
*