Commit Graph
945 Commits
Author SHA1 Message Date
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
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 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
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 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
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
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 d6dddb9518 [FIX] mail: do not open server-synced chat windows in mobile
Before this commit, when there were some chat windows open
in desktop, mobile device were displaying the chat windows
at page load.

This was even buggy, because the chat windows are mounted in
a folded state, and it shows only the header of chat window.
The content behind the chat window is visible but we cannot
interact unless the chat window is closed.

This commit makes a few changes to fix the issue:
- Folded state of chat windows is ignored in mobile: the chat
  window is fully displayed in mobile even when in "folded" state.
- At page load, server data from chat window state are ignored
  in mobile
- Messaging menu in mobile should not display content below:
  dropdown in mobile had some margin which displayed some content
  below. Fix is to have `m-0`.
- Chat Windows are displayed on top of Messaging Menu in mobile.
  In desktop it makes sense it's the other way, because messaging
  menu can be toggled when there's a chat window. But it's not
  clickable in mobile, and it acts as the previous screen to open
  a chat window.

closes odoo/odoo#127597

X-original-commit: 791924d6d1d0e5aff6d9e84844626ac5863c2a88
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-06 20:55:49 +02:00
Alexandre Kühn 3097fa0217 [FIX] mail: quickly mark as read message in inbox
Before this commit, to mark a message as read in Inbox
of Discuss app, we had to click on "More" option and
then select "Mark as Read".

Considering this is a frequently used option in Inbox,
it'd best to have it easily accessible like "Reply".

This commit shows "Mark as Read" as a quick option of
message when in inbox. As to keep at most 3 quick options,
the "Add a reaction" option has been moved to the "More"
menu when in inbox.

Note that Emoji picker requires an anchor, and items in Dropdown
are components therefore they cannot have `t-ref`. To solve this
issue, there's an invisible `<span>` in the quick option list
that is used as anchor for the emoji picker when used from
the "More options".

Task-3412306

closes odoo/odoo#127570

X-original-commit: b9c8fe1759f03952a42c9bee117e718eab3fef08
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-06 19:46:24 +02:00
Alexandre Kühn 7f0e372e34 [IMP] mail: edit message comment in chatter
Before this commit, only logged notes could be edited in chatter.

With this commit, messages sent with "Send message" are also
editable.

Task-3380465

closes odoo/odoo#125939

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-06 17:52:01 +02:00
Alexandre Kühn e228acb081 [REV] mail: debounce suggestion (and channel selector) searches
This reverts odoo#126869.

Motivation for debounce was to reduce the amount of RPCs, to
not put too much load on server.

However, this makes showing of mention slower than it should,
and the load on server is already adjusted based on duration
of ongoing `fetchSuggestion` RPC: if server can reply with mentions
immediately, then no need to debounce. If the RPC is slow, then
next `fetchSuggestion` waits for current RPC to finish before
making a new fetch.

This PR also fixes this small crash when using mentions:

```
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at cleanTerm (format.js:244:1) (/mail/static/src/utils/format.js:244)
```

Steps to reproduce:
- type `@` then `backspace` then `@` then `backspace`, etc.

This happened because suggestion hook internal state had `term` being undefined when there is no term, but `undefined` is invalid for `cleanTerm`. `""` is a better default for no search term, and since this is a string this works with `cleanTerm`.

closes odoo/odoo#127399

Related: odoo/enterprise#43678
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 18:46:42 +02:00
Michael (mcm) ac153558a6 [FIX] web, mail: indirectly call a patched function
The commit [1] removed two async module and caused a reorganisation
on the module loading.
Since that commit, the patches could be applied in a different order
and be applied after a save of one these patches.

This commit fixes a case where we save the reference of a patched
function that we call it later with missing patches.

[1]: 96687f29496ab4cf16ae2ab1584ef1a6a3fb4a11

Part-of: odoo/odoo#121185
2023-07-05 15:58:20 +02:00
Sanjay-Sharma 4f6a92e684 [IMP] web_editor: add emoji picker in web editor
Purpose:

This commit adds Emoji_picker functionality to the web_editor,
allowing users to conveniently add emojis to their text and
improving the overall user experience.

Specifications:

Now we can insert emoji in web_editor using `/emoji`.

Task id: 3253958

closes odoo/odoo#125137

Related: odoo/enterprise#42772
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2023-07-05 11:37:06 +02:00
Sanjay-Sharma 4bc70c585c [MOV] moved emoji_picker from mail to web
Before this commit:

emoji_picker was in mail module

After this commit:

moved emoji_picker to web module

Part-of: odoo/odoo#125137
2023-07-05 11:37:06 +02:00
Alexandre Kühn 496b74fe1b [FIX] mail: message res url should redirect to model
Before this commit, when opening the related thread of a
message from inbox with "Open Link in New Tab", it was not
redirecting to the thread.

This happens because the url was wrongly using message id rather
than thread id. As a result, it redirects to either bad model or
a non-existing model.

This commit fixes the issue by correctly using `resId` instead of
`id`, which is the thread id of message. Also renaming `url` field
of message to `resUrl`, to clarify this is the link of thread and
not a specific link to message.

closes odoo/odoo#127342

X-original-commit: 8270138aba7e31f5db7853fbf00be6922347a8c0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 00:19:37 +02:00
Alexandre Kühn 2ac5ceb7ff [FIX] mail: keyboard navigation in chat window dropdown
Before this commit, dropdowns in chat window (chat window more menu,
message actions more menu) had no keyboard navigation support.

This happens because dropdown item navigation makes use of hotkey
service, and hotkey service intercepts keyboard in bubble phase on
window object. `ChatWindow` component had a `t-on-keydown.stop` on its
root node, which prevented the hotkey service to receive keyboard
navigation for the good working of dropdown keyboard navigation.

This commit removes the `.stop` modifier on this `t-on-keydown` root
node of `ChatWindow` template. `onKeydown` in dropdown inside chat
window have precedence over `onKeydown` on chat window: For example,
when dropdown is open, hotkey "Escape" closes the dropdown menu but
does not close the chat window.

closes odoo/odoo#127318

X-original-commit: 4b36b28bd9e426b115ffefbbc174fe2efa3dfbf3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 20:33:48 +02:00
Alexandre Kühn 987eeef710 [FIX] mail: debounce suggestion (and channel selector) searches
Before this commit, fetching suggestions (e.g. channel selector
in discuss sidebar "Find or create a channel", or `@`-mentions)
were performing RPCs on each user input, resulting in wasted
network and server load.

This commit fixes the issue by debouncing the fetching of
suggestions to 0.5 sec.

closes odoo/odoo#126952

X-original-commit: 6770ac3
Related: odoo/enterprise#43502
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 03:43:48 +02:00
Louis Wicket (wil) ce07b37111 [IMP] mail: make channel_info private
Make `channel_info` private so that it is no longer exposed to RPCs.

closes odoo/odoo#127078

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 00:51:54 +02:00
Didier (did)andBrieuc-brd 771477b9a7 [IMP] mail: Introduce gif picker in Discuss
This commit adds a GIF picker in discuss
app. GIF feature makes use of Tenor GIF API [1].
To enable GIF picker in discuss, you must provide
a Tenor GIF API key in the General Settings.
Then the GIF picker is visible in all channels
(chat window and discuss app), next to the emoji picker
button.

[1] https://tenor.com/gifapi/documentation

task-2365705

closes odoo/odoo#116060

Related: odoo/enterprise#41959
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
2023-06-30 23:38:01 +02:00
Didier (did) a2cd11c55b [FIX] mail: enable mentions when editing a message.
Before this commit, when editing a message, it was not possible
to add new mentions.

This commit adds the support to add new mentions when editing the
message.

Note that mentions added from editing message won't notify them:
it's only at creation of message that mentioned users are notified.

task-3329714

closes odoo/odoo#126888

X-original-commit: 1fe935d273142064784b9ecff2fff1c34e91064f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 13:08:26 +02:00
Alexandre Kühn ca64f6f5bb [FIX] mail: improved (fuzzy) search of emoji picker
Before this commit, search in emoji picker was case-sensitive
and had no scoring of items. For example:
- typing "ok" did not match with 🆗
- "ok" 1st suggestion was 😘 because of keyword "face blowing a kiss"
 and this is one of the 1st emoji having characters "o" and "k" in
 search terms.

After this commit, search is now fuzzy:
- typing "ok" shows 🆗
- "ok" 1st suggestions are 👌 & 🆗

Task-3175520

closes odoo/odoo#126801

X-original-commit: 4953172398719df829735f381f4e8939f17b1989
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 00:21:16 +02:00
tsm-odoo 8c6ec25533 [FIX] mail: unpin thread should close chat window
Before this commit, unpinning a thread from the discuss app
would keep its related chat window opened. This PR solves
this issue.

Steps to reproduce (non channels):
- Open a chat window (e.g. sales channel)
- Go to the discuss app
- Leave the sales channel
- Get back to the home menu
- Chat window is now the "New message chat window" as the
thread has been removed but the chat window was not closed.

If those steps are reproduced with a channel (e.g. direct messages),
the chat window is kept as is as the channel is not removed.

task-3389554

closes odoo/odoo#126751

X-original-commit: ef14f50d9ab7e2f38d65ac569f4108a89abbb69a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 00:21:01 +02:00
Maitri Patel 229fe73517 [FIX] mail: handle error while click on follow button
When a user click on the 'Follow' button in the chatterbox of the project
Task form view without adding any data, then traceback will appear.

Steps to reproduce(i.e Project):

- Install project module.
- Go to Project >> Tasks >> My task(you can also choose the all task menu) .
- In the list view of project.task model, click on the new button.
- In-form view of project.task model, Click on Follow Button in the chatterbox.

Error: traceback appears: "psycopg2.errors.UndefinedFunction: operator does
not exist: integer = boolean"

sentry-4243265676

closes odoo/odoo#126749

X-original-commit: eeaee0d57effb50d3a0edad1672e17bffea11d0a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 00:20:58 +02:00
Zelong Lin a0aa45ce00 [IMP] mail: chat window dropdown actions from avatar & name
Before this commit, chat window actions were all placed in
the right part of header. It was showing the main action (call),
close action, and all other actions in dropdown menu from
the "..." (more) button.

This commit now replaces the "..." (more) button by clicking
on avatar/name of conversation. The "..." (more) button has been
replaced to "_" (minimize/fold) button, as clicking on header to
open/fold chat window can become hard due to avatar + name being
clickable to show most chat window actions.

This commit also adds the following actions in chat window:
- Open (Employee) Profile
- Rename (conversation)

Task-3336752

closes odoo/odoo#124592

Related: odoo/enterprise#42480
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-29 19:54:38 +02:00
Didier (did) 3d2342cde8 [IMP] mail: display email addresses when sending a message from chatter
Task-3358505

closes odoo/odoo#125580

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-29 18:20:19 +02:00
tsm-odoo 3ed674645d [IMP] im_livechat: add last used date to mail shortcodes
This PR make add a last used date to the canned responses
in order to know whether they are still usefull or not.

part of task-3332872

closes odoo/odoo#125909

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-27 16:26:51 +02:00
Maryam Kia 896a69cc30 [IMP] mail: disable escape on composer wizard
task #2793003
- rename Cancel to Discard on composer wizard
- disable escape on composer wizard to prevent closing the composer accidentally

closes odoo/odoo#120427

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 00:13:46 +02:00
Sébastien Theys 70b4ba4539 [FIX] mail: load around not formatting parent messages
This results in parent message being displayed as text when it is part
of the result of a load around call.

closes odoo/odoo#125439

X-original-commit: 783a5186cf7529161d95c34c9290dc57a32b8200
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-16 23:01:24 +02:00
Sébastien Theys d619908772 [FIX] mail: fix mock server of load around
Forgot to properly sort messages, resulting in returning messages not
actually around but the most recent instead.

X-original-commit: 803f1ad7e3bceaa8f03fca06f920447ce9d8eb69
Part-of: odoo/odoo#125439
2023-06-16 23:01:24 +02:00
Alexandre Kühn 9b55c4565b [FIX] mail: linkify message content
closes odoo/odoo#125307

X-original-commit: 406ff4727e361588bded08c6719f932a8b800b35
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:32 +02:00
Alexandre Kühn 5276ed23e6 [FIX] mail: show typing in chat window
closes odoo/odoo#125135

X-original-commit: c9a94488381abef016a28a4bda0b23423e8217ee
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:55 +02:00
Alexandre Kühn af21d99a36 [FIX] mail: pass props to thread actions
Since [1] thread actions are stored in a specific registry.
Some of those actions require props to be passed to their
component.

Those props are not correctly passed as the `componentProps`
key is in fact a function that returns the props but is
treated as the props themselves.

This commit fixes this issue by transforming `componentProps`
into a getter, so that `action` is internally passed to
`componentProps` definition. The templates using thread
actions can still use `t-props="componentProps"` as getter,
as the active action is deduced by transform automatically.

[1]: odoo#123454

closes odoo/odoo#125120

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-15 18:51:48 +02:00
Alexandre Kühn da73468c31 [FIX] mail: linkify url with subdomain containing numbers
Before this commit, when posting a message in discuss with some
urls, the url was not linkified.

Example of such linkify not working:
```
https://www.45017478-master-all.runbot134.odoo.com/web

```

The url regexp was changed with [1]
to make punctuation mark the end of url to linkify. The 1st dot
removed in diff was a mistake. This commit reverts this part, so
that url above is correctly linkified while fixing the problem
of [1].

[1] https://github.com/odoo/odoo/pull/122621

closes odoo/odoo#125081

X-original-commit: bbbc85865b45615937a22ed08b6e560a0aa898a0
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:39 +02:00
Alexandre Kühn 8a9bc4c55e [FIX] mail: Send message/log note in chatter style with MILK
- Send button has text "Send" or "Log" depending on composer mode
- When button is active, it has `btn-primary` and composer mode
  buttons use `btn-outline-primary`
- Add hint to use Send keyboard shortcut for fast send in chatter

Other changes:

- Re-introduce missing feature to jump to present when posting
  a new message in a thread.
- In chatter, the topbar and composer are sticky. Whole chatter
  is scrollable rather than just a part of it. As a result,
  `Chatter-scrollable` becomes `Chatter-content`.
- Editing a message in chatter now uses the extended composer

Task-3356271

closes odoo/odoo#124905

X-original-commit: 894ec7e7757d2bb78574e8cd210012b83fad1cf6
Related: odoo/enterprise#42508
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:14 +02:00
Sébastien Theys 77fa212a43 [REF] mail: move ChannelSelector to discuss folder
Part of task-3265211

closes odoo/odoo#124891

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-14 22:40:02 +02:00
Alexandre Kühn 1d42692cfd [IMP] mail: improve discuss counter style
To match the visual of the messaging menu badge for its counter.

Task-3345133

closes odoo/odoo#122946

Related: odoo/enterprise#42493
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-13 19:28:59 +02:00
Alexandre Kühn 8f38b5130c [FIX] bus, mail: message notif should not increment counter twice
Before this commit, a new unread message could contribute to unread
counter of conversation twice.

Steps to reproduce:

1. Log in as Demo and start a conversation with Mitchell Admin
2. Log in as Admin: if this is the first message in the conversation,
   counter is correct and shows (1)
3. Log out as Admin
4. Send another message to Admin
5. Log in as Admin and notice that the counter is doubled
6. If the conversation was still open, counter is correct!

This happens because some notification are pending dispatch before
fetching messaging state initially. The counter at init_messaging
fetch takes into account the notification. However, when handling
the message notifcation, it's wrongly considered as a new
notification, thus incrementing the counter when it shouldn't.

This commit fixes the issue by fetching the last bus notification
when fetching init_messaging. Doing so allow to determine whether
a notification is newer or older than init_messaging state.
This helps deciding whether the counter should be incremented or not.

Task-3357960

closes odoo/odoo#124767

X-original-commit: 081ab772dece86f1b5a5d4b3f6227b4b311d9206
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-06-13 10:14:06 +02:00
Sébastien Theys 6021b68b17 [REF] mail, im_livechat: move author open chat to discuss folder
Part of task-3265211

closes odoo/odoo#124495

Related: odoo/enterprise#42264
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-12 17:41:14 +02:00
Sébastien Theys 3ba40f468d [REF] mail: remove obsolete test tracking setup
Part of task-3265211

Part-of: odoo/odoo#124495
2023-06-12 17:41:13 +02:00
Sébastien Theys 16329a6a3e [REF] mail, im_livechat: remove obsolete context service
inPublicPage is already written from public page boot

Part of task-3265211

Part-of: odoo/odoo#124495
2023-06-12 17:41:12 +02:00
Sébastien Theys 2e386d966a [FIX] mail: move channel url to discuss folder + fix cache key
Avatar didn't sync when changed due to miss reading the cache key.

Part of task-3265211

closes odoo/odoo#124466

X-original-commit: 58fea4c78e11176bac609f89476fec8cd9fdb5df
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-09 17:01:51 +02:00
Sébastien Theys 9dba4e0d77 [REF] mail, *: reorganize JS files
Remove "fake" feature sub-folders that make files harder to find.

Note: If there are too many files in the main folder now, a new split
that actually makes sense can be done at a later time: this would not
just be code move, but removing coupling between said feature and the
rest of the code.

Apply consistent structure, where the top level folder is a feature (or
core), and sub-folders are subdivision of the feature depending on
context (closely related to assets bundles).

```
- core
    - common
    - public
    - web
- feature
    - common
    - public
    - web
```

The opportunity is taken to reorganize the top of the files and imports:
- Always use absolute path in imports to be able to find all usages of a
  file with a single search.
- Reorganize imports to group them by module, and to sort them
  alphabetically by path/feature.
- Always use single asterisk (*) for `odoo-module`: less characters yay!
  And double asterisk should be used for JSDoc comments, not for custom
  instructions.

Part of task-3265211

closes odoo/odoo#124168

Related: odoo/enterprise#42121
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-08 21:52:44 +02:00
Sébastien Theys 0dfed1b18b [REF] mail, im_livechat: move call files to discuss call folder
Part of task-3265211

closes odoo/odoo#124066

Related: odoo/enterprise#42093
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-07 18:01:04 +02:00
Sébastien Theys 227796c984 [REF] mail: move tests to core folder
Avoid having test floating in the root folder.

Part of task-3265211

Part-of: odoo/odoo#124066
2023-06-07 18:01:04 +02:00
Sébastien Theys 5dde72ace7 [REF] mail: move call tests to discuss call folder
Part of task-3265211

Part-of: odoo/odoo#124066
2023-06-07 18:01:03 +02:00