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
closesodoo/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>
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
closesodoo/odoo#128320
X-original-commit: 12f2ddf722d659df651e5ef929f775ea1cabed88
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#127406
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
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
closesodoo/odoo#126361
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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.
closesodoo/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>
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.
closesodoo/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>
`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
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.
closesodoo/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>
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.
closesodoo/odoo#127997
X-original-commit: b8bf65478cad558e02a5902886b3e4272483944e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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.
closesodoo/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>
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.
closesodoo/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>
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.
closesodoo/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>
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
closesodoo/odoo#127570
X-original-commit: b9c8fe1759f03952a42c9bee117e718eab3fef08
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Before this commit, only logged notes could be edited in chatter.
With this commit, messages sent with "Send message" are also
editable.
Task-3380465
closesodoo/odoo#125939
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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`.
closesodoo/odoo#127399
Related: odoo/enterprise#43678
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
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
closesodoo/odoo#125137
Related: odoo/enterprise#42772
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
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.
closesodoo/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>
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.
closesodoo/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>
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.
closesodoo/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>
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
closesodoo/odoo#116060
Related: odoo/enterprise#41959
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
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
closesodoo/odoo#126888
X-original-commit: 1fe935d273142064784b9ecff2fff1c34e91064f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#126801
X-original-commit: 4953172398719df829735f381f4e8939f17b1989
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#126751
X-original-commit: ef14f50d9ab7e2f38d65ac569f4108a89abbb69a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#126749
X-original-commit: eeaee0d57effb50d3a0edad1672e17bffea11d0a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#124592
Related: odoo/enterprise#42480
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#125909
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This results in parent message being displayed as text when it is part
of the result of a load around call.
closesodoo/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>
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
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
closesodoo/odoo#125120
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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/122621closesodoo/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>
- 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
closesodoo/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>
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
closesodoo/odoo#124767
X-original-commit: 081ab772dece86f1b5a5d4b3f6227b4b311d9206
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Avatar didn't sync when changed due to miss reading the cache key.
Part of task-3265211
closesodoo/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>
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
closesodoo/odoo#124168
Related: odoo/enterprise#42121
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>