@bindu-dashing/dam-solution-v2 5.8.113 → 5.8.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -182,9 +182,9 @@ const ActionsBar = ({ fileIds, folderIds, onCloseSelection, selectedFilesData =
|
|
|
182
182
|
}
|
|
183
183
|
}, [fileLinks, folderLinks]);
|
|
184
184
|
const isTrashPage = useMemo(() => type === DriveModes.TRASH, [type]);
|
|
185
|
-
return (_jsxs("div", { className: "md-lib-fixed md-lib-bottom-6 md-lib-left-1/2 md-lib-transform -md-lib-translate-x-1/2 md-lib-w-80 md:md-lib-w-[720px] md-lib-max-w-3xl md-lib-bg-textColorActive md-lib-border dark:md-lib-bg-darkPrimary dark:md-lib-border-darkBorderColor md-lib-border-secondaryHoverColor md-lib-rounded-xl md-lib-shadow-md md-lib-flex md-lib-items-center md-lib-justify-between md-lib-px-4 md-lib-py-2 md-lib-z-50", children: [_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-5 md-lib-pl-2", children: [_jsx(Button, { type: "text", size: "large", icon: _jsx(FiDownloadIcon, { size: 24, className: "" }), disabled: isTrashPage, onClick: onDownloadFiles, loading: downloadFileMutation.isLoading }), isTrashPage ? (_jsx(Tooltip, { title: "Restore", children: _jsx(Button, { type: "text", size: "large", icon: _jsx(RedoOutlined, { className: "" }), onClick: () => onRestoreFiles(), disabled: !isTrashPage }) })) : (_jsx(_Fragment, { children: isAdmin && (_jsx(Tooltip, { title: "Delete", children: _jsx(Button, { type: "text", size: "large", icon: _jsx(FiTrash2Icon, { size: 24, className: "" }), onClick: () => toggleConfirmPopup("delete"), disabled: isTrashPage }) })) })), _jsx(FileMenuOptions, { file: selectedFile || null, fileIds: fileIds, folderIds: folderIds, folder: selectedFolder || null, onCloseSelection: onCloseSelection, readOnly: isTrashPage })] }), _jsx("div", { className: "md-lib-flex md-lib-items-center", children: _jsxs(Tag, { className: "md-lib-bg-[#DEE4ED] dark:md-lib-bg-darkPrimaryHoverColor !md-lib-rounded-lg !md-lib-px-4 h-[38px] md-lib-text-sm md-lib-items-center md-lib-font-medium md-lib-flex md-lib-gap-2 md-lib-text-textColor dark:md-lib-text-darkTextColor", closable: true, closeIcon: _jsx(FiXIcon, { onClick: onCloseSelection, className: "md-lib-cursor-pointer" }), children: [get(fileIds, "length", 0) + get(folderIds, "length", 0), " Selected"] }) }), showMoveFolder && (_jsx(MoveToAnotherFolder, { open: showMoveFolder, handleCancel: () => {
|
|
185
|
+
return (_jsxs("div", { className: "md-lib-fixed md-lib-bottom-6 md-lib-left-1/2 md-lib-transform -md-lib-translate-x-1/2 md-lib-w-80 md:md-lib-w-[720px] md-lib-max-w-3xl md-lib-bg-textColorActive md-lib-border dark:md-lib-bg-darkPrimary dark:md-lib-border-darkBorderColor md-lib-border-secondaryHoverColor md-lib-rounded-xl md-lib-shadow-md md-lib-flex md-lib-items-center md-lib-justify-between md-lib-px-4 md-lib-py-2 md-lib-z-50", children: [_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-5 md-lib-pl-2", children: [_jsx(Button, { type: "text", size: "large", icon: _jsx(FiDownloadIcon, { size: 24, className: "" }), disabled: isTrashPage, onClick: onDownloadFiles, loading: downloadFileMutation.isLoading }), _jsx(Tooltip, { title: "Move", children: _jsx(Button, { type: "text", size: "large", icon: _jsx(FiFolderPlusIcon, { size: 24, className: "" }), disabled: isTrashPage, onClick: toggleShowMoveFolder }) }), isTrashPage ? (_jsx(Tooltip, { title: "Restore", children: _jsx(Button, { type: "text", size: "large", icon: _jsx(RedoOutlined, { className: "" }), onClick: () => onRestoreFiles(), disabled: !isTrashPage }) })) : (_jsx(_Fragment, { children: isAdmin && (_jsx(Tooltip, { title: "Delete", children: _jsx(Button, { type: "text", size: "large", icon: _jsx(FiTrash2Icon, { size: 24, className: "" }), onClick: () => toggleConfirmPopup("delete"), disabled: isTrashPage }) })) })), _jsx(FileMenuOptions, { file: selectedFile || null, fileIds: fileIds, folderIds: folderIds, folder: selectedFolder || null, onCloseSelection: onCloseSelection, readOnly: isTrashPage })] }), _jsx("div", { className: "md-lib-flex md-lib-items-center", children: _jsxs(Tag, { className: "md-lib-bg-[#DEE4ED] dark:md-lib-bg-darkPrimaryHoverColor !md-lib-rounded-lg !md-lib-px-4 h-[38px] md-lib-text-sm md-lib-items-center md-lib-font-medium md-lib-flex md-lib-gap-2 md-lib-text-textColor dark:md-lib-text-darkTextColor", closable: true, closeIcon: _jsx(FiXIcon, { onClick: onCloseSelection, className: "md-lib-cursor-pointer" }), children: [get(fileIds, "length", 0) + get(folderIds, "length", 0), " Selected"] }) }), showMoveFolder && (_jsx(MoveToAnotherFolder, { open: showMoveFolder, handleCancel: () => {
|
|
186
186
|
toggleShowMoveFolder();
|
|
187
187
|
onCloseSelection();
|
|
188
|
-
}, folderIds: folderIds, fileIds:
|
|
188
|
+
}, folderIds: folderIds, fileIds: fileIds, entity: null })), _jsx(DeleteConfirmationModal, { showDeleteModal: showConfirmModal, toggleDeleteModal: toggleConfirmPopup, icon: actionType === "archive" ? (_jsx(IoArchiveOutlineIcon, {})) : (_jsx(DeleteOutlined, {})), okText: actionType === "archive" ? ARCHIVE_OK_TEXT : DELETE_OK_TEXT, description: DELETE_CONFIRMATION_MESSAGE.replace(":action", actionType).replace(" :entity", ""), subHeading: actionType === "archive" ? "" : DELETE_MESSAGE_DESCRIPTION, onOk: actionType === "archive" ? () => { } : onDeleteFile, loading: deleteFileMutation.isLoading })] }));
|
|
189
189
|
};
|
|
190
190
|
export default ActionsBar;
|
|
@@ -363,12 +363,13 @@ function FileMenuOptions({ file, folderIds = [], fileIds = [], folder, onCloseSe
|
|
|
363
363
|
onClick: onDownloadFile,
|
|
364
364
|
},
|
|
365
365
|
...adminItems,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
366
|
+
{
|
|
367
|
+
key: FileActionsList.MOVE,
|
|
368
|
+
label: "Move",
|
|
369
|
+
icon: _jsx(MdDriveFileMoveOutlineIcon, {}),
|
|
370
|
+
onClick: () => toggleShowMoveFolder(),
|
|
371
|
+
disabled: !!get(folderIds, "length"),
|
|
372
|
+
},
|
|
372
373
|
// {
|
|
373
374
|
// key: FileActionsList.ARCHIVE,
|
|
374
375
|
// label: "Archive",
|
|
@@ -425,6 +426,6 @@ function FileMenuOptions({ file, folderIds = [], fileIds = [], folder, onCloseSe
|
|
|
425
426
|
? "md-lib-cursor-not-allowed md-lib-text-disabledBtnColor dark:md-lib-text-darkBorderColor"
|
|
426
427
|
: "md-lib-cursor-pointer", onClick: (e) => e.stopPropagation() }) }), displayUpdateName && (!!file || !!folder) && (_jsx(AddFolder, { file: file, open: displayUpdateName, handleCancel: toggleDisplayUpdateName, folder: folder, onCloseSelection: onCloseSelection, fileModal: fileModal })), _jsx(DeleteConfirmationModal, { showDeleteModal: showConfirmModal, toggleDeleteModal: toggleConfirmPopup, icon: actionType === "archive" ? (_jsx(IoArchiveOutlineIcon, {})) : (_jsx(DeleteOutlined, {})), okText: actionType === "archive" ? ARCHIVE_OK_TEXT : DELETE_OK_TEXT, description: isMultiSelection
|
|
427
428
|
? DELETE_CONFIRMATION_MESSAGE.replace(":action", actionType).replace(" :entity", "")
|
|
428
|
-
: DELETE_CONFIRMATION_MESSAGE.replace(":action", actionType).replace(":entity", get(file, "name", "this file")), onOk: actionType === "archive" ? onArchiveFile : onDeleteFile, subHeading: actionType === "archive" ? "" : DELETE_MESSAGE_DESCRIPTION, loading: deleteFileMutation.isLoading || archiveFileMutation.isLoading }), showPreviewModal && (_jsx(FileDetails, { open: showPreviewModal, handleClose: toggleShowPreviewModal, file: file || undefined, files: getSelectedFiles(queryClient, folderId ? folderId : rootFolderId, generateFoldersQueryKey(type), file ? [get(file, "_id")] : fileIds), fileIds: file ? [get(file, "_id")] : fileIds, onCloseSelection: onCloseSelection })), showMoveFolder && (_jsx(MoveToAnotherFolder, { open: showMoveFolder, handleCancel: toggleShowMoveFolder, fileIds: [get(file, "_id")], entity: file, onCloseSelection: onCloseSelection })), showShareModal && (_jsx(InviteTeamModal, { open: showShareModal, onClose: toggleShareModal, onFetchInvitations: () => { }, shareModal: true, fileIds: file ? [get(file, "_id")] : fileIds, folderIds: folderIds, inviteType: DriveModes.FILE, file: file })), showFileAccess && (file || folder) && (_jsx(ManageFile, { open: showFileAccess, onClose: toggleFileAccess, file: file ? file : folder })), showLogsModal && (_jsx(FileDownloadHistory, { file: file ? file : folder, open: showLogsModal, onClose: toggleLogsModal }))] }));
|
|
429
|
+
: DELETE_CONFIRMATION_MESSAGE.replace(":action", actionType).replace(":entity", get(file, "name", "this file")), onOk: actionType === "archive" ? onArchiveFile : onDeleteFile, subHeading: actionType === "archive" ? "" : DELETE_MESSAGE_DESCRIPTION, loading: deleteFileMutation.isLoading || archiveFileMutation.isLoading }), showPreviewModal && (_jsx(FileDetails, { open: showPreviewModal, handleClose: toggleShowPreviewModal, file: file || undefined, files: getSelectedFiles(queryClient, folderId ? folderId : rootFolderId, generateFoldersQueryKey(type), file ? [get(file, "_id")] : fileIds), fileIds: file ? [get(file, "_id")] : fileIds, onCloseSelection: onCloseSelection })), showMoveFolder && (effectiveFile || file) && (_jsx(MoveToAnotherFolder, { open: showMoveFolder, handleCancel: toggleShowMoveFolder, fileIds: effectiveFile ? [get(effectiveFile, "_id")] : [get(file, "_id")], folderIds: [], entity: effectiveFile || file, onCloseSelection: onCloseSelection })), showShareModal && (_jsx(InviteTeamModal, { open: showShareModal, onClose: toggleShareModal, onFetchInvitations: () => { }, shareModal: true, fileIds: file ? [get(file, "_id")] : fileIds, folderIds: folderIds, inviteType: DriveModes.FILE, file: file })), showFileAccess && (file || folder) && (_jsx(ManageFile, { open: showFileAccess, onClose: toggleFileAccess, file: file ? file : folder })), showLogsModal && (_jsx(FileDownloadHistory, { file: file ? file : folder, open: showLogsModal, onClose: toggleLogsModal }))] }));
|
|
429
430
|
}
|
|
430
431
|
export default FileMenuOptions;
|
|
@@ -78,6 +78,6 @@ function FolderTabs({ folderIds = [], selectedFolderId, setSelectedFolderId, })
|
|
|
78
78
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "md-lib-text-sm md-lib-mb-4 md-lib-text-secondaryTextColor", children: ["Current location:", " ", _jsx("span", { className: "font-semibold truncate ", title: get(currentFolder, "name", capitalize(activeTabKey)), children: get(currentFolder, "name", capitalize(activeTabKey)) })] }), get(parentFoldersList, "length") ? (_jsxs("div", { className: "md-lib-flex md-lib-flex-col md-lib-gap-3", children: [_jsxs("div", { className: "md-lib-flex md-lib-gap-4 md-lib-cursor-pointer md-lib-items-center", onClick: () => {
|
|
79
79
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { parentFoldersList: initial(prevState.parentFoldersList) })));
|
|
80
80
|
setSelectedFolderId("");
|
|
81
|
-
}, children: [_jsx(FaArrowLeftLongIcon, {}), _jsx("span", { className: "md-lib-font-semibold md-lib-truncate md-lib-max-w-7xl", title: get(nth(get(currentFolder, "tree", []), get(currentFolder, "tree.length") - 1), "name", capitalize(activeTabKey)), children: get(nth(get(currentFolder, "tree", []), get(currentFolder, "tree.length") - 1), "name", capitalize(activeTabKey)) })] }), _jsx(RenderTabContent, {})] })) : (_jsxs(Tabs, { activeKey: activeTabKey, onChange: (key) => setState((prev) => (Object.assign(Object.assign({}, prev), { activeTabKey: key }))), children: [_jsx(Tabs.TabPane, { tab: "Suggested", children: _jsx(RenderTabContent, {}) }, DriveModes.RECENTS), _jsx(Tabs.TabPane, { tab: "
|
|
81
|
+
}, children: [_jsx(FaArrowLeftLongIcon, {}), _jsx("span", { className: "md-lib-font-semibold md-lib-truncate md-lib-max-w-7xl", title: get(nth(get(currentFolder, "tree", []), get(currentFolder, "tree.length") - 1), "name", capitalize(activeTabKey)), children: get(nth(get(currentFolder, "tree", []), get(currentFolder, "tree.length") - 1), "name", capitalize(activeTabKey)) })] }), _jsx(RenderTabContent, {})] })) : (_jsxs(Tabs, { activeKey: activeTabKey, onChange: (key) => setState((prev) => (Object.assign(Object.assign({}, prev), { activeTabKey: key }))), children: [_jsx(Tabs.TabPane, { tab: "Suggested", children: _jsx(RenderTabContent, {}) }, DriveModes.RECENTS), _jsx(Tabs.TabPane, { tab: "All locations", children: _jsx(RenderTabContent, {}) }, "all")] }))] }));
|
|
82
82
|
}
|
|
83
83
|
export default FolderTabs;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
11
|
import { useMemo, useState } from "react";
|
|
3
12
|
import { Modal } from "antd";
|
|
@@ -24,12 +33,17 @@ function MoveToAnotherFolder({ open, handleCancel, fileIds = [], entity, folderI
|
|
|
24
33
|
const { selectedFolderId } = state;
|
|
25
34
|
const moveFileMutation = useMutation({
|
|
26
35
|
mutationFn: moveFiles,
|
|
27
|
-
onSuccess: (response) => {
|
|
28
|
-
|
|
36
|
+
onSuccess: (response) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const foldersQueryKey = generateFoldersQueryKey(type);
|
|
38
|
+
const currentFolderId = folderId ? folderId : rootFolderId;
|
|
39
|
+
invalidateData(queryClient, foldersQueryKey, currentFolderId);
|
|
40
|
+
yield queryClient.refetchQueries({
|
|
41
|
+
queryKey: [foldersQueryKey, currentFolderId],
|
|
42
|
+
});
|
|
29
43
|
handleCancel();
|
|
30
44
|
onCloseSelection === null || onCloseSelection === void 0 ? void 0 : onCloseSelection();
|
|
31
45
|
showNotification(get(response, "data.message", MOVE_SUCCESS), NotificationStatus.SUCCESS);
|
|
32
|
-
},
|
|
46
|
+
}),
|
|
33
47
|
onError: (error) => {
|
|
34
48
|
showNotification(get(error, "message", SOMETHING_WENT_WRONG), NotificationStatus.ERROR);
|
|
35
49
|
},
|