diff --git a/frontend/src/metadata/components/context-menu/index.js b/frontend/src/metadata/components/context-menu/index.js
index f2c38f983d..b2a99abbd3 100644
--- a/frontend/src/metadata/components/context-menu/index.js
+++ b/frontend/src/metadata/components/context-menu/index.js
@@ -3,7 +3,12 @@ import PropTypes from 'prop-types';
import './index.css';
-const ContextMenu = ({ options, boundaryCoordinates, onOptionClick, ignoredTriggerElements }) => {
+const ContextMenu = ({
+ options,
+ boundaryCoordinates = { top: 0, right: window.innerWidth, bottom: window.innerHeight, left: 0 },
+ onOptionClick,
+ ignoredTriggerElements
+}) => {
const menuRef = useRef(null);
const [visible, setVisible] = useState(false);
const [position, setPosition] = useState({ top: 0, left: 0 });
diff --git a/frontend/src/metadata/views/gallery/context-menu/index.js b/frontend/src/metadata/views/gallery/context-menu/index.js
index 1af18ab758..f2490ba44f 100644
--- a/frontend/src/metadata/views/gallery/context-menu/index.js
+++ b/frontend/src/metadata/views/gallery/context-menu/index.js
@@ -19,7 +19,7 @@ const CONTEXT_MENU_KEY = {
REMOVE: 'remove',
};
-const GalleryContextMenu = ({ metadata, selectedImages, boundaryCoordinates, onDelete, onDuplicate, addFolder, onRemoveImage }) => {
+const GalleryContextMenu = ({ metadata, selectedImages, onDelete, onDuplicate, addFolder, onRemoveImage }) => {
const [isZipDialogOpen, setIsZipDialogOpen] = useState(false);
const [isCopyDialogOpen, setIsCopyDialogOpen] = useState(false);
@@ -68,7 +68,7 @@ const GalleryContextMenu = ({ metadata, selectedImages, boundaryCoordinates, onD
return;
}
const dirents = selectedImages.map(image => {
- const value = image.path === '/' ? image.name : `${image.path}/${image.name}`;
+ const value = image.parentDir === '/' ? image.name : `${image.parentDir}/${image.name}`;
return value;
});
metadataAPI.zipDownload(repoID, '/', dirents).then((res) => {
@@ -100,13 +100,12 @@ const GalleryContextMenu = ({ metadata, selectedImages, boundaryCoordinates, onD
}, [handleDownload, onDelete, selectedImages, toggleCopyDialog, onRemoveImage]);
const dirent = new Dirent({ name: selectedImages[0]?.name });
- const path = selectedImages[0]?.path;
+ const parentDir = selectedImages[0]?.parentDir;
return (
<>
@@ -115,7 +114,7 @@ const GalleryContextMenu = ({ metadata, selectedImages, boundaryCoordinates, onD
image.path === '/' ? image.name : `${image.path}/${image.name}`)}
+ target={selectedImages.map(image => image.parentDir === '/' ? image.name : `${image.parentDir}/${image.name}`)}
toggleDialog={closeZipDialog}
/>
@@ -123,7 +122,7 @@ const GalleryContextMenu = ({ metadata, selectedImages, boundaryCoordinates, onD
{isCopyDialogOpen && (
{
+const KanbanContextMenu = ({ selectedCard, onDelete, onRename }) => {
const [isRenameDialogShow, setIsRenameDialogShow] = useState(false);
const [isZipDialogOpen, setIsZipDialogOpen] = useState(false);
@@ -130,7 +130,6 @@ const KanbanContextMenu = ({ boundaryCoordinates, selectedCard, onDelete, onRena
<>
@@ -154,7 +153,6 @@ const KanbanContextMenu = ({ boundaryCoordinates, selectedCard, onDelete, onRena
};
KanbanContextMenu.propTypes = {
- boundaryCoordinates: PropTypes.object,
selectedCard: PropTypes.string,
onDelete: PropTypes.func,
onRename: PropTypes.func,
diff --git a/frontend/src/metadata/views/kanban/index.js b/frontend/src/metadata/views/kanban/index.js
index cdac8be821..042b5a3305 100644
--- a/frontend/src/metadata/views/kanban/index.js
+++ b/frontend/src/metadata/views/kanban/index.js
@@ -42,7 +42,7 @@ const Kanban = () => {
}, [isShowSettings]);
return (
-
+
{
}, [containerRef]);
return (
-