Commit Graph
30 Commits
Author SHA1 Message Date
Sébastien Theys a7485e53d6 [REF] mail, *: clean click and contains API
* = test_mail, hr, im_livechat

- Allow only selectors
- Add `value` check to `contains`
- Remove return from `click`

closes odoo/odoo#132799

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-23 17:40:07 +02:00
Sébastien Theys d08a18b791 [IMP] mail, *: tests: use contains in click and insertText
* = account, calendar, im_livechat, mrp, project_todo, sms, snailmail,
    test_mail, web, website_livechat

`contains` is more efficient than `afterNextRender` as it does not wait
for several extra animation frames, and it is functionally more
meaningful.

closes odoo/odoo#130451

Related: odoo/enterprise#44999
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-21 21:00:03 +02:00
Sébastien Theys 9a1efcbde7 [REF] mail, im_livechat, mrp: rename waitUntil to contains
`await contains` is shorter and reads better than `await waitUntil`.

Part-of: odoo/odoo#130451
2023-08-21 21:00:02 +02:00
Sébastien Theys 3f8544d906 [IMP] mail, im_livechat: tests: add assert to waitUntil
`QUnit` tests require at least one `assert`. This change allows to write
tests that only contain `waitUntil` without extra `assert` in the test.

`waitUntil` is more efficient than `afterNextRender` as it does not wait
for several extra animation frames, and it is functionally more
meaningful.

Currently existing tests that contain `waitUntil` have been adapted
accordingly. More and more tests should make use of it in the future.

Part-of: odoo/odoo#130451
2023-08-21 21:00:00 +02:00
lrizzi1 698e14a003 [FIX] mail: closing hidden chat window should not crash
Before this commit, closing a hidden chat window may crash.

This happens because closing a chat window was always treated as the
closing of a visible chat window, which should make the 1st hidden
chat window visible, if any. This code should not be called when
closing a hidden chat window, otherwise unexpected behaviour are
to be expected, e.g. closing 2nd hidden chat window swaps last visible
with 1st hidden chat window, or even a crash.

This commit makes sure auto-swapping of 1st hidden chat window only
occurs when closing a visible chat window.

opw-3460466

closes odoo/odoo#132458

X-original-commit: b49364b687757385a2a7356d17dc428edafd2767
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-20 14:43:56 +02:00
tsm-odoo 7131f7c626 [IMP] mail, *: add support for guests/dynamic users in tests
*: bus, calendar, im_livechat, web, website_livechat.

This PR adds the possibility to set the current user during tests as
well as the mail guest. This will be used to test mail guest page and
livechat once the visitors will be treated as guests.

part of task-3332628

closes odoo/odoo#130811

Related: odoo/enterprise#45331
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-08-09 14:36:12 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
Alexandre Kühn 29ca8f806a [FIX] mail: chat window state should sync crosstab
Before this commit, chat windows state (open/close/folded) was not
syncing between browser tabs. This lack of feature makes using chat
in crosstab quite inconvenient.

This feature exist in 16.2 and was mistakenly removed from rewritting
of Discuss code in 16.3. This commit reimplements as it was in 16.2.

Task-3435120

closes odoo/odoo#129812

X-original-commit: 8f27d1f254e79becf6886cdb90a1af14b28e9946
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-27 05:18:49 +02:00
Alexandre Kühn 4a92dfa3ba [FIX] mail: open chat on very narrow devices
Before this commit, when opening a chat on a very narrow mobile
device (e.g. 300px width), there was the following crash:

```
TypeError: Cannot set properties of undefined (setting 'hidden')
```

This happens because the computed maximum amount of visible chat
windows was 0, which prevented the good opening of chat window.
Indeed, the code relied on at least a `CHAT_WINDOW_WIDTH`, which
is 360px.

This commit fixes the issue by guaranteeing that it is always
possible to make 1 chat window on the screen, regardless of the width
of the device.

closes odoo/odoo#129474

X-original-commit: 1c9289fffe2a8d0936a1afa99255777ff275c712
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-25 17:36:10 +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 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
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
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
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
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
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
tsm-odoo 20c1772d35 [REF] im_livechat, *: refactor livechat
This PR refactors the public livechat in order for it to use
owl and to rely on the discuss components as much as possible.

task-2212347

closes odoo/odoo#122834

Related: odoo/enterprise#41636
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-02 22:29:06 +02:00
Alexandre Kühn 953498de76 [FIX] mail: reintroduce notif + chat window on new user connection
A recent refactoring of discuss app unintentionally removed the
feature to automatically notify and open chat window with new user
when they log in for the 1st time.

closes odoo/odoo#123044

X-original-commit: 9132dacbf9b4b9d000b6d0be23938b46db1035a1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-31 15:54:13 +02:00
Alexandre Kühn 123c9b3b47 [FIX] mail: show more options in chat window header
Before this commit, chat window header showed all actions,
which made it quite bloated. The name of conversation was
sometimes completely truncated by available actions.

This commit fixes the issue by showing at most 2 actions
immediately in the chat window header. When there are more
actions, it shows an expandable more menu.

As a consequence of this change, when a panel is open, it
was harder to see the button to close the active panel
(toggling off the button).
To solve this issue, when a panel is open in chat window,
there's a floating button in the top-right corner of content
to close the panel.

Task-3334793

closes odoo/odoo#122419

X-original-commit: eef4ef86e66709eef5b34ebce37cda3aab037bf9
Related: odoo/enterprise#41466
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-25 22:33:42 +02:00
tsm-odoo ea3008cc49 [IMP] mail, im_livechat: use ui service instead of store.isSmall
Since [1], the ui service is reactive which removes the needs for
the `mail.store` service to maintain a reactive version of `isSmall`.

This PR replaces the use of `store.isSmall` as well as `env.isSmall`
by the ui service.

1: https://github.com/odoo/odoo/pull/121343

closes odoo/odoo#121590

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-22 11:42:58 +02:00
Zelong Lin ff122ac7ae [IMP] mail: avatar edit in channel and group
1. Display avatar in top bar next to channel name and description.
2. Edit icon appears on hover.
3. Clicking on the Edit icon opens file browser to upload a new avatar.
4. Certain file types are allowed.
5. Avatar can only be changed for group chat by any member of the channel.
6. For channel it can be done with admin rights.
7. Disable uploading text from file uploader in this case.

Also show avatar of channel/chat conversation in chat window.
Author avatar in message list no longer shown im status.
Chat window header color matches new systray color.

task-2684679

[FIX] mail: make chat window header match systray color

Part-of: odoo/odoo#117357
2023-05-16 14:42:05 +02:00
tsm-odoo e1f0811b22 [IMP] mail: replace hardcoded orm commands in tests
Using hardcoded ORM commands in tests is cumbersome and not reliable.
This commit introduces the same system as the one used on the server.

closes odoo/odoo#120670

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 15:58:50 +02:00
Sébastien Theys 694d501a35 [REF] mail, im_livechat: move /mail/chat_post to im_livechat
It is only used there.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119306

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-24 18:25:59 +02:00
Sébastien Theys 90cb44e1e1 [REF] mail, *: rename mail.channel to discuss.channel
* = bus, calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot,
    mass_mailing, privacy_lookup, test_discuss_full, test_mail,
    test_mail_full, website_crm_livechat, website_livechat, base

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#118354

Related: odoo/upgrade#4553
Related: odoo/enterprise#39661
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-21 02:21:53 +02:00
Alexandre Kühn 4fd9cfbe81 [FIX] mail: make chat window take whole height in mobile
Before this commit, chat window take at most 95% of global
height. This is ok in desktop, 5% room allow clicking on
systray menu. In mobile, however, the intend is for chat window
to take whole height.

This commit makes chat window take whole height in mobile, while
preserving the max-height 95% of global height in desktop.

Also fix an issue where chat window were foldable in mobile, when
this feature is desktop-only.

closes odoo/odoo#119058

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-19 19:14:47 +02:00
Alexandre Kühn 804d3786e8 [FIX] mail: do not auto-open chat window with odoobot on login
closes odoo/odoo#117978

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-07 19:43:25 +02:00
zel-odoo fa006f2bbe [IMP] mail: ChannelSelector improvements
1. Display no result when having no matched results.
2. Hidden when clicking outside of the field.
3. Be visible when clicking inside the field.
4. Add related tests

task-3208033

closes odoo/odoo#116214

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 15:09:20 +02:00
Alexandre Kühn 5bc42ddc32 [FIX] mail: no member-list and settings buttons on folded chat window
They make sense when the chat window is unfolded,
as it changes the content. But when folded, the buttons have no
visible affect. Better hide them in that case.

closes odoo/odoo#116242

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 19:44:44 +01:00
tsm-odoo 14b0da3d0a [IMP] mail: mark message as unread
task-3232911

Part-of: odoo/odoo#116085
2023-03-22 14:52:13 +01:00
7710c3331e [REF] mail, *: refactor Discuss
This commit refactors discuss code to use OWL components
and new tools and services in web/.
Functionally, Discuss app should work relatively the same as
before this commit.

closes https://github.com/odoo/odoo/pull/110188

Related:
https://github.com/odoo/enterprise/pull/38058
https://github.com/odoo/upgrade/pull/4423

closes odoo/odoo#110188

Related: odoo/upgrade#4423
Related: odoo/enterprise#38058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre (aku) <aku@odoo.com>
Co-authored-by: Didier (did) <did@odoo.com>
Co-authored-by: Géry (ged) <ged@odoo.com>
Co-authored-by: Louis (wil) <wil@odoo.com>
Co-authored-by: Maël (mapa) <mapa@odoo.com>
Co-authored-by: Maryam (maki) <maki@odoo.com>
Co-authored-by: Sébastien (seb) <seb@odoo.com>
Co-authored-by: Thanh (tso) <tso@odoo.com>
Co-authored-by: Matthieu (tsm) <tsm@odoo.com>
Co-authored-by: Zelong (zel) <zel@odoo.com>
2023-03-17 11:47:09 +01:00