@bindu-dashing/dam-solution-v2 5.8.108 → 5.8.111
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.
|
@@ -58,8 +58,9 @@ const AddDrive = ({ parentFolderId }) => {
|
|
|
58
58
|
showGenerateThumbnails: false,
|
|
59
59
|
});
|
|
60
60
|
const { openFolderModal, openMapFile, uploading, filesList, showUploadStatus, uploadStatusList, openBlukUploadModal, showGenerateThumbnails, } = state;
|
|
61
|
-
const toggleOpenMapFile = (files = []) => {
|
|
62
|
-
|
|
61
|
+
const toggleOpenMapFile = (files = [], shouldDelete = false) => {
|
|
62
|
+
var _a;
|
|
63
|
+
if (openMapFile && shouldDelete && ((_a = filesList === null || filesList === void 0 ? void 0 : filesList[0]) === null || _a === void 0 ? void 0 : _a.filePath)) {
|
|
63
64
|
try {
|
|
64
65
|
api.delete(DELETE_S3_FILE_URL.replace(":path", filesList === null || filesList === void 0 ? void 0 : filesList[0].filePath));
|
|
65
66
|
}
|
|
@@ -69,6 +70,9 @@ const AddDrive = ({ parentFolderId }) => {
|
|
|
69
70
|
}
|
|
70
71
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { openMapFile: !prevState.openMapFile, filesList: files, showUploadStatus: false })));
|
|
71
72
|
};
|
|
73
|
+
const handleMapFileCancel = (shouldDelete = false) => {
|
|
74
|
+
toggleOpenMapFile([], shouldDelete);
|
|
75
|
+
};
|
|
72
76
|
const toggleFolderModal = () => {
|
|
73
77
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { openFolderModal: !prevState.openFolderModal })));
|
|
74
78
|
};
|
|
@@ -166,6 +170,6 @@ const AddDrive = ({ parentFolderId }) => {
|
|
|
166
170
|
},
|
|
167
171
|
];
|
|
168
172
|
const toggleGenerateThumbnails = () => setState((prevState) => (Object.assign(Object.assign({}, prevState), { showGenerateThumbnails: !prevState.showGenerateThumbnails })));
|
|
169
|
-
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:
|
|
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 }))] }));
|
|
170
174
|
};
|
|
171
175
|
export default AddDrive;
|
|
@@ -26,6 +26,6 @@ const FileViewer = ({ file, onNext, onPrev, hasNext, hasPrev, handleClose, }) =>
|
|
|
26
26
|
// children: <Compliance />,
|
|
27
27
|
// },
|
|
28
28
|
];
|
|
29
|
-
return (_jsx(Layout, { children: _jsxs(Content, { className: "md-lib-grid md-lib-grid-cols-3 md-lib-gap-2", children: [_jsx("div", { className: "md-lib-col-span-1 md:md-lib-col-span-2 md-lib-imageBg md-lib-bg-cover md-lib-bg-center md-lib-min-h-full md-lib-flex md-lib-items-center md-lib-justify-center md-lib-relative md-lib-bg-textColorActive dark:md-lib-bg-darkSecondaryColor", children: _jsx(PreviewDetails, { file: file, hasNext: hasNext, hasPrev: hasPrev, onNext: onNext, onPrev: onPrev }) }), _jsx(MapFile, { fromUpload: false, filesList: file ? [file] : [], handleCancel: handleClose })] }) }));
|
|
29
|
+
return (_jsx(Layout, { children: _jsxs(Content, { className: "md-lib-grid md-lib-grid-cols-3 md-lib-gap-2", children: [_jsx("div", { className: "md-lib-col-span-1 md:md-lib-col-span-2 md-lib-imageBg md-lib-bg-cover md-lib-bg-center md-lib-min-h-full md-lib-flex md-lib-items-center md-lib-justify-center md-lib-relative md-lib-bg-textColorActive dark:md-lib-bg-darkSecondaryColor", children: _jsx(PreviewDetails, { file: file, hasNext: hasNext, hasPrev: hasPrev, onNext: onNext, onPrev: onPrev }) }), _jsx(MapFile, { fromUpload: false, filesList: file ? [file] : [], handleCancel: handleClose ? () => handleClose() : undefined })] }) }));
|
|
30
30
|
};
|
|
31
31
|
export default FileViewer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileEntity, ResponseFile } from "../../utilities/constants/interface";
|
|
2
2
|
declare function MapFile({ open, handleCancel, filesList, fromUpload, parentFolderId, }: {
|
|
3
3
|
open?: boolean;
|
|
4
|
-
handleCancel?: () => void;
|
|
4
|
+
handleCancel?: (shouldDelete?: boolean) => void;
|
|
5
5
|
filesList: ResponseFile[] | FileEntity[];
|
|
6
6
|
fromUpload?: boolean;
|
|
7
7
|
parentFolderId?: string;
|
|
@@ -131,7 +131,7 @@ function MapFile({ open, handleCancel, filesList, fromUpload, parentFolderId, })
|
|
|
131
131
|
return fileData;
|
|
132
132
|
}) }));
|
|
133
133
|
showNotification(get(response, "data.message", CREATE_SUCCESS), NotificationStatus.SUCCESS);
|
|
134
|
-
handleCancel && handleCancel();
|
|
134
|
+
handleCancel && handleCancel(false);
|
|
135
135
|
}
|
|
136
136
|
catch (error) {
|
|
137
137
|
showNotification(get(error, "message", SOMETHING_WENT_WRONG), NotificationStatus.ERROR);
|
|
@@ -205,7 +205,7 @@ function MapFile({ open, handleCancel, filesList, fromUpload, parentFolderId, })
|
|
|
205
205
|
};
|
|
206
206
|
const getMetadataForm = (_jsxs(Form, { layout: "vertical", form: form, scrollToFirstError: true, onFinish: fromUpload ? handleSubmit : handleUpdate, className: "md-lib-m-2", children: [_jsx(AssetSelectionFormItem, { handleAssetTemplateChange: handleAssetTemplateChange, assetOptions: assetOptions, assetsLoading: assetsLoading }), selectedAssetTemplate && (_jsxs(_Fragment, { children: [_jsx(Form.Item, { name: "teamIds", label: "Teams", children: _jsx(Select, { options: teamOptions, placeholder: "Select teams", mode: "multiple", onChange: (val) => onChangeTeams(val), style: { width: "100%" }, showSearch: true, optionFilterProp: "key" }) }), _jsx(Form.Item, { name: "expiryDate", label: "Expiry Date", children: _jsx(DatePicker, { placeholder: "Expiry Date", style: { width: "100%" } }) }), _jsx(Metadata, { asset: selectedAssetTemplate, form: form, file: (filesList === null || filesList === void 0 ? void 0 : filesList[0]) || null })] })), _jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-justify-end md-lib-gap-3", children: [_jsx(Button, { onClick: () => {
|
|
207
207
|
if (handleCancel) {
|
|
208
|
-
handleCancel();
|
|
208
|
+
handleCancel(true);
|
|
209
209
|
}
|
|
210
210
|
else if (navigate) {
|
|
211
211
|
// Navigate back if navigate function is available
|
|
@@ -214,6 +214,6 @@ function MapFile({ open, handleCancel, filesList, fromUpload, parentFolderId, })
|
|
|
214
214
|
}, children: "Cancel" }), _jsx(Button, { disabled: !selectedAssetTemplate, type: "primary",
|
|
215
215
|
// onClick={handleSubmit}
|
|
216
216
|
loading: loading || updateFileMutation.isLoading, htmlType: "submit", children: "Save" })] })] }));
|
|
217
|
-
return (_jsx(_Fragment, { children: fromUpload ? (_jsx(Drawer, { title: "Metadata", open: open, onClose: handleCancel, maskClosable: false, children: getMetadataForm })) : (_jsxs("div", { className: "md-lib-p-2 md-lib-overflow-y-scroll md-lib-max-h-[calc(100vh-65px)]", children: [_jsx("p", { className: "md-lib-text-lg md-lib-font-semibold", children: "Metadata" }), getMetadataForm] })) }));
|
|
217
|
+
return (_jsx(_Fragment, { children: fromUpload ? (_jsx(Drawer, { title: "Metadata", open: open, onClose: () => handleCancel && handleCancel(true), maskClosable: false, children: getMetadataForm })) : (_jsxs("div", { className: "md-lib-p-2 md-lib-overflow-y-scroll md-lib-max-h-[calc(100vh-65px)]", children: [_jsx("p", { className: "md-lib-text-lg md-lib-font-semibold", children: "Metadata" }), getMetadataForm] })) }));
|
|
218
218
|
}
|
|
219
219
|
export default MapFile;
|