[FIX] web_editor, website: allow removing duplicated navabr CTA buttons
Steps to reproduce [17.0]:
- Go to website (in "Edit" mode) > Click on the "Contact Us" button.
- Duplicate the CTA button ("Button options" > "Duplicate icon").
- There is no way to only remove the duplicated button, and the "Header" > "Show/Hide Button" option will disable the whole CTA container.
After the website headers redesign in 1, a new feature was added to allow users to select the elements they want to display in the header (social links, call to action...). The CTA section was also marked as 'oe_unremovable' which disabled the option to remove it in the editor.
When a CTA button is duplicted, the clone will also be unremovable which makes it impossible to remove.
The goal of this commit is to at least make the duplicated CTA buttons removable in stable (maybe a better approach can be implemented in the master forward port).
Remark: Also after 1, two header navbars were added in the DOM (for the desktop view and mobile). Which means that the CTA field is also duplicated and every change on the CTA buttons in Desktop will be reflected in the mobile version.
opw-3706902
Wouldn't it be better to just prevent the duplicate of this element? Like hiding the duplicate icon/button?
Yes. Actually, my focus for this diff was on allowing the removal of existing duplicated buttons, but since it's OK to do it via OPW tickets, It's OK for me to just prevent duplication. It seems that the Buttons option already has a forceDuplicateButton = true to force the clone :grimacing:. I updated the code to break this condition only when the target is a CTA button. Just let me know if something needs to be changed here :+1:
