mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
Fix: Media Library List View
This commit is contained in:
parent
c1708b520f
commit
ffbaca0974
@ -22,18 +22,18 @@ export const TableRows = ({
|
||||
}) => {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
const handleRowClickFn = (element, elementType, id) => {
|
||||
const handleRowClickFn = (element, elementType, id, path) => {
|
||||
if (elementType === 'asset') {
|
||||
onEditAsset(element);
|
||||
} else {
|
||||
onChangeFolder(id);
|
||||
onChangeFolder(id, path);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Tbody>
|
||||
{rows.map((element) => {
|
||||
const { id, isSelectable, name, folderURL, type: contentType } = element;
|
||||
const { path, id, isSelectable, name, folderURL, type: contentType } = element;
|
||||
|
||||
const isSelected = !!selected.find(
|
||||
(currentRow) => currentRow.id === id && currentRow.type === contentType
|
||||
@ -43,7 +43,7 @@ export const TableRows = ({
|
||||
<Tr
|
||||
key={id}
|
||||
{...onRowClick({
|
||||
fn: () => handleRowClickFn(element, contentType, id),
|
||||
fn: () => handleRowClickFn(element, contentType, id, path),
|
||||
})}
|
||||
>
|
||||
<Td {...stopPropagation}>
|
||||
|
||||
@ -332,7 +332,9 @@ export const MediaLibrary = () => {
|
||||
folderCount={folderCount}
|
||||
indeterminate={indeterminateBulkSelect}
|
||||
onChangeSort={handleChangeSort}
|
||||
onChangeFolder={(folderID) => push(getFolderURL(pathname, query, folderID))}
|
||||
onChangeFolder={(folderID, folderPath) =>
|
||||
push(getFolderURL(pathname, query, { folder: folderID, folderPath }))
|
||||
}
|
||||
onEditAsset={setAssetToEdit}
|
||||
onEditFolder={handleEditFolder}
|
||||
onSelectOne={selectOne}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user