Skip to content

Commit ff03fd0

Browse files
fdardenneFrancoisGe
authored andcommitted
[FIX] html_builder: highlight: props validation
1 parent cba9687 commit ff03fd0

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

addons/html_builder/static/src/website_builder/plugins/highlight/highlight_configurator.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ export class HighlightConfigurator extends Component {
3131
static template = "website.highlightConfigurator";
3232
static components = { ColorPicker };
3333
static props = {
34-
previewableApplyHighlight: Object,
35-
previewableApplyHighlightStyle: Object,
34+
applyHighlight: Function,
35+
applyHighlightStyle: Function,
36+
getHighlightState: Function,
37+
getSelection: Function,
38+
previewHighlight: Function,
39+
previewHighlightStyle: Function,
40+
revertHighlight: Function,
41+
revertHighlightStyle: Function,
3642
componentStack: Object,
3743
};
3844

addons/html_builder/static/src/website_builder/plugins/highlight/highlight_plugin.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { formatsSpecs } from "@html_editor/utils/formatting";
1010
import { closestElement } from "@html_editor/utils/dom_traversal";
1111
import { removeStyle } from "@html_editor/utils/dom";
1212
import { isTextNode } from "@html_editor/utils/dom_info";
13+
import { omit } from "@web/core/utils/objects";
1314

1415
export class HighlightPlugin extends Plugin {
1516
static id = "highlight";
@@ -170,6 +171,17 @@ formatsSpecs.highlight = {
170171
};
171172

172173
class HighlightToolbarButton extends Component {
174+
static props = {
175+
applyHighlight: Function,
176+
applyHighlightStyle: Function,
177+
getHighlightState: Function,
178+
getSelection: Function,
179+
previewHighlight: Function,
180+
previewHighlightStyle: Function,
181+
revertHighlight: Function,
182+
revertHighlightStyle: Function,
183+
title: String,
184+
};
173185
static template = xml`
174186
<button t-ref="root" class="btn btn-light" t-on-click="openHighlightConfigurator">
175187
<i class="fa oi oi-text-effect oi-fw py-1"/>
@@ -181,7 +193,7 @@ class HighlightToolbarButton extends Component {
181193
this.componentStack = useStackingComponentState();
182194
this.componentStack.push(HighlightConfigurator, {
183195
componentStack: this.componentStack,
184-
...this.props,
196+
...omit(this.props, "title"),
185197
});
186198
this.configuratorPopover = usePopover(StackingComponent, {
187199
onClose: () => {

0 commit comments

Comments
 (0)