mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_responsive: Migration to 17.0
This commit is contained in:
28
web_responsive/static/src/components/chatter/chatter.esm.js
Normal file
28
web_responsive/static/src/components/chatter/chatter.esm.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/** @odoo-module **/
|
||||
/* Copyright 2021 ITerra - Sergey Shebanin
|
||||
* Copyright 2023 Onestein - Anjeel Haria
|
||||
* Copyright 2023 Taras Shabaranskyi
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
import {Chatter} from "@mail/core/web/chatter";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
import {useEffect} from "@odoo/owl";
|
||||
|
||||
patch(Chatter.prototype, {
|
||||
setup() {
|
||||
super.setup();
|
||||
useEffect(this._resetScrollToAttachmentsEffect.bind(this), () => [
|
||||
this.state.isAttachmentBoxOpened,
|
||||
]);
|
||||
},
|
||||
/**
|
||||
* Prevent scrollIntoView error
|
||||
* @param {Boolean} isAttachmentBoxOpened
|
||||
* @private
|
||||
*/
|
||||
_resetScrollToAttachmentsEffect(isAttachmentBoxOpened) {
|
||||
if (!isAttachmentBoxOpened) {
|
||||
this.state.scrollToAttachments = 0;
|
||||
}
|
||||
},
|
||||
});
|
||||
42
web_responsive/static/src/components/chatter/chatter.scss
Normal file
42
web_responsive/static/src/components/chatter/chatter.scss
Normal file
@@ -0,0 +1,42 @@
|
||||
/* Copyright 2023 Taras Shabaranskyi
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
.o-mail-Composer {
|
||||
grid-template-areas:
|
||||
"sidebar-header core-header"
|
||||
"core-main core-main"
|
||||
"sidebar-footer core-footer";
|
||||
|
||||
.o-mail-Composer-sidebarMain {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
grid-template-areas:
|
||||
"sidebar-header core-header"
|
||||
"sidebar-main core-main"
|
||||
"sidebar-footer core-footer";
|
||||
|
||||
.o-mail-Composer-sidebarMain {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.o-mail-SuggestedRecipient {
|
||||
margin-left: 42px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.o-mail-Form-chatter {
|
||||
.o-mail-SuggestedRecipient,
|
||||
.o-mail-Chatter-recipientList {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
.o-mail-SuggestedRecipient,
|
||||
.o-mail-Chatter-recipientList {
|
||||
margin-left: 42px;
|
||||
}
|
||||
}
|
||||
}
|
||||
69
web_responsive/static/src/components/chatter/chatter.xml
Normal file
69
web_responsive/static/src/components/chatter/chatter.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2023 Taras Shabaranskyi
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
|
||||
<templates>
|
||||
<t
|
||||
t-name="web_responsive.Chatter"
|
||||
t-inherit="mail.Chatter"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<xpath expr="//SuggestedRecipientsList" position="attributes">
|
||||
<attribute name="styleString">''</attribute>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[hasclass('o-mail-Chatter-recipientListButton')]/.."
|
||||
position="attributes"
|
||||
>
|
||||
<attribute name="style" />
|
||||
<attribute name="class" add="o-mail-Chatter-recipientList" separator=" " />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[hasclass('o-mail-Chatter-sendMessage')]"
|
||||
position="replace"
|
||||
>
|
||||
<button
|
||||
t-if="props.hasMessageList"
|
||||
class="o-mail-Chatter-sendMessage btn text-nowrap me-1"
|
||||
t-att-class="{
|
||||
'btn-secondary': state.composerType !== 'message',
|
||||
'btn-primary active': state.composerType === 'message',
|
||||
'my-2': !props.compactHeight
|
||||
}"
|
||||
t-att-disabled="!state.thread.hasWriteAccess and !(state.thread.hasReadAccess and state.thread.canPostOnReadonly) and props.threadId"
|
||||
data-hotkey="m"
|
||||
t-on-click="() => this.toggleComposer('message')"
|
||||
>
|
||||
<i class="fa fa-envelope me-sm-1" />
|
||||
<span class="d-none d-sm-inline">Send message</span>
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//button[hasclass('o-mail-Chatter-logNote')]" position="replace">
|
||||
<button
|
||||
t-if="props.hasMessageList"
|
||||
class="o-mail-Chatter-logNote btn text-nowrap me-2"
|
||||
t-att-class="{
|
||||
'btn-primary active': state.composerType === 'note',
|
||||
'btn-secondary': state.composerType !== 'note',
|
||||
'my-2': !props.compactHeight
|
||||
}"
|
||||
data-hotkey="shift+m"
|
||||
t-on-click="() => this.toggleComposer('note')"
|
||||
>
|
||||
<i class="fa fa-sticky-note me-sm-1" />
|
||||
<span class="d-none d-sm-inline">Log note</span>
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[hasclass('o-mail-Chatter-activity')]/span"
|
||||
position="before"
|
||||
>
|
||||
<i class="fa fa-clock-o me-sm-1" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[hasclass('o-mail-Chatter-activity')]/span"
|
||||
position="attributes"
|
||||
>
|
||||
<attribute name="class" add="d-none d-sm-inline" separator=" " />
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
Reference in New Issue
Block a user