diff --git a/packages/datagateway-dataview/src/page/pageContainer.component.tsx b/packages/datagateway-dataview/src/page/pageContainer.component.tsx index d8ac2870d..3db61aee9 100644 --- a/packages/datagateway-dataview/src/page/pageContainer.component.tsx +++ b/packages/datagateway-dataview/src/page/pageContainer.component.tsx @@ -33,6 +33,7 @@ import { useHistory, useRouteMatch, matchPath, + Switch, } from 'react-router-dom'; import PageBreadcrumbs from './breadcrumbs.component'; import PageRouting from './pageRouting.component'; @@ -165,7 +166,12 @@ const isisPaths = [ ]; // DLS base paths - required for linking to correct search view -const dlsPaths = [paths.myData.dls, paths.myDOIs.dls, paths.toggle.dlsProposal]; +const dlsPaths = [ + paths.myData.dls, + paths.myDOIs.dls, + paths.toggle.dlsProposal, + paths.landing.dlsDataPublicationLanding, +]; const BlackTextTypography = styled(Typography)({ color: '#000000', @@ -206,10 +212,13 @@ const NavBar = React.memo( xs aria-label="page-breadcrumbs" > - {/* don't show breadcrumbs on /my-data - only on browse */} - - - + {/* don't show breadcrumbs on /my-data or dls landing pages - only on browse */} + + + + + + {props.loggedInAnonymously || isDataPublication ? ( diff --git a/packages/datagateway-dataview/src/views/landing/dls/dlsDataPublicationContentTable.component.tsx b/packages/datagateway-dataview/src/views/landing/dls/dlsDataPublicationContentTable.component.tsx index 6e16438ae..aeff2897d 100644 --- a/packages/datagateway-dataview/src/views/landing/dls/dlsDataPublicationContentTable.component.tsx +++ b/packages/datagateway-dataview/src/views/landing/dls/dlsDataPublicationContentTable.component.tsx @@ -22,6 +22,8 @@ import { useDataPublicationContentCount, Investigation, formatBytes, + DLSVisitDetailsPanel, + DLSDatafileDetailsPanel, } from 'datagateway-common'; import { IndexRange, TableCellProps } from 'react-virtualized'; import { useTranslation } from 'react-i18next'; @@ -196,6 +198,16 @@ const DLSDataPublicationContentTable = ( } }, [t, textFilter, dateFilter, currentTab]); + const detailsPanel = React.useMemo(() => { + if (currentTab === 'investigation') { + return DLSVisitDetailsPanel; + } else if (currentTab === 'dataset') { + return DLSDatasetDetailsPanel; + } else if (currentTab === 'datafile') { + return DLSDatafileDetailsPanel; + } + }, [currentTab]); + const selectedRows = React.useMemo( () => cartItems @@ -235,8 +247,11 @@ const DLSDataPublicationContentTable = ( onCheck={addToCart} onUncheck={removeFromCart} disableSelectAll={true} - detailsPanel={DLSDatasetDetailsPanel} + detailsPanel={detailsPanel} columns={columns} + // key prop forces the table to fully rerender on entity type change + // which means default column sizes get properly set + key={currentTab} /> );