From 3321534162b09a4dd420c5f46a9cae9066605065 Mon Sep 17 00:00:00 2001 From: Mostafa Mekky <59936007+mekkyz@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:08:47 +0200 Subject: [PATCH] fix(UI): Attachment list (#1852) * Fix: eslint & intrument dropdown offset when no generci dataset metadata * feat: add warning if instrument missing * feat: instance of thumbnail to appear centered --- app/assets/stylesheets/attachment-list.scss | 32 +++++++++--- .../apps/mydb/elements/list/AttachmentList.js | 28 +++++++++-- app/packs/src/components/common/ImageModal.js | 17 +++---- .../container/ContainerDatasetModal.js | 50 ++++++++++++++----- .../container/ContainerDatasetModalContent.js | 11 ++-- 5 files changed, 101 insertions(+), 37 deletions(-) diff --git a/app/assets/stylesheets/attachment-list.scss b/app/assets/stylesheets/attachment-list.scss index 89d95c270a..b32d237c72 100644 --- a/app/assets/stylesheets/attachment-list.scss +++ b/app/assets/stylesheets/attachment-list.scss @@ -67,18 +67,34 @@ } .attachment-row-image { - flex: 0.05; - display: flex; - margin-left: 10px; + position: relative; + display: inline-flex; align-items: center; - transition: transform 0.3s ease-in-out; + margin-left: 10px; + transition: transform 0.6s ease-in-out; } -.attachment-row-image:hover { - transform: scale(6) translateX(20px); - z-index: 1000; - transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); + +.attachment-row-image .large-preview-modal { + position: absolute; + left: 1000%; + top: -300%; + width: 400px; + height: 400px; + border-radius: 5px; + background-color: #FFF; + object-fit: contain; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); + opacity: 0; + visibility: hidden; + transition: opacity 0.8s ease, visibility 0s linear 0.8s; + z-index: 10; } +.attachment-row-image:hover .large-preview-modal { + opacity: 1; + visibility: visible; + transition-delay: 0s; +} .attachment-row-text { flex: 0.7; diff --git a/app/packs/src/apps/mydb/elements/list/AttachmentList.js b/app/packs/src/apps/mydb/elements/list/AttachmentList.js index 59b3643235..d2b08a066e 100644 --- a/app/packs/src/apps/mydb/elements/list/AttachmentList.js +++ b/app/packs/src/apps/mydb/elements/list/AttachmentList.js @@ -21,12 +21,31 @@ export const attachmentThumbnail = (attachment) => ( boxShadow: '0 2px 10px rgba(0, 0, 0, 0.1)', transition: 'transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out', }} - hasPop alt="thumbnail" previewObject={{ src: attachment.preview, }} - popObject={ + popObject + disableClick + /> +