diff --git a/packages/core/upload/admin/src/components/AssetDialog/BrowseStep/index.js b/packages/core/upload/admin/src/components/AssetDialog/BrowseStep/index.js
index 876241a35a..26beec4ecd 100644
--- a/packages/core/upload/admin/src/components/AssetDialog/BrowseStep/index.js
+++ b/packages/core/upload/admin/src/components/AssetDialog/BrowseStep/index.js
@@ -4,7 +4,6 @@ import styled from 'styled-components';
import { useIntl } from 'react-intl';
import { Button } from '@strapi/design-system/Button';
import { Flex } from '@strapi/design-system/Flex';
-import { Stack } from '@strapi/design-system/Stack';
import { Box } from '@strapi/design-system/Box';
import { Divider } from '@strapi/design-system/Divider';
import { BaseCheckbox } from '@strapi/design-system/BaseCheckbox';
@@ -17,11 +16,14 @@ import PlusIcon from '@strapi/icons/Plus';
import { FolderDefinition, AssetDefinition } from '../../../constants';
import getTrad from '../../../utils/getTrad';
+import { getBreadcrumbDataCM } from '../../../utils';
import getAllowedFiles from '../../../utils/getAllowedFiles';
import { AssetList } from '../../AssetList';
import { FolderList } from '../../FolderList';
import { EmptyAssets } from '../../EmptyAssets';
+import { Breadcrumbs } from '../../Breadcrumbs';
import SortPicker from '../../SortPicker';
+import { useFolder } from '../../../hooks/useFolder';
import { FolderCard, FolderCardBody, FolderCardBodyAction } from '../../FolderCard';
import { Filters } from './Filters';
import PaginationFooter from './PaginationFooter';
@@ -32,7 +34,6 @@ const StartBlockActions = styled(Flex)`
& > * + * {
margin-left: ${({ theme }) => theme.spaces[2]};
}
-
margin-left: ${({ pullRight }) => (pullRight ? 'auto' : undefined)};
`;
@@ -48,6 +49,7 @@ export const BrowseStep = ({
allowedTypes,
assets,
canCreate,
+ canRead,
folders,
multiple,
onAddAsset,
@@ -66,6 +68,16 @@ export const BrowseStep = ({
selectedAssets,
}) => {
const { formatMessage } = useIntl();
+
+ const { data: currentFolder, isLoading: isCurrentFolderLoading } = useFolder(
+ queryObject?.folder,
+ {
+ enabled: canRead && !!queryObject?.folder,
+ }
+ );
+
+ const breadcrumbs = !isCurrentFolderLoading && getBreadcrumbDataCM(currentFolder);
+
const allAllowedAsset = getAllowedFiles(allowedTypes, assets);
const areAllAssetSelected =
allAllowedAsset.every(
@@ -79,7 +91,6 @@ export const BrowseStep = ({
const isSearchingOrFiltering = isSearching || isFiltering;
const assetCount = assets.length;
const folderCount = folders.length;
-
const handleClickFolderCard = (...args) => {
// Search query will always fetch the same results
// we remove it here to allow navigating in a folder and see the result of this navigation
@@ -88,48 +99,58 @@ export const BrowseStep = ({
};
return (
-
{
return (
-