Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 55 additions & 54 deletions src/components/ThreadEnvelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</NcButton>
</div>
</div>

<div class="envelope__header">
<div class="envelope__header__avatar">
<Avatar v-if="envelope.from && envelope.from[0]"
Expand All @@ -33,7 +32,7 @@
class="app-content-list-item-star icon-important"
:data-starred="isImportant ? 'true' : 'false'"
@click.prevent="hasWriteAcl ? onToggleImportant() : false"
v-html="importantSvg" />

Check warning on line 35 in src/components/ThreadEnvelope.vue

View workflow job for this annotation

GitHub Actions / NPM lint

'v-html' directive can lead to XSS attack
<IconFavorite v-if="envelope.flags.flagged"
fill-color="#f9cf3d"
:size="18"
Expand All @@ -46,7 +45,6 @@
:data-starred="envelope.flags.$junk ? 'true' : 'false'"
@click.prevent="hasWriteAcl ? onToggleJunk() : false" />
</div>

<router-link :to="route"
event=""
class="left"
Expand Down Expand Up @@ -228,46 +226,48 @@
</template>
</div>
</div>
<MessageLoadingSkeleton v-if="loading === Loading.Skeleton" />
<Message v-if="message"
v-show="loading === Loading.Done"
:envelope="envelope"
:message="message"
:full-height="fullHeight"
:smart-replies="showFollowUpHeader ? [] : smartReplies"
:reply-button-label="replyButtonLabel"
@load="onMessageLoaded"
@translate="onOpenTranslationModal"
@reply="(body) => onReply(body, showFollowUpHeader)" />
<Error v-else-if="error"
:error="error.message || t('mail', 'Not found')"
message=""
:data="error"
:auto-margin="true"
role="alert" />
<ConfirmModal v-if="message && message.unsubscribeUrl && message.isOneClickUnsubscribe && showListUnsubscribeConfirmation"
:confirm-text="t('mail', 'Unsubscribe')"
:title="t('mail', 'Unsubscribe via link')"
@cancel="showListUnsubscribeConfirmation = false"
@confirm="unsubscribeViaOneClick">
{{ t('mail', 'Unsubscribing will stop all messages from the mailing list {sender}', { sender: from }) }}
</ConfirmModal>
<ConfirmModal v-else-if="message && message.unsubscribeUrl && showListUnsubscribeConfirmation"
:confirm-text="t('mail', 'Unsubscribe')"
:confirm-url="message.unsubscribeUrl"
:title="t('mail', 'Unsubscribe via link')"
@cancel="showListUnsubscribeConfirmation = false"
@confirm="showListUnsubscribeConfirmation = false">
{{ t('mail', 'Unsubscribing will stop all messages from the mailing list {sender}', { sender: from }) }}
</ConfirmModal>
<ConfirmModal v-else-if="message && message.unsubscribeMailto && showListUnsubscribeConfirmation"
:confirm-text="t('mail', 'Send unsubscribe email')"
:title="t('mail', 'Unsubscribe via email')"
:disabled="unsubscribing"
@cancel="showListUnsubscribeConfirmation = false"
@confirm="unsubscribeViaMailto">
{{ t('mail', 'Unsubscribing will stop all messages from the mailing list {sender}', { sender: from }) }}
</ConfirmModal>
<div class="envelope__body-container">
<MessageLoadingSkeleton v-if="loading === Loading.Skeleton" />
<Message v-if="message"
v-show="loading === Loading.Done"
:envelope="envelope"
:message="message"
:full-height="fullHeight"
:smart-replies="showFollowUpHeader ? [] : smartReplies"
:reply-button-label="replyButtonLabel"
@load="onMessageLoaded"
@translate="onOpenTranslationModal"
@reply="(body) => onReply(body, showFollowUpHeader)" />
<Error v-else-if="error"
:error="error.message || t('mail', 'Not found')"
message=""
:data="error"
:auto-margin="true"
role="alert" />
<ConfirmModal v-if="message && message.unsubscribeUrl && message.isOneClickUnsubscribe && showListUnsubscribeConfirmation"
:confirm-text="t('mail', 'Unsubscribe')"
:title="t('mail', 'Unsubscribe via link')"
@cancel="showListUnsubscribeConfirmation = false"
@confirm="unsubscribeViaOneClick">
{{ t('mail', 'Unsubscribing will stop all messages from the mailing list {sender}', { sender: from }) }}
</ConfirmModal>
<ConfirmModal v-else-if="message && message.unsubscribeUrl && showListUnsubscribeConfirmation"
:confirm-text="t('mail', 'Unsubscribe')"
:confirm-url="message.unsubscribeUrl"
:title="t('mail', 'Unsubscribe via link')"
@cancel="showListUnsubscribeConfirmation = false"
@confirm="showListUnsubscribeConfirmation = false">
{{ t('mail', 'Unsubscribing will stop all messages from the mailing list {sender}', { sender: from }) }}
</ConfirmModal>
<ConfirmModal v-else-if="message && message.unsubscribeMailto && showListUnsubscribeConfirmation"
:confirm-text="t('mail', 'Send unsubscribe email')"
:title="t('mail', 'Unsubscribe via email')"
:disabled="unsubscribing"
@cancel="showListUnsubscribeConfirmation = false"
@confirm="unsubscribeViaMailto">
{{ t('mail', 'Unsubscribing will stop all messages from the mailing list {sender}', { sender: from }) }}
</ConfirmModal>
</div>
</div>
</template>
<script>
Expand Down Expand Up @@ -734,21 +734,17 @@
}
},
scrollToThread(threadId) {
this.$nextTick(() => {
const threadElement = document.querySelector(`[data-thread-id="${threadId}"]`)
if (threadElement) {
threadElement.scrollIntoView({ behavior: 'smooth', block: 'top' })
}
})
const threadElement = document.querySelector(`[data-thread-id="${threadId}"]`)
if (threadElement) {
threadElement.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
},

scrollToEnvelope() {
this.$nextTick(() => {
const envelopeElement = this.$refs.envelope
if (envelopeElement) {
envelopeElement.scrollIntoView({ behavior: 'smooth', block: 'top' })
}
})
const envelopeElement = this.$refs.envelope
if (envelopeElement) {
envelopeElement.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
},
async fetchItineraries() {
// Sanity check before actually making the request
Expand Down Expand Up @@ -1045,6 +1041,11 @@
transform: none;
}
}
&__body-container {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
}

& + .envelope {
margin-top: calc(var(--default-grid-baseline) * -7);
Expand Down
Loading