Skip to content

Commit 4a4d111

Browse files
committed
[REF] mass_mailing, website: remove now-unused special drop in options
so_snippet_addition and so_content_addition are fully converted and can now be removed. The mass_mailing legacy snippet addition selector was outdated in this commit [1]. The mass_mailing legacy content addition selector was outdated in this commit [2]. Further updates were pushed in these commits [3] [4]. [1]: edf81c1 [2]: ee94c0c [3]: 1dff079 [4]: 507b80a task-3850413
1 parent d914d88 commit 4a4d111

File tree

4 files changed

+5
-29
lines changed

4 files changed

+5
-29
lines changed

addons/mass_mailing/static/src/js/mass_mailing_snippets.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import options from "@web_editor/js/editor/snippets.options.legacy";
44
import { loadImage } from "@web_editor/js/editor/image_processing";
5+
import { registerSnippetAdditionSelector } from "@web_editor/js/editor/snippets.registry";
56
const SelectUserValueWidget = options.userValueWidgetsRegistry['we-select'];
67
import weUtils from "@web_editor/js/common/utils";
78
import {
@@ -17,6 +18,8 @@ import { isCSSColor, normalizeCSSColor } from "@web/core/utils/colors";
1718
// Options
1819
//--------------------------------------------------------------------------
1920

21+
registerSnippetAdditionSelector(".o_mail_snippet_general");
22+
2023
// Adding compatibility for the outlook compliance of mailings.
2124
// Commit of such compatibility : a14f89c8663c9cafecb1cc26918055e023ecbe42
2225
options.registry.MassMailingBackgroundImage = options.registry.BackgroundImage.extend({

addons/mass_mailing/views/snippets_themes.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,6 @@
410410
data-drop-near="[data-oe-field='body_html']:not(:has(.o_layout)) > *, .oe_structure > *"
411411
data-drop-in="[data-oe-field='body_html']:not(:has(.o_layout)), .oe_structure"/>
412412

413-
<t t-set="so_snippet_addition_selector" t-translation="off">.o_mail_snippet_general</t>
414-
<div id="so_snippet_addition"
415-
t-att-data-selector="so_snippet_addition_selector"
416-
data-drop-in=":not(p).oe_structure:not(.oe_structure_solo), :not(.o_mega_menu):not(p)[data-oe-type=html], :not(p).oe_structure.oe_structure_solo:not(:has(> section, > div))"/>
417-
418-
<t t-set="so_content_addition_selector" t-translation="off">.s_mail_blockquote, .s_mail_alert, .s_rating, .s_hr, .s_mail_text_highlight</t>
419-
<div id="so_content_addition"
420-
t-att-data-selector="so_content_addition_selector"
421-
t-attf-data-drop-near="p, h1, h2, h3, ul, ol, .row > div > img, #{so_content_addition_selector}"
422-
data-drop-in=".content, nav"/>
423-
424413
<div data-js="sizing_y"
425414
data-selector=".o_mail_snippet_general, .o_mail_snippet_general .row > div"
426415
data-exclude=".o_mail_no_resize, .o_mail_no_options, .s_col_no_resize.row > div, .s_col_no_resize"/>

addons/website/static/src/snippets/s_popup/options.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ registerWebsiteOption("SnippetPopup", {
174174
selector: ".s_popup",
175175
exclude: "#website_cookies_bar",
176176
target: ".modal",
177+
// TODO: Should this be a snippet addition selector? (see
178+
// registerSnippetAdditionSelector)
177179
dropIn: ":not(p).oe_structure:not(.oe_structure_solo):not([data-snippet] *), :not(.o_mega_menu):not(p)[data-oe-type=html]:not([data-snippet] *)",
178180
});
179181

addons/website/views/snippets/snippets.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -561,24 +561,6 @@
561561
data-drop-near=".row.o_grid_mode > div"
562562
data-exclude=".s_col_no_resize.row > div, .s_col_no_resize"/>
563563

564-
<t t-set="so_snippet_addition_selector" t-translation="off">section, .parallax, .s_hr</t>
565-
<div id="so_snippet_addition"
566-
t-att-data-selector="so_snippet_addition_selector"
567-
data-drop-in=":not(p).oe_structure:not(.oe_structure_solo), :not(.o_mega_menu):not(p)[data-oe-type=html], :not(p).oe_structure.oe_structure_solo:not(:has(> section:not(.s_snippet_group), > div:not(.o_hook_drop_zone)))"/>
568-
<!-- /!\ drop-in here is partly duplicated for s_popup (see dedicated options) -->
569-
<!-- TODO should be improved -->
570-
571-
<t t-set="so_content_addition_selector" t-translation="off">
572-
blockquote, .s_card:not(.s_timeline_card), .s_alert, .o_facebook_page, .s_share, .s_social_media, .s_rating,
573-
.s_hr, .s_google_map, .s_map, .s_countdown, .s_chart, .s_text_highlight, .s_progress_bar, .s_badge,
574-
.s_embed_code, .s_donation, .s_add_to_cart, .s_online_appointment, .o_snippet_drop_in_only, .s_image
575-
</t>
576-
577-
<div id="so_content_addition"
578-
t-att-data-selector="so_content_addition_selector"
579-
t-attf-data-drop-near="p, h1, h2, h3, ul, ol, div:not(.o_grid_item_image) > img, .btn, #{so_content_addition_selector}"
580-
data-drop-in="nav"/>
581-
582564
<div data-js="SnippetSave"
583565
data-selector="[data-snippet], a.btn"
584566
t-attf-data-exclude=".o_no_save, #{so_submit_button_selector}">

0 commit comments

Comments
 (0)