Commit Graph
362 Commits
Author SHA1 Message Date
Antoine Guenet 6ce790612c [FIX] mass_mailing, web_tour: skip a unsuitable parent for the tour tip
This makes it possible to declare an element unsuitable as parent of the
tour tip via the "o_forbidden_tooltip_parent" class.
We then apply this class to the "o_we_customize_panel" of mass_mailing's
snippets menu so the tip is applied to its parent like in saas-14.2.
Without that, the tip is hidden by the body of the mail. The reason it
was positioned in the parent in saas-14.2 is that the theme selector
wasn't in the customize panel but positioned absolutely above it.
This is an ad-hoc fix to something of an ad-hoc situation, given the
relative weirdness of the html environment (the snippets menu is in the
padding of the body of an iframe).

closes odoo/odoo#69876

X-original-commit: 58d5af5df81926af1a5715dd57f6b5c3b40b1e16
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 06:29:20 +00:00
740168ce8d [REF] web_editor, website_*, mass_mailing: adapt to Odoo Editor
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 16:01:06 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Julien MougenotandSimon Genin e0efbb08a4 [IMP] web_tour: add tour 'disabled' option
This commit changes the way tours are automatically disabled when in
demo data.

Previously, an override of the assets_common template was applied by a
file loaded in the web_tour demo data, ensuring that the tours are
disabled when demo data are loaded in the database.

Now, a "tour_disable" boolean will be given to the session_info object
to determine whether the tour manager must be disabled, meaning that it
will automatically consume all registered tours.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Géry Debongnie dc02ff520b [FIX] web_tour: make tour system more resilient
The tour system is based on many assumptions, some of those not being
true all the time.  In practice, it works most of the time, but when
some slight changes occurs, we may observe undeterministic behavior.
This was actually the case in a dev branch working on assets: the order
of some files was changed, and it caused crashes in various tours.

This helped us identify two issues in the Tip class:

- the Tip class may be destroyed before it is completely started (so,
  the destroy method should not assume that the code in start was called
- the attach_to method should not resolve if the tip was destroyed
meanwhile.  This is critical, because some code uses that promise to act
on the widget.

This commit fixes both of these issues.

closes odoo/odoo#67896

X-original-commit: b88b634a0363a55411290e54e37806cfec1b2de5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-03-15 17:35:17 +00:00
Benoit Socias a62745d78a [FIX] web_tour: display the full text of tour tip steps
Before this commit the dimensions of the tour tip text obtained from
the text content was forced onto the complete active tooltip, sometimes
hiding a part of the text because the complete tooltip had additional
borders that prevent the text from using the same space as during the
measurement.

After this commit the dimensions of the tour tip text is computed by
taking the measure on the full tip by temporarily switching it to the
text display during initialization.

task-2391201

closes odoo/odoo#64771

X-original-commit: 8bd038c74c2e3b89b78e54385e5a2380fa1b54b7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-19 19:08:39 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

New solutions are being investigated in master. For the moment, it seems
better to remove Jabberwock to unlock difficult forward-port between
14.0 and 14.1/master, until we decide what to do once and for all in
a later master. We may un-revert this later but that would be way easier
than reverting Jabberwock in a few months.

This was done as safely as possible by removing any commit related to
Jabberwock, then resolving conflicts, then reforcing commits from 14.0
that were hugely adapted for 14.1/master, then forcing the whole diff
over a rebased 14.1/master. The only possible miss (other than me making
a mistake) would be commits that were not forward-ported to 14.1 thanks
to Jabberwock handling the issue on its own (I know we had such commits
in website, which I manually included in this revert, see below).

For reference:

Commits which were reforced to their 14.0 version:
- https://github.com/odoo/odoo/commit/1a916fc2362c0b006460d94a219366ade1cce058
- https://github.com/odoo/odoo/commit/fd9e58a675bb7ec1bf97cb77b21b3c65369d51fe
- https://github.com/odoo/odoo/commit/bdfddace29b16404c06a7ebfc0cc242463a0e768
- https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
- https://github.com/odoo/odoo/commit/710784da1f02d45cbe898da426ba7e2ac63dc711
- https://github.com/odoo/odoo/commit/597585c9b8b1350bcfd84e8433ea6c82060bcc3d
- https://github.com/odoo/odoo/commit/333a9124608ff655bd9ad5e63044a5cb7ef9c636

Commits that were not forward-ported to 14.1/master and now are:
- https://github.com/odoo/odoo/commit/55ff2d971b672dec5f103215be39101c88856b6c
- https://github.com/odoo/odoo/commit/ebbb3de1e5f363689a5ba1647bb4c26416e42d5b

+ Adapt this forward-port: https://github.com/odoo/odoo/pull/60976 (as
  it was simplified for non-stable master version relying to the
  Jabberwock implementation and now needed to be adapted to the
  summernote implementation).
  See `!$el.data('oe-expression') && $el.data('oe-xpath')`

+ Revert https://github.com/odoo/odoo/pull/60477 and reforce original
  14.0 fix https://github.com/odoo/odoo/commit/746bf53b4aecfc601f0581a948d7cb7153812c82

Note: this also means that any good refactoring that was done by the
Jabberwock-related commits is lost for now. Once the revert reaches
master, I'll try and restore what we want from those commits. Here
are their references (but obviously they have the opposite conflicts
than those resolved during this revert):

e766842a92b6 [REM] web_editor,website: empty summernote files
08c94c986e09 [REF] web_editor,web: adapt to new jabberwock editor
1546c1b74713 [REF] mass_mailing: adapt to new jabberwock editor
fd0b963c6028 [REF] website: adapt to new jabberwock editor
0113d05c6c94 [ADD] web_editor: add new Jabberwock editor lib
d0c88a396493 [FIX] web_editor: don't change background color out of the website editor
d52d3d67d4e1 [FIX] web_editor : better icon in text style dropdown
61cb2f0d21da [FIX] web_editor: should not ask if want to leave the page twice
c42012b863b5 [FIX] web_editor: trigger a resize when use the mobile preview
d934d05d6e39 [FIX] web_editor: need to build the snippet before commit it into vDom
495bea924745 [FIX] web_editor: remove box shadow on the #wrap container
bffb5612e689 [ADD] field_html: add resizer in most field_html
f3c94e40cccf [IMP] web_editor: update Jabberwock library to commit 41e4063
cc87dea3ef32 [FIX] web_editor: update header change position to work with JW
5d9b25f66704 [FIX] web_editor: do not insert chars around step icon on click
70d3f0e4630c [IMP] web_editor: update Jabberwock library to commit 0bd94881
a57f13891f82 [FIX] web_editor: open media modal in appropriate tab on dblclick media
5b7537397e08 [IMP] web_editor: update Jabberwock library to commit a7ba7c34
a8d7ec235eeb [FIX] web_editor: adapt iframe Qunit test to new editor
5f794eac7209 [FIX] mass_mailing: hide all panels on show themes
551d45641d19 [IMP] website: remove unused reference
10580e1c102f [IMP] wesbite: add comment in tour
c17049f6b764 [FIX] web_editor: Fix description toggle in pricelist snippet
18a428e854b1 [IMP] web_editor: update Jabberwock library to commit 43a10003
58a161c645a5 [REF] web_editor, website: use editor helper setClass
62dd0bd3bc66 [FIX] web_editor: properly deactivate snippets and reactivate the last
99eebcaa34cb [FIX] web_editor: disable snippet in preview mode on mouse leave options
a84216932958 [FIX] web_editor: fix the image gallery snippet
f8dd4ea3e7d5 [FIX] web_editor: fix shadow selector for Safari
e50a4f3a16de [IMP] web_editor: update Jabberwock library to commit de13ed7e
4a2718f7a5ba [FIX] web_editor: ensure dom is properly cleaned at end of save test
03684c004a4e [FIX] website: ensure reset of bg-image on add bg-video
d63397159708 [FIX] web_editor: fix image remove from images wall
82fa5142f1a5 [IMP] note: restyle note without sheet or resizer
8b9f1ce603d5 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
fc2183b66305 [FIX] web_editor: image overlay did not update with changes
cd0d2f5791cd [FIX] web_editor: add color preview to color picker
28a168172454 [FIX] web_editor: restore removal of spinner
67c90dd3b946 [FIX] website_forum: properly initialize editor
920dfe2a430a [FIX] website_forum: better css in the JW toolbar
43f33fd651af [IMP] web_editor: update Jabberwock library to commit 6853b60
71246c92f8de [FIX] Web_editor: table options button should be inside the toolbar
12b9e5916692 [FIX] web_editor: properly update the image options on replace image
e889cf8583da [FIX] website, website_sale: properly save filter id of dynamic snippets
e0fd11e36e45 [IMP] web_editor: update Jabberwock library to commit 4b2c903b
8f2b7ba35614 [FIX] web_editor: properly stop snippet option changed event propagation
a30c2c4105c7 [FIX] website: fix megamenu snippet editor behavior
312091cf822b [FIX] web_editor: fix overlay that is not reappearing
9f1d03dda613 [FIX] web_editor: table picker not fully displayed
814ddada6124 [IMP] web_editor: remove message before leaving page if editor is destro
4f38e26af7da [FIX] web: allow saving copyright footer
01e947b6123b [FIX] web_editor: only save translations that changed
103676072c50 [FIX] web_editor: prevent traceback on open crop dialog
5844ff66d4a0 [FIX] web_editor: apply image crop in jw on save dialog
1b435652e4a0 [FIX] website_forum: ensure media modal opens on click button
4f4a6ca0b8ac [FIX] web_editor: ensure valid default html value
51e22026ac7b [IMP] web_editor: update Jabberwock library to commit ab1184f8
2413fa19be0e [FIX] web_editor: Qunit test properly wait for editor stop
aa89e1ea3e97 [FIX] web_editor: properly save view blocks with an id
e2e90b53992e [FIX] web_editor: ensure language selector is non editable
0efd72089d5c [IMP] web_editor: clean useless lines
f54dfc7631f9 [IMP] web_editor: remove useless comment
3995ab1b84f2 [IMP] web_editor: update Jabberwock library to commit b8d73691
0834b1e5740a [IMP] web_editor: withDomMutations
f1459fb7b45c [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
6e8acc6c8cc7 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
18a0c95d51cb [FIX] website, web_editor: #wrapwrap in body
4686a92e742c [FIX] website_form: allow edition of success message
78cc4da075cc [FIX] web_editor: allow edition of branded nodes only
bcffa7353448 [FIX] web: dialog should not use field value footer items
67ff56e14746 [FIX] web_editor,website_mass_mailing: display the popup preview
3cb9bea50c20 [IMP] web_editor: update Jabberwock library to commit a20492ea
518f03e6f1c9 [FIX] web_editor: use withIntangibles to find ZoneNode
d0ad6a568f49 [FIX] website: move sidebar out of theme
d690f5da13ea [FIX] website: properly save popup id
43b3433df3e6 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
4ee8f4dedc30 [FIX] web_editor: prevent deadlock when removing child snippet of popup
850be198ef6d [FIX] web_editor: prevent traceback on reposition background image
4c3eaba41f5d [FIX] mass_mailing: adapt tour to the new editor design.
496d3ea272ed [FIX] web_editor: properly position sidebar scrollbar
5be4de703074 [FIX] web_editor: Show the toolbar when select the text in forum edition

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
fw-bot 337434428e Cherry pick of 361eac12074e480d26c23d6f2eba704a18515f2d failed
stdout:

stderr:

Error: could not apply 361eac12074... [IMP] website, web_tour: have steps to select shape or color
Hint: after resolving the conflicts, mark the corrected paths
Hint: with 'git add <paths>' or 'git rm <paths>'
Hint: and commit the result with 'git commit'
X-original-commit: 94540d5bbac97f59f24fb0f2d644c571640e8cbc
2020-12-17 16:55:29 +00:00
Aurélien Warnon 431ac269a2 [FIX] web_tour: prevent kanban quick create closing when tooltip is clicked
Currently, when the user is using the quick create card of the kanban view, the
card will automatically close itself if the user clicks on a tooltip element
from a tour.

This can lead to bad user experience since the tour tip can be visually
*within* the quick create card, and the user will not understand why the card
is closing.

More importantly, the tooltip element "zone" is bigger that what it visually
looks like and you may click on an element (a field, ...) that seems to be
perfectly within the quick create card but is in fact part of the tooltip.

This commit fixes that behavior by preventing the click event propagation in
the tip widget handler.

The fix is made in version 14.0 because this is especially problematic for the
tour of the "CRM" app, that heavily uses the quick create card in combination
with tour tips.

Task 2388450

closes odoo/odoo#62175

X-original-commit: 48d30e1375cc25fd430cdcb53e9b849be295ac26
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-11-23 12:29:51 +00:00
qsm-odoo dfa043feb3 [FIX] web_tour: better point at the anchor element
Before this commit, tips were bouncing from 6px from the anchor to 0px
from the anchor. Now they bounce from 3px from the anchor to 3px
inside the anchor.

closes odoo/odoo#62122

X-original-commit: 34f2303327e8f2b9b7e95bc33c6246d52a633dc1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-20 17:42:28 +00:00
YOGRAJ TANDEL 642bce457c [FIX] web_tour: fix issue of droplet animation follow the wrong button
Currently, when signing the document during the tour,
the droplet animation don't follow correctly the button.

So in this commit, due to timeout/Aniamation there is lag on scroll
so need to change 50 to 0.1, now droplet have correctly follow
the button, or appear after the button animation

closes odoo/odoo#56214

Taskid: 2296010
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-21 07:59:55 +00:00
qsm-odoo f8df10dd01 [IMP] web_tour: review tour tips design
We noticed users may have difficulties noticing where the tip is in the
page, even when searching explicitly for it. This commit reviews the
design and improves the scss: the tip shape is now made of an unique
transformed element with a white border all around. The box shadow was
also made more visible. The visibility over white elements stays the
same as before but it is now way more visible over dark content (like
the website editor panel).

task-2357170

closes odoo/odoo#61731

X-original-commit: dbf966f6f012ccf5aa9b501586e2aa0fde05be5d
Related: odoo/enterprise#14735
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-13 16:55:39 +00:00
95d0ca4b2c [REF] web_editor,web: adapt to new jabberwock editor
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@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>
2020-10-14 10:29:09 +00:00
qsm-odoo 463fd81486 [FIX] web_tour: shield tips design from external css rules
As the tips can be put anywhere in the DOM, external css rules may
target them by mistake. This was for instance discovered on the frontend
where the boxed layout does something like this:
```
    #wrapwrap > * { width: XXX; }
```
which does breaks the tips which would be placed in the #wrapwrap.

This commit solves the problem by forcing rules with !important flags.

closes odoo/odoo#58874

X-original-commit: 5084ea9b4d24c41a8171f5c9ad92f903f1067705
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-01 17:53:37 +00:00
Jeremy Kersten 1af84c99df [IMP] web_tour: remove consume button option in step content
This reverts commit 27158a0f612897e41601bf9e9d20861e9b87279f

Why keep a new option now that it has been developped ?

X-original-commit: bd4628e69df1e27498f88f348812a269cc9d3648
2020-09-21 07:24:01 +00:00
Laurent Stukkens (LTU) 2d930cbccf [IMP] web_tour: add alternative selector to consume step
* Prior to this commit only one selector could be provided in order to got to the
  next tour step.

* After this commit an additional selector can be provided in order to consume
  a tour step. This additional selector can be specified through the step property
  alt_trigger. We also toke the opportunity to remove $actualAnchor in tip.js as no
  more used.

task-2325001
Related PR: odoo/enterprise#12711

closes odoo/odoo#57680

X-original-commit: 9606e9e231be9e1e7d15ea0efdedbf5afff47102
Related: odoo/enterprise#13214
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-14 15:53:45 +00:00
Benjamin Vray bdcb960de2 [FIX] web_tour: fix position of the tips
When tips show something outside of the screen (bottom), the hover will flicker
 the tooltip.

Now the tooltip come on top of the tips, exactly like for the top.

https://drive.google.com/file/d/1p3IGEAy2QekrykIqOzTzyJhmzjxbk5N7/view

closes odoo/odoo#57572

X-original-commit: fd5b43336a11ade92b954c281e27a40d043df34f
Related: odoo/design-themes#356
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-11 16:31:53 +00:00
Jeremy Kersten 301f002ff0 [IMP] web_tour: allow theme to override a tour
Each theme now will earase the homepage tour with his own tour

X-original-commit: 60c4cb82c40e2823daafe8709417e2b8997cef91
2020-09-11 16:31:53 +00:00
Jeremy Kersten e6145d550a [IMP] web_tour: consume button in step content
This commit add a button in a step to be able to consume it.
It allows to have optional steps that the user can skip.

Part of https://github.com/odoo/odoo/pull/44328

task-2172208

X-original-commit: 27158a0f612897e41601bf9e9d20861e9b87279f
2020-09-11 16:31:50 +00:00
wan 7ceb7782b4 [IMP] web_tour: rainbowManMessage as a function
Task 2327599

In some cases, we want a function to evaluate the string shown by the
rainbow man.
For instance, if the message should depend on the state of other tours.
2020-09-10 12:32:11 +00:00
Martin Trigaux 90d85eb9c5 [I18N] export saas-13.5 source terms
Without demo data

closes odoo/odoo#56869

X-original-commit: 33f251b6489455cd7221f2c62dee0400a69784b8
Related: odoo/enterprise#12836
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-01 11:18:00 +00:00
Pierre Collinet (pic) 26ada8aea0 [IMP]hr_recruitment: adjustments for the onboarding tour
- reduce the size of the tooltip box when the tip is short
- display the rainbow message longer on the screen to allow
the user to read it.

closes odoo/odoo#56562

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-26 09:23:18 +00:00
Julien MougenotandAaron Bohy ef731cc1c9 [IMP] crm,web_tour: Improve CRM tour keynav
Two things have been introduced in this commit:

The first is a change in the way the tour tip widgets are updated when
a DOM mutation is triggered: before this commit, each active tip would
evaluate its current anchor to elements matching its "trigger" selector.
If the element was not the anchor, it was set as the new anchor and
would be bound to the tip event handlers. Now, the unbinding/rebinding
of event handlers is done regardless of the new element.
This is helpful when the anchor is on a field monetary for example,
which keeps the same input element while internally unbinding and
rebinding the widget event listeners to it on each rendering. This
process does not include external event listeners such as those of the
tip and they were lost until now, breaking the tour step.

The second change is a modification of the CRM tour: the "Expected
revenue" field being an input, the according step trigger has been set
to target the input element instead of its parent. This means that the
step will await an "input" event instead of a click to be consumed,
making the tour step feasible with a keyboard.

Task: 2314864

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-08-18 13:49:02 +00:00
yhu-odoo 48c2c1eb9f [FIX] web_tour: clear _transitionEndTimer before destory the tip widget
Before this commit, when we doing the tour. If we move the mouse fast
enough. We may trigger the tip_consumed event before its
_transitionEndTimer call its callback to update the position, and a
bubble will be left there.

In this commit, we clear the _transitionEndTimer timeout before we
destory the widget to prevent the issue.

Task 2298950
PR #55155
2020-08-11 12:19:24 +00:00
Dhruv Patel 246a9de7b6 [FIX] web_tour: tooltip bubble info glitch and moves to the left
When you hover on the bubble tooltip infobox then sometimes its glitch,
and moves left. once you leave the mouse over from the tooltip info then
it will be repositioned as before.

So with this commit, we have resolved this issue by giving the condition
on the repositioning of every time the _updatePosition methods execute.
If the tooltip infobox is open then we are not repositioning the box's position.
otherwise, it will be repositioned.

closes odoo/odoo#55162

Task: 2263600
X-original-commit: 1d62b9d5fbe17cb1cc33dd335cff129ce9b13570
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-29 15:39:03 +00:00
Aaron Bohy 3d3348c2d2 [FIX] web_tour: do not reposition hidden tips
The tour system is made such that we always have at most one tip
displayed on every screen. Since commit [1], "inactive tips" (i.e.
tips that aren't displayed because there's already an higher
priority tip displayed), are rendered, but turned invisible (s.t.
their action is still consumed when their anchor is clicked on),
whereas before [1], those inactive tips weren't rendered.

As a consequence, in the enterprise Home Menu with **a lot** of
apps installed (e.g. on runbot), it lags when the user scrolls,
because all those invisible tips still do a lot of computation to
reposition themselves.

This commit skips these positionning computation for invisible
tips.

[1] 3bf1d8418f41bcaa0ba4b153620def11aaea0a2b

Issue spotted while testing task 2263600

closes odoo/odoo#54920

X-original-commit: cac1689718299fcf509de8228ed6cf2bfdb7c57c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-24 14:46:10 +00:00
Siddarth Gajjar d4e3298b8b [IMP] web_tour: adapt statusBar CTA helper function
Now that for a single visible button there is no 'Action' dropdown, the
tour helper function has to be adapted.

Related PR odoo/enterprise#10602
Task ID: 2225270
2020-07-22 12:58:35 +00:00
Joseph Caburnay 76700a4a1e [IMP] web_tour: observe characterData mutation
Prior to owl, dom changes is normally performed by removing an element in the
dom and replacing it with new one. This is not a problem for the tour service
even if the used mutation observer is only observing attributes and childList
changes.

However, using owl is now a different story because it can change even just a
text of a node when rendering. If after a step this is the only change that
happened in the dom and you are expecting in the next step that the text has
changed, then the tour fails in that next step, but you are given a screenshot
containing the value you are expecting in the failed step. This is a false
negative.

It means that observing only classList and attributes changes in the dom is
not enough, and it is now necessary to observe characterData changes in order
to avoid the false negatives in tour tests.

This change is expected to incur performance tradeoff so the delay in calling
the mutation callback is increased from 500 to 750ms.

closes odoo/odoo#53649

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-25 11:18:48 +00:00
Joseph Caburnay c39e92c9ea [FIX] web_tour: hasTrackedMutation on childList mutation
Current logic returns false if one of the childList nodes is untracked.
It is more correct to return false if all the mutations are untracked.
2020-06-25 10:51:56 +00:00
Aaron Bohy 5e888f8a6c [FIX] web_tour: consume step even if tip not visible
When several tips (coming from different tours) can be displayed on
the same screen, we only display one of them [1], the one from the
tour having the lowest priority [2]. For instance, with CRM and
Sales, there are two tours starting from the HomeMenu, but we only
display the tip on the CRM app.

Before this commit, if the user entered the Sales app, the first
step of sales tour wasn't consumed, so no tip were displayed inside
the Sales app, even though the user "discovered it by himself".

This commit ensures that tips that aren't displayed because there
is another one with a lower sequence still get consumed when the
user clicks on their anchor.

[1] f0a7d69dcf
[2] 61ed0409c3c419f9624874fb0743d707eee673b1

closes odoo/odoo#53606

X-original-commit: 3bf1d8418f41bcaa0ba4b153620def11aaea0a2b
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-06-24 15:20:11 +00:00
Aaron Bohy b4ba0fc340 [FIX] *: adapt tests to env rework
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 09:47:48 +00:00
Laurent Stukkens (LTU) 7c00503008 [FIX] web_tour: Correct misplaced tip info mode in iframe
* The info mode was misplaced when running into iframe.

* Added static position to the tip when anchor position is fixed

Task Id 2216067
Closes #48529
2020-05-08 07:56:09 +00:00
Martin Trigaux 2d00263127 [I18N] *: export saas-13.3 translations
closes odoo/odoo#50031

X-original-commit: 15a7a9f9d71a0b9c46d7caf2f4fbf09a5a4c63fe
Related: odoo/enterprise#10140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-23 07:13:48 +00:00
dmonzonis 9654961879 [IMP] web_tour: Allow customization of rainbow man message
Before this commit, the rainbow man message at the end of tours is fixed
to a hardcoded message.

This commit allows to customize the message within the definition of the
tour, to add the ability to use tailored messages depending on the app
the tour is about. If no custom message is set, the old default will
still be used.

Task ID: 2241549

closes odoo/odoo#49779

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 06:14:04 +00:00
Okan SUMER (osu)andqsm-odoo a34cd7c662 [IMP] web_tour: add a scroll indicator + input event for contenteditable
This commit places a tip to indicate the user to scroll when the anchor
is out of viewport.

Also now allow to wait that the user types on his keyboard before
consuming a step when text modification is required on a contenteditable
element.

Part of https://github.com/odoo/odoo/pull/48678
task-2228694

closes odoo/odoo#48678

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-04-14 08:29:56 +00:00
qsm-odoo 88e115b480 [FIX] web_tour: add dom untracked modifications rules
This commit adds some untracked modifications rules that ignore
these DOM modifications:

- Ignore when the class "o_tooltip_parent" is added or removed (will
  be important with the next commit)

- Ignore when the ID of an element changes (normally never in Odoo
  codebase (at least not alongside other changes), but jQuery uses
  ID modification for some performance improvements).

This is required to avoid loops in the update system (the
o_tooltip_parent class is added, thus we update tips, which search the
DOM so jQuery changes IDs, thus we update tips, which ...). Previously,
this already occured but less frequently than it is about to be
with future tips improvements.

To be able to do that change, the system had to be reviewed. Indeed,
the DOM mutation observer was debounced thus leading to considering a
very small portion of DOM mutation. As we now have to check the addition
or removal of a specific class or ID, we have to consider them all. In
fact, it worked by chance before... this occured:

1) The user clicks on something, the UI is updated -> DOM mutation
2) The code uses jQuery so a strange ID update is done -> DOM mutation
3) As the observer is debounced, we only see (2), which was not an
   ignored DOM mutation -> we update the tips.

Now that (2) is an ignored DOM mutation, if we still debounce, (3) will
not update the tips while it should have because of (1). In fact, this
could theoratically break already: if (2) is a tip update for some
reason, (1) will be forgotten in the current codebase.

Instead of debouncing we now register all DOM mutations and process
them in a debounced way. So if I receive 3949 mutations over half a
second, I will save them all but only start processing them once I am
not receiving some anymore. And most of the time, only a couple of
processing is needed to know that a tracked DOM mutation occured, which
thus needs to lead to a tip update.

Part of https://github.com/odoo/odoo/pull/48678
task-2228694
2020-04-14 08:29:56 +00:00
Okan SUMER (osu) 4ce1340f4f [FIX] web_tour: fix tip ideal location
This commit adds the case where the overflow of an anchor ancestor is
'hidden auto' and not only 'hidden'.

Part of https://github.com/odoo/odoo/pull/48678
task-2228694
2020-04-14 08:29:56 +00:00
qsm-odoo b30b591e35 [FIX] web_tour: toggle tip opening/closing in a more robust way
A system was implemented to not close/open a tip if the user
leaves/enters the anchor and immediatly re-enters/re-leaves it but that
system was broken at some point.

This commit restores it.

Part of https://github.com/odoo/odoo/pull/48678
task-2228694
2020-04-14 08:29:56 +00:00
Aaron Bohy 8827c96035 [FIX] web_tour: correctly check ui-sortable parent
closes odoo/odoo#49242

X-original-commit: 20e16f8cb81da573dd58f9b736cf2105a6608b26
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-08 14:26:07 +00:00
Julien Mougenot 48ee7272b6 [IMP] *: adapt qunit suite bundle inheritance
Since the test assets bundle name has been changed and its structure is different,
the inheriting assets need to be updated.

Task 2002399
2020-04-07 14:40:53 +00:00
Aaron Bohy d997aa1574 [FIX] web_tour: consume tip on kanban record drag&drop
This commit concerns tours executed in onboarding mode (the user
manually follows the steps and consumes the tips).

Commit [1] changed the default event type to consume a tip from
'mousedown' to 'click'. This caused an issue when a tip was
attached to an element that had to be dragged and dropped. The
issue has been fixed by [2]. This fix is based on the fact
that draggable elements have classname 'ui-draggable-handle'.

Kanban records are draggable, but their implementation uses the
'sortable' feature of jQuery instead of the 'draggable' one (the
records are also sorted in their column). So [2] isn't enough in
this case. For instance, in the crm tour, the tip telling to drag
and drop a record to another column can't be consumed.

This commit handles the case of sortable elements that have to be
dragged and dropped.

[1] e5bc2e7306251a55ce90adeef992840517c240e6
[2] 3f458fe06e6a629edc72428eab749068c2eba1ba

closes odoo/odoo#49072

X-original-commit: 67335bda1653f592011a57146fb750d7b69cfc27
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-06 14:03:39 +00:00
Aaron Bohy ebb94e6299 [IMP] web_tour: reset tours from debug manager
This commit improves the "Start tour" dialog accessible via the
DebugManager. It is now possible to reset a tour to its initial
step, so that it can be re-executed (in onboarding mode). The
content of the dialog has been reworked as well:
  - testing tours are displayed in another table
  - tour sequence is displayed
  - tours are sorted by sequence, and by name.

Task 2229909

closes odoo/odoo#48892

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-04-03 10:13:33 +00:00
Julien Mougenot 634c00a32f [FIX] web_tour: load xml at test start
Before this commit, the template of the "Tip" widget was loaded on test runtime
and caused a concurrency issue.

Now, the template is loaded before the test suite is launched and is ready when
the test is executed.

closes odoo/odoo#48589

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-30 10:20:12 +00:00
Romain Estievenart 04cc2b5700 [FIX] web, web_tour: mobile quick search view issues
Now we have the mobile search_panel in enterprise,
this commit simply adapt the Odoo repos part with:

- Css Clean up
- Remove the no longer existing step inside the tour
the button 'o_enable_searchview' no longer exist
inside a M2X dialog

Task ID: 2200099

closes odoo/odoo#48376

Related: odoo/enterprise#9494
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-03-29 14:24:33 +00:00
Julien Mougenot d316c6630b [IMP] web_tour: add a sequence option to tours
Before this commit, tours were activated in a non deterministic way and there was
no way to control the order.

Now there is a `sequence` key in the options dict (i.e. the second parameters of
`tour.register`) which will determine the tour sequence order, the lowest being
first and going upward. Unsequenced tours will behave as before with no particular
order.

Task 2191192
2020-03-27 12:09:27 +00:00
Julien MougenotandMathieu Duckerts-Antoine 0a129284e4 [IMP] web,*: Enhance test helpers
1. Test utils helpers adapted to properly instantiate the new Owl control panel
2. New file 'test_utils_control_panel' to create a control panel and use helpers
3. New helper: createComponent (creates a generic component, see jsdoc)
4. Use of the new helpers in the current tests (more in sibling commits)
5. Helper 'addMockEnvironment' is now asynchronous
6. Owl config mode set to 'dev' in test suite (props validation)

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 11:39:53 +00:00
Romeo Fragomeli ab2e3fdb7d [REF] *: add tour steps utils
This commit moves some step utils in a dedicated file and add new ones.
These steps will be very useful for the Main Flow Tour to avoid
duplicated code.

To do this, we also had to transform it into functions to allow
utils to call each other. Existing one are converted for
standardization purpose.

Note that 'WEBSITE_NEW_PAGE' wasn't considered as an util.
This is a very simple step only used twice.
2020-03-11 10:10:16 +00:00
Romeo Fragomeli 298f2f4aae [IMP] web_tour: add 'mobile' flag for steps in tours
We are not able to precise in which case a step should be executed.
We already have 'edition' and now we introduce 'mobile'.

undefined: Desktop + Mobile*
true:      Mobile* only
false:     Desktop only

*: Responsive (<= SM), see isMobile
2020-03-11 10:10:16 +00:00
Romeo Fragomeli 3a191d053a [FIX] web_tour: tip not consumed with the right event on mobile
Before this commit, the tip for a many2X field was consumed with a
input event.

But on mobile we doesn't have the same behaviour; a kanban modal is
opened when we click on the many2X field input instead of writing in it
(auto-complete) like on desktop.

After this commit, the tip is consumed with a click event for many2X on mobile.
2020-03-11 10:10:15 +00:00
Romeo Fragomeli 10a47cf401 [FIX] web_tour: tip not visible anymore on notebook header
Since commit: odoo/enterprise@e662ef3629
a 'div' wrapper was added around the notebook header.

The tip was not visible due to it's location in the wrapper with
'overflow: hidden'.

After this commit, the tip is appended to the ancestor of the wrapper
and so it's visible again.
2020-03-11 10:10:15 +00:00