From dd56346c482715094e957efbf051080548a67f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Wed, 12 Jul 2023 16:46:04 +0000 Subject: [PATCH] [FIX] mail: link preview should have at most 2 lines of text content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/core/common/link_preview.scss | 6 ++++++ addons/mail/static/src/core/common/link_preview.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/core/common/link_preview.scss b/addons/mail/static/src/core/common/link_preview.scss index 20365675b7c..3ccdf749b7e 100644 --- a/addons/mail/static/src/core/common/link_preview.scss +++ b/addons/mail/static/src/core/common/link_preview.scss @@ -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; diff --git a/addons/mail/static/src/core/common/link_preview.xml b/addons/mail/static/src/core/common/link_preview.xml index f3aba5836b3..3858c35169c 100644 --- a/addons/mail/static/src/core/common/link_preview.xml +++ b/addons/mail/static/src/core/common/link_preview.xml @@ -21,7 +21,7 @@
-

+