note email impr

This commit is contained in:
Yuri Kuznetsov
2024-11-16 18:26:27 +02:00
parent 2ecb41cc90
commit 80cf38e0fc
2 changed files with 18 additions and 3 deletions
@@ -46,7 +46,7 @@
{{#if hasPost}}
<div class="stream-post-container">
<span class="cell cell-post">{{{post}}}</span>
<span class="cell cell-post {{#if mutedPost}} text-muted {{/if}}">{{{post}}}</span>
</div>
{{/if}}
@@ -76,12 +76,19 @@ class EmailReceivedNoteStreamView extends NoteStreamView {
*/
emailId
/**
* @private
* @type {boolean}
*/
emailNotLoaded = false
data() {
return {
...super.data(),
emailId: this.emailId,
emailName: this.emailName,
hasPost: this.hasPost && !this.detailsIsShown,
hasPost: this.hasPost && (!this.detailsIsShown || !this.bodyFieldView),
mutedPost: this.hasPost && this.detailsIsShown && !this.bodyFieldView && !this.emailNotLoaded,
hasAttachments: this.hasAttachments,
emailIconClassName: this.getMetadata().get(['clientDefs', 'Email', 'iconClass']) || '',
isPinned: this.isThis && this.model.get('isPinned') && this.model.collection &&
@@ -214,7 +221,15 @@ class EmailReceivedNoteStreamView extends NoteStreamView {
Espo.Ui.notify(' ... ');
await this.formModel.fetch();
try {
await this.formModel.fetch();
} catch (e) {
this.emailNotLoaded = true;
await this.reRender();
return;
}
this.bodyFieldView = new EmailBodyFieldView({
name: 'body',