Skip to content

Commit 0cd16ff

Browse files
agau-odoobso-odoo
authored andcommitted
fix header options order
1 parent 1d291b1 commit 0cd16ff

File tree

2 files changed

+40
-20
lines changed

2 files changed

+40
-20
lines changed

addons/html_builder/static/src/website_builder/plugins/options/header_option_plugin.js

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,37 @@ import {
33
getDefaultShadow,
44
shadowToString,
55
} from "@html_builder/plugins/shadow_option_plugin";
6-
import { after, SNIPPET_SPECIFIC_NEXT } from "@html_builder/utils/option_sequence";
6+
import {
7+
SNIPPET_SPECIFIC_END,
8+
SNIPPET_SPECIFIC_NEXT,
9+
splitBetween,
10+
} from "@html_builder/utils/option_sequence";
711
import { Plugin } from "@html_editor/plugin";
812
import { withSequence } from "@html_editor/utils/resource";
913
import { registry } from "@web/core/registry";
1014
import { HeaderBorderOption } from "./header_border_option";
1115

12-
export const HEADER_TEMPLATE = SNIPPET_SPECIFIC_NEXT;
13-
export const HEADER_TEMPLATE_SECONDARY_OPTIONS = after(HEADER_TEMPLATE);
14-
export const HEADER_SCROLL_EFFECT = after(HEADER_TEMPLATE_SECONDARY_OPTIONS);
15-
export const HEADER_ELEMENT = after(HEADER_SCROLL_EFFECT);
16-
export const HEADER_BORDER = after(HEADER_ELEMENT);
16+
const [
17+
HEADER_TEMPLATE,
18+
HEADER_TEMPLATE_SECONDARY_OPTIONS,
19+
HEADER_BORDER,
20+
HEADER_SCROLL_EFFECT,
21+
HEADER_ELEMENT,
22+
HEADER_END,
23+
...__ERROR_CHECK__
24+
] = splitBetween(SNIPPET_SPECIFIC_NEXT, SNIPPET_SPECIFIC_END, 6);
25+
if (__ERROR_CHECK__.length > 0) {
26+
console.error("Wrong count in header option split");
27+
}
28+
29+
export {
30+
HEADER_TEMPLATE,
31+
HEADER_TEMPLATE_SECONDARY_OPTIONS,
32+
HEADER_BORDER,
33+
HEADER_SCROLL_EFFECT,
34+
HEADER_ELEMENT,
35+
HEADER_END,
36+
};
1737

1838
class HeaderOptionPlugin extends Plugin {
1939
static id = "headerOption";
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1+
import { HEADER_END } from "@html_builder/website_builder/plugins/options/header_option_plugin";
12
import { Plugin } from "@html_editor/plugin";
23
import { withSequence } from "@html_editor/utils/resource";
3-
import { _t } from "@web/core/l10n/translation";
44
import { registry } from "@web/core/registry";
55

66
class WebsiteSaleShowEmptyOptionPlugin extends Plugin {
7-
static id = "showEmptyOption";
8-
resources = {
9-
builder_options: [
10-
withSequence(100, {
11-
template: "website_sale.ShowEmptyOption",
12-
selector: "#wrapwrap > header",
13-
editableOnly: false,
14-
groups: ["website.group_website_designer"],
15-
}),
16-
],
17-
};
7+
static id = "showEmptyOption";
8+
resources = {
9+
builder_options: [
10+
withSequence(HEADER_END, {
11+
template: "website_sale.ShowEmptyOption",
12+
selector: "#wrapwrap > header",
13+
editableOnly: false,
14+
groups: ["website.group_website_designer"],
15+
}),
16+
],
17+
};
1818
}
1919

2020
registry
21-
.category("website-plugins")
22-
.add(WebsiteSaleShowEmptyOptionPlugin.id, WebsiteSaleShowEmptyOptionPlugin);
21+
.category("website-plugins")
22+
.add(WebsiteSaleShowEmptyOptionPlugin.id, WebsiteSaleShowEmptyOptionPlugin);

0 commit comments

Comments
 (0)