[IMP] mail: turn 'ChatWindow/shiftNextText' into field

Task-2793280

closes odoo/odoo#86374

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-03-15 13:22:03 +01:00
parent 70a34a7773
commit 1520a98d69
3 changed files with 14 additions and 11 deletions
@@ -21,16 +21,6 @@ export class ChatWindowHeader extends Component {
return this.messaging && this.messaging.models['ChatWindow'].get(this.props.chatWindowLocalId);
}
/**
* @returns {string}
*/
get shiftNextText() {
if (this.messaging.locale.textDirection === 'rtl') {
return this.env._t("Shift left");
}
return this.env._t("Shift right");
}
/**
* @returns {string}
*/
@@ -62,7 +62,7 @@
</div>
</t>
<t t-if="chatWindow.hasShiftNext">
<div class="o_ChatWindowHeader_command o_ChatWindowHeader_commandShiftNext" t-att-class="{ 'o-mobile': messaging.device.isMobile }" t-on-click="_onClickShiftNext" t-att-title="shiftNextText">
<div class="o_ChatWindowHeader_command o_ChatWindowHeader_commandShiftNext" t-att-class="{ 'o-mobile': messaging.device.isMobile }" t-on-click="_onClickShiftNext" t-att-title="chatWindow.shiftNextText">
<!-- this is reversed automatically when language is rtl -->
<i class="fa fa-angle-right"/>
</div>
@@ -293,6 +293,16 @@ registerModel({
_computeNewMessageFormInputPlaceholder() {
return this.env._t("Search user...");
},
/**
* @private
* @returns {string}
*/
_computeShiftNextText() {
if (this.messaging.locale.textDirection === 'rtl') {
return this.env._t("Shift left");
}
return this.env._t("Shift right");
},
/**
* @private
* @returns {ThreadViewer}
@@ -476,6 +486,9 @@ registerModel({
newMessageFormInputPlaceholder: attr({
compute: '_computeNewMessageFormInputPlaceholder',
}),
shiftNextText: attr({
compute: '_computeShiftNextText',
}),
/**
* Determines the `Thread` that should be displayed by `this`.
* If no `Thread` is linked, `this` is considered "new message".