1
1
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" ;
3
3
import { removePlugins } from "@html_builder/utils/utils" ;
4
- import { MAIN_PLUGINS as MAIN_EDITOR_PLUGINS } from "@html_editor/plugin_sets" ;
5
4
import { Component } from "@odoo/owl" ;
6
5
import { registry } from "@web/core/registry" ;
7
6
import { DYNAMIC_PLACEHOLDER_PLUGINS } from "@html_editor/backend/plugin_sets" ;
@@ -21,31 +20,22 @@ export class MassMailingBuilder extends Component {
21
20
...registry . category ( "mass_mailing-plugins" ) . getAll ( ) ,
22
21
] ) ;
23
22
// 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" ,
32
28
] ;
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 ) ) ;
40
30
const optionalPlugins = new Set ( [
41
31
...( 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
+ )
43
36
: [ ] ) ,
44
37
] ) ;
45
- const Plugins = mainEditorPlugins
46
- . union ( builderEditorPlugins )
47
- . union ( massMailingPlugins )
48
- . union ( optionalPlugins ) ;
38
+ const Plugins = builderEditorPlugins . union ( massMailingPlugins ) . union ( optionalPlugins ) ;
49
39
builderProps . Plugins = Array . from ( Plugins ) ;
50
40
return builderProps ;
51
41
}
0 commit comments