Skip to content

Conversation

@Syozik
Copy link

@Syozik Syozik commented Apr 24, 2025

No description provided.

@robodoo
Copy link

robodoo commented Apr 24, 2025

This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged.

this.websiteEditService = this.websiteService.websiteRootInstance.bindService("website_edit");

const updatePreview = () => {
const iframeDocument = document.querySelector("iframe.o_add_snippet_iframe").contentDocument;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better to use a ref to directly access the target instead of doing this, in my opinion

<t t-name="html_builder.SnippetViewer">
<div class="row g-0 o_snippets_preview_row">
<div class="col-lg-6" t-foreach="this.getSnippetColumns()" t-as="snippetsColumn" t-key="snippetsColumn_index">
<t t-foreach="snippetsColumn" t-as="snippet" t-key="snippet.id">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add a t-ref="content" on the root div from this template (the one with o_snippets_preview_row)


setup() {
this.dialog = useService("dialog");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.content = useRef("content");

this.dialog = useService("dialog");

this.websiteService = useService("website");
this.websiteEditService = this.websiteService.websiteRootInstance.bindService("website_edit");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid confusion, you should rename it this.innerWebsiteEditService maybe.

@Syozik Syozik force-pushed the master-mysterious-egg-seru-01 branch 7 times, most recently from e5e4ed1 to 211fec6 Compare April 25, 2025 14:01

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if root is created in onMounted, it should probably be destroyed in onWillUnmount

@Syozik Syozik force-pushed the master-mysterious-egg-seru-01 branch 5 times, most recently from 4f9d883 to 174fe6e Compare April 29, 2025 07:32
@Syozik Syozik force-pushed the master-mysterious-egg-seru-01 branch from 174fe6e to ddc5f8d Compare April 29, 2025 07:34
@ged-odoo ged-odoo merged commit 845f4c6 into master-mysterious-egg Apr 29, 2025
@ged-odoo ged-odoo deleted the master-mysterious-egg-seru-01 branch April 29, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants