From c699095d1aeb802181158597e68f3cc1f5cacaca Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Tue, 22 Aug 2023 05:55:20 +0400 Subject: [PATCH 1/2] Add thumbnail asset preview to list view assets [SCI-9014] --- app/assets/stylesheets/shared/assets.scss | 17 ++++++++++++++++ .../vue/shared/content/attachments/list.vue | 20 +++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/shared/assets.scss b/app/assets/stylesheets/shared/assets.scss index 9b212b738..bbdb43472 100644 --- a/app/assets/stylesheets/shared/assets.scss +++ b/app/assets/stylesheets/shared/assets.scss @@ -248,6 +248,23 @@ @include font-main; } + .attachment-image-tooltip { + display: none; + z-index: 9999; + position: relative; + right: 110px; + bottom: 90px; + + img { + width: 150px; + height: 150px; + } + } + + .file-preview-link:hover + .attachment-image-tooltip { + display: block; + } + .file-name { @include font-main; color: $brand-primary; diff --git a/app/javascript/vue/shared/content/attachments/list.vue b/app/javascript/vue/shared/content/attachments/list.vue index 3f2855f67..af01936dc 100644 --- a/app/javascript/vue/shared/content/attachments/list.vue +++ b/app/javascript/vue/shared/content/attachments/list.vue @@ -11,12 +11,14 @@ :data-gallery-view-id="parentId" :data-preview-url="attachment.attributes.urls.preview" > - + {{ attachment.attributes.file_name }} +
+ +
{{ i18n.t('attachments.new.description') }} @@ -53,7 +55,17 @@ parentId: { type: Number, required: true - } + }, }, + data() { + return { + imageLoadError: false + }; + }, + methods: { + handleImageError() { + this.imageLoadError = true; + } + } } From 76479f6bf7dcd45c328db562c56785f21190a1a1 Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Tue, 22 Aug 2023 06:02:30 +0400 Subject: [PATCH 2/2] hound fix --- app/assets/stylesheets/shared/assets.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/shared/assets.scss b/app/assets/stylesheets/shared/assets.scss index bbdb43472..3e2767b59 100644 --- a/app/assets/stylesheets/shared/assets.scss +++ b/app/assets/stylesheets/shared/assets.scss @@ -249,15 +249,15 @@ } .attachment-image-tooltip { + bottom: 90px; display: none; - z-index: 9999; position: relative; right: 110px; - bottom: 90px; + z-index: 9999; img { - width: 150px; height: 150px; + width: 150px; } }