[REM] mail: remove o_mail_note class in chatter

Purpose of this commit is to clean a bit various classes and conditions.

First clean is the removal of o_mail_note class in activities less. It comes
from first implementation of activity widget and is not used anymore in
activity widgets rendering.

Second clean is the removal of o_mail_note class when displaying messages.
Only o_mail_discussion is used currently in chatter to make a different
background depending on whether the message is a discussion or not. All
we have to know to differentiate message display is whether it is a
discussion done by an user or not.

Tests have been updated to use o_mail_discussion class triggered by
the message being a discussion, aka a comment posted by an user.
This commit is contained in:
Thibault Delavallée
2018-03-14 11:06:32 +01:00
parent 8de00fee31
commit b4ecbcfaa3
3 changed files with 7 additions and 11 deletions
@@ -102,10 +102,6 @@
}
}
.o_thread_message_core.o_mail_note {
padding: 0px 3px;
}
.o_activity_color_default {
color: #dddddd;
}
+1 -1
View File
@@ -157,7 +157,7 @@
t-att-class="'fa o_thread_message_star o_thread_icon ' + (message.is_starred ? 'fa-star' : 'fa-star-o')"
t-att-data-message-id="message.id" title="Mark as Todo"/>
</div>
<div t-att-class="'o_thread_message_core' + (message.is_note ? ' o_mail_note' : '')">
<div class='o_thread_message_core'>
<p t-if="message.display_author" class="o_mail_info">
<t t-if="message.is_note">
Note by
+6 -6
View File
@@ -463,8 +463,8 @@ QUnit.test('chatter: post, receive and star messages', function (assert) {
assert.ok(form.$('.o_chatter_topbar .o_chatter_button_log_note').length,
"log note button should be available");
assert.strictEqual(form.$('.o_thread_message').length, 1, "thread should contain one message");
assert.ok(!form.$('.o_thread_message:first() .o_mail_note').length,
"the message shouldn't be a note");
assert.ok(form.$('.o_thread_message:first().o_mail_discussion').length,
"the message should be a discussion");
assert.ok(form.$('.o_thread_message:first() .o_thread_message_core').text().indexOf('A message') >= 0,
"the message's body should be correct");
assert.ok(form.$('.o_thread_message:first() .o_mail_info').text().indexOf('John Doe') >= 0,
@@ -477,8 +477,8 @@ QUnit.test('chatter: post, receive and star messages', function (assert) {
form.$('.oe_chatter .o_composer_button_send').click();
assert.ok($('.oe_chatter .o_chat_composer').hasClass('o_hidden'), "chatter should be closed");
assert.strictEqual(form.$('.o_thread_message').length, 2, "thread should contain two messages");
assert.ok(!form.$('.o_thread_message:first() .o_mail_note').length,
"the last message shouldn't be a note");
assert.ok(form.$('.o_thread_message:first().o_mail_discussion').length,
"the last message should be a discussion");
assert.ok(form.$('.o_thread_message:first() .o_thread_message_core').text().indexOf('My first message') >= 0,
"the message's body should be correct");
assert.ok(form.$('.o_thread_message:first() .o_mail_info').text().indexOf('Me') >= 0,
@@ -491,8 +491,8 @@ QUnit.test('chatter: post, receive and star messages', function (assert) {
form.$('.oe_chatter .o_composer_button_send').click();
assert.ok($('.oe_chatter .o_chat_composer').hasClass('o_hidden'), "chatter should be closed");
assert.strictEqual(form.$('.o_thread_message').length, 3, "thread should contain three messages");
assert.ok(form.$('.o_thread_message:first() .o_mail_note').length,
"the last message should be a note");
assert.ok(!form.$('.o_thread_message:first().o_mail_discussion').length,
"the last message should not be a discussion");
assert.ok(form.$('.o_thread_message:first() .o_thread_message_core').text().indexOf('My first note') >= 0,
"the message's body should be correct");
assert.ok(form.$('.o_thread_message:first() .o_mail_info').text().indexOf('Me') >= 0,