Commit Graph
5296 Commits
Author SHA1 Message Date
Alexandre Kühn fbcab1fccc [FIX] mail: missing spacing in Messaging Menu 'New Message'
Follow-up of [1]

PR above made several improvements to Messaging Menu, especially
in mobile.

By mistake, it removes the spacing between "All"|"Chats"|"Channels"
and "New Message" in desktop.

This commit re-adds this spacing with `div.flex-grow-1`.

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

closes odoo/odoo#142186

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-11-15 15:03:58 +00:00
tsm-odoo c9b72f09d8 [FIX] bus: fix im status not updating
Odoo periodically updates the user online status. This is
done every minute and is throttled in order to ensure it won't
be triggered more than it should.

Since [1], the underscore `throttle` function has been replaced
by the `throttleForAnimation` function. This is not equivalent:
the function won't be triggered if there is no animation which
result in an outdated user status.

This issue was highlighted by the live chat: the button does
not show up when there is no available operator.

Steps to reproduce the issue:
- Log in on Odoo with live chat installed
- Go to a web page that uses the live chat widget
- Wait more that one minute and refresh the page
- The live chat button is not shown anymore: the only
operator is considered as disconnected.

This PR fixes that issue by re-introducing the underscore
throttle function: it is robust and can be needed, not all
throttles are linked to animations.

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

opw-3578517

closes odoo/odoo#142160

X-original-commit: f64a7cbad3dee3ffc365b931306b1c13c8bff536
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-11-15 13:56:35 +00:00
tsm-odoo f5e0ca51de [FIX] mail: fix dropzone background for live chat
Before this PR, the dropzone background was not showing on
the embed live chat. The dropzone is displayed as a `main
component`. In the Odoo frontend, the main component container
is displayed outside of the live chat shadow dom, where the
`bg-view` class is not available. This commit replaces this
class by the `bg-100` one that is almost the same and available
in the frontend.

task-3595537

closes odoo/odoo#142055

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-15 11:26:07 +00:00
Nasreddin Boulif (bon) 4c38507c03 [FIX] mail: don't apply system timezone on tracked date value in chatter
Steps to reproduce:

  - Add a date field in a model with `tracking=True`
  - Log with a user with timezone set to UTC+2
  - Create a record and set the date field to any date.
  - Update the date value to another date
    (Should have logged a message in the chatter with changes)
  - Log with a user with timezone set to `America/Los Angeles`
  - Check the chatter of the record created above

Issue:

  New date value displayed in the chatter is wrong (set to one day
  before).

Cause:

  The value displayed in the chatter is the date value converted first
  as datetime (with Luxon library), then the system timezone is set on
  it and therefore might change the day.

Solution:

  Use `deserializeDate` instead, who has the same computation as
  `deserializeDatetime` (with the sole difference of date vs datetime)
  and therefore will not apply a timezone on the date.

opw-3427502

closes odoo/odoo#142034

X-original-commit: ca3254f8c7700fe78053072710f0c57fee60af5b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-11-15 09:07:59 +00:00
Sébastien Theys d3b7ff500b [FIX] mail: fix race condition in load_message_order
- adapt test to ensure consistent (scroll) state at each step

The issue is hard to reproduce, so the complete resolution of the issue
is not guaranteed, but the current change should do the job, and if it
doesn't, it will help to pinpoint the issue.

Estimated issue: the thread doesn't load more messages when scrolling to
bottom because the scroll to bottom is overriden by the auto-scroll top
when clicking on pin. Adding extra wait point should solve the issue.

runbot-24512

closes odoo/odoo#141999

X-original-commit: 477b1c3aa1da7261273341338f3d37ee828715f8
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-14 15:16:08 +00:00
Didier (did) cfeef1472f [FIX] mail: cache online and offline getter
Before this PR online and offline cache getter where called when not needed.
This PR move the code inside the onWillRender hook to cache the results and
avoid useless computation of getters.

task-3572093

closes odoo/odoo#141750

X-original-commit: 57aa00893cc47456d5eb39f429c83c4069ab0d7e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-13 13:20:11 +00:00
Didier (did) bcf64fa885 [FIX] mail: mark as read can ignore 404 error
404 means that the thread was deleted

Task-3577083

closes odoo/odoo#141372

X-original-commit: 6aeb00d7e3b60f9eb0cb968fe16ba1a333076ec3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-11-08 01:21:58 +00:00
Didier (did) 4064508af5 [IMP] mail: send cache control header on avatars
Before this PR cache control header for avatar was set to no-cache which is not
the right value.
This PR mark the avatar routes response as immutable when a unique string is
present. We also use the partner write_date as unique string when possible.

task-3551636

closes odoo/odoo#141326

X-original-commit: 3de4f1f1225229cbdb0512df5790ce491f04ea7e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-07 21:02:27 +00:00
Maryam Kia 546f77d1ca [IMP] mail: sharing both screen and camera tests
This commit contains the tests related to the screen sharing at the same time with camera sharing on call

closes odoo/odoo#141275

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-07 21:02:21 +00:00
FrancoisGe 5674e221c4 [FIX] web, *: clicking on a button that crashes does not enabled buttons
In many situations, when you click on a button, you want to disable all
the other buttons while it is running.
Currently, in each of these situations, we duplicate the same code that
disabled all the buttons and enabled them afterwards. Unfortunately, in
many cases, if the code executed crashes, the buttons are not enabled.
In this commit, we're going to create a helper so that we have a single
version of the code that correctly handles crashes. This helper will
disabled all the buttons, then execute the click code and enabled all the
buttons afterwards. If the code crashes, it will also enbaled them.

The problem has been reported for the Settings Form view:
When you edit this view and click save, if an error occurs in the save,
all the buttons remain disabled.

closes odoo/odoo#140938

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-07 19:32:17 +00:00
Alexandre Kühn d68488db7d [FIX] mail: several slight messaging menu improvements
Before this commit, the Messaging Menu had the following issues:

- Header is too large;
- Header color in dark theme is too white;
- Important notifications (= needactions) are not highlighted enough
  compared to muted notifications;
- Notification body and title looked too alike;
  => title should be more visible than content
- Mouse-hovering on notification items breaks background-inherit
  style of avatar and IM status;
  => side-effect of `list-group-item-action`
- Desktop: Header items slightly move when changing selection;
  => comes from `fw-bolder`
- Desktop: mark as read button was too small and not visible enough;
- Mobile: too many borders, and they are too strong;
  => undesirable dropdown style
- Mobile: Messaging Menu had poor "New message" button link whereas
  Discuss app has nice "Start a conversation" button;
- Mobile: "Start a conversation" button is not shown on livechat tab;
- Mobile: when menu is open while Discuss app is open in background,
  it's unclear whether the messaging menu is open or not;
  => missing background highlight on Messaging Menu toggler
- Mobile: State of Mobile Discuss App was not synced properly when
  using Messaging Menu at the same time;
  => e.g. unselected tab
- Mobile: Discuss app and Messaging Menu were not properly aligned;
  => Messaging Menu did not offset position based on systray navbar
  height
- Mobile: active navbar item was not highlighted enough, especially
  in white theme;
- "OdooBot has a suggestion" is shown on all tabs instead of only
  in "All" tab like "OdooBot has a request";

This commit fixes all the above issues.
Some styling issues were also affecting the Activity Menu, such as
borders and highlighted open state. This commit applies these
few improvements on the Activity Menu too.

closes odoo/odoo#140405

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-07 19:32:15 +00:00
Pierre Rousseau e4b66668e0 [FIX] web: do not use command "set"
In a many2many_tags field with onchange and on a slow network, quickly
add or remove tags several times. Each call to update sends a command 6
(SET) based on the current state of the record (typically here,
the very initial state). For example, if there're 2 tags [1, 2] in the
relation and I add 3, a command 6 with ids [1, 2, 3] is sent. If I
quickly add 4 before the onchange returns, another command 6 with ids
[1, 2, 4] is sent. At the end, 3 would not have been added to the
relation.

With this commit, we don't use the command "set" anymore. Instead, we
use a combinaison of commands "link" and "unlink" to add and remove
records from the relation. This way, we don't need to know the current
state of the record, and we can be sure that the final state of the
relation is the one we expect.

Task-id 3522153

closes odoo/odoo#140644

Related: odoo/enterprise#49995
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-07 17:57:14 +00:00
Pierre-Yves Dufays 5415953b21 [IMP] mail: add fallback for not deployed action/view
To avoid crash on possibly not deployed action and related views
(mail.mail_activity_without_access_action), we temporary add a fallback on
existing action and views.

Task-3562098

Part-of: odoo/odoo#139917
2023-11-07 09:19:03 +00:00
Pierre-Yves Dufays c5bd3f6b2f [IMP] mail: add custom view for "other activities"
When clicking on "Other activities" in the systray, a list of activities
assigned to the user for which he has no access to underlying record is
displayed. The default list allows to delete, archive, duplicate, ...
activities but what we want is a readonly view. We add here a new view that
doesn't allow any modification on the activities by removing those actions.
Unfortunately, archive and unarchive action is not controllable with an
attribute (nor by setting the active field as readonly in the view), so we
create a very simple extension of the list view to disable it.

We also add in the list view a button to mark an activity as done and a simple
form view to see the details of the activity (note, ...). The "mark as done is
not added in the form view as the activity is deleted causing an error because
the form is still displayed and the record is gone.

Note that those action are only removed from the client but the actions are
not forbidden on the server side.

Task-3562098

Part-of: odoo/odoo#139917
2023-11-07 09:19:03 +00:00
Pierre-Yves Dufays 54aaf3a0a5 [IMP] mail: display activities without record access in the systray
When scheduling plans on employees, activities may be assigned to people who
don't have access to the record. It was managed locally in HR through a dummy
model aggregating activities. However, it was removed and we replace it here by
a generic solution that adds an entry in the systray: "Other activities". When
clicking on that entry, it displays a list view of the activities assigned to
the user for which he has no access to the related record. Those activities
were not visible to the user before.

Technical note: to allow displaying such records, we have modified the custom
acl defined in python to allow users to read activities assigned to them even
if they don't have access to the related record.

Task-3562098

Part-of: odoo/odoo#139917
2023-11-07 09:19:02 +00:00
TSO bc16aae6e2 [FIX] discuss: rely on streaming state flags instead of streams
Before this commit, we used to rely on duplicates of streams and the
presence of streams to know if a session was streaming.

This commit changes this and make it so that we now use streaming
activity flags instead.

This is a prerequisite for https://github.com/odoo/odoo/pull/132153 as,
similarly to webRTC "unified plan", the SFU keeps the same streams for
the whole lifespan of a connection.

closes odoo/odoo#140053

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-07 04:29:04 +00:00
Didier (did) f09d659a26 [FIX] mail: add missing threadService to mailCoreWeb
closes odoo/odoo#141207

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-06 20:52:29 +00:00
Brieuc-brd 70f853aab9 [IMP] web, mail: adapt "Add a Reaction/emoji" icon
Prior to this commit, "Add a Reaction/emoji" and "View Reactions"
buttons had the same icon, which was confusing.

This PR adapts the "Add a Reaction/emoji" icon to make it more
recognizable.

task-3577008

closes odoo/odoo#140481

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-06 20:52:28 +00:00
tsm-odoo f10c9114e6 [FIX] mail: fix scroll flicker on thread start
The `onWillStart` hook that was used in the thread component but was
replaced  by the `onMounted` hook. Indeed, fetching the messages in
the `onWillStart` hook was leading to an infinite loop (props updated
as a side-effect of the `onWillStart` hook).

After messages are loaded, the scroll position of the thread is
restored. Since this is done after the component is mounted, another
render is triggered and results in a flicker when opening the thread.

This commit fixes this issue by waiting for the thread to be mounted
and for the scroll position to be restored before showing the message
list.

closes odoo/odoo#141145

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-06 12:32:06 +00:00
tsm-odoo bad8d093f5 [FIX] mail: incorrect message order on previous messages load
Discuss models use relationnal fields. Since [1], the implementation
of the `unshift` method changed for `many` fields. The new
implementation is incorrect: unshifting several records results in an
insertion on the inverse order which differs from the native
implementation.

This issue broke the loading of older messages in discuss: older
messages are inserted with the `unshift` method thus in the inverse
order.

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

closes odoo/odoo#140747

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-06 12:32:00 +00:00
mano-odoo b38d3b837b [FIX] web, mail: searchbar facet cog overlapping
When discuss is not installed, hovering a facet in the searchbar makes
the cog overlap the icon/text.

This is due to the `o-bg-inherit` class which is set in the mail module.
Therefore if discuss is not installed, the SCSS for the background
doesn't exist.

This commit moves the `o-bg-inherit` as a new utility class `bg-inherit`
, allowing it to be used even if no apps are installed.

Therefore also renaming the occurences of `o-bg-inherit` into
`bg-inherit`.

task-3575837

closes odoo/odoo#140334

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-06 12:31:58 +00:00
Sébastien Theys 221b11e7ac [FIX] mail: lazy load message out of focus sound
There is no reason to load this sound until it should be played.

closes odoo/odoo#140900

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-04 03:25:48 +00:00
Sébastien Theys 06603e9dc7 [FIX] mail: show translations for emails
Due to shadowRoot, emails were not properly translated.

closes odoo/odoo#140847

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-03 00:49:06 +00:00
Sébastien Theys 3bf990d0b0 [FIX] mail: allow translating self authored messages
This is an arbitrary restriction and it is confusing to not always find
the button.

Part-of: odoo/odoo#140847
2023-11-03 00:49:06 +00:00
Rahul Prajapati 153d62eaf4 [FIX] mail: rtc session counting in updatertcsessions
Before this commit:

The logic used to count the number of RTC Sessions was incorrect. Which led to
multiple sounds being played sometimes. Etc, on start a meeting

After this commit:

Corrected the RTC Sessions counting logic.

closes odoo/odoo#140628

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-02 18:23:14 +00:00
zel-odoo cf86759d1d [FIX] mail: wrong use of group_based_subscription
1. `searchPartnerSuggestions` uses`authorizedGroupFullName` to see
if the channel is public or not
2. `filteredThreads` and `getThreads` uses `hasSelfAsMember`
and `is_pinned` along with the channel type
3. search should use `displayName` otherwise the search on group
with default empty name will fail
4. fix tests.

closes odoo/odoo#140495

X-original-commit: b358c410988686610638e7ffbee1fbbbeff5f0ba
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-02 18:23:12 +00:00
Pierre-Yves Dufays d2f44211b9 [IMP] mail: add/modify activity client tests
We add a test that checks the rendering of the activity view and the activity
popover with activities done.

We also add a test that marks as done an activity and verify that the activity
view is updated accordingly.

And we do a correction in the test "activity menu widget: activity menu with 2
models" (assert.ok(selectContaining... was always true as an array is always
returned and [] is true in javascript).

Task-3558929

Part-of: odoo/odoo#139373
2023-11-02 13:25:48 +00:00
Pierre-Yves Dufays 949039135d [FIX] mail: fix invalid date done in the activity list popover
Date done field was in camel case instead of snake case leading to undefined
value and "Invalid date" in the interface.

Task-3558929

Part-of: odoo/odoo#139373
2023-11-02 13:25:48 +00:00
Sébastien Theys 2426cf369b [FIX] mail: no crash on opening non-existing channel
closes odoo/odoo#140562

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-31 15:54:33 +00:00
Alexandre Kühn f65699dbd1 [FIX] mail: OdooBot has a request notif should not be muted
Before this commit, the "OdooBot has a request" notification in the
Messaging Menu -- which suggest to enable push notifications -- had
a muted style, which looks as if the item is unimportant and was
read by the current user.

This is an important notification, at an equivalent level of
importance than needaction notifications. This was already
highlighted by this item contributing to the global Messaging Menu
counter.

This commit fixes the issue by not muting this notification. To do
so, it enhances prop `muted` on `NotificationItem` component:
- 0 (default): the notif is unmuted
- 1: the notif is slightly muted
- 2: the notif is hard-muted

0/1 are equivalent to the different muted style of notification in
16.4, while `muted: 2` shows a hard-muted notification when the user
choose to manually mute a channel, as to not receive any notification
from it.

Some logic related to "mark as read"/"counter" logic has been moved
to this muted prop concern, as not all notification that have mark
as read or a counter necessarily must be muted, e.g. with "OdooBot
has a request".

Task-3566799

closes odoo/odoo#140380

X-original-commit: c60fdbb25b38899ceeb89e76abc35c3474ce1f5b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-31 14:40:56 +00:00
Rahul Prajapati 089e46ae59 [FIX] mail: channel unpin/delete issues
Before this commit:

Channel was not getting unpinned after being deleted

After this commit:

- Channel gets unpinned for all the channel members after being deleted
- If a user leaves channel/group then all of the messages of that channel/group
  are removed from the user's history/starred/inbox channel.

Task-2814440

closes odoo/odoo#139972

X-original-commit: 4767d6001d15628768388bcac98c04ab185040c8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-31 13:26:40 +00:00
Didier (did) ceebd2e8d0 [FIX] mail: reorder direct message when opening a new one
Before this PR, newly created direct message would be added at the bottom of the
list instead of the top.
This PR fix the issues by sorting the direct messages when creating a new direct
message channel.

Task-3566728

closes odoo/odoo#139960

X-original-commit: 60cf880102615a524f2fa89c71be7f1b08d931d1
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-31 10:33:49 +00:00
Alexandre Kühn bef68e577a [FIX] mail: center avatar with composer with a single line
Before this commit, the avatar next to composer in Discuss app
had the top aligned with the top of the text input of composer.
The avatar is smaller than the input, and the text in the input
is centered, so the alignment looks off.

This commit fixes the issue by offseting the avatar so that
when the composer has only 1 line, the avatar is vertically centered
with the input.

Note that this alignment should be fixed, i.e. if the input field has
more than 1 line, we want to keep the avatar in the same place, hence
why the avatar is just statically offset.

Also align composer avatar with message list, by removing the
`align-justify: self` that was moving avatar slightly towards the
discuss app sidebar.

closes odoo/odoo#140398

X-original-commit: 5fe4297f3d1a988ae65617c177046a223bc62890
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-30 21:50:48 +00:00
tsm-odoo 74f59fc59c [IMP] im_livechat: no 2 emoji icons in quick actions of message
Before this commit, messages in livechat from visitor POV show
2 emoji icons in the quick actions. This is confusing and comes
from 2 actions sharing this exact same icon: "Add a reaction"
and "View reactions".

This commit fixes the issue by reducing the number of quick message
actions to 2 for the embed live chat. In other contexts there's
"Reply-to" and "Mark as Favorite" in quick actions, so the
"View reactions" item is always in expand menu.

Note that this "dirty" fix come from 2 actions with same icon.
Eventually we should fix that by clearly making icons unique.
This solution is decent for the time being, giving us more time
to make a dedicate icon for one of the emoji actions.

task-3498446

closes odoo/odoo#140335

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-30 21:50:46 +00:00
Alexandre Kühn a74691949c [FIX] mail: same discuss badge color as systray in dark theme
Dark-mode colors have been adapted from MILK redesign in 16.3 [1].
Discuss badge colors were changed in 16.4 to match systray color [2].
Commit [1] adapted them to use primary color instead of intended
sytray color. Removing the override of style fixes the issue, as the
base style in `core.scss` (white theme) works in both themes.

[1]: https://github.com/odoo/odoo/pull/130991
[2]: https://github.com/odoo/odoo/pull/122946

closes odoo/odoo#140300

X-original-commit: b46bded27349acd311682846c0a0416ce4898882
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-30 16:41:51 +00:00
Alexandre Kühn 7cf86921b4 [FIX] mail: click on messaging menu item should not rename thread
Before this commit, when opening a thread in the Discuss app and
changing to another active thread from the Messaging Meu in the
systray, the new thread was mistakenly renamed to the previous
active thread name.

This happens because the component `AutoresizeInput`, which is used
to show the thread name in the header of Discuss app, also allows to
rename the thread. The code to trigger rename was too naïve, in that
a click away was considered as a rename operation on the current
thread.

This commit fixes the issue by triggering the editing of the value
in the `AutoresizeInput` component only when the click away happens
while the input had focus. The click in messaging menu will not
trigger it as the input is not focused.

Task-3570377

closes odoo/odoo#140208

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-30 16:41:46 +00:00
tsm-odoo 1306635db8 [FIX] mail: fix highlight pin message from notification
Since [1], highlighting a pinned message from the notification sent
to the channel does not work anymore. This is due to a `super` call
missing. This PR fixes the issue.

Steps to reproduce:
- Go to a channel
- Pin a message
- Click on the "message" link
- Nothing happens

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

closes odoo/odoo#139948

X-original-commit: 68992ba05eb48459800df17707741295a4f47c9c
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-30 07:37:13 +00:00
c0b683e2f4 [IMP] web,*: improve darkmode
This commit introduces some adjustments to the dark mode color scheme
and the use of bootstrap classes in Community.

- Mini calendar contrast -

The colors were not using variables, making them non dynamic
and breaking the contrast in dark mode.

- Avoid !important rules spreadsheet -

Prior to this commit, spreadsheet top bar was using a `bg-white` class,
making it pure black in dark mode.

Since spreadsheet is designed with light colors and we don't provide a
dark mode for it, we remove that class and set a `background-color`
property using CSS in Enterprise.

- Input color -

This commit fixes the focus behavior on the searchbar in the control
panel, the `command_palette_search`, and the `start a conversation` in
discuss.

- Copy clipboard field border color -

Make use of the `text-primary` color for the copy to clipboard field
We use the o-theme-color function to avoid an undefined since primary
doesn't exist in the o-theme-text-color map in white mode.

- Web_editor toolbar variables -

The toolbar was using the `o-brand-primary` variable
which was set to a darker shade. This caused issue when activating an
option due to how vibrant the color is.

- Improve the controls on border-color -

Introducing a custom property on the border-color to allow
further control on individual components (such as the popover).

- Improve setting tabs colors use -

Prior to this commit, the colors of the settings tabs menu were kinda
inverted. The menu was light in dark mode and dark in light mode.

We fix this by changing the values associated to the CSS variables in
use.

- Make model field selector dark mode proof -

Fixing the design of the model field selector popover in both
light and dark mode. Since the popover was using custom style with
arbitrary values, it was not designed for the dark mode and had a lack
of consistency.

To improve the design, we use variables rather than custom style, and
make sure the desired render is as close as before.

- Sign colors use -

This commit aims to improve the sign module in both light and dark mode.
There were some readability issue with some `btn-light` having poor
contrasts in both light and dark mode, and the use of some classes was a
bit unexpected (e.g `card-header` to set a grey background with some
padding).

- Improve buttons design inside listview -

Prior to this commit, this button was using custom CSS to make it look
like a primary button, while it was using classes related to secondary
buttons.

We remove the custom CSS used to style it correctly and keep our button
design consistent.

- Messaging menu layout in mail -

This commit aims to improve the design of the notifications displayed
in the messaging menu. Prior to this commit, the notifications dropdown
was using custom CSS variables overriding the regular behavior
of our dropdowns.

In fact, the layout was generating some friction:

1) Marking a notification as read would turn its background into a
darker color

2) Effects like `:hover` were all based on the custom CSS variables
resulting in an inconsistent layout.

- Multi company selector adaptations -

In darkmode the multi company selection was using the btn-light which
creates a weird effect and overrides the dropdown default hover behavior

This commit uses the btn-link to display an hover effect on the
company switch and on the checkbox while blending with the background
and the default dropdown hover effect.

- Adapts default badge design -

Improve the design of the default badges in dark mode.

If you open the light mode, these badges are dark grey with a white
text. If you switch to dark mode, they are dark grey but with a dark
text, which makes them look either muted or off.

We make use of SCSS variables to handle the color of the component,
providing a good styling in both modes.

- Fix kanban cards borders inside dropdown -

Fixes the issue with the divider inside the kanban dropdown menu not
showing in dark mode.

To ensure it is visible, we assign it the `$dropdown-divider-bg`, which
is the color it should use, as the horizontal divider above uses.

- Fix tour pointer design for dark mode -

This commit aims to insert the tour pointer and its content inside the
styling we applied to our tooltip.

To do so, we make sure it uses CSS variables, allowing more control and
consistency, plus we replicate the overall look of our tooltips.

- Fix `text-primary` on action background contrast -

This commit improves the readability of our `text-primary` classes when
it's used on a `$o-component-active-bg` background.

Prior to this commit, the `text-primary` was not meeting the contrast
standard, mainly when you were using the `CMD+K` shortcut on the
app switcher.

To prevent that, we changed the background to a `$o-component-active-bg`
background with an opacity ensuring our text provides a good contrast.

- Fix input states -

Prior to this commit, the `--o-input-border-color` CSS variable was
using the `$o-form-lightsecondary` variable to define the standard color
of the `border-bottom` property of our inputs.

This was conflicting since `$o-form-light-secondary` is also used to
define the `background-color` of our table on focus.

With this commit, we separate these two element with different variables
to make sure they don't affect each others.

- Fix kanban ghost background -

Before this commit, if you created a project without any stage or element
in it, the ghost cards that act like placeholders would be pure `#000` in
dark mode, due to the `bg-white` class.

This commit replaces that class with a `bg-light`, providing a better
visual result in both light and dark mode.

- Fix new message design -

Improve the design of the new message element while
inside Discuss, using our danger color, ensuring a good visual result in
both modes.

task-3201038

closes odoo/odoo#139966

Related: odoo/enterprise#49666
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: chgo-odoo <chgo@odoo.com>
Co-authored-by: stefanorigano <sri@odoo.com>
2023-10-28 10:07:53 +00:00
Alexandre Kühn 05f434c222 [FIX] mail: show original format of email message in white theme
Before this commit, messages of type email had their style initially
altered on the UI to match the theme, notably the background and font
color. To see the original format, a floating button
"Show Original Format" was shown in the top-right corner of these
messages.

The main problem with this button is that most email messages do not
have a different visual between altered and non-altered, so this
button felt useless most of the time. Also, the original style of
email message is a annoyance in dark theme but not in white theme.

This commit removes the presence on the button and the style of
email message is now based on the chosen theme:
- white theme: always show the original style of the email
- dark theme: always show a slightly altered style of the email

This commit also fixes a bug where message of type `email_outgoing`
were not properly considered as email messages. To fix this issue,
`message.type === "email"` has been replaced with
`message.type.includes("email")` to also take these messages into
account.

Task-3573855

closes odoo/odoo#140176

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-28 01:18:30 +00:00
TSO c5237e1ac1 [FIX] discuss: use the right rtcSession property in activeCall check
Before this commit, since https://github.com/odoo/odoo/pull/137750,
the `RtcSession.channelId` property was removed, which prevented
the "LIVE" state in calls to be displayed (and hidden) in the right
conditions, a missing button in call invitations, and possibly other
bugs.

This was not caught by tests because there is no test for that.

closes odoo/odoo#140082

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-27 16:09:39 +00:00
Aaron Bohy 01f03b1e19 [IMP] mail: do not wait for init_messaging at webclient startup
The messaging service starts synchronously and exposes a promise
isReady that is resolved when the call to init_messaging is done.
This is good as this call thus doesn't slow down the services
startup and thus the webclient mount.

Unfortunately, the ChatWindowContainer, which is a main component,
i.e. a child of the WebClient, waits for that promise in its
onWillStart. As a consequence, the webclient can't be mounted
until the rpc returns, which can take a while (in odoo.com, this
rpc lasts ~500ms).

The chat windows being "peripherical components", there's no reason
to block the whole application for them. Instead, the webclient
can be mounted, and when they are ready, the chat windows can be
rendered. This is what this commit does.

Back-port of https://github.com/odoo/odoo/pull/139750/

closes odoo/odoo#140056

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 14:22:14 +00:00
Rahul Prajapati 3b1d10f0f1 [FIX] mail: message author name and image pointer style tests
This commit adapts message tests to check pointer style on message author name
and author image.

closes odoo/odoo#139951

X-original-commit: 134b7cc1143faf9275683ae12c2b121ab03aed7e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:22 +00:00
Alexandre Kühn af3d6bf4a6 [IMP] mail: chat window dropdown show active background
Before this commit, when the command dropdown was open by clicking
on avatar/chat window header name, the clickable area was the same
as the rest of chat window header.

As a result, the dropdown was shown without some UI to help see the
toggler that is responsible from this dropdown.

This commit highlights the toggler of dropdown when it is open, so
that it looks nicer when the dropdown is open as we clearly see the
toggler of this dropdown.

closes odoo/odoo#139920

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:18 +00:00
Zelong Lin 45ac37425b [FIX] mail: broken AutoresizeInput style
hovering and focusing style is lost.

closes odoo/odoo#139911

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:14 +00:00
Alexandre Kühn 47be118fb1 [FIX] mail: message reply-to click area should match cursor feedback
Before this commit, when a message is a reply to another message,
the whole row of the message reply-to was clickable to highlight the
reply-to message.

This is ok when the click happens on the actual reply-to message
above the message, but when the content of the reply-to message
is short, the click area extends to more than the "clickable" cursor
show, so that click on thread view hightlights the reply-to message
when it shouldn't.

The `cursor-pointer` style was already correctly shown only the the
actual part of the reply-to message. But the `t-on-click` was more
generous and considered the whole row in the thread view.

This commit fixes the issue by matching the `t-on-click` with the
intentional clickable area, matching the `cursor-pointer` that was
correct.

closes odoo/odoo#139906

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 11:35:08 +00:00
Alexandre Kühn b88ecba36f [IMP] mail: improve label of button to toggle style of email message
Before this commit, when a message is of type email, the button to
toggle between adjusted content style with webclient theme and the
original email style was labelled "Show Original Email" and
"Don't show original Email".

This label is confusing, as it gives the impression that this button
opens a new screen or removes a UI element. This button only alters
the visual of the message, that is the style, so the label should
be better worded to tell that.

This commit rename the label to "Show Original/Custom Format", so that
it's clearer what this button actually does.

closes odoo/odoo#139901

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 11:35:06 +00:00
Alexandre Kühn 38d35c1ac6 [REF] mail: have author in notification formatter
So that `Message.insert()` in JS becomes trivial, as it doesn't have
to infer the author of message to current user.

closes odoo/odoo#139501

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-26 13:41:16 +00:00
Alexandre Kühn eae6943021 [IMP] mail: RecordList auto-call unimplemented array method
This allows to support many unimplemented array methods, such
as `Array.prototype.findLast()`.

Part-of: odoo/odoo#139501
2023-10-26 13:41:16 +00:00
Alexandre Kühn c9a3b335d8 [REF] mail: remove mail/utils/arrays
This utils file was added because removing item in JS based on
item content sucks, so some higher-order functions were introduced
to ease it slightly.

As many of its uses has been replaced with `RecordList.delete()`
where data is uniquely linked to a model, in the end the functions
were only used once. These functions have been moved to the only file
that still use them, so that we don't encourage using them.

Part-of: odoo/odoo#139501
2023-10-26 13:41:16 +00:00
Alexandre Kühn f97012e0ed [REF] mail: support multi-data insertion in discuss model
Before this commit, when having an array of data to insert
in a model, we had to iterate and insert data item on by one:
```js
messageDataList.forEach(data => this.store.Message.insert(data));
```

With this commit, we can simply insert the array of data to
insert:
```js
this.store.Message.insert(messageDataList);
```

This helps simplifying the business code further, less LOCs is
usually better!

Part-of: odoo/odoo#139501
2023-10-26 13:41:16 +00:00