diff --git a/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx b/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx index 2abd8e6a0..53d2e2616 100644 --- a/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx +++ b/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx @@ -153,13 +153,32 @@ const DataFilesListing = ({ api, scheme, system, path, isPublic }) => { const systemDisplayName = useSystemDisplayName({ scheme, system, path }); const homeDir = selectedSystem?.homeDir; - // Check if the current path is the home directory itself - const isAtHomeDir = path.replace(/^\/+/, '') === homeDir?.replace(/^\/+/, ''); + // Check if the current path is the root directory + const isRootDir = path === '/' || path === ''; - // Determine the sectionName based on the path (if homeDir, use systemDisplayName--else use current dir) - const sectionName = isAtHomeDir - ? systemDisplayName - : getCurrentDirectory(path); + // Adjusted check for home directory + const isAtHomeDir = + isRootDir || path.replace(/^\/+/, '') === homeDir?.replace(/^\/+/, ''); + + // Determine the sectionName with added handling for root directory + function determineSectionName( + isAtHomeDir, + isRootDir, + systemDisplayName, + path + ) { + if (isAtHomeDir) { + return isRootDir ? 'Root' : systemDisplayName; + } + return getCurrentDirectory(path); + } + + const sectionName = determineSectionName( + isAtHomeDir, + isRootDir, + systemDisplayName, + path + ); return ( <> diff --git a/client/src/components/PublicData/PublicData.jsx b/client/src/components/PublicData/PublicData.jsx index 40724764f..fa5e76da3 100644 --- a/client/src/components/PublicData/PublicData.jsx +++ b/client/src/components/PublicData/PublicData.jsx @@ -18,6 +18,8 @@ import DataFilesShowPathModal from '../DataFiles/DataFilesModals/DataFilesShowPa import { ToolbarButton } from '../DataFiles/DataFilesToolbar/DataFilesToolbar'; import styles from './PublicData.module.css'; +import dropdownStyles from '../../styles/components/dropdown-menu.css'; +import CombinedBreadcrumbs from '../DataFiles/CombinedBreadcrumbs/CombinedBreadcrumbs'; const PublicData = () => { const history = useHistory(); @@ -98,9 +100,9 @@ const PublicDataListing = ({ canDownload, downloadCallback }) => {