Skip to content

Commit

Permalink
task/WP-367: Adding Public Data CMS Nav and fixing search bar root bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor Grafft authored and Taylor Grafft committed Dec 8, 2023
1 parent afed181 commit b8a3166
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/PublicData/PublicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -98,9 +100,9 @@ const PublicDataListing = ({ canDownload, downloadCallback }) => {
<Section
// HACK: Replicate wrapper class gives button correct global style
// WARNING: Applies unused and redundant `.workbench-content` styles
className="workbench-content"
className="workbench-content workbench-wrapper"
header={
<DataFilesBreadcrumbs
<CombinedBreadcrumbs
api={api}
scheme={scheme}
system={system}
Expand Down

0 comments on commit b8a3166

Please sign in to comment.