Skip to content

Commit e571324

Browse files
committed
[IMP] mail: more friendly empty conversation visual
Also center "no message in conversation" in chatter. closes odoo#180916 Signed-off-by: Zelong Lin (zel) <[email protected]>
1 parent 2553b61 commit e571324

File tree

10 files changed

+18
-17
lines changed

10 files changed

+18
-17
lines changed

addons/mail/static/src/chatter/web/chatter.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<Composer composer="state.thread.composer" autofocus="true" className="state.composerType === 'message' ? '' : 'pt-4'" mode="'extended'" onPostCallback.bind="onPostCallback" onCloseFullComposerCallback.bind="onCloseFullComposerCallback" dropzoneRef="rootRef" type="state.composerType" t-key="props.threadId"/>
9797
</t>
9898
</div>
99-
<div class="o-mail-Chatter-content">
99+
<div class="o-mail-Chatter-content d-flex flex-column flex-grow-1">
100100
<div t-if="state.isSearchOpen" class="o-mail-Chatter-search">
101101
<SearchMessagesPanel
102102
closeSearch.bind="closeSearch"

addons/mail/static/src/core/common/thread.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@
4848
</div>
4949
</t>
5050
<t t-else="">
51-
<div class="o-mail-Thread-empty d-flex flex-column align-items-center justify-content-center text-muted fst-italic h-100" t-att-class="{'p-4': props.showEmptyMessage}">
51+
<div class="o-mail-Thread-empty d-flex flex-column align-items-center justify-content-center text-muted h-100" t-att-class="{'p-4': props.showEmptyMessage}">
5252
<t t-if="props.thread.isLoaded and props.showEmptyMessage">
53-
<span t-ref="empty-message">There are no messages in this conversation.</span>
53+
<t name="empty-message">
54+
<span class="fs-1" style="filter: grayscale(1);">😶</span>
55+
<span class="fst-italic">The conversation is empty.</span>
56+
</t>
5457
</t>
5558
</div>
5659
</t>

addons/mail/static/src/core/web/thread_patch.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<templates xml:space="preserve">
33
<t t-inherit="mail.Thread" t-inherit-mode="extension">
4-
<xpath expr="//*[@t-ref='empty-message']" position="replace">
4+
<xpath expr="//*[@name='empty-message']" position="replace">
55
<t t-if="props.thread.isEmpty and props.thread.model === 'mail.box'">
66
<t t-if="props.thread.id === 'inbox' and state.mountedAndLoaded">
77
<div t-if="store.self.notification_preference !== 'inbox'" class="align-items-center text-center">

addons/mail/static/tests/chat_bubble/chat_bubble.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ test("'New message' chat window can only be open [REQUIRE FOCUS]", async () => {
5757
await click(".o-discuss-ChannelSelector-suggestion");
5858
triggerHotkey("Enter");
5959
await contains(".o-mail-ChatWindow");
60-
await contains(".o-mail-Thread-empty", { text: "There are no messages in this conversation." });
60+
await contains(".o-mail-Thread-empty", { text: "The conversation is empty." });
6161
await click(".o-mail-ChatWindow-command[title='Fold']");
6262
await contains(".o-mail-ChatBubble", { count: 1 }); // can fold chat
6363
});
@@ -74,7 +74,7 @@ test("No duplicated chat bubbles [REQUIRE FOCUS]", async () => {
7474
await click(".o-discuss-ChannelSelector-suggestion");
7575
triggerHotkey("Enter");
7676
await contains(".o-mail-ChatWindow", { text: "John" });
77-
await contains(".o-mail-ChatWindow", { text: "There are no messages in this conversation." }); // wait fully loaded
77+
await contains(".o-mail-ChatWindow", { text: "The conversation is empty." }); // wait fully loaded
7878
await click("button[title='Fold']");
7979
await contains(".o-mail-ChatBubble[name='John']");
8080
// Make bubble of "John" chat again

addons/mail/static/tests/chat_window/chat_window.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ test("chat window: basic rendering", async () => {
177177
await contains("[title='Open Actions Menu']");
178178
await contains("[title='Fold']");
179179
await contains("[title*='Close Chat Window']");
180-
await contains(".o-mail-ChatWindow .o-mail-Thread", {
181-
text: "There are no messages in this conversation.",
182-
});
180+
await contains(".o-mail-ChatWindow .o-mail-Thread", { text: "The conversation is empty." });
183181
await click("[title='Open Actions Menu']");
184182
await contains(".o-mail-ChatWindow-command", { count: 14 });
185183
await contains(".o-dropdown-item", { text: "Attachments" });

addons/mail/static/tests/chatter/web/chatter.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ test("should not display user notification messages in chatter", async () => {
245245
});
246246
await start();
247247
await openFormView("res.partner", partnerId);
248-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
248+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
249249
await contains(".o-mail-Message", { count: 0 });
250250
});
251251

addons/mail/static/tests/discuss_app/discuss.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ test("post a simple message", async () => {
882882
});
883883
await start();
884884
await openDiscuss(channelId);
885-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
885+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
886886
await contains(".o-mail-Message", { count: 0 });
887887
await insertText(".o-mail-Composer-input", "Test");
888888
await click(".o-mail-Composer-send:enabled");
@@ -911,7 +911,7 @@ test("post several messages with failures", async () => {
911911
await start();
912912
await openDiscuss(channelId);
913913
// post 3 messages
914-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
914+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
915915
await contains(".o-mail-Message", { count: 0 });
916916
await insertText(".o-mail-Composer-input", "0");
917917
await click(".o-mail-Composer-send:enabled");

addons/mail/static/tests/discuss_app/sidebar.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ test("default thread rendering", async () => {
200200
});
201201
await click(".o-mail-DiscussSidebarChannel", { text: "General" });
202202
await contains(".o-mail-DiscussSidebarChannel.o-active", { text: "General" });
203-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
203+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
204204
});
205205

206206
test("sidebar quick search at 20 or more pinned channels", async () => {

addons/mail/static/tests/message/message.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ test("message considered empty", async () => {
15901590
]);
15911591
await start();
15921592
await openDiscuss(channelId);
1593-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
1593+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
15941594
await contains(".o-mail-Message", { count: 0 });
15951595
});
15961596

addons/mail/static/tests/thread/thread.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ test("do not display day separator if all messages of the day are empty", async
171171
});
172172
await start();
173173
await openDiscuss(channelId);
174-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
174+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
175175
await contains(".o-mail-DateSection", { count: 0 });
176176
});
177177

@@ -448,7 +448,7 @@ test("show empty placeholder when thread contains no message", async () => {
448448
const channelId = pyEnv["discuss.channel"].create({ name: "general" });
449449
await start();
450450
await openDiscuss(channelId);
451-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
451+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
452452
await contains(".o-mail-Message", { count: 0 });
453453
});
454454

@@ -458,7 +458,7 @@ test("show empty placeholder when thread contains only empty messages", async ()
458458
pyEnv["mail.message"].create({ model: "discuss.channel", res_id: channelId });
459459
await start();
460460
await openDiscuss(channelId);
461-
await contains(".o-mail-Thread", { text: "There are no messages in this conversation." });
461+
await contains(".o-mail-Thread", { text: "The conversation is empty." });
462462
await contains(".o-mail-Message", { count: 0 });
463463
});
464464

0 commit comments

Comments
 (0)