[IMP] mail: turn 'ComposerView/hasFooter' into field

Task-2793280

closes odoo/odoo#86468

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-03-21 14:59:50 +01:00
parent fc9e67bc6b
commit fa6d67f2bc
3 changed files with 20 additions and 19 deletions
@@ -34,23 +34,6 @@ export class Composer extends Component {
return this.messaging && this.messaging.models['ComposerView'].get(this.props.localId);
}
/**
* Determine whether composer should display a footer.
*
* @returns {boolean}
*/
get hasFooter() {
if (!this.composerView) {
return false;
}
return (
this.composerView.hasThreadTyping ||
this.composerView.composer.attachments.length > 0 ||
this.composerView.messageViewInEditing ||
!this.composerView.isCompact
);
}
/**
* Determine whether the composer should display a header.
*
@@ -6,7 +6,7 @@
t-att-class="{
'o-focused': composerView and composerView.isFocused,
'o-has-current-partner-avatar': props.hasCurrentPartnerAvatar,
'o-has-footer': hasFooter,
'o-has-footer': composerView and composerView.hasFooter,
'o-has-header': hasHeader,
'o-is-in-thread-view': composerView and composerView.threadView,
'o-is-compact': composerView and composerView.isCompact,
@@ -116,7 +116,7 @@
</t>
</div>
</div>
<t t-if="hasFooter">
<t t-if="composerView.hasFooter">
<div class="o_Composer_coreFooter" t-att-class="{ 'o-composer-is-compact': composerView.isCompact }">
<t t-if="composerView.hasThreadTyping">
<ThreadTextualTypingStatus className="'o_Composer_threadTextualTypingStatus'" threadLocalId="composerView.composer.activeThread.localId"/>
@@ -577,6 +577,18 @@ registerModel({
}
return clear();
},
/**
* @private
* @returns {boolean}
*/
_computeHasFooter() {
return Boolean(
this.hasThreadTyping ||
this.composer.attachments.length > 0 ||
this.messageViewInEditing ||
!this.isCompact
);
},
/**
* @private
* @return {boolean}
@@ -1035,6 +1047,12 @@ registerModel({
compute: '_computeHasFollowers',
default: false,
}),
/**
* Determines whether composer should display a footer.
*/
hasFooter: attr({
compute: '_computeHasFooter',
}),
/**
* States whether there is any result currently found for the current
* suggestion delimiter and search term, if applicable.