Skip to content

Commit

Permalink
Austenem/CAT-913 remove file accordion (#3546)
Browse files Browse the repository at this point in the history
* remove extra files accordion

* add changelog

* add accordion prop for publications
  • Loading branch information
austenem authored Sep 23, 2024
1 parent febf1b8 commit 3efd23b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-remove-file-accordion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove extra files accordion from processed datasets summary sections.
23 changes: 15 additions & 8 deletions context/app/static/js/components/detailPage/files/Files/Files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,25 @@ import { UnprocessedFile } from '../types';

interface FilesProps {
files: UnprocessedFile[];
includeAccordion?: boolean;
}

function Files({ files }: FilesProps) {
function Files({ files, includeAccordion }: FilesProps) {
const fileContent = files.length > 0 && (
<Box mb={2}>
<FileBrowser files={files} />
</Box>
);

return (
<FilesContextProvider>
<CollapsibleDetailPageSection id="files" title="Files">
{files.length > 0 && (
<Box mb={2}>
<FileBrowser files={files} />
</Box>
)}
</CollapsibleDetailPageSection>
{includeAccordion ? (
<CollapsibleDetailPageSection id="files" title="Files">
{fileContent}
</CollapsibleDetailPageSection>
) : (
fileContent
)}
</FilesContextProvider>
);
}
Expand Down
2 changes: 1 addition & 1 deletion context/app/static/js/pages/Publication/Publication.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Publication({ publication, vignette_json }) {
{shouldDisplaySection.visualizations && (
<PublicationsVisualizationSection vignette_json={vignette_json} uuid={uuid} />
)}
{shouldDisplaySection.files && <Files files={files} uuid={uuid} hubmap_id={hubmap_id} />}
{shouldDisplaySection.files && <Files files={files} includeAccordion />}
{shouldDisplaySection['bulk-data-transfer'] && <PublicationBulkDataTransfer uuid={uuid} label={hubmap_id} />}
<ContributorsTable contributors={contributors} contacts={contacts} title="Authors" />
{shouldDisplaySection.provenance && <ProvSection uuid={uuid} assayMetadata={publication} />}
Expand Down

0 comments on commit 3efd23b

Please sign in to comment.