From b8a31669168d85d028618087da76f40f604281cf Mon Sep 17 00:00:00 2001 From: Taylor Grafft Date: Fri, 8 Dec 2023 09:54:56 -0600 Subject: [PATCH] task/WP-367: Adding Public Data CMS Nav and fixing search bar root bug --- .../DataFilesListing/DataFilesListing.jsx | 14 ++++++++++---- client/src/components/PublicData/PublicData.jsx | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx b/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx index 2abd8e6a0..aae347870 100644 --- a/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx +++ b/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx @@ -153,12 +153,18 @@ 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) + // Adjusted check for home directory + const isAtHomeDir = + isRootDir || path.replace(/^\/+/, '') === homeDir?.replace(/^\/+/, ''); + + // Determine the sectionName with added handling for root directory const sectionName = isAtHomeDir - ? systemDisplayName + ? isRootDir + ? 'Root' + : systemDisplayName : getCurrentDirectory(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 }) => {