Skip to content

product image option plugin #4502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 443 commits into
base: master-mysterious-egg
Choose a base branch
from

Conversation

duau-odoo
Copy link

No description provided.

bso-odoo and others added 30 commits April 18, 2025 11:19
After dropping, we want to stay on the block tab, to drag other blocks
afterwards.
the wrong keyword was used in name_search
throw an error in handleProps to have a clearer error
*: html_builder, web_tour

Co-authored-by: Sanjay Sharma <[email protected]>
Co-authored-by: Vishal Padhiyar <[email protected]>
Co-authored-by: Rudra Patel <[email protected]>
Co-authored-by: Rahil Ghanchi <[email protected]>
Co-authored-by: Dhruv Chauhan <[email protected]>
This option is a bit special, as it is saved with a different orm call

The previous implementation saves the widgets' state to the dataset of the cover's htmlelement on every edit.
(in `addons/website/static/src/js/editor/snippets.options.js > options.registry.CoverProperties > _updateSavingDataset`)
And on save, the dataset is used to write the model
(in `addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js > WysiwygAdapterComponent > _saveCoverProperties`)

The new implementation has the same logic (save to dataset + write in orm on save).
But has significant distinctions:
- the state is read just before saving, in a `clean_for_save_handlers`, instead of on every user changes
- the state is read from the dom of the html, instead of the widgets of the option
- the background-image is also passed by the dataset instead of read during save to be more similar to the others
- I relied on the save_plugin to only save once, instead of re-implementing the logic present in `_saveCoverProperties` that avoids several concurrent saves

The labels for the sizes for blog cover were overriden in `addons/website_blog/static/src/js/options.js` > `options.registry.CoverProperties.include`
@robodoo
Copy link

robodoo commented Apr 28, 2025

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

@duau-odoo duau-odoo force-pushed the master-mysterious-egg-3-duau branch from 1cf763b to 0d76c5a Compare April 28, 2025 13:06
@duau-odoo duau-odoo force-pushed the master-mysterious-egg-3-duau branch from 0d76c5a to b51a289 Compare April 28, 2025 15:49
FrancoisGe and others added 7 commits April 29, 2025 08:57
…e, .s_social_media, .s_rating, .s_hr, .s_google_map, .s_map, .s_countdown, .s_chart, .s_text_highlight, .s_progress_bar, .s_badge, .s_embed_code, .s_donation, .s_add_to_cart, .s_online_appointment, .o_snippet_drop_in_only, .s_image, .s_cta_badge, .s_accordion, .s_website_form, .s_searchbar_input, .s_card
@duau-odoo duau-odoo force-pushed the master-mysterious-egg-3-duau branch 3 times, most recently from 5934ef4 to 4e52e6e Compare April 29, 2025 10:43
@duau-odoo duau-odoo force-pushed the master-mysterious-egg-3-duau branch from 4e52e6e to e911cd6 Compare April 29, 2025 10:45
@ged-odoo ged-odoo force-pushed the master-mysterious-egg branch from e24556e to 897f4ab Compare April 29, 2025 18:30
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.