summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/html_editor.test.js
AgeCommit message (Collapse)Author
2019-06-05[IMP] *: move test and tour files to new folder hierarchy and assetRomain Derie
As we now have a new debug mode 'tests' which load a new asset bundle containing tour-test files, we moved those files to a new folder hierarchy. That will clean the .js files trees. Also, those files should be included in the new asset. Basically, the .js tour files (not test) should be inside /static/src/js/tours while .js tour test files (test=true) should be inside /static/tests/tours next to QUnit tests, inside a tours folder. + test_new_api: don't run the test in debug assets task-1934445 Comes with https://github.com/odoo/enterprise/pull/4281 Closes #33213
2019-02-27[REF] *: definitely get rid of web_editor.baseqsm-odoo
* portal, sale, website, website_blog, website_crm, website_event, website_event_sale, website_forum, website_hr_recruitment, website_sale, website_sale_wishlist At last, that ugly JS module can be removed. Before this current PR, it was still used to wait for "page ready", to initialize widgets on page loading. Now, all can be done thanks to public root and public widgets. web_editor.base was also still used in tours, which should not be necessary anymore for the same reason, especially since the tour manager waits for the public root naturally. Part of https://github.com/odoo/odoo/pull/29442 task-1932066
2019-02-13[FIX] website: adapt tests to new editor and new html editorRomain Derie
Scss tour was broken due to recent task that shows only 2 new custom scss files if not in edit mode. As the tests was trying to read `website.ui.scss` that is now in debug mode in a filter, it would not be found. Html tour was broken due to new editor that changed the save process. For some reason, after the drag & drop of a snippet, clicking fast on save would not fire RPCs as it would not be considered as dirty. (Editor would then close, you would still see the modifications even if nothing was saved on DB) closes odoo/odoo#31067
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