[FIX] mail: link preview should have at most 2 lines of text content

Before this commit, link preview showed the whole text content
of the link preview, which has it's limit at around 300 characters.

When description is long, the link preview was too long, which made
it too visible as a "preview".

This commit fixes the issue by truncating the description to at most
2 lines.

Task-3416429

closes odoo/odoo#128347

X-original-commit: 73025d977f6960a829f914a3f0f0c0d87abbb561
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Alexandre Kühn
2023-07-13 10:46:21 +02:00
parent 4db8a60619
commit dd56346c48
2 changed files with 7 additions and 1 deletions
@@ -6,6 +6,12 @@
}
}
.o-mail-LinkPreviewCard-description {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.o-mail-LinkPreviewCard-hasMultineLines {
display: -webkit-box;
-webkit-box-orient: vertical;
@@ -21,7 +21,7 @@
<h6 class="card-title mb-0 me-2" t-attf-class="{{ props.linkPreview.og_description ? 'text-truncate' : 'overflow-hidden' }}">
<a t-att-href="props.linkPreview.source_url" target="_blank" t-out="props.linkPreview.og_title"/>
</h6>
<p t-if="props.linkPreview.og_description" class="card-text mb-0 mt-2 text-muted small overflow-hidden" t-out="props.linkPreview.og_description"/>
<p t-if="props.linkPreview.og_description" class="o-mail-LinkPreviewCard-description card-text mb-0 mt-2 text-muted small overflow-hidden" t-out="props.linkPreview.og_description"/>
</div>
</div>
<div class="o-mail-LinkPreviewCard-imageLinkWrap col-4 d-block">