Commit Graph
2178 Commits
Author SHA1 Message Date
Christophe Simonis ea0b3d600d [FIX] mail: declare services used in forward-ported test
Only broke test with enterprise overwrite.
2018-09-14 14:05:24 +02:00
Christophe Simonis 826cd9b3d3 [MERGE] forward port branch 11.0 up to c3ea0a7811 2018-09-10 19:21:57 +02:00
Lucas Perais (lpe) bb12890977 [FIX] mail: activity don't loose text of feedback popover
On an activity, click Mark as done, the popover pops over
Now write some text in it, but click somewhere else, like to copy/paste something
The popover looses focus, and your text disappears

After this commit, we store the value of the popover when hiding it,
then, when when showing back the popover, the value is reinjected

OPW 1873999
closes #26315
2018-09-10 11:24:42 +02:00
Christophe Simonis f3929aa0f7 [MERGE] forward port branch saas-11.2 up to 87dadc5bc8 2018-07-13 14:32:05 +02:00
Christophe Simonis c952a11770 [MERGE] forward port branch 11.0 up to 6e6e3d4c96 2018-07-13 10:47:18 +02:00
Alexandre Kühn 212ed85ac4 [FIX] mail: upload again a same file on the composer
Before this commit, it was not possible to upload again a file on the
browser from the composer, when it was added then removed from the attachments.

When a file is uploaded on the browser, it writes on a special input
some data to identify this file. In order to detect a new upload,
the code listens on the JQuery event `change` on this input. Since the
value of this input was not cleared after an attachment removal, the
user couldn't reupload the same file, because the value of the input
will be unchanged.

This commit solves this issue by clearing the special input when removing
an attachment, so that adding the same file again will trigger a `change`
on this input.
2018-07-10 15:30:30 +02:00
Alexandre Kühn fb98bb009a [FIX] mail: remove attachment when clicking on white cross icon
Before this commit, we could not remove an attachment in the composer
by clicking on the white-cross icon that is shown on mouse hover.

This was due to the handler function picking the wrong DOM element
as target for reading on the attachment ID: it should pick the target
of this handler function, and not the specific target below the mouse
on click. For instance, let's consider this HTML snippet for the button:

    ```
    <div class='delete' data-attachment-id=100>
        <span class='cross-icon'>X</span>
    </div>
    ```

where the handler function is called when clicking on `div.delete`.

When we click on `span.cross-icon`, it triggers the handler function
of `div.delete`. The MouseEvent object contains the following property
values:

    - `target`: the `<span>` element
    - `currentTarget`: the `<div>` element

The handler function of `div.delete` deletes an attachment by looking
into the `data-attachment-id` attribute of `div.delete`. It should
always pick `div.delete`, even when the user clicks on `span.cross-icon`.
2018-07-10 15:25:02 +02:00
Christophe Simonis b06af028e6 [MERGE] forward port branch saas-11.2 up to d112a163cd 2018-06-28 10:55:12 +02:00
Christophe Simonis d112a163cd [MERGE] forward port branch 11.0 up to f6d36d81f7 2018-06-28 10:32:03 +02:00
Nicolas Lempereurandqsm-odoo f6d36d81f7 [FIX] mail: discuss smileys on several lines
In the discuss composer on google chrome, when when the smileys have
more width than available, they stayed on one line and would increase
page size (adding an horizontal scrollbar).

This happened really easily in saas-11.3 because we have more smileys,
but still happened in 11.0 depending on the screen size.

opw-1861191
closes #25507

Co-authored-by: qsm-odoo <qsm@odoo.com>
2018-06-28 09:05:36 +02:00
Christophe Simonis 40836194c2 [MERGE] forward port branch saas-11.2 up to 12ddec3a76 2018-06-27 13:41:00 +02:00
Aaron Bohy ffe9bb501b [FIX] mail: test utils: mock is_odoo_focused
In the mocked version of the longpolling bus used in tests, the
is_odoo_focused function should be defined to prevent crashes when
we simulate incoming messages.
2018-06-21 13:55:10 +02:00
Aaron Bohy cf3cc98f1c [FIX] mail: set correct parent to ChatWindows
Since the ChatWindowManager is a service, this is no longer
necessary to set the webclient as parent of ChatWindow's instances.

This rev. sets the ChatWindowManager itself as parent, which makes
much more sense, and which allows to properly mock the whole
ChatManager-ChatWindowManager environment in tests.
2018-06-21 13:55:10 +02:00
Alexandre Kühn b74d1e90ef [FIX] mail: warn user on record reload before post message
Before this commit, the user could lost some unsaved changes in a record when
posting a message in the chatter.

This is due to reloading the data on the record, which is necessary because
a `message_post` may make some changes on the record [1].

With this commit, a dialog will warn the user that the record will be reloaded
in the following cases:

    a) posting a message in the basic composer that will reload the record
    b) opening the full-composer when the record is dirty

Indeed, any operation after opening the full-composer will always refresh the
record (even closing the dialog).

Known issues:

    - a record is not considered as dirty if we only make changes in its
      description from a pad.

      > the content of the pad will be erased without any warning...

[1] https://github.com/odoo-dev/odoo/commit/803d5cf04835fcf8e7ddb143e1ab140408beef93

opw-1825005
2018-06-15 17:46:32 +02:00
Christophe Simonis 50860317cc [MERGE] forward port branch saas-11.2 up to b170a753e1 2018-06-15 11:30:27 +02:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +02:00
Christophe Simonis b05e4d5f95 [MERGE] forward port branch saas-15 up to a53bea49fe 2018-06-14 21:28:39 +02:00
Christophe Simonis 803df909b1 [MERGE] forward port branch saas-14 up to 804d68efe5 2018-06-14 18:05:38 +02:00
Christophe Simonis 804d68efe5 [MERGE] forward port branch 10.0 up to 23a1bce2a9 2018-06-14 18:03:26 +02:00
jlzhou 68cde40515 [FIX] mail: fix translation issue in client notification
Closes #19095.
2018-06-13 11:03:46 +02:00
Christophe Simonis af1853775f [MERGE] forward port branch 11.0 up to e3658d6f56 2018-06-12 16:49:11 +02:00
Lucas Perais (lpe) dded98a04c [FIX] mail: open a channel in discuss on systray click
User B mentions @UserA in a channel on discuss
User A gets two notifications: one for direct chat,the other for the channel
User A clicks on the notification for the channel

Before this commit the form view of the channel was opened

After this commit, the channel is opened in discuss

OPW 1849577
closes #25074
2018-06-08 10:06:11 +02:00
Christophe Simonis 37eed7c509 [MERGE] forward port branch saas-11.2 up to 58e3552246 2018-05-25 14:34:18 +02:00
Christophe Simonis 2bc6ea1b37 [MERGE] forward port branch 11.0 up to 02ee3fd88e 2018-05-23 19:33:40 +02:00
Denis Ledoux 36d45175b0 [FIX] mail: translate activity type in kanban
When opening the activity dropdown in the kanban view
of the opportunities,
the activity type names were not translated in the user language.

In addition, when marking it as done, the message
posted in the discussion thread of the opportunity
was not translated either.

opw-1847908
2018-05-18 12:31:07 +02:00
Christophe Simonis 644f0959d0 [MERGE] forward port branch saas-11.2 up to 1655202924 2018-05-17 14:23:37 +02:00
Alexandre Kühn 93f9131450 [REVERT] "[IMP] mail : display mentions in green color in edit mode"
This reverts commit c778de44c7.
2018-05-16 15:06:39 +02:00
Alexandre Kühn c52243794d [REVERT] "[FIX] mail: fix composer style for chat windows"
This reverts commit 0275c70f78.
2018-05-16 15:05:35 +02:00
Toufik Benjaa 05ef2f24e0 [FIX] mail: Missing parenthesis to call "remove" on chatter spinner
- The code to remove the loading spinner from the chatter was missing parenthesis to actually do the function call.
2018-05-15 17:53:22 +02:00
Toufik Benjaa 84f0b4d934 [FIX] mail: Avoid crashing when removing link from chatter
- The code to remove mentionned users on the chatter isn't robust enough.
  It crashes when trying to remove a link added from a copy/paste as if it was a mention.
  Mentions have an id defined on their "a" html node, linked copied and pasted don't.
  Which crashes the javascript code because it is trying to use the id.

  This fix, make sure to delete the node without using its id (we already have the node) and make sure to remove it only if it starts with a '@' (meaning it is a mention).
2018-05-15 16:48:54 +02:00
Thibault Delavallée 7e90349cb9 [IMP] various: clean references to removed content_subtype post parameter
content_subtype was a parameter to message_post allowing to give plaintext
content instead of html content. It has been removed at 74d4b3902d. This
commit cleans some leftover bits referencing this now removed parameter.
2018-05-15 15:04:13 +02:00
Christophe Simonis 7f707200ad [FIX] mail: adapt test to altered dom.
See c265e47a63
2018-05-14 19:01:08 +02:00
Christophe Simonis 5a751fa200 [MERGE] forward port branch saas-11.2 up to aae54ecc15 2018-05-09 15:45:20 +02:00
Alexandre Kühn 0275c70f78 [FIX] mail: fix composer style for chat windows
Revision on dd8e95cb1a12603940cc32a3d840b6097515df85

The intent of the commit above was to fix the style of the composer,
which was broken when turning the textarea input into a contenteditable
div. While fixing the style for the composer in Discuss or in the Chatter,
it misplaced the initial position of the caret in a chat window.

This commit fixes the issue on chat windows, while also improving the
previous fix.

Known issues:

    In a chat window with more messages than it could be displayed at once,
    when at the bottom of the thread, the line separator of the composer
    and the thread is off by 1 or 2 pixels (vertically).

    > Fixing this issue breaks a lot the alignment of items in the composer
      of Discuss and Chatter, so this small visual glitch is preferred.
2018-05-04 17:23:36 +02:00
Christophe Simonis ac63dfc8f4 [MERGE] forward port branch 11.0 up to 8dade01e2c 2018-05-04 16:10:50 +02:00
Akash Bhavsar 8b7fb9a764 [FIX] mail: Do not close chat widnow if ESCAPE key is pressed on document viewer and keep focus on chat window input when document viewer is closed (#22741)
If document viewer is opened from chat window and when document viewer is opened then focus 
remains on it's modal, pressing escape should set focus back to chat window's input element,

if file selecor dialog is opened and if user press ESCAPE on file selector dialog to cancel file selector 
dialog then it should not close chat window instead it should set focus on chat window input and on 
second ESCAPE key chat window should be closed
also increase z-index of document viewer dialog so image remain on top of cht window

OPW: 1777937
2018-05-03 15:16:56 +02:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Christophe Simonis 320b631c81 [MERGE] forward port branch saas-15 up to 810603f4ef 2018-05-02 15:34:42 +02:00
Christophe Simonis 810603f4ef [MERGE] forward port branch saas-14 up to 55ce6aff10 2018-05-02 14:49:58 +02:00
Christophe Simonis 55ce6aff10 [MERGE] forward port branch 10.0 up to 79bbd1dcb8 2018-05-02 13:52:12 +02:00
Nicolas Martinelli 517fb99926 [FIX] mail: emoji substitution
- Create a message with 100k+ smileys
- Send it to a colleague you hate
- His (and your) web browser starts eating up all the memory
- Go cry to the technical guy because you can't use Odoo anymore.

On some browsers, like Chrome, the image rendering consumes a lot of
memory up to the point it makes it unusable.

opw-1831610
2018-04-27 08:08:36 +02:00
Géry Debongnie 3b3f6cc069 [FIX] mail: update test broken by forward port
The _mockMessageFetch method was changed in the mockserver in saas11.2.
The forward port then obviously broke this test, which depended on the
fact that it returns an empty list.
2018-04-24 14:37:14 +02:00
Christophe Simonis 1f22b81203 [MERGE] forward port branch saas-11.2 up to 7113b70762 2018-04-23 19:36:25 +02:00
Christophe Simonis e8bf128318 [MERGE] forward port branch 11.0 up to 3ab25b60bc 2018-04-23 18:15:25 +02:00
Martin Trigaux 82de88b066 [FIX] mail: cover more cases for URLs
Transifex URLs have an original scheme using #lang, followed by the module or
'$' (for any module) and the searched text can be quoted

Before this commit the link was cut after
https://www.transifex.com/odoo/odoo-11/translate/#fr/, making the link not
clicable

Closes #24346
2018-04-20 15:45:08 +02:00
Alexandre Kühn f2ba1cc843 [FIX] mail: no crash when clicking on systray inbox notification not linked to a document
Before this commit, when we have a notification in the messaging menu (systray)
that comes from a message in inbox which isn't linked to a document
(e.g. a task), clicking on it result in a crash.

This issue comes from a typo of a recent js mail refactoring [1]

Although this is only a 1-line fix, there are no tests on the messaging menu
widget in the systray. Therefore, this commit also introduces some basic tests
of this widget, in addition to the test related to the fixed issue.

[1] https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498
2018-04-20 12:13:51 +02:00
Alexandre Kühn df58ead943 [FIX] mail: fix composer css style
Revision of https://github.com/odoo/odoo/commit/c778de44c7cd9b7ef5a9a91738164ab0ebd0ca06

The commit above changed the composer in order to add colored text for mentions
(instead of textarea, it uses a div with contenteditable).

Some tweaks were made in order to preserve the css style of the composer, but
there were some leftovers:

    - placeholder "Write Something" should be more transparent
    - cursor hover on placeholder should be of type text
    - text is not vertically centered with the input container
    - there should be no focus border when the composer has the focus
    - "Send" button is vertically misaligned by 1 pixel off in discuss

This commit solves all of the above problems.

As a result, the css style of the composer should look almost similarly to the
one in v11.
2018-04-20 12:13:51 +02:00
Christophe Simonis 74033eb007 [MERGE] forward port branch saas-11.2 up to 90f8f17fb4 2018-04-16 19:50:50 +02:00
Christophe Simonis 5f2d080cf8 [MERGE] forward port branch 11.0 up to ad825b673b 2018-04-16 18:34:56 +02:00
Géry Debongnie dc35d740a6 [FIX] mail: prevent race condition in discuss
The discuss application starting process is strongly asynchronous.
However, it relies implicitely on the fact that the widget is not
destroyed in its starting process.  For example, if the widget is
detroyed before the updateChannel method is called, then any call to the
chat manager service will return undefined and the widget will crash.

When discuss is destroyed exactly between the start and the end of the
creation of its search view (which is asynchronous), then it is possible
to have a crash, because the search view will be destroyed when the
do_search method is called.

Note that we had to fix discuss mobile as well:
The _setChannel method is supposed to return a deferred, but the mobile
override did not return it.  As a result, a test in the mobile suite
failed because this.alive takes a deferred in argument.
2018-04-13 17:16:11 +02:00