From 8708ab1c610c505c273110ff34263fab60fc90a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= Date: Mon, 16 Dec 2024 18:35:29 +0800 Subject: [PATCH 1/2] fix: download people imahe --- frontend/src/metadata/views/gallery/context-menu/index.js | 4 +--- frontend/src/metadata/views/gallery/main.js | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/metadata/views/gallery/context-menu/index.js b/frontend/src/metadata/views/gallery/context-menu/index.js index f3e0edcaeda..7169ec5c7f8 100644 --- a/frontend/src/metadata/views/gallery/context-menu/index.js +++ b/frontend/src/metadata/views/gallery/context-menu/index.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import ContextMenu from '../../../components/context-menu'; import { gettext, useGoFileserver, fileServerRoot } from '../../../../utils/constants'; import { getRowById } from '../../../utils/table'; -import { useMetadataView } from '../../../hooks/metadata-view'; import { downloadFile } from '../../../utils/file'; import ZipDownloadDialog from '../../../../components/dialog/zip-download-dialog'; import metadataAPI from '../../../api'; @@ -16,10 +15,9 @@ const CONTEXT_MENU_KEY = { DELETE: 'delete', }; -const GalleryContextMenu = ({ selectedImages, boundaryCoordinates, onDelete }) => { +const GalleryContextMenu = ({ metadata, selectedImages, boundaryCoordinates, onDelete }) => { const [isZipDialogOpen, setIsZipDialogOpen] = useState(false); - const { metadata } = useMetadataView(); const repoID = window.sfMetadataContext.getSetting('repoID'); const checkCanDeleteRow = window.sfMetadataContext.checkCanDeleteRow(); diff --git a/frontend/src/metadata/views/gallery/main.js b/frontend/src/metadata/views/gallery/main.js index 26148a31885..c3fafc584f9 100644 --- a/frontend/src/metadata/views/gallery/main.js +++ b/frontend/src/metadata/views/gallery/main.js @@ -362,6 +362,7 @@ const Main = ({ isLoadingMore, metadata, onDelete, onLoadMore }) => { )} Date: Mon, 16 Dec 2024 18:37:24 +0800 Subject: [PATCH 2/2] feat: add proptypes --- frontend/src/metadata/views/gallery/context-menu/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/metadata/views/gallery/context-menu/index.js b/frontend/src/metadata/views/gallery/context-menu/index.js index 7169ec5c7f8..bde8d065ec9 100644 --- a/frontend/src/metadata/views/gallery/context-menu/index.js +++ b/frontend/src/metadata/views/gallery/context-menu/index.js @@ -94,6 +94,7 @@ const GalleryContextMenu = ({ metadata, selectedImages, boundaryCoordinates, onD }; GalleryContextMenu.propTypes = { + metadata: PropTypes.object, selectedImages: PropTypes.array, boundaryCoordinates: PropTypes.object, onDelete: PropTypes.func,