@bindu-dashing/dam-solution-v2 5.8.30 → 5.8.32
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.
|
@@ -72,6 +72,7 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
|
|
|
72
72
|
}
|
|
73
73
|
return params;
|
|
74
74
|
};
|
|
75
|
+
console.log('## folderId', parentFolderId);
|
|
75
76
|
const { data: foldersPaginatedData, isLoading, hasNextPage, fetchNextPage, refetch, isFetching, error, } = useFolders(api, generateFoldersQueryKey(type), merge({}, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ page: DEFAULT_PAGE }, (type ? { category: type } : {})), (!!imagePicker
|
|
76
77
|
? {
|
|
77
78
|
includeSubFolders: get(imagePicker, "includeSubFolders", true),
|
|
@@ -79,12 +80,14 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
|
|
|
79
80
|
}
|
|
80
81
|
: {})), (!!searchKey && !!searchValue ? getSearchParams() : {})), (!!metadataKey && !!metadataValue
|
|
81
82
|
? { metadataKey: metadataKey, metadataValue: metadataValue }
|
|
82
|
-
: {})), (!!folderSearch ? { name: folderSearch } : {})), (!!globalSearch && (folderId === rootFolderId || !folderId)
|
|
83
|
+
: {})), (!!folderSearch ? { name: folderSearch } : {})), (!!globalSearch && ((parentFolderId || folderId || id) === rootFolderId || !(parentFolderId || folderId || id))
|
|
83
84
|
? { globalSearch }
|
|
84
|
-
: {})), { sortBy: sortBy, sortOrder: sortOrder }), Object.assign(Object.assign({}, getDateRangeFromKey(selectedDateKey)), (!!selectedType ? { type: selectedType } : {}))),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
: {})), { sortBy: sortBy, sortOrder: sortOrder }), Object.assign(Object.assign({}, getDateRangeFromKey(selectedDateKey)), (!!selectedType ? { type: selectedType } : {}))),
|
|
86
|
+
// Priority: parentFolderId (from selection) > folderId (from URL params) > id > rootFolderId
|
|
87
|
+
parentFolderId
|
|
88
|
+
? parentFolderId
|
|
89
|
+
: folderId
|
|
90
|
+
? folderId
|
|
88
91
|
: id
|
|
89
92
|
? id
|
|
90
93
|
: rootFolderId);
|
|
@@ -97,6 +100,7 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
|
|
|
97
100
|
}
|
|
98
101
|
}, []);
|
|
99
102
|
const folders = useMemo(() => {
|
|
103
|
+
console.log('## foldersPaginatedData', foldersPaginatedData);
|
|
100
104
|
return !!foldersPaginatedData
|
|
101
105
|
? flatMap(get(foldersPaginatedData, "pages"), "folders")
|
|
102
106
|
: [];
|
|
@@ -168,7 +172,7 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
|
|
|
168
172
|
});
|
|
169
173
|
const response = yield api.post(UPLOAD_IMAGE_PICKER_LOCAL_FILE_URL, {
|
|
170
174
|
brandId,
|
|
171
|
-
folderId: folderId || rootFolderId,
|
|
175
|
+
folderId: parentFolderId || folderId || rootFolderId,
|
|
172
176
|
name: file.name,
|
|
173
177
|
size: file.size,
|
|
174
178
|
});
|
|
@@ -184,7 +188,7 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
|
|
|
184
188
|
// setSelectedFile()
|
|
185
189
|
const fileResponse = yield api.post(FETCH_IMAGE_PCIKER_THUMBNAIL_URL, {
|
|
186
190
|
brandId,
|
|
187
|
-
folderId: folderId || rootFolderId,
|
|
191
|
+
folderId: parentFolderId || folderId || rootFolderId,
|
|
188
192
|
name: file.name,
|
|
189
193
|
mimetype: `image/${extension}`,
|
|
190
194
|
s3Path: filePath,
|