summaryrefslogtreecommitdiff
path: root/addons/web_tour/static/src
AgeCommit message (Collapse)Author
2019-04-05[IMP] web_tour: add a startTour helper on odooChristophe Monniez
As a start_tour helper was added on the python side (PR #32316), a javascript helper counterpart was needed as suggested on the PR. closes odoo/odoo#32441 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-03-06[REF] web_tour: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-19[IMP] tests: replace browser_js success and failure stringsChristophe Monniez
When evaluating js tests using the browser_js method, they are considered a success when 'ok' is found in the console log and a failure if 'error' is found instead. This is not very robust and recently failed with this commit : 7410de111fe It adds a filter named 'Error' in a view, when the 'click_all' test clicks on this filter, a message with the name of the filter is written in the console, wrongly leading to a test failure. With this commit, the browser_js method expects a log message in the browser console with the explicit text "test successful". On the other hand, any error in the console log will lead to a test failure but a test can be forced to fail with the explicit error message in the browser console "test failed". As a bonus, the python logger should now also log browser js trace messages. closes odoo/odoo#31158
2019-02-15[FIX] web_tour: consume step on clickAaron Bohy
Before this rev., steps were consumed on 'mousedown' events. This caused an issue with the RainbowMan displayed at the end of tours (which closes itself on 'click' events outside its $el). Here is what occured when the user clicked on the last step's element: - 'mouseenter' event triggered - current step consumed, as well as the tour, and a RainbowMan is instantiated and appended to the DOM - 'click' event triggered - RainbowMan closes itself because of that 'click' event closes odoo/odoo#31148
2019-01-28[MERGE] forward port branch saas-12.1 up to d3b8422c9c4Christophe Simonis
closes odoo/odoo#30614
2019-01-18[MERGE] forward port branch 12.0 up to f854e01a983Christophe Simonis
2019-01-17[FIX] web_tour: ensure Tip template is loadedqsm-odoo
The 500 page has `session.is_frontend === undefined` as it has its own whole HTML template. In that case, the ajax.loadXML is not done, making the tour crash when visiting a 500 error page. This is needed for #29957 that has a test tour on 500 error page. closes odoo/odoo#30240
2019-01-09[MERGE] forward port branch 12.0 up to 3e4138deaa2Christophe Simonis
closes odoo/odoo#30045
2019-01-14[FIX] web_tour: clear call stack between each stepAaron Bohy
This rev. concerns automatic executions of tours. It makes each step executed in a setTimeout, thus ensuring that the call stack has been emptied before executing the next step (which is the case when the user manually executes the flow).
2019-01-14[FIX] web_tour: remove delay in test modeAaron Bohy
For historical reasons, the tour manager executed each step of tour in a setTimeout (10ms). When a step could be executed (i.e. when its trigger selector has a match in the DOM), the element matching its trigger was saved as a jQuery element (the $anchor), and in the setTimeout, the action (e.g. click) was performed on that element. However, it could happen that, after the delay, the $anchor was no longer in the DOM, either because 1) the tip selector had no match anymore, meaning that the element had been removed from the DOM meanwhile 2) the tip selector still had a match in the DOM, but that element had been rerendered meanwhile Case 2) occured sometimes when the main_flow_tour was executed in community, when trying to open a Manufacturing Order after having reloaded the Manufacturing Order list view (because the row of the order to open that was saved as $anchor was the one of the list before the reload, and that list was re-rendered during the delay). This rev. removes the default delay of 10ms, but the feature is kept such that one can still manually run a tour slowly (e.g. to debug or to make a demo).
2018-12-18[IMP] web_tour: allow simulating click without leaveSébastien Theys
This is important if the mouse must stay on the element after it has been clicked. This is the case for the product image zoom, which will be tested in the following commit.
2019-01-17[ADD] web_editor,*: Tests for new structure of web editorAntoine Guenet
The refactoring also had to be done in order to create a set of unit tests. Each behavior can be tested, including the behaviors performed as a consequence of keyboard interactions (for instance: Enter, Tab...). This commit also contains some changes to test_utils that were necessary given the new structure of the wysiwyg editor. Co-authored-by: Gorash <chm@odoo.com>
2018-11-21[IMP] web_tour: better logs in case of failureChristophe Monniez
With this commit, a failing tour will display more information in the logs, which may be useful for debugging purpose. - display full html instead of just the content of body - display the 'content' flag of the step, which is very useful to see which step failed closes odoo/odoo#28863
2018-10-26[FIX] web_tour: only allow one active tip at onceGéry Debongnie
Before this commit, the code for the tour system was kind of naive and simply activated tips for each tour. This was not really an issue, since most user install one app at a time, so they had the time to follow a tour, and when they install the next app, it is no longer active. However, since we activated the multi-app feature in our website, it now happens that multiple apps are installed at once. Because of this, this commit is now necessary. closes odoo/odoo#28178
2018-10-23[FIX] web_tour: tooltip message over document viewerNicolas Lempereur
Currently: - normal modals have a z-index of 1050 ($zindex-modal) - chat window have a z-index of 1051 ($zindex-model + 1 == $o-mail-thread-window-zindex) - document viewer modal have a z-index of 1052 ($o-mail-thread-window-zindex + 1) - tour tooltip ball and messages have a z-index of 1051 ($zindex-modal) A tooltip ball is in the DOM next to the element that is pointed out, so if the element is inside a document viewer modal we see the ball. But a tooltip message is positioned inside the body, so if we hover a ball inside the document viewer modal, the tooltip message is behind the modal. In this commit, we set tooltip to bootstrap $zindex-tooltip value (1070 a of now). opw-1893035 closes #27928
2018-10-23[FIX] web: do not block tour with blockUIMartin Geubelle
A previous rev. odoo/odoo@2672143 has prevented a tip to be consumed in automated tours when blockUI was displayed. This condition is not exactly correct. A blockUI element can be displayed on any node, not only the webclient (which is the case when calling `framework.blockUI`. This is the use case we want to deal, not the others. So the tip cannot be consumed only with `o_ui_blocked` now. closes odoo/odoo#28060
2018-09-20[FIX] web_tour: drag&drop trigger a mouseenter event before beginning the dragVincent Schippefilt
2018-09-18[FIX] *: adapt calls to _is_superuserAaron Bohy
Rev. 2f7c03d added a second admin user (id 2), the 'human' one, on top of the 'technical' one (id 1, also known as the superuser). Basically, all calls to _is_superuser() should have been changed to _is_admin(). They weren't. As a consequence, some features that were previously available for the admin weren't anymore (e.g. tours). This rev. replaces all calls to _is_superuser() by calls to _is_admin().
2018-09-17[FIX] web_tour: place tooltip above dropdown-menuAlexandre Kühn
Before this commit, a tip on a dropdown menu item was visible. This is due to the positioning of the tip, which was on the dropdown-menu (because it has overflow `auto`). The tip was appended on the dropdown-menu, and may overflow as a result. This commit handles specifically the case of dropdown-menu, so that dropdown-menu is never a candidate for the placement of the tip.
2018-09-17[FIX] *: adapt tours for the new community navbarAlexandre Kühn
*: crm, hr_expense, hr_recruitment, point_of_sale, project, sale, stock, web_tour, test_main_flows, test_new_api To sum up: - Click on "Apps Menu" then the app item. (previously: click on '+' then the app item). - Click on navbar section menu item. (previously: click on sidebar section menu item).
2018-08-30[FIX] tests, web_tour: improve js error display in build detailsXavierDo
Since chrome headless has been merged, js error messages are difficult to read: some information was missing or only displayed in full all log. All console.error() will now be displayed in build details, and will appear just before the python assertion. XMO's improvement will also be used on all log: Using module and classname of the class calling phantomJS. Also: some small improvements on error messages to make them easier to read Note: this commit also shown that some error were not detected: now we will fail in any case if js log an error.
2018-08-13[IMP] web, web_tour: handle iframe in tests and tourMartin Geubelle
In both test util functions (`dragAndDrop`) and tours, using elements in iframe was not supported. As a jQuery selector won't work with an iframe, when using a selector like `div.o_my_class iframe p:first` the tour manager will split the selector, which will result to `$('div.o_my_class iframe').contents().find('p:first')`.
2018-08-10[REF] *: add support for RTL languagesMartin Trigaux
מזל טוב The direction parameter will now have a real impact on the web interface and completly switch the direction of the interface. Add the dependency rtlcss to switch the direction with a css postprocessor. Two different assets will be generated for ltr or rtl /web/content/<...>/web.assets_backend.0.css and /web/content/<...>/rtl/web.assets_backend.0.css to be able to differentiate it easily Adapt the css and views to be easier to switch direction Render graph as it is, do not move y-axis right side, as per mathematical rule value goes left from origin are considered negative, so keep graph as it is for right to left language add test cases for language direction specific assets bundle if language direction is rtl then we also store css files in assets bundle now we store two assets bundle, one for ltr and one for rtl language direction test two assets bundles generated, also test two assets bundle generated for en_US and ar_SY
2018-07-27[REF] web, *: share and adapt code for auto "more" buttons for navbarsqsm-odoo
* portal, web_tour, website, base Before this commit, there were 3 different implementations for the same feature: the "more" button in the community navbar, the "+" button for the website menu and the "+" button in the enterprise navbar. As those implementation were now broken with BS4, it was a good time to share the code of those 3 features.
2018-07-27[REF] *: BS4, adapt tables (and list view)qsm-odoo
`table-condensed` -> `table-sm` Also SCSS variables were renamed. Also restore list view design.
2018-07-27[REF] *: BS4, review color systemqsm-odoo
Odoo used to declare two main colors: primary and optional (which are purple and turquoise in enterprise). Those were respectively assigned to the 'primary' bootstrap variable and the 'btn-primary' bootstrap variable. BS4, however, does not allow to have a different primary color for buttons. Instead, the 'primary' color is used for all 'primary' related components and utility classes, same as for all other colors. So, if we want to keep our enterprise buttons green, our 'optional' colors had to become our 'primary' color. The old odoo primary is then renamed to the 'odoo' color. The palette of grays is now larger by default and is numbered from 100 to 900 alongside the $black and $white variables. The equivalence for older variables and the way we used them is: $gray-darker -> gray 900 (unused before) $gray-dark -> gray 900 $gray -> gray 700 $gray-light -> gray 600 $gray-lighter-darker -> gray 400 (the old variable was created by us) $gray-lighter-dark -> gray 300 (the old variable was created by us) $gray-lighter -> gray 200 Fortunately, the 'lighter' variations we created fit well in the default BS4 system ! Unfortunately, our $gray-lighter which carried the same function as $gray-200 (see above) is very close to the new default $gray-100 and quite distant from the new $gray-200. This will be handled in the next commit.
2018-07-27[REF] *: BS4, adapt dropdowns and caretsqsm-odoo
- The dropdown structure was simplified, allowing to get rid of the 3-levels structure induced by <ul/> elements and dropdowns can now contain anything. The class 'dropdown-item' is now mandatory for each dropdown clickable element. The class 'dropdown-item-text' can be used to add same padding and style but without making the element have a clickable look. - Dividers now use the class 'dropdown-divider' - The way dropdowns are opened and hidden also changed (before the 'open' class was added on the `.dropdown-menu` parent, now the 'show' class is added on both the `.dropdown-menu` parent and the `.dropdown-menu` itself). - JS-wise, no click event handlers can be put on `.dropdown-toggle` elements anymore (instead, use handlers for dropdown events). - Carets are automatically put on `.dropdown-toggle` elements, so this commit replaces the `.caret` elements with this. This feature was possible to disable but would prevent us from adding a caret with scss. Also, this simplifies the DOM. The 'o-no-caret' class was also introduced to allow using the 'dropdown-toggle' class on non-caret elements. - Also adapt the scss to use $caret-width instead of $caret-width-base
2018-07-27[REF] *: BS4, remove the use of btn-smqsm-odoo
Odoo made the bad choice of using the 'btn-sm' class for every button instead of configuring the padding for default 'btn' to be smaller. In BS4, the style of btn-sm is actually more complex, lowering the font-size too. Also, btn-xs was removed so we would not have the possibility to display smaller button than our default ones. This commit removes btn-sm wherever it was used. Unfortunately, this might remove it at some places where it made sense but this can be restored in a second time.
2018-07-27[REF] *: get rid of vendor prefixesqsm-odoo
BS4 do not provide vendor prefixes scss mixins anymore as it is meant to be used with the 'autoprefixer' library. As we only support the last version of every major browsers in Odoo, we took the decision to not use the library as it was also complex to integrate in Odoo. We decided to do the library's work by hand if it ever become necessary.
2018-07-10[IMP] web_tour: allow simulating double-click and triple-clickqsm-odoo
2018-07-09[FIX] *: fix some side-effects of ↵qsm-odoo
https://github.com/odoo/odoo/commit/9de1bc0eef6f5bfaa2a8d745431caa361ae91548 - JS Modals were not correctly built anymore, their .modal-body element was duplicated and many without-effect JS lines were introduced (as a side effect, the form view design was broken when inside modals) - Tests were changed to make bugs go unnoticed. For example, the media dialog functionnality was entirely broken because the .modal-dialog element was not receiving the correct class anymore. - The JS translation function is _t, not _ - Do not use the <title/> tag as a regular DOM element, it is meant to be unique, in the <head/> section - CSS rules were added to the utils.scss file, which is meant to contain functions and mixins, otherwise, the rule is duplicated in every asset - Some icons were still broken, as missed by https://github.com/odoo/odoo/commit/f90cf060a3cfeb37a67bec83264c0aaab8892b56 - Tests were changed to use [role="dialog"]/footer/header in their selectors without any reason, this commit restores some of that to avoid rebase conflicts with the BS4 work. - ... Note: other elements should still be discussed, like the direct use of the 'o_form_label' class in views definition... but those do not cause direct problems.
2018-06-22[IMP] Improve compatibility with screen readers (accessibility) (#24574)kujiu
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable. This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader. * [IMP] Labels must have a for attribute. Improve accessibility. * [IMP] Better error message when trying to read a missing cached value * [FIX] Add some aria-label and title attributes for screen readers. * [FIX] Template name is not included in the error message in case of SyntaxError in QWeb * [FIX] Improve the Tour failed at step error message to be more explicit. * [IMP] Add aria-labels * [FIX] Add missing aria-label on failing test * [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all. * [IMP] Color names on kanban views and many2many tags * [IMP] Add some checks on views for accessibility. * [IMP] Add `alt` attribute on `img` tags. * [IMP] Add aria-label and title on non-described icons * [IMP] Add button role to widgets with btn class * [IMP] Translate aria and formatted attributes. * [IMP] Remove wrong aria-labelledby * [IMP] Add menu role on dropdowns * [IMP] Buttons must be focusable * [IMP] Add aria attributes on progress bars * [IMP] Improve accessibility of basic widgets * [IMP] Change main layout to more semantic tags * [IMP] Add menuitem role when missing * [IMP] Remove wrong role='presentation' * [IMP] Improve accessibility of tab panels * [IMP] Add aria-invalid on invalid fields * [IMP] Add aria-sort on ordered columns * [IMP] Add role on alerts * [IMP] Use dialog role, header, main and footer tags for modals * [IMP] Add labels on o_status * [IMP] Improve accessibility of kanban view with feeds and articles * [IMP] Add alerts in case of new messages * [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-11[FIX] web_tour: properly adapt to 9c262fe6f8ca8b47d97d42b4b4b0bcb9229654a7Simon Lejeune
2018-06-11[REF] web_tour: allows to include RunningTourActionHelperArnaud Baes
Moves this class in an Odoo module so that other addons are able to require and include the class in order to add different helpers. This will be usefil in the `stock_barcode` module that will add a `scan` helper.
2018-04-23[IMP] crm: Improve tour labelsMitali Patel
Task Id: 1827293
2018-04-18[REF] *: review scss variables handlingqsm-odoo
Unlike LESS, SCSS variables are not lazy loaded. Our system has thus to be updated. This commit creates new templates which are t-called in assets bundles (to replace the old less_helpers template): - web._assets_utils: regroups the mixins and functions which *can* (and so should) be available in every asset bundle - web._assets_primary_variables: regroups the variables (or mixins used as variables) which *can* (and so should) be available in every asset bundle - web._assets_secondary_variables: same as above but provides an environnement where all the 'primary' ones are accessible. This is for example useful to handle the community/enterprise split: // Community primary variables $o-pink-color: pink; // enterprise color $o-brand-primary: blue; // Enterprise primary variables $o-brand-primary: $o-pink-color; // Community secondary variables $o-my-darker-primary: darken($o-brand-primary, 5%); => If there was only one variable template, enterprise edition would have been able to define its primary color at the end but the darker primary would not have been updated. Using the "!default" system and putting enterprise definition above would not have solved the problem as the $o-pink-color would not have been accessible. - web._assets_backend_helpers: regroups the variables, mixins and functions which *can* (and so should) be available in the backend asset bundle only. This is especially (only?) useful for bootstrap variables overriddes. - web._assets_frontend_helpers: regroups the variables, mixins and functions which *can* (and so should) be available in the frontend asset bundle only. This is especially (only?) useful for bootstrap variables overriddes. Note: bootstrap variables are not accessible in any of those anymore. If you have variables that should depend on bootstrap, you have 3 solutions: - Find another way: your variable is probably useless, use bootstrap variables directly or create a variable that will influence the value of bootstrap variables. E.g. instead of declaring: `$myvar: $bootstrapvar * 3` and using $myvar alone, declare: `$myvar: 3` and use `$myvar * $bootstrapvar` where needed. - Declare a copy of the bootstrap variable and use that one. In that case, you should also force-set the real bootstrap one to be sure they match (this should be done in appropriate templates mentioned above). E.g. ``` $o-boostrapvar: 5; ... $boostrapvar: $o-bootstrapvar; ``` - Set your variable to null and set it to your bootstrap expression in the file you will need it (where bootstrap variables are accessible) without forgetting to add the !default flag to allow overriddes. ``` $myvar: null; ... $myvar: $bootstrapvar * 5 !default; ``` This commit also partly changes the variable names to follow the convention: $o-<app_id>-<name> where 'app_id' is the current's app name or a meaningful unique identifier ("theme" for all themes for example, as no multiple themes can be installed).
2018-04-18[REF] *: convert less content to scss contentqsm-odoo
Convert content so that the assets compile on app installation. The style is still broken after this as the variables/mixins/... are not defined in the right order (as it did not matter in LESS but does in SCSS). This commit basically changes: - Variables: @​var_hello -> $var-hello - Mixins: .mixin_world() {} -> @​mixin mixin-world {} - Classes used as mixin: .my_class() -> @​extend .my_class - Here there were no other solution than to convert the use of a mixin call by the use of an extend as a first approximation - LESS functions -> SCSS functions (e.g. fade -> rgba) - Move first variable definition before the variable is used - Still need to make sure last variable definition is at the right place
2018-04-18[REF] *: rename all LESS files to SCSSqsm-odoo
This is a simple renaming without adaptation.
2018-02-12[FIX] mail,web,*: Cleaning some JS codeAlexandre Kühn
- Whitespace trailing - Split long lines - Replace some 'self' to 'this' - Improved some JS docs - DRY in tests using services
2018-02-12[FIX] web{_site,_editor}: transparent root instance 'root widget'Alexandre Kühn
With this commit, any component that needs an instance of the root widget can simply require the module 'root.widget'. Based on the context (backend, frontend, iframe), the real root.widget will resolve to either the webclient, the website root instance, or the iframe root instance. This is desirable in order for the tour_manager to become a child of the root widget, as tours are enabled in any of the above contexts. This commit is a requirement in order to solve an issue with JS services, in which there should be only one service provider at any given time.
2018-02-01[REF][IMP] *: mail js refactoringAaron Bohy
This commit improves the JS code of the mail module, which comes maily from the new coding guidelines and the addition of "JS services". JS services are important objects that do not fit well in the component tree, such as chat_manager or ajax. The benefits of JS services are improved readability of the code, reduced coupling, and more testable modules. In particular, discuss was hard to Summary of the changes: - ClientAction has been renamed into Discuss - Clear instantiation of chatManager - New coding guidelines in most mail modules - JS Services can interact with each other - Chat Manager and Window Manager are services - Window Manager renamed to Chat Window Manager - bus.bus is now encapsulated in Bus Service (a service) - The test infrastructure has been tweaked with JS Services - Chat Mixin has been removed A future improvement would be to translate some 'trigger' into 'trigger_up'.
2018-01-26[IMP] web,*: config: add XXS size to config.deviceAaron Bohy
In Less, the size_class XXS is defined and used in media queries. This rev. adds it in JS for sake of consistency. Code in addons comparing the size_class needed to be adapted due to the new XXS size_class. Moreover, we now use the helper 'config.device.isMobile' everywhere we should, instead of manually comparing the size_class. Finally, we changed the way the config.device has to be specified in the test environment. From now on, only the size_class should be set, and the isMobile flag is computed automatically.
2018-01-16[REF] account,web(_tour): close rainbowman on clickAaron Bohy
This rev. makes the Rainbowman stop listening to event 'clear_uncommitted_changes' on core.bus, as this event is about to be removed (in a next commit). It was using it to destroy itself when such an event was triggered (basically, when the current view was left). Instead, we removed the option 'click_close' as, when set to true, which was the default, the rainbowman was destroyed as soon as the user clicked outside the raibowman.
2018-01-16[IMP] web_tour: close tip on click on touch devicesPrakash Prajapati
Task #34856
2018-01-12[MERGE] forward port branch saas-11.1 up to 56974322f8cChristophe Simonis
2018-01-12[MERGE] forward port branch 11.0 up to 3b80a059ff4Christophe Simonis
2018-01-10[FIX] doc: informal sub-paramsXavier Morel
Revert 6cb12273e2c1e1385098e38880317ae162dc902e which reverted 08d48b0fff0938e7ac004767dddfab13d3cff30b. Issue was the support for sub-parameters (aka @param {type} foo.bar) where the "parent" parameter was not formal (only present in a function's docstring, but not in the function's parameters list), subtype creation would fail to find a root parameter to attach the sub-parameter to. This has not actually been fixed, but for the specific case where the formal parameters list is *completely empty* we fall back on a list of the docstring's parameters, which works well enough for this case.
2018-01-03[MERGE] forward port branch saas-11.1 up to 726b91b9fbcChristophe Simonis
2018-01-03[MERGE] forward port branch 11.0 up to fe22a0f9ca9Christophe Simonis
2017-12-22[FIX[ web_tour: simplify docstringMartin Trigaux
Changed at 08d48b0ff but was crashing when building the documentation as not complient for sphinx Temporary fix that should be restored when our doc engine will be smarter