@bindu-dashing/dam-solution-v2 5.8.106 → 5.8.107
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.
|
@@ -53,48 +53,9 @@ function TestImagePickerModal({ imagePicker, open, toggleModal, setSelectedFile,
|
|
|
53
53
|
return Object.assign(Object.assign({}, field), { fieldId: get(metaField, "_id") });
|
|
54
54
|
});
|
|
55
55
|
// console.log(formattedOutputFormat);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
console.log('DAM ImagePicker - Formatted value:', formattedValue);
|
|
60
|
-
console.log('DAM ImagePicker - File s3Url from API (fileData.s3Url):', get(fileData, "s3Url"));
|
|
61
|
-
console.log('DAM ImagePicker - File s3Url from fileForConfirmation:', fileForConfirmation === null || fileForConfirmation === void 0 ? void 0 : fileForConfirmation.s3Url);
|
|
62
|
-
console.log('DAM ImagePicker - Actual file s3Url being used:', actualFileS3Url);
|
|
63
|
-
console.log('DAM ImagePicker - File data:', fileData);
|
|
64
|
-
console.log('DAM ImagePicker - File for confirmation:', fileForConfirmation);
|
|
65
|
-
// FIX: Ensure we always use the actual file s3Url, not thumbnail URL
|
|
66
|
-
// The preview API needs the actual file URL, not thumbnail URL
|
|
67
|
-
let finalValue = formattedValue;
|
|
68
|
-
if (actualFileS3Url) {
|
|
69
|
-
const formattedValueStr = String(formattedValue || '');
|
|
70
|
-
// Check if formatted value is a thumbnail URL (contains '/thumbnails/' in path)
|
|
71
|
-
if (formattedValueStr.includes('/thumbnails/')) {
|
|
72
|
-
// Use the actual file s3Url instead of thumbnail URL
|
|
73
|
-
finalValue = actualFileS3Url;
|
|
74
|
-
console.log('DAM ImagePicker - FIXED: Replaced thumbnail URL with file s3Url');
|
|
75
|
-
console.log('DAM ImagePicker - Thumbnail URL was:', formattedValueStr);
|
|
76
|
-
console.log('DAM ImagePicker - File s3Url is:', finalValue);
|
|
77
|
-
}
|
|
78
|
-
else if (formattedValueStr.includes('/files/')) {
|
|
79
|
-
// Formatted value already contains file URL, use it
|
|
80
|
-
finalValue = formattedValueStr; // Remove query params if any
|
|
81
|
-
console.log('DAM ImagePicker - Formatted value is already a file URL, using it');
|
|
82
|
-
}
|
|
83
|
-
else if (formattedValueStr !== actualFileS3Url && actualFileS3Url.includes('/files/')) {
|
|
84
|
-
// If formatted value is different and s3Url is a file URL, use s3Url
|
|
85
|
-
finalValue = actualFileS3Url;
|
|
86
|
-
console.log('DAM ImagePicker - FIXED: Using file s3Url (formatted value was not file URL)');
|
|
87
|
-
console.log('DAM ImagePicker - Final value (file s3Url):', finalValue);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
console.log('DAM ImagePicker - Using formatted value as-is:', finalValue);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
console.warn('DAM ImagePicker - WARNING: No file s3Url available!');
|
|
95
|
-
console.warn('DAM ImagePicker - Using formatted value:', finalValue);
|
|
96
|
-
}
|
|
97
|
-
setSelectedFile(fileForConfirmation === null || fileForConfirmation === void 0 ? void 0 : fileForConfirmation.thumbnailUrl, finalValue);
|
|
56
|
+
const value = getFormattedValue(formattedOutputFormat, fileForConfirmation === null || fileForConfirmation === void 0 ? void 0 : fileForConfirmation.s3Url, get(fileData, "metadata", {}));
|
|
57
|
+
console.log(value);
|
|
58
|
+
setSelectedFile(fileForConfirmation === null || fileForConfirmation === void 0 ? void 0 : fileForConfirmation.thumbnailUrl, value);
|
|
98
59
|
});
|
|
99
60
|
return (_jsx(Modal, { title: `Test ${get(imagePicker, "name", "Image picker")}`, open: open, onCancel: toggleModal, okText: "Create", maskClosable: false, width: get(imagePicker, "assetId") ? 600 : 1000, footer: get(fileForConfirmation, "thumbnailUrl") ? (_jsx(CustomButton, { type: "primary", label: "Confirm", onClick: () => {
|
|
100
61
|
onSelectFile();
|
|
@@ -104,9 +65,7 @@ function TestImagePickerModal({ imagePicker, open, toggleModal, setSelectedFile,
|
|
|
104
65
|
console.log("local file", file);
|
|
105
66
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { fileForConfirmation: file })));
|
|
106
67
|
if (localFile) {
|
|
107
|
-
|
|
108
|
-
setSelectedFile(get(file, "thumbnailUrl", ""), get(file, "s3Url", "") // Use actual file s3Url, not thumbnail
|
|
109
|
-
);
|
|
68
|
+
setSelectedFile(get(file, "s3Url", ""), get(file, "thumbnailUrl", ""));
|
|
110
69
|
}
|
|
111
70
|
}, parentFolderId: parentFolderId, setParentFolderId: (id) => setState((prevState) => (Object.assign(Object.assign({}, prevState), { parentFolderId: id, fileForConfirmation: {} }))), pickerFolderId: get(imagePicker, "folderId"), selectedPickerFile: fileForConfirmation, imagePicker: imagePicker, globalSearch: globalSearch, setGlobalSearch: setGlobalSearch }) })) }));
|
|
112
71
|
}
|