summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/tests
AgeCommit message (Collapse)Author
2020-09-16[IMP] web_editor, *: make media-dialog search odoo media-librarySamuel Degueldre
*: website, web_unsplash, website_blog We have recently created an odoo media library that exposes a public API for searching for open-source media, including dynamic SVGs that can be used with the dynamic background-shape system to create illustrations whose colors can be changed by the user. This commit adds the corresponding client-side functionalty: search for the images in the media-library, creating a corresponding attachment when selected, as well as an option to customize the colors of the dynamic SVGs. In the process, adaptations have been made in the web_unsplash module to avoid duplicating code and to adapt code that was making assumptions that are no longer valid. To make new users more aware of this feature, all default images have been hidden from the media-dialog, so that the user is prompted so search for images. Some tests and tours that were relying on having default images in the media-dialog (eg in website_blog) have been adapted to match. task-2316651 Linked to: odoo/iap-apps#235 closes odoo/odoo#56479 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-14[IMP] web_editor, *: review background color/image options UIqsm-odoo
*: website, mass_mailing, website_blog, doc Part of https://github.com/odoo/odoo/pull/53930 task-2157252
2020-07-14[IMP] web_editor, *: remove snippet panel block iconsqsm-odoo
*: website, mass_mailing Part of https://github.com/odoo/odoo/pull/53930 task-2157252
2020-07-13[IMP] web,*: do not deploy services in testsAaron Bohy
*mail,point_of_sale,web_editor,website In the tests, required services are deployed for each test independently. There is no need to have, in additon, all services deployed globally. Worse, it could conflict and lead to unexpected results. This commit ensures services are no longer deployed globally in tests. It turns the module 'web.env' into a declarative module with no side-effect, by moving the service deployment to main.js, which isn't added to the tests page. Task 2287397 closes odoo/odoo#53817 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-09[FIX] web_editor: adapt test to new transparent.png locationqsm-odoo
A mockRPC was catching the route to transparent.png file which has been relocated with [1]. This commit solves that unadapted mockRPC and makes it easier to grep. [1]: https://github.com/odoo/odoo/commit/94b59b1972e1a18e18dfcd6c2ded495391380b9a Part of https://github.com/odoo/odoo/pull/54274
2020-07-06[FIX] web, web_editor, *: review chess-like bg for transparency previewqsm-odoo
*: website The style to achieve the chess-like bg result was duplicated at many places. The 'web' app was also actually using an image from the 'web_editor' app (we can live with it in stable as web_editor always comes with web in auto_install but this was still a mistake). closes odoo/odoo#54154 Also: fix some layout issue in the colorpicker widget. Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-06-12[FIX] *: adapt tests to env reworkAaron Bohy
This commit adapts tests following recent changes on the helpers. The main change is that addMockEnvironment (and all functions using it) are now async, as they need to wait for services to be started.
2020-06-12[IMP] *: update notifications to optional titleJulien Mougenot
closes odoo/odoo#52826 Related: odoo/enterprise#11084 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-02[IMP] web_editor, website, *: use new color namesqsm-odoo
*: mass_mailing, website_blog, website_forum, website_hr_recruitment Deprecate alpha, beta, gamma, delta and espilon color names and now use a new color system: o-color-x, with x from 1 to 5. This will allow to review the colors of all themes to have nice visuals for the new color combinations classes, without breaking the current uses of bg-alpha, alert-delta, etc in current websites of customers (by keeping the old color and classes for compatibility). This will also allow to uniformize all themes under the same conventions to enforce BS color override: - o-color-1 used as primary (as before, for alpha) - o-color-2 used as secondary (as before, for beta) Before, some themes were not following the 2 guidelines. The users using those themes will simply have the possibility to choose o-color-1 and o-color-2 colors accordingly to restore their website without breaking the new system features. Another change is that those colors are defined through color palettes and not theme color palettes. This will avoid them to generate automatic bootstrap classes which we don't want (alert, btn) and generate the one we want by ourself. Note: for mass mailing, the colors and classes also have been renamed but the system stays unchanged. Part of https://github.com/odoo/odoo/pull/45856 task-2197038
2020-06-02[IMP] web_editor, *: integrate new o_cc${xxx} classes in the colorpickerqsm-odoo
*: website Part of https://github.com/odoo/odoo/pull/45856 task-2197038
2020-05-31[FIX] web_editor: make a test more robustqsm-odoo
Don't know how this test worked before but it will stop working with next updates. This just make it more robust using the same trick as other tests: wait for the colorpicker to be opened before actually using it. Part of https://github.com/odoo/odoo/pull/52211 Related to task-2197038
2020-05-14[IMP] *: convert to private methodsMartin Trigaux
render, render_template, load, activity_schedule_with_view, get_website_pages should all be private: It should not be possible to render an aribtrary template only with its name or id Still need to render some qweb views from js so the method render_template is kept public. This explains why the website editor still need read access on ir.ui.view as we want to allow any snippet to be rendered.
2020-03-30[IMP] web_editor: improve image optimization workflow in media dialogSamuel Degueldre
Previously, when selecting an image, the user could optimize their images by clicking a little cog icon in the media dialog. They would also be prompted to optimize their images when uploading them. In most cases, it makes a lot more sense to always save the original in the database, and optimize the original whenever it's dropped in the page automatically. A second problem is that when using the optimization feature, optimized images would be displayed along the originals by default, resulting in a lot of duplicates while browsing the media dialog. This commit changes both of these things: - By default, when uploading an image, the original uploaded image is used. The user can still optimize their image manually through the media-dialog by using the cog icon. When choosing an image in the media-dialog, if it's not already an optimized image, an optimized copy is automatically created and used instead. - Optimized images are now hidden by default, in the media dialog, and can be shown by clicking a checkbox at the top of the modal when in debug mode task-2091417 closes odoo/odoo#45174
2020-03-30[IMP] web_editor, web_unsplash: improve media-dialog UXSamuel Degueldre
Previously, searching for images in the database and on unsplash was mutually exclusive, and controlled by a dropdown menu next to the search bar. Additionally, the display of db images and unsplash images was very different, making using the search function inconsistent and awkward. This commit merges the unsplash search into the db search. When searching, the first few matches from the database are displayed, then results from unsplash. Additionally, the layout of images has been greatly improved, eliminating almost all padding, using some flex-box magic to allow the images to take up all the available space without being cropped or deformed. The input to add an attachment by URL is now collapsed by default, and clicking on it will expand it to reduce visual clutter. Finally, when not in multi-images mode, the clicked image is immediately used, rather than the user having to click it and then click the add button, or having to double click, which was not obvious. task-2091417 closes odoo/odoo#45174
2020-03-13[REF] web: Update generic filesJulien Mougenot
General cleaning of some helpers and generic files. The idea is that they are less likely to be entirely re-written in the near future so this is a way to keep the code clean, readable and compliant to the current standards. Changes include: - Use of async/await when possible - Use of const/let instead of var - Removal of underscore.js - Use of native JS instead of jQuery when possible The logic of the affected code remains the same.
2020-01-31[FIX] web_editor: fix required html fieldsJason Van Malder
Issue - Studio - Add an required html field - Create new record - Leave it empty It is saved Cause The isSet function of FieldHtml widget, have a "/" in the <br> tag and summernote empty = <p><br></p>. If you add a space, the value becomes <p>&nbsp;&nbsp; <p>. Solution Remove the "/" and the spaces, check if value != <p></p> && <p><br></p> OPW-2183687 closes odoo/odoo#44427 X-original-commit: c984b1b1210cea1e63f3bc66cec2120554c76c2a Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-12-09[FIX] web,*: fix all tests and test utils to use native eventsVincent Schippefilt
In this commit: - transformed test_utils helpers to always trigger native events - introduced new test_utils_create helper: prepareTarget - updated qunit asserts to support Owl Components - updated all misused helpers that would crash with the updated test_utils Co-authored-by: Julien Mougenot <jum@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
2019-12-09[REV] web: reverts update to fontawesome 5.11.2Kevin Baptiste
This reverts commit ff1c35513aecef5fbc30f7c2f3834450e719714e. closes odoo/odoo#41480 X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc Related: odoo/enterprise#7110 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-01[IMP] web_editor, *: add new user value colorpicker widgetqsm-odoo
* web, mass_mailing, website Introduced a new sub-widget for snippet options: we-colorpicker. This allows to retrieve a color value (either a normalized css color or a theme color name) to be used for a snippet option method. This commit replaces the old 'colorpicker' snippet option whose behavior is now simply achieved by defining an xml option using a we-colorpicker widget in combination with the 'selectStyle' standard method. This commit also adds the possibility to control the border-color of elements alongside their border-width. Again, just a we-colorpicker widget in combination with the 'selectStyle' standard method. Note: this commit reviewed what the colorpalette palette widget notifies. This is not a cssColor and a 'isClass' flag to say if it is a css class or not. The colorpalette always returns a color string which can be the name of a color like 'alpha'. This is up to the caller to check if the color string is a css color or not with isCSSColor. In the case it is not, the related code can read the actual color by reading the related css variable. Part of https://github.com/odoo/odoo/pull/40282 In preparation of task-2122935 and other tasks
2019-11-28[IMP] web: update to fontawesome 4.7.0 to 5.11.2Kevin Baptiste
FontAwesome 5 introduced new names for some icons as described on https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes This commit replaces the old names to the new ones. closes odoo/odoo#35826 Taskid: 2050241 Related: odoo/enterprise#5180 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-18[IMP] web_editor, *: review 'colorPalette' editor UIqsm-odoo
*: website, mass_mailing Part of https://github.com/odoo/odoo/pull/38959 maintask-2066614 task-2087383 Co-authored-by: fja-odoo <fja@odoo.com>
2019-11-18[IMP] web_editor, website: generalize colorpickerfja-odoo
Currently we have: - a colorpicker for background color of snippets - a colorpicker for foreground and background text (topbar) - a colorpicker for menu/footer/navbar/etc These 3 are separate colorpickers with different options. After this Commit All 3 will use the same color palette wich allow you to select theme color, common colors, custom color and transparent filter. Part of https://github.com/odoo/odoo/pull/38959 maintask-2066614 task-2087383
2019-11-18[IMP] web_editor, *: introduce select & checkboxes for the left panel UIqsm-odoo
* website, website_blog, website_form, website_sale + introduce default UI for snippet options + refactor style of icon buttons Part of https://github.com/odoo/odoo/pull/38959 task-2066614
2019-11-18[REF] website, *: remove all snippet options UI iconsqsm-odoo
* web_editor, website_blog, mass_mailing In preparation of the new left panel UI, remove all snippet options UI icons as we do not want them anymore to simplify the UI. Part of https://github.com/odoo/odoo/pull/38959 task-2066614
2019-09-09[IMP] web: edit translations in new dialogVincent Schippefilt
Before this commit, translations were edited in a list view with a filter on the field that needed to be translated. After this commit, the translations for each fields are translated in a dedicated dialog. The changes done to the current language are taken into account immediately, both ways, from the dialog to the form and from the form to the dialog. Translating terms is also available in create mode, the user will be prompted to save before editing a translation Task ID: 2028152 closes odoo/odoo#36185 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-08-28[IMP] web_editor, *: introduce and restore new web_editor UIqsm-odoo
* mass_mailing, note, website, website_blog, website_form, website_mass_mailing, website_sale This commit, unfortunately, mixes three things: - Restoring as much as possible the scss organisation to allow styling the web_editor UI properly. - Fixing some bugs like a border around the page once the editor is loaded, no ability to scroll the snippets, etc - Introducing a whole new UI for snippet options: a left panel instead of the old dropdown & button overlay. Note: this commit also do some linting and ES6 convertion even though some of it has been done in the parent commit. Note 2: some elements that were removed are still styled in the POS apps but this is because part of a feature was removed while leaving dead code behind, this is handled in another PR which is to be merged (https://github.com/odoo/odoo/pull/36136). Part of https://github.com/odoo/odoo/pull/36068 task-1942370 closes odoo/odoo#36068 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-21[REF] web_editor: adapt wysiwyg tests to older summernote versionGorash
These modifications crystalize the behavior of the old editor, even if it makes less sense than the behavior of the saas-12.2 one. In some cases, the only reasonable adaptation we could do for 13.0 was to delete the tests, as these tests relied on mechanisms of the newer version of summernote introduced in saas-12.2 which cannot be easily replicated in the older version from 12.0 that we are reintroducing in this PR. It is sad to see these tests go, but we knew this was going to be something we would lose in reverting back to the older editor. That being said, since these tests were not present back in 12.0, we are simply back to the 12.0 state of things, not worse. Don't weep for them though, they will be back in Odoo 14. Part of PR 35677. Co-authored-by: Nicolas Bayet <nby@odoo.com> Co-authored-by: Antoine Guenet <age@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-21[REF] web_editor, website: adapt wysiwyg to 12.0 editorGorash
The wysiwyg abstraction layer was introduced in saas-12.2 by commit f2969923. Its goal was to provide an external interface for other modules that wanted to use the editor feature such that the editor core itself could be changed without requiring extensive changes in the other modules. This commit is adapting the wysiwyg interface to instantiate the 12.0 editor below it rather than the saas-12.2 one, thus reverting the "new editor" part of f2969923 itself. Part of PR 35677. Co-authored-by: Nicolas Bayet <nby@odoo.com> Co-authored-by: Antoine Guenet <age@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-14[MERGE] forward port branch saas-12.4 up to 98a55917a60Christophe Simonis
2019-08-08[MERGE] forward port branch saas-12.3 up to 752b2553c6fChristophe Simonis
2019-08-06[FIX] web_editor: remove virtual corrector/completion keyboard glitchGorash
For the ours need, we can not let the contentEditable behavior. Indeed, this one does not have the same behavior according to the browser. The DOM node could be erase, merge, cut, in them according to the keyboard interactions. The problem is that if we have to manage these behaviors, we have to manage everything. It was already the case in the previous version, however before we created an editor by zone and by a hack we mix the history. In the case of the virtual keyboard of some OS / Phone, the events are different and the autocompletion does not update (bug that prevents modification interactions with javascript). In order to solve these problems, we use another event for the insertion of the characters. However, we must also force the update of the corrector by forcing a blur and a focus. The current version is a temporary version. We are currently working on a version that uses a virtual dom and does not need to do excessive prevent default.
2019-07-22[MERGE] Forward port of saas-12.3 to saas-12.4 up to fe4caecb59dMartin Trigaux
closes odoo/odoo#35059 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-19[FIX] web_editor: momentarily comment the assertRomainLibert
Having an assert that randomly breaks is quite annoying, as this assert is not critical and breaks once every 100 - 120 builds. It can "safely" be commented out before being fixed closes odoo/odoo#35043 Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-07-16[MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c94551bMartin Trigaux
2019-07-16[MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7d34Martin Trigaux
closes odoo/odoo#34907 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-11[FIX] web_editor: properly insert character in empty nested listAntoine Guenet
Fix a bug that can be reproduced like so: - Insert list - Type char - ENTER - TAB - Type char The character gets inserted _after_ the `br` instead of replacing it. closes odoo/odoo#34805 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-06-19[FIX] web_editor, web_unsplash: fix nested divfja-odoo
The div that is replaced with the existing.attachments template was not the right target and kept nesting div into each other. The parent div of the existing.attachments now has the o_we_existing_attachments class (the target to be replaced by itself). Part of #33983
2019-06-06[MERGE] forward port branch saas-12.3 up to 409679866b2Christophe Simonis
2019-06-03[MERGE] forward port branch saas-12.2 up to 995aa1685eeChristophe Simonis
2019-06-05[REF] *: removes datas_fname from ir.attachmentThanh Dodeur
This commit removes the field `datas_fname` from `ir.attachment` as it was unnecessary and most of the time the duplicate of `name` or `url`. Task #1909865 closes odoo/odoo#32976 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-04[IMP] web, web_editor, *: add media image optimize dialogSébastien Theys
* = website, website_blog The goal is to give the user an opportunity to optimize his images before using them. For this we introduce a preview/configuration dialog after every image upload, where appropriate default values are filled for the quality and resolution, based on where the image is going to be used. Since this is not going to be perfect all the time, we still allow the user to configure them, and we display a preview to ease this process. Indeed it is important for SEO and for usability in general that the images are as light as possible in size. Technically the original image is uploaded and saved first, and then it can be optimized. This way the upload only happens once, and the preview can be computed from the already saved image. task-1930726 PR: #31208
2019-06-04[IMP] web_editor, *: improve media dialog attachment uploadSébastien Theys
* = web_unsplash, website Remove iframe upload and replace it with a proper RPC. The route is now only accepting one file at a time, which makes it easier to maintain, and allows to process the first file as soon as it is ready, instead of having to wait on everything. Also fix a bug where a document could not be uploaded because it would try to parse it as an image. Remove filter after search result from the JS and add the corresponding conditions in the domain to avoid processing and returning unnecessary records. If multiple attachments exist with the same URL, now display them all to avoid confusion. Compute all the necessary values in the python model instead of in the JS. Allow SVG in the widget (the server already accepted them before). Disable multiple image upload when not in multiImages mode. task-1930726 PR: #31208
2019-06-04[IMP] web_editor, *: improve file media widget views & selectionSébastien Theys
* = web_unsplash, website_blog Rename "image" to "attachment" when appropriate in FileWidget Improve image selection / highlight code (now based on attachment id) Improve image grid view: - Remove the row mechanism and replace it by a single loop over the images. - Take advantage of row wrap for a responsive display. - Uniformize the height (prevent tall images from moving down everything). - Load a miniature of the images when possible, remove the loading placeholder. This should significantly reduce the download size when opening the dialog, at the cost of CPU usage on the server. - Split the existing image view into one view for the loop and one view for the image itself. This way in a following commit we can reuse the image view when adding a new one, instead of having to render everything again. task-1930726 PR: #31208
2019-07-22[MERGE] Forward port of saas-12.4 to master up to aadc4a9f0be4Martin Trigaux
2019-07-16[MERGE] Forward port of saas-12.4 to master up to beba36416fdf2Martin Trigaux
closes odoo/odoo#34924 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15[IMP] uom: Remove parentheses on uom namesYannick Tivisse
Purpose ======= Parentheses in the label of units of measure sometimes make reading needlessly uncomfortable. Specification ============= Remove parentheses in the name of every standard uom.uom and hardcoded occurence on views/field names. TaskID: 2030444 closes odoo/odoo#34492 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-06[MERGE] forward port branch saas-12.2 up to 78b3b650b0dChristophe Simonis
2019-04-19[FIX] web_editor: disable tooltips in keyboard tests and on option offAntoine Guenet
The link and media tooltips were not taking Summernote's `tooltip` option into account. That option ensures that tooltips are disabled if the option is off (which is for instance the case on mobile). This fix ensures that these tooltips are disabled when the option is set to `false`. It also disables tooltips in the keyboard tests. They are not relevant to the keyboard tests and occasionally caused the DOM to not be properly cleaned after the tests were run (most likely due to their 2000ms `setTimeout`).
2019-05-13[FIX] web_editor: indent multiple lines at a time with editable as parentGorash
2019-04-30[FIX] web_editor: properly unformat text at the start of the DOMAntoine Guenet
When trying to remove a format (bold, italic, underline), collapsed at the start of the DOM, an error occurred because of a wrong range. Ex.: `<p><b>Odoo</b></p>` -> when clicking before the word "Odoo", then clicking the "bold" button, we expect to be able to start writing in plain (not bold) text (for that, the DOM has to look like this: `<p>\u200B<b>Odoo</b></p>`). We now have that proper behavior without the accompanying error message and loss of selection. Task ID: 1978515 closes odoo/odoo#33038 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>