Commit Graph
4942 Commits
Author SHA1 Message Date
Samuel Degueldre 2d42501a5b [FIX] mail, web: fix memory leak in QUnit test suite
With the discuss refactoring, two memory leaks were introduced:
- the activity service opens a broadcast channel for cross-tab
communication.  Because services have no destruction mechanism, the
broadcast channel is never closed, and since most tests create their own
test environment with services, each test would leak an instance of the
activity service as it is captured by the bound onmessage function. The
activity service holds a reference to the mail store which results in a
large leak
- the RelativeTime component creates a timeout so that it can update its
time every minute or every hour depending on how old the message is,
this timeout is cleared when the component is destroyed. This component
tries to initialize the value of its timeout to `null`, but it does so
*after* calling the method that actually sets the timeout, causing the
timeout to be overriden with null and never cleared

The BroadcastChannel problem has been solved by adding BroadcastChannel
to the browser object, and patching it in the test setup code of web, as
it's a generic problem with BroadcastChannels. The timeout problem has
been fixed by simply reordering the lines so that we don't override the
timeout and it gets correctly cleared when the component is destroyed.

closes odoo/odoo#128768

X-original-commit: bd25f14d7a746fe48e09edea7ebb4aaa4634fbdc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-17 19:26:05 +02:00
Alexandre Kühn e9110383ed [FIX] mail: active style of discuss sidebar item in dark mode
Before this commit, when an item in discuss app is active or
mouse-hovered in dark mode, there was no indicator.

This is caused by `bg-200` being equivalent to `bg-view` in
dark mode, therefore the active items were not visually distinct
from the background.

This commit fixes the issue by keeping `bg-200` in white mode, but
this becomes `bg-100` in dark mode. That way, active items are
slightly highlighted as they should

closes odoo/odoo#128767

X-original-commit: d66db4aa257984ae984d3207819c2a23b0f6897c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-17 18:13:56 +02:00
Sébastien Theys b43f8c840e [REF] mail, im_livechat: move "discuss.channel/last_interest_dt_changed"
To discuss folder.

Part of task-3265211

closes odoo/odoo#128593

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-17 18:13:40 +02:00
Sébastien Theys a008feec69 [REF] mail: move discuss.channel/unpin to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:39 +02:00
Sébastien Theys ba5cbd21e7 [REF] mail: move discuss.channel.member/fetched to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:39 +02:00
Sébastien Theys d4399cef37 [REF] mail: move discuss.channel.member/seen to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:39 +02:00
Sébastien Theys 91c331c185 [REF] mail: move discuss.channel/transient_message to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:39 +02:00
Sébastien Theys 95592d7fa5 [REF] mail: move discuss.channel/legacy_insert to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:38 +02:00
Sébastien Theys 485379ad60 [REF] mail: move discuss.channel/joined to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:38 +02:00
Sébastien Theys 91872440b1 [REF] mail: move discuss.channel/leave to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:38 +02:00
Sébastien Theys adae210696 [REF] mail: move discuss.channel/new_message to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:38 +02:00
Sébastien Theys bcc420e5d4 [REF] mail: move command palette to discuss folder
Part of task-3265211

Part-of: odoo/odoo#128593
2023-07-17 18:13:37 +02:00
Alexandre Kühn 8dc9d12905 [FIX] mail: fetch followers 100 at a time
Before this commit, the data of all followers of a chatter were
fetched whenever `mail/thread/data` was called. This route is
called when loading the chatter for the first time, and whenever
the chatter must be reloaded.

When there are at most dozens of followers, it's not a big deal.
However, with thousand of followers, the route `mail/thread/data`
may become quite long, which made chatter barely usable with a
long loading.

This commit fixes the issue by showing only 100 followers at once
when opening the follower menu. When scrolling down the list,
it loads data of more followers.

Task-3293718

closes odoo/odoo#127966

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-17 18:13:11 +02:00
Thanh Dodeur 000bf53251 [FIX] mail: add a missing mock of the browser media api in tests
Before this commit, a test of call was using the real web media API
and would request micrphone access to the brower. This commit fixes
this issue by using the mocked version for this test.

closes odoo/odoo#128722

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-17 16:46:02 +02:00
tsm-odoo 12152279a5 [IMP] mail: add a registry for partner suggestion sort
Before this PR there was no way to add a sort criteria to the
partner suggestions. This commit introduce a registry of compare
functions that can be arranged thanks to a sequence key. This way,
it will be very easy to add custom sort criteria.

part of task-3332872

closes odoo/odoo#128570

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-17 12:06:04 +02:00
Alexandre Kühn 1b72b93a9a [FIX] mail: do not show (edited) label on messages
When a message is posted, sometimes the label tells the message
is edited when it definitely shouldn't.

This happens because implementation of detecting whether a message
is edited relies on difference between `create_date` and
`write_date`. This implementation is flawed, especially when the
message being newly posted has its fields being updated in another
ransaction, which is unfortunately what happens when the message
should be sent by email.

No good solution to preserve this label in a working state was
found, so the showing of this label is being disabled.
Messages can still be edited: only the label is no longer shown
after this commit. This makes feature of message edition matches how
it was in prior versions of Odoo, where the label was also missing.

closes odoo/odoo#128656

X-original-commit: f5d108eff2276ba577a52d9d10a82f9ea769c701
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-17 09:21:21 +02:00
tsm-odoo 7d180a0bc0 [FIX] mail: remove return in handle notification loop
Before this commit, some notifications handler were using `return`.
The issue is that this will exit the notification processing loop
preventing further notifications to be processed. In practice, this
scenario is limited since notifications come by small batches but
it could be an issue.

closes odoo/odoo#128606

X-original-commit: e8fbc26716917b1066b9002010662d41aaeacbf0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-15 13:06:07 +02:00
Benoit Socias d1292a96a6 [IMP] base,*: support image/webp image format
*: mail, mrp, test_website, web, web_editor

Before this commit '.webp' images could not be used in odoo.

After this commit '.webp' images can be uploaded to odoo.
- can be used in image field
- can be used in HTML field image
- can be used in mails and website
- can be transformed (shape mask, filter effect, crop, rotate, resize,
  adjust quality)

task-2774352

Part-of: odoo/odoo#85494
2023-07-15 05:10:45 +02:00
Alexandre Kühn 1adad23fcb [FIX] mail: no crash when open invitation menu from start a meeting
The "add-user" thread action is not necessarily present in the view,
therefore the action should not necessarily be programmatically
called.

This commit fixes the issue by letting discuss app programmatically
call the invitation button precisely in the next rendering when
it was requested from click on "start a meeting".

Fixes runbot-23240

closes odoo/odoo#128510

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-14 19:25:55 +02:00
Alexandre Kühn b711020e8d [FIX] mail: no suggested recipients in full composer of log note
Before this commit, opening full composer from chatter were always
copying the selected suggested recipients, regardless of the mode
of the composer.

Suggested recipients only makes sense in "Send message" mode,
therefore it should not copy them in "Log note" mode, which this
commit fixes.

Also fix a bug where copying of suggested recipients in full composer
was taking all suggested recipients into account, regardless of
checkbox state. This commit fixes issue by copying only checked
suggested recipients

closes odoo/odoo#128466

X-original-commit: 89afc58a69a53824a9100ceaf4f3574bb82dfc1d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 19:28:37 +02:00
Earth Patel 543e0b22f1 [FIX] mail: open invitation popup on start a meeting button
Before this commit
When the user clicks on "Start a meeting" button, the invitation popup does not
open.

After this commit
The invitation popup now opens when the user clicks the "Start a meeting"
button.

Task-3346081

closes odoo/odoo#128320

X-original-commit: 12f2ddf722d659df651e5ef929f775ea1cabed88
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 18:17:52 +02:00
tsm-odoo 2b401d078d [IMP] mail, website_livechat: show visitor lang on member list
Before this commit, the lang of the visitor was only shown on the
member list based on the `anonymous_country` of the channel.

In order for this information to be as complete as possible, the
lang is now also checked on the website visitor if there is one.

part of task-3332872

closes odoo/odoo#128242

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 16:52:58 +02:00
Pierre Pulinckx (pipu) 504b4a7178 [REF] *:Replace moment usages with luxon
luxon and moment are both used in the solution, but
these two libraries facilitate the manipulation of dates.
It was decided to replace all uses of moment with
luxon so we can then remove moment.js from the
code and lighten the assets.

task-3391739

closes odoo/odoo#127406

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-13 14:47:41 +02:00
Zelong Lin 5438599af9 [IMP] mail: add single user to self-chat makes a DM chat
Opening DM chat or making group chat is determined by amount of
members in the resulting conversation to start. Before this commit,
starting a conversation with self and another user was wrongly
considered as making a group chat, because it wrongly assumed there'd
be 3 channel members in this conversation: the other user,
self (explicitly), and self again (implicitly).

This commit makes DM or group chat more natural when dealing with
self user:

- Adding only self to start a conversation should open a self-chat
- Adding a user to self-chat should open DM chat
- Invite more than one user in self-chat should make a group chat

task-3382231

closes odoo/odoo#126361

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 14:47:24 +02:00
Alexandre Kühn dd56346c48 [FIX] mail: link preview should have at most 2 lines of text content
Before this commit, link preview showed the whole text content
of the link preview, which has it's limit at around 300 characters.

When description is long, the link preview was too long, which made
it too visible as a "preview".

This commit fixes the issue by truncating the description to at most
2 lines.

Task-3416429

closes odoo/odoo#128347

X-original-commit: 73025d977f6960a829f914a3f0f0c0d87abbb561
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 10:46:21 +02:00
Alexandre Kühn 9726a414e9 [FIX] mail: do not show Odoobot has a request in mobile
The Odoo mobile app manages push notifications by the app
itself, not the web app. Therefore there's no need to enable
web push notifications.

This commit fixes the issue by considering web push notification
being denied in the mobile app.

closes odoo/odoo#128344

X-original-commit: 045aeaace279d585a7ebefcd5cba7d32207ba9ba
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 10:46:13 +02:00
Alexandre Kühn 11eebe12bf [FIX] mail: post message in chat window of chatter should log note
Before this commit, when posting a message in chat window of chatter,
it was posting it in "Send message" mode. This mode notifies all
followers of the chatter.

Even though this is the default mode of chatter, there's no explicit
way to define the composer mode in chat window of chatter. Usually
chatter in chat window is used for internal communication, where
logging notes and pinging users with `@`-mentions is mostly used.
Since the chat window was in "Send message", it could inadvertly
notify users of message content not addressed to them. Logging note
is much safer, as it notifies users only when explicitly mentionned
in the message content.

This commit fixes the issue by putting composer mode of chatter
in chat window in "Log note", so that there's no longer a risk to
send message to wrong recipients by mistake.

Also put proper placeholder in chatter of chat window and reply-to
in discuss app, so it's clear posting message will either send
message or log a note.

closes odoo/odoo#128337

X-original-commit: e2609b2f8134b7c3248fb2d519daaadabf5401bf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 08:28:20 +02:00
Alexandre Kühn 72f8407292 [IMP] mail: move follower button menu into FollowerList component
closes odoo/odoo#128326

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 08:28:17 +02:00
Didier (did) c348ea89a6 [FIX] mail: fix default_partner_ids in full composer
Before this PR suggested recipients were not correctly moved to the full
composer because the partner id is stored on the persona.

closes odoo/odoo#128291

X-original-commit: 38902e19389d2d559bf5866bfa96f638ca619c34
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 08:28:12 +02:00
Sébastien Theys d289d8a7d0 [FIX] mail: make file upload consistent between guest and portal
opw-3370926

closes odoo/odoo#128290

X-original-commit: 2e5f8a3c9e7cff8c61f66e56da7b0f9a59f9bf2e
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-13 08:28:06 +02:00
Sébastien Theys d700cd39b2 [FIX] mail: properly re-render attachment list
The attachment list was not displaying extra attachments that were
received from the bus if the list had at least one attachment.

Part-of: odoo/odoo#128290
2023-07-13 08:28:06 +02:00
Sébastien Theys 1aad11ba49 [FIX] mail: fix message edit as guest
Mentions are disabled for guest, so partners was undefined.

Part-of: odoo/odoo#128290
2023-07-13 08:28:05 +02:00
Sébastien Theys fac4c9c1c5 [FIX] mail: remove duplicate steps in discuss guest tour
`discuss_public_tour` is ran after `discuss_channel_as_guest_tour`
leading to all steps presents in both to be executed twice.

The opportunity is taken to add empty `run` functions to avoid
unnecessary clicks.

Part-of: odoo/odoo#128290
2023-07-13 08:28:05 +02:00
Alexandre Kühn 4e2256dc6a [FIX] mail: align message actions with 1st line of message
Before this commit, action list of message was centered with
message. This can be hard to notice where the actions are shown
on long messages.

This commit fixes the issue by positioning action lists always
next to the 1st line of message content.

closes odoo/odoo#128274

X-original-commit: 7227513eac8242f9f94d75eed6b84ef99098cff2
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-13 07:18:48 +02:00
tsm-odoo 7be977af4d [FIX] im_livechat, mail: fix add member to livechat channel
Before this commit, inviting a partner to a livechat channel
had no effect. This commit solves this issue.

Steps to reproduce:
- Go to a livechat channel in the discuss app
- Click on invite a member on the top right corner
- Select a member
- Click on the invite button
- Nothing happens

closes odoo/odoo#128173

X-original-commit: 94086d9289222008f59a97611a80de4e1310e41c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-13 02:21:53 +02:00
FrancoisGe 42e5e247bf [FIX] web: m2o must only use the context of the field
From commit 2ecfed335d, clicking on the arrow of a m2o opens the
record in form view and passes it the context of the current view.
After this commit, only the context defined on the <field> is passed.

Problem:
An example of a problem, is the use of an incorrect active_id in the
second view that is passed through the first form view to the second.
Previously, the active_id of a form view was always the id of the record
and not that of the previous view. This behaviour is debatable, but it
leads to major changes. We therefore prefer to revert to the old behaviour
and no longer pass the entire context in order to avoid this problem.

How to reproduce:
- Go to a form view with a m2o
- Click on the arrow of the m2o

Before this commit:
    The view context contains all the context from the first form
    view and the second.

After this commit:
    The view context contains the context of the m2o field and the second view.

closes odoo/odoo#127538

Taskid: 3394945
X-original-commit: a9bec1fec3ff08461732ef2717457524339eb716
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 16:52:54 +02:00
Brieuc-brd 89227a62db [FIX] mail: mobileTopbar buttons spacing
Prior to this commit, there was a spacing issue between `mobileTopbar`
buttons.

This PR fixes this issue.

task-3415575
Part of task-3326263

closes odoo/odoo#128190

X-original-commit: c599df12fe99bbf6ca5eaef2abc4ac94d27a59ae
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-12 09:14:57 +02:00
tsm-odoo f5da99c0ad [FIX] mail: fix crash when unknown member leaves channel
Before this commit, a crash occurred when an unknown member
left a channel.

Steps to reproduce:
- Open two browsers, one for admin, one for demo
- Ensures both users are on the general channel
- Execute the `/leave` command with demo
- A traceback appears on the admin browser

This issue occurs because the `action_unfollow` only sends
the channel member id through the bus but the client relies
on other keys without checking for their presence. This
commit fixes this issue.

closes odoo/odoo#128090

X-original-commit: f8452b2eb8f9243402984d78184ed494384a187c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-12 07:40:11 +02:00
tsm-odoo 1fd39b35b2 [FIX] mail: fix suggestion hook char deletion
Before this commit, the suggestion list would not work when
a string with no match was entered then modified.

Steps to reproduce:
- Open a channel
- Type `/hee` (this string matches no suggestion)
- Delete one of the `e` in order to get `/he`
- This string should match the `/help` suggestion but nothing
is shown.

There is several issues here:
- The suggestion hook is based on the composer selection but
the `selectionChange` event is not triggered when deleting text
from the textarea which leads to incorrect selection.
- The search is cleared in the `suggestionHook` when nothing is
found which leads to incorrect delimiter position after a deletion.

This commit fixes both issues.

closes odoo/odoo#127997

X-original-commit: b8bf65478cad558e02a5902886b3e4272483944e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-12 07:40:00 +02:00
tsm-odoo 9728406695 [FIX] mail: fix transient messages wrongly positionned
Before this commit, transient messages were inserted at the
wrong position.

Steps to reproduce:
- Send a message on a channel
- Execute the `/help` command
- The transient message is positioned before the message
that was sent first.

When a message was posted, the message fetch route was called
and the transient messages were inserted again.

They are two issues here:
- Messages should not be fetched when posting a message
- Transient message index is wrongly computed when it is
the last one.

This PR fixes both issues.

closes odoo/odoo#127979

X-original-commit: bebea00e1ff0757ce5ce34d6ae87f6adef2e515c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-11 09:10:12 +02:00
Antoine (anso) 715eba5a47 [FIX] mail: close chatter button in attachment view
This commit fixes the style of the close chatter button in the
attachment view to match new Milk button design

It also fixes a no spacing issue between `.o-mail-Chatter-close` and
`.o-mail-Chatter-follow`

task-3415853
part of task-3326263

closes odoo/odoo#127978

X-original-commit: f655bdfda5caf6608d4364f49bdddf25f3abf201
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-10 18:16:39 +02:00
Didier (did) 5e18390858 [IMP] mail: add missing type def
closes odoo/odoo#127868

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-10 16:59:21 +02:00
Alexandre Kühn 3ea1564ef9 [FIX] mail: improve follower menu vertical spacing
The "Add Followers" button felt too close to top of
menu, and the last item was to close to bottom of menu.

closes odoo/odoo#127857

X-original-commit: 1c28eab0142d5011d109955977ab99d5091f989b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-08 13:03:51 +02:00
Alexandre Kühn 6aeb89f544 [FIX] mail: proper alignment of chatter attachment button
Before this commit, the icon and label of the attachment button
in chatter topbar was not aligned.

closes odoo/odoo#127856

X-original-commit: 3842ef84b33e1282b4f7d4d7c92b13b3f4b81b51
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-08 13:03:48 +02:00
tsm-odoo d97ff6820e [FIX] mail: fix slow follower insertion
Before this commit, follower insertion checked if a follower
was already in the thread's follower list by using
`Array.prototype.includes`. Since this method must run through
every item in the array to tell whether or not a follower is
present, it is extremly slow with large arrays (especially
since it is called for each follower).

This would slow down the tab for threads having lots of follower
(issue starts appering at 5k+ followers).

This PR solves the issue by replacing thread follower lists by
sets. With this change, inserting even 15k+ follower is almost
instantaneous since the membership test is done in O(1) instead
of O(n).

closes odoo/odoo#127833

X-original-commit: 406c91c8cba32e01eaa8df4b7fb9d0e3ad821e9c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 23:48:43 +02:00
Louis Wicket (wil) ced4efa612 [FIX] mail: format date tracking values according to the locale
Prior to this commit, date tracking values in Chatter were always
formatted using the LL/dd/yyyy format.
After this commit, date tracking values will be formatted according to
the user's locale, so as not to cause discrepancies with other dates.

closes odoo/odoo#127834

X-original-commit: 865522e0925fbeae14f5f83d3a2d69a54b546b04
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 20:24:58 +02:00
Alexandre Kühn 0304df6dff [FIX] mail: message attachments ordered from older to newer
Before this commit, when posting a message with 3 attachments
`A B C`, the message displayed attachments in order `C B A`.

This happens because message format list attachments in order
of `message.attachment_ids`, which has no specific order.

This commit fixes the issue by ordering attachments in
`message_format` from the oldest to most recent, so that displayed
order in message matches the one from composer, which itself
matches the order of creation of attachments.

closes odoo/odoo#127830

X-original-commit: 53508effa66bca79aa872412333ca8578ca9b813
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 20:24:56 +02:00
Alexandre Kühn fa2489379a [FIX] mail: no flicker on showing jump present at specific threshold
Before this commit, when scrolling down on a long chatter,
there was a specific scroll position that indefinitely
shows & hides "Jump to present" with an infinite flicker.

This happens because visibility of "Jump to present" affects
`scrollHeight`, and the threshold to show/hide this bar was
exactly the same, at 2500px. So when at exactly 2500px,
the bar is shown, but then the distance to present becomes
less than 2500px (because the bar is sticky and pushes the
present down), therefore it must be hidden. But hiding it,
the present moves up, so distance is 2500px again, etc.

This commit fixes the issue by having a 200px tolerance:
- more than 2500px: show "jump to present"
- less than 2300px: do not show "jump to present"

As the "Jump to present" bar is less than 200px height,
there's no risk to indefinitely change its visibility.

closes odoo/odoo#127829

X-original-commit: b1205a90dccc44e6cc7d5fd869cab34a63a4db2c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 20:24:53 +02:00
Alexandre Kühn 09f2bda7d8 [FIX] mail: allow to CTRL-C in chat window from home menu
Before this commit, it was not possible to copy some text content in
chat window with CTRL-C from the home menu.

This happens because keydown events are intercepted by the (hidden)
search bar in the home menu. So when pressing CTRL, the focus is
lost in the chat window.

This commit fixes the issue by not bubbling events from chat window.
Exceptions are inside dropdown, as the keyboard navigation there
make use of the hotkey service that needs bubbling of keydown events.

closes odoo/odoo#127662

X-original-commit: 05d9d3ce1fed0c76d9c85a50e361035a7a81b46b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 10:52:55 +02:00
Alexandre Kühn d575ebf701 [FIX] mail: no crash in safari < 15.4 from using BroadcastChannel
`BroadcastChannel` is not supported in Safari < 15.4.
This commit prevents the crash by not using broadcast channel
if it doesn't work.

A minor inconvenience of not using `BroadcastChannel` API is that
activity data are not synced among tabs. But this is still better
than a crash.

closes odoo/odoo#127660

X-original-commit: f7f7e11ae30d2a5a659b09d913566b0cab95846a
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 10:52:52 +02:00