Skip to content

Commit

Permalink
FIX rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisGe committed Dec 12, 2024
1 parent 5cab1c7 commit 58143fd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
29 changes: 14 additions & 15 deletions addons/html_builder/static/tests/toolbox/widget.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { setSelection } from "@html_editor/../tests/_helpers/selection";
import { describe, expect, test } from "@odoo/hoot";
import {
animationFrame,
Expand Down Expand Up @@ -412,9 +413,7 @@ describe("WeNumberInput", () => {
test("should get the initial value of the input", async () => {
addActionOption({
customAction: {
getValue: ({ editingElement }) => {
return editingElement.innerHTML;
},
getValue: ({ editingElement }) => editingElement.innerHTML,
apply: ({ param }) => {
expect.step(`customAction ${param}`);
},
Expand All @@ -435,9 +434,7 @@ describe("WeNumberInput", () => {
test("should preview changes", async () => {
addActionOption({
customAction: {
getValue: ({ editingElement }) => {
return editingElement.innerHTML;
},
getValue: ({ editingElement }) => editingElement.innerHTML,
apply: ({ editingElement, value }) => {
expect.step(`customAction ${value}`);
editingElement.innerHTML = value;
Expand All @@ -463,9 +460,7 @@ describe("WeNumberInput", () => {
test("should commit changes", async () => {
addActionOption({
customAction: {
getValue: ({ editingElement }) => {
return editingElement.innerHTML;
},
getValue: ({ editingElement }) => editingElement.innerHTML,
apply: ({ editingElement, value }) => {
expect.step(`customAction ${value}`);
editingElement.innerHTML = value;
Expand Down Expand Up @@ -502,9 +497,7 @@ describe("WeNumberInput", () => {
});
addActionOption({
customAction: {
getValue: () => {
return "customValue";
},
getValue: () => "customValue",
},
});

Expand Down Expand Up @@ -540,9 +533,7 @@ describe("WeTextInput", () => {
});
addActionOption({
customAction: {
getValue: () => {
return "customValue";
},
getValue: () => "customValue",
},
});

Expand Down Expand Up @@ -603,6 +594,10 @@ describe("WeSelectItem", () => {
</WeSelect>`,
});
await setupWebsiteBuilder(`<div class="test-options-target" customAttribute="a">x</div>`);
setSelection({
anchorNode: queryFirst(":iframe .test-options-target").childNodes[0],
anchorOffset: 0,
});
await contains(":iframe .test-options-target").click();
expect(".options-container").toBeDisplayed();
expect(".we-bg-options-container .dropdown").toHaveText("A");
Expand Down Expand Up @@ -761,6 +756,10 @@ describe("dependencies", () => {
`,
});
await setupWebsiteBuilder(`<div class="test-options-target">b</div>`);
setSelection({
anchorNode: queryFirst(":iframe .test-options-target").childNodes[0],
anchorOffset: 0,
});
await contains(":iframe .test-options-target").click();
expect(".options-container").toBeDisplayed();
expect(
Expand Down
4 changes: 1 addition & 3 deletions addons/html_editor/static/src/main/font/font_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ export class FontPlugin extends Plugin {
const block = closestBlock(anchorNode);
const tagName = block.tagName.toLowerCase();

const matchingItems = fontItems.filter((item) => {
return item.tagName === tagName;
});
const matchingItems = fontItems.filter((item) => item.tagName === tagName);

const matchingItemsWitoutExtraClass = matchingItems.filter((item) => !item.extraClass);

Expand Down
2 changes: 1 addition & 1 deletion addons/html_editor/static/src/main/font/font_selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { DropdownItem } from "@web/core/dropdown/dropdown_item";
export class FontSelector extends Component {
static template = "html_editor.FontSelector";
static props = {
title: String,
getItems: Function,
getDisplay: Function,
onSelected: Function,
getSelection: Function,
};
static components = { Dropdown, DropdownItem };

Expand Down
2 changes: 1 addition & 1 deletion addons/html_editor/static/src/main/media/image_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ export class ImagePlugin extends Plugin {
{
id: "image_transform",
groupId: "image_transform",
title: _t("Transform the picture (click twice to reset transformation)"),
Component: ImageTransformButton,
props: this.getImageTransformProps(),
},
Expand Down Expand Up @@ -335,6 +334,7 @@ export class ImagePlugin extends Plugin {
getImageTransformProps() {
return {
icon: "fa-object-ungroup",
title: _t("Transform the picture (click twice to reset transformation)"),
getSelectedImage: this.getSelectedImage.bind(this),
resetImageTransformation: this.resetImageTransformation.bind(this),
addStep: this.dependencies.history.addStep.bind(this),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class ImageTransformButton extends Component {
static template = "html_editor.ImageTransformButton";
static props = {
icon: String,
title: String,
getSelectedImage: Function,
resetImageTransformation: Function,
addStep: Function,
Expand Down

0 comments on commit 58143fd

Please sign in to comment.