@bindu-dashing/dam-solution-v2 5.8.111 → 5.8.112

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.
@@ -170,6 +170,6 @@ const AddDrive = ({ parentFolderId }) => {
170
170
  },
171
171
  ];
172
172
  const toggleGenerateThumbnails = () => setState((prevState) => (Object.assign(Object.assign({}, prevState), { showGenerateThumbnails: !prevState.showGenerateThumbnails })));
173
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "md-lib-flex md-lib-gap-3", children: [_jsx(CustomButton, { label: "Generate Thumbnails", icon: _jsx(RiGalleryLineIcon, {}), size: "large", onClick: toggleGenerateThumbnails }), _jsx(Dropdown, { menu: { items }, trigger: ["click"], placement: "bottomRight", children: _jsxs(Button, { icon: _jsx(GoPlusIcon, { size: 16 }), type: "primary", size: "large", children: ["Add ", _jsx(MdKeyboardArrowDownIconIcon, {})] }) })] }), _jsx("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleNativeFileUpload }), openFolderModal && (_jsx(AddFolder, { open: openFolderModal, handleCancel: toggleFolderModal, parentFolderId: currentFolderId })), openMapFile && (_jsx(MapFile, { open: openMapFile, handleCancel: handleMapFileCancel, filesList: filesList, fromUpload: true, parentFolderId: currentFolderId })), showUploadStatus && (_jsx(UploadStatusModal, { open: showUploadStatus, statusList: uploadStatusList, onClose: () => setState((prevState) => (Object.assign(Object.assign({}, prevState), { showUploadStatus: false }))) })), openBlukUploadModal && (_jsx(BulkUploadModal, { toggleUpload: toggleFolderBulkModal, folderId: currentFolderId })), showGenerateThumbnails && (_jsx(BulkUploadModal, { toggleUpload: toggleGenerateThumbnails, thumbnailsOnly: true, folderId: currentFolderId }))] }));
173
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "md-lib-flex md-lib-gap-3", children: [_jsx(CustomButton, { label: "Generate Thumbnails", icon: _jsx(RiGalleryLineIcon, {}), size: "large", onClick: toggleGenerateThumbnails }), _jsx(Dropdown, { menu: { items }, trigger: ["click"], placement: "bottomRight", children: _jsxs(Button, { icon: _jsx(GoPlusIcon, { size: 16 }), type: "primary", size: "large", children: ["Add ", _jsx(MdKeyboardArrowDownIconIcon, {})] }) })] }), _jsx("input", { ref: fileInputRef, type: "file", multiple: true, style: { display: 'none' }, onChange: handleNativeFileUpload }), openFolderModal && (_jsx(AddFolder, { open: openFolderModal, handleCancel: toggleFolderModal, parentFolderId: currentFolderId })), openMapFile && (_jsx(MapFile, { open: openMapFile, handleCancel: handleMapFileCancel, filesList: filesList, fromUpload: true, parentFolderId: currentFolderId })), showUploadStatus && (_jsx(UploadStatusModal, { open: showUploadStatus, statusList: uploadStatusList, onClose: () => setState((prevState) => (Object.assign(Object.assign({}, prevState), { showUploadStatus: false }))) })), openBlukUploadModal && (_jsx(BulkUploadModal, { toggleUpload: toggleFolderBulkModal, folderId: currentFolderId })), showGenerateThumbnails && (_jsx(BulkUploadModal, { toggleUpload: toggleGenerateThumbnails, thumbnailsOnly: true, folderId: currentFolderId }))] }));
174
174
  };
175
175
  export default AddDrive;
@@ -187,8 +187,13 @@ function FileMenuOptions({ file, folderIds = [], fileIds = [], folder, onCloseSe
187
187
  },
188
188
  });
189
189
  const onDuplicateFile = () => {
190
+ const fileToUse = effectiveFile;
191
+ if (!fileToUse || !get(fileToUse, "_id")) {
192
+ onFailure("File not found");
193
+ return;
194
+ }
190
195
  duplicateFileMutation.mutate({
191
- fileIds: [get(file, "_id")],
196
+ fileIds: [get(fileToUse, "_id")],
192
197
  api,
193
198
  });
194
199
  };
@@ -302,17 +307,13 @@ function FileMenuOptions({ file, folderIds = [], fileIds = [], folder, onCloseSe
302
307
  onClick: () => toggleDisplayUpdateName(),
303
308
  disabled: isMultiSelection || !isAdmin,
304
309
  },
305
- // {
306
- // key: FileActionsList.DUPLICATE,
307
- // label: "Duplicate",
308
- // icon: duplicateFileMutation.isLoading ? (
309
- // <CustomLoader />
310
- // ) : (
311
- // <IoDuplicateOutlineIcon />
312
- // ),
313
- // onClick: () => onDuplicateFile(),
314
- // disabled: isMultiSelection || !isAdmin,
315
- // },
310
+ {
311
+ key: FileActionsList.DUPLICATE,
312
+ label: "Duplicate",
313
+ icon: duplicateFileMutation.isLoading ? (_jsx(CustomLoader, {})) : (_jsx(IoDuplicateOutlineIcon, {})),
314
+ onClick: () => onDuplicateFile(),
315
+ disabled: isMultiSelection || !isAdmin,
316
+ },
316
317
  {
317
318
  key: FileActionsList.DELETE,
318
319
  label: "Delete",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bindu-dashing/dam-solution-v2",
3
- "version": "5.8.111",
3
+ "version": "5.8.112",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.0.1",
6
6
  "@emoji-mart/data": "^1.2.1",