[FIX] mail: correct breadcrumb when open discuss from chat window

Before this commit, when opening Discuss from chat window and then
accessing the settings page of a channel, the breadcrumb showed
"Unamed" as the name of the App instead of "Discuss".

This happens because the client action was not named when expanding
the chat window by opening Discuss app.

closes odoo/odoo#118939

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Alexandre Kühn
2023-04-20 11:57:31 +02:00
parent 608e90e998
commit 7995349001
2 changed files with 16 additions and 0 deletions
@@ -16,6 +16,7 @@ import { ChannelInvitation } from "@mail/discuss/channel_invitation";
import { isEventHandled } from "@mail/utils/misc";
import { ChannelSelector } from "@mail/discuss/channel_selector";
import { PinnedMessagesPanel } from "@mail/discuss/pinned_messages_panel";
import { _t } from "@web/core/l10n/translation";
/**
* @typedef {Object} Props
@@ -159,6 +160,7 @@ export class ChatWindow extends Component {
{
type: "ir.actions.client",
tag: "mail.action_discuss",
name: _t("Discuss"),
},
{ clearBreadcrumbs: true }
);
@@ -1929,3 +1929,17 @@ QUnit.test("Member list and settings menu are exclusive", async (assert) => {
assert.containsOnce($, ".o-mail-CallSettings");
assert.containsNone($, ".o-mail-ChannelMemberList");
});
QUnit.test(
"Correct breadcrumb when open discuss from chat window then see settings",
async (assert) => {
const pyEnv = await startServer();
pyEnv["mail.channel"].create({ name: "General" });
await start();
await click(".o_main_navbar i[aria-label='Messages']");
await click(".o-mail-NotificationItem:contains(General)");
await click(".o-mail-ChatWindow [title='Open in Discuss']");
await click(".o-mail-DiscussCategoryItem:contains(General) [title='Channel settings']");
assert.strictEqual($(".breadcrumb").text(), "DiscussGeneral");
}
);