summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/html_editor.test.js
AgeCommit message (Collapse)Author
2019-01-29[FIX] web_editor, website: consider COW view when loading viewRomain Derie
Before this commit: 1. If we were editing a template with no xml_id, typically the case when editing a specific view (COW'd), the 'Template ID' label would be left empty as the view does not have an xml_id but only a key. 2. If we were editing a generic view, the template would be COW'd and replaced by the specific one created during the save. After the save, the page would be reload and will try to reopen the edited template (stored in url `res=123`). But as this template would be replaced by the COW'd view, the JS would crash trying to access an inexisting view. The HTML editor would then open in a very thin modal, barely editable. Now: 1. Display the template's key instead of its xml_id. The key is basically a duplicate of the xml_id, mainly used in website. 2. If we are saving a generic view, we search for its newly created specific view to upload the URL hash before reloading. task-1934279 Fix #30447
2019-01-29[IMP] website: add tests for scss edition on html editorRomain Derie
As this behavior was recently broken (fixed in #30403), this commit adds a test tour for that flow. task-1934279 Fix #30447
2019-01-29[FIX] web_editor: send the html editor writes one after anotherRomain Derie
With the following view hierarchy: A | B' (oe_structure_ID view) Before this fix, when saving multiple templates at once from the same hierarchy the COW views (website) would not be saved correctly as the first call to `write` would COW the parent view, then the second concurent call to `write` would create the child specific view under the generic parent view. Instead, the generic parent should have been cloned to a specific parent view and then the child view should be COW under the specific parent. A A' | | B' B*' (This one is the old B', without B' changes in the html editor) Instead of A A' | B' Calling the `write` one after another will do the trick. Indeed, when the second call is fired, the first call has already triggered the COW behavior. Thus, the second call correctly retrieves the COW view. Another issue might still appear, if the parent view write is sent first. Indeed, the parent view will be COW, thus the specific child view (second write waiting to be fired) will be deleted to be added on the new specific hierarchy. Thus, that write will then raise an error since the view does not exist anymore. task-1934279 Fix #30447