Skip to content

Commit cfc1a95

Browse files
[IMP] fix mass_mailing_plugins
1 parent 1927a79 commit cfc1a95

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

addons/mass_mailing_egg/static/src/builder/mass_mailing_builder.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Builder } from "@html_builder/builder";
2-
import { CORE_PLUGINS as CORE_BUILDER_PLUGINS } from "@html_builder/core/core_plugins";
2+
import { CORE_PLUGINS } from "@html_builder/core/core_plugins";
33
import { removePlugins } from "@html_builder/utils/utils";
4-
import { MAIN_PLUGINS as MAIN_EDITOR_PLUGINS } from "@html_editor/plugin_sets";
54
import { Component } from "@odoo/owl";
65
import { registry } from "@web/core/registry";
76
import { DYNAMIC_PLACEHOLDER_PLUGINS } from "@html_editor/backend/plugin_sets";
@@ -21,31 +20,22 @@ export class MassMailingBuilder extends Component {
2120
...registry.category("mass_mailing-plugins").getAll(),
2221
]);
2322
// TODO EGGMAIL: copied from website, check if something needs to be changed here
24-
const mainEditorPluginsToRemove = [
25-
"PowerButtonsPlugin",
26-
"DoubleClickImagePreviewPlugin",
27-
"SeparatorPlugin",
28-
"StarPlugin",
29-
"BannerPlugin",
30-
"MoveNodePlugin",
31-
"ColorPlugin", // it's duplicated in the builder
23+
const pluginsToRemove = [
24+
"BuilderFontPlugin", // Makes call to Google API (can't be used for emails)
25+
"SavePlugin",
26+
"SaveSnippetPlugin",
27+
"AnchorPlugin",
3228
];
33-
const mainEditorPlugins = new Set(
34-
removePlugins([...MAIN_EDITOR_PLUGINS], mainEditorPluginsToRemove)
35-
);
36-
const coreBuilderPluginsToRemove = ["SavePlugin", "SaveSnippetPlugin", "AnchorPlugin"];
37-
const builderEditorPlugins = new Set(
38-
removePlugins([...CORE_BUILDER_PLUGINS], coreBuilderPluginsToRemove)
39-
);
29+
const builderEditorPlugins = new Set(removePlugins([...CORE_PLUGINS], pluginsToRemove));
4030
const optionalPlugins = new Set([
4131
...(this.props.builderProps.config.dynamicPlaceholder
42-
? removePlugins(DYNAMIC_PLACEHOLDER_PLUGINS, ["PromptPlugin"])
32+
? removePlugins(
33+
DYNAMIC_PLACEHOLDER_PLUGINS,
34+
["PromptPlugin"] // mass_mailing does not use the dependency banner plugin
35+
)
4336
: []),
4437
]);
45-
const Plugins = mainEditorPlugins
46-
.union(builderEditorPlugins)
47-
.union(massMailingPlugins)
48-
.union(optionalPlugins);
38+
const Plugins = builderEditorPlugins.union(massMailingPlugins).union(optionalPlugins);
4939
builderProps.Plugins = Array.from(Plugins);
5040
return builderProps;
5141
}

0 commit comments

Comments
 (0)