odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[FIX] web_editor: prevent inner snippets to toggle the grid mode

Open sobo-odoo opened this issue 3 years ago • 4 comments

In 1, conditions have been made in order to allow/forbid each snippet to toggle the grid mode. However, a case has been forgotten: when a snippet that cannot toggle the grid mode is dropped inside a snippet that can toggle it (so it is an inner snippet). Indeed, if we drag one of the inner snippet columns, we can see that the grid mode is toggled, where it should not be the case.

This issue comes from the check looking if the grid layout option is in the right panel. Indeed, even though such a snippet does not have it, if it is dropped inside a snippet that can toggle the grid mode, then the option is well present in the right panel (= the outer snippet one).

This commit fixes this issue by improving the check: now, dragging a column can toggle the grid mode only if the container having the option is the same as the one of the column. This commit also improves the siblings removal, in order to only have the relevant dropzones, by taking this case into account.

Steps to reproduce:

  • drop a Text-Image snippet
  • drop a Form snippet inside one of the columns
  • drag a form field => the grid mode is toggled.

opw-3100399

sobo-odoo avatar Dec 19 '22 19:12 sobo-odoo

Pull request status dashboard

robodoo avatar Dec 19 '22 19:12 robodoo

@qsm-odoo @rdeodoo

sobo-odoo avatar Dec 21 '22 10:12 sobo-odoo

@qsm-odoo I made the changes :) In the end, I still had to manage the case of the inner siblings (when the outer snippet is in grid mode) so other columns cannot be dropped in them (without that, the inner dropzones were overlapping with the grid dropzone, which didn't look good and was not convenient).

sobo-odoo avatar Jan 03 '23 14:01 sobo-odoo

@qsm-odoo I made the changes :)

sobo-odoo avatar Jan 09 '23 16:01 sobo-odoo

@qsm-odoo I made the changes :)

sobo-odoo avatar Jan 13 '23 15:01 sobo-odoo