Skip to content
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

[FW][FIX] web_editor: prevent unexpected placeholder for editable area #146859

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Dec 19, 2023

Previously, the code for adding placeholders checked if the content inside a block was either an empty string ('') or just a single <br> element. While this logic was intended to provide hints when blocks were empty, it had the unintended consequence of adding placeholders in situations where it wasn't necessary, such as when removing images from a section.

To prevent unexpected placeholders, this commit refines the logic. It now adds a placeholder only when the content inside a block consists solely of a single <br> element, which is a more accurate indicator of an empty block.

Additionally, this PR resolves an issue with the drag and drop a building block here functionality. Previously, when entering edit mode and clicking on drag and drop a building block here, it moved upward. After these changes, it remains fixed in its original position.

task-3380599

Forward-Port-Of: #140444

@robodoo
Copy link
Contributor

robodoo commented Dec 19, 2023

Pull request status dashboard.

@fw-bot
Copy link
Contributor Author

fw-bot commented Dec 19, 2023

@utag-odoo @Goaman cherrypicking of pull request #140444 failed.

stdout:

Auto-merging addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js
CONFLICT (content): Merge conflict in addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js

stderr:

16:40:27.670362 git.c:463               trace: built-in: git cherry-pick 60c3ace310a1ee546b0244cb0ffe6244a35ada9b
error: could not apply 60c3ace310a1... [FIX] web_editor: prevent unexpected placeholder for editable area
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
----------
status:

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Dec 19, 2023
@C3POdoo C3POdoo added the RD research & development, internal work label Dec 19, 2023
Previously, the code for adding placeholders checked if the content
inside a block was either an empty string (`''`) or just a single `<br>`
element. While this logic was intended to provide hints when blocks were
empty, it had the unintended consequence of adding placeholders in
situations where it wasn't necessary, such as when removing images from
a section.

To prevent unexpected placeholders, this commit refines the logic. It
now adds a placeholder only when the content inside a block consists
solely of a single `<br>` element, which is a more accurate indicator of
an empty block.

Additionally, this PR resolves an issue with the `drag and drop a
building block here` functionality. Previously, when entering edit mode
and clicking on `drag and drop a building block here,` it moved upward.
after these changes, it remains fixed in its original position.

task-3380599

X-original-commit: def1eee
@utag-odoo utag-odoo force-pushed the 16.0-15.0-web_editor-remove_unexpected_placeholder-utag-5C7L-fw branch from b3d3552 to 1e75289 Compare December 20, 2023 04:56
@C3POdoo C3POdoo requested a review from a team December 20, 2023 04:58
@utag-odoo
Copy link
Contributor

@Goaman, We resolve the conflict. Can you please r+
Thanks!

@Zynton
Copy link
Contributor

Zynton commented Dec 21, 2023

robodoo r+

robodoo pushed a commit that referenced this pull request Dec 21, 2023
Previously, the code for adding placeholders checked if the content
inside a block was either an empty string (`''`) or just a single `<br>`
element. While this logic was intended to provide hints when blocks were
empty, it had the unintended consequence of adding placeholders in
situations where it wasn't necessary, such as when removing images from
a section.

To prevent unexpected placeholders, this commit refines the logic. It
now adds a placeholder only when the content inside a block consists
solely of a single `<br>` element, which is a more accurate indicator of
an empty block.

Additionally, this PR resolves an issue with the `drag and drop a
building block here` functionality. Previously, when entering edit mode
and clicking on `drag and drop a building block here,` it moved upward.
after these changes, it remains fixed in its original position.

task-3380599

closes #146859

X-original-commit: def1eee
Signed-off-by: Nicolas Bayet (nby) <[email protected]>
Signed-off-by: Antoine Guenet (age) <[email protected]>
@robodoo robodoo closed this Dec 21, 2023
@fw-bot fw-bot deleted the 16.0-15.0-web_editor-remove_unexpected_placeholder-utag-5C7L-fw branch January 4, 2024 10:46
luanjubica pushed a commit to luanjubica/odoo-code that referenced this pull request Feb 14, 2024
Previously, the code for adding placeholders checked if the content
inside a block was either an empty string (`''`) or just a single `<br>`
element. While this logic was intended to provide hints when blocks were
empty, it had the unintended consequence of adding placeholders in
situations where it wasn't necessary, such as when removing images from
a section.

To prevent unexpected placeholders, this commit refines the logic. It
now adds a placeholder only when the content inside a block consists
solely of a single `<br>` element, which is a more accurate indicator of
an empty block.

Additionally, this PR resolves an issue with the `drag and drop a
building block here` functionality. Previously, when entering edit mode
and clicking on `drag and drop a building block here,` it moved upward.
after these changes, it remains fixed in its original position.

task-3380599

closes odoo#146859

X-original-commit: def1eee
Signed-off-by: Nicolas Bayet (nby) <[email protected]>
Signed-off-by: Antoine Guenet (age) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants