[FIX] mail: restore public discuss display on small screen

All features are not working as intended (examples: side panels should
be full screen instead of on the right, missing user rename/avatar
change) but at least something is shown with this commit.

closes odoo/odoo#123030

X-original-commit: 35a87c21230613852e1536eb0d717ad3f5753b5e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Sébastien Theys
2023-06-05 13:31:38 +02:00
parent f2a8e6bd51
commit 04bdf6dc5a
3 changed files with 6 additions and 8 deletions
@@ -40,9 +40,7 @@ export class Discuss extends Component {
FileUploader,
ImStatus,
};
static props = {
public: { type: Boolean, optional: true },
};
static props = {};
static template = "mail.Discuss";
setup() {
@@ -98,7 +96,7 @@ export class Discuss extends Component {
}
get channelAvatar() {
return this.props.public
return this.store.inPublicPage
? url(
`/discuss/channel/${this.thread.id}/avatar_128?unique=${this.thread?.avatarCacheKey}`
)
@@ -2,9 +2,9 @@
<templates xml:space="preserve">
<t t-name="mail.Discuss" owl="1">
<div class="o-mail-Discuss d-flex h-100 flex-grow-1 border-top" t-att-class="{ 'flex-column align-items-center bg-view': ui.isSmall }" t-ref="root">
<div class="o-mail-Discuss d-flex h-100 flex-grow-1 border-top" t-att-class="{ 'border-top': !store.inPublicPage, 'flex-column align-items-center bg-view': ui.isSmall }" t-ref="root">
<div t-if="ui.isSmall and store.discuss.activeTab === 'mailbox'" class="w-100 border-bottom" t-call="mail.Discuss.mobileTopbar" t-ref="mobileTopbar"/>
<div t-if="thread and !(ui.isSmall and ['chat', 'channel'].includes(store.discuss.activeTab))" class="o-mail-Discuss-content d-flex flex-column h-100 w-100 bg-view overflow-auto" t-ref="content">
<div t-if="thread and (store.inPublicPage or !(ui.isSmall and ['chat', 'channel'].includes(store.discuss.activeTab)))" class="o-mail-Discuss-content d-flex flex-column h-100 w-100 bg-view overflow-auto" t-ref="content">
<div class="o-mail-Discuss-header px-3 bg-view border-bottom d-flex flex-shrink-0 align-items-center">
<div t-if="thread and ['channel', 'group', 'chat'].includes(thread.type)" class="o-mail-Discuss-threadAvatar position-relative align-self-center align-items-center mt-2 mb-2 me-2">
<img class="rounded" t-att-src="channelAvatar" alt="Thread Image"/>
@@ -45,7 +45,7 @@
<button t-if="thread.allowCalls and thread.type !== 'mailbox' and thread !== rtc.state.channel" class="btn rounded px-2 shadow-none" title="Start a Call" t-on-click="() => this.rtc.toggleCall(this.thread)" t-ref="startCall">
<i class="fa fa-lg fa-phone text-700"/>
</button>
<div t-if="props.public and !ui.isSmall" class="d-flex align-items-center">
<div t-if="store.inPublicPage and !ui.isSmall" class="d-flex align-items-center">
<img class="o-mail-Discuss-selfAvatar mx-1 rounded-circle o_object_fit_cover flex-shrink-0" alt="Avatar" t-att-src="threadService.avatarUrl(store.self, thread)"/>
<div class="lead fw-bold flex-shrink-1 text-dark">
<t t-if="store.user" t-esc="store.user.name"/>
@@ -4,7 +4,7 @@
<t t-name="mail.DiscussPublic" owl="1">
<div class="o-mail-DiscussPublic d-flex h-100 w-100 position-absolute">
<WelcomePage t-if="state.welcome" data="props.data" proceed="() => state.welcome = false"/>
<Discuss t-else="" public="true"/>
<Discuss t-else=""/>
</div>
</t>