[19.0][MIG] website_snippet_product_category: Migration to version 19.0 - #1288
[19.0][MIG] website_snippet_product_category: Migration to version 19.0#1288cristina-hidalgo-tecnativa wants to merge 35 commits into
Conversation
|
/ocabot migration website_snippet_product_category |
|
Please reduce administrative commits |
…d by published in snippet field TT33532
…site.page Bulk changes shouldn't be applied indiscriminately to all places.
Currently translated at 100.0% (10 of 10 strings) Translation: e-commerce-13.0/e-commerce-13.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-13-0/e-commerce-13-0-website_snippet_product_category/ca/
Currently translated at 100.0% (10 of 10 strings) Translation: e-commerce-13.0/e-commerce-13.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-13-0/e-commerce-13-0-website_snippet_product_category/es/
Currently translated at 100.0% (10 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/it/
Currently translated at 80.0% (8 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/fr/
Currently translated at 20.0% (2 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/nl/
Currently translated at 90.0% (9 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/ca/
Currently translated at 0.0% (0 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/pt_BR/
Currently translated at 90.0% (9 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/es/
Currently translated at 100.0% (10 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/it/
Currently translated at 100.0% (10 of 10 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/es/
…categories TT61624
Currently translated at 100.0% (13 of 13 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/ca/
Currently translated at 100.0% (13 of 13 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/it/
Currently translated at 100.0% (13 of 13 strings) Translation: e-commerce-18.0/e-commerce-18.0-website_snippet_product_category Translate-URL: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_snippet_product_category/es/
e6591a2 to
c416fc3
Compare
Done! |
| }; | ||
|
|
||
| cleanForSave({root}) { | ||
| for (const el of root.querySelectorAll(".js_product_category")) { |
There was a problem hiding this comment.
The previous implementation only cleaned the current option target (this.$target.empty()). Why do we now clean every .js_product_category under root? Please avoid broadening the behavior unless required by the new builder API.
There was a problem hiding this comment.
I found this one is required by the new API, not a behavior broadening: clean_for_save_handlers in the new Builder Plugin system is registered once globally and only receives the whole editable root, not a per-instance target like the old options system did.
Iterating root.querySelectorAll(...) is the standard pattern the core itself uses for this exact case (e.g. popup_visibility_plugin.js, embed_code_option_plugin.js both do the same).
Without the loop, a page with more than one instance of this snippet would only get the first one cleaned on save.
c416fc3 to
e176945
Compare
sAnimation(removed in 19.0) to the newInteractionAPI.web_editor, removed) with the new BuilderPluginAPI: the save-cleanup logic moves toclean_for_save_handlers, which also makes thes_product_category_optionstemplate (it inheritedwebsite.snippet_options, also removed) unnecessary and lets us drop it.@route(type="json")→@route(type="jsonrpc")(deprecated alias in 19.0).@Tecnativa TT64172
@pedrobaeza @pilarvargas-tecnativa