-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NickAkhmetov/CAT-777 Processed Data section #3495
Changes from 20 commits
5bab2ee
dea3cb2
4d88066
ee78c1e
7503f55
e0519ca
c7273ed
e9cebb6
a213e72
9dfab45
4ce7bc2
ca986f2
ea4289c
d4f9097
f706d97
96b5424
043659c
2ea5fcf
8a41ab2
1a93ad2
8cc2eca
6c1622f
0bbab47
d495020
eba2c3b
1d67892
47052f7
5af67df
1337b06
a99287e
4b6166c
d2cbbc3
21a6a59
8344df3
96c6ebb
6f8667f
4987df4
9f9c156
91e0fd7
81efb7f
fb74d02
1cbc62a
ad04b6d
c71383f
9008a74
84dc88b
180d146
3170a72
70c5c45
38f29b3
2300131
8813366
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Added processed datasets section to display all visualizations for a given raw dataset. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
|
||
import { DagProvenanceType } from 'js/components/types'; | ||
import AnalysisDetailsList from './AnalysisDetailsList'; | ||
|
||
interface AnalysisDetails { | ||
dagListData: DagProvenanceType[]; | ||
} | ||
|
||
function AnalysisDetails({ dagListData }: AnalysisDetails) { | ||
const ingestPipelines = dagListData.filter((pipeline) => !('name' in pipeline)); | ||
const cwlPipelines = dagListData.filter((pipeline) => 'name' in pipeline); | ||
|
||
return ( | ||
<div> | ||
{ingestPipelines.length > 0 && ( | ||
<AnalysisDetailsList | ||
pipelines={ingestPipelines} | ||
pipelineType="Ingest" | ||
tooltip="Supplementary links for the data ingestion pipelines for this dataset" | ||
/> | ||
)} | ||
{cwlPipelines.length > 0 && ( | ||
<AnalysisDetailsList | ||
pipelines={cwlPipelines} | ||
pipelineType="CWL" | ||
tooltip="Supplementary links for the CWL (Common Workflow Language) pipelines for this dataset" | ||
/> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default AnalysisDetails; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import List from '@mui/material/List'; | ||
import Typography from '@mui/material/Typography'; | ||
|
||
import InfoTooltipIcon from 'js/shared-styles/icons/TooltipIcon'; | ||
import ProvAnalysisDetailsLink from './AnalysisDetailsLink'; | ||
|
||
interface ProvAnalysisDetailsListProps { | ||
pipelines: { | ||
hash: string; | ||
name?: string; | ||
origin: string; | ||
}[]; | ||
pipelineType: string; | ||
tooltip?: string; | ||
} | ||
|
||
function ProvAnalysisDetailsList({ pipelines, pipelineType, tooltip }: ProvAnalysisDetailsListProps) { | ||
return ( | ||
<> | ||
<Typography variant="subtitle2"> | ||
{`${pipelineType} Pipelines`} <InfoTooltipIcon iconTooltipText={tooltip} /> | ||
</Typography> | ||
<List data-testid={pipelineType}> | ||
{pipelines.map((item) => ( | ||
<ProvAnalysisDetailsLink | ||
data={item} | ||
key={`provenance-analysis-details-${pipelineType.toLowerCase()}-pipeline-${item.hash}`} | ||
/> | ||
))} | ||
</List> | ||
</> | ||
); | ||
} | ||
|
||
export default ProvAnalysisDetailsList; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import AnalysisDetails from './AnalysisDetails'; | ||
|
||
export default AnalysisDetails; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { styled } from '@mui/material/styles'; | ||
import LaunchRoundedIcon from '@mui/icons-material/LaunchRounded'; | ||
import Divider from '@mui/material/Divider'; | ||
|
||
import OutboundLink from 'js/shared-styles/Links/OutboundLink'; | ||
|
||
const CwlIcon = styled(LaunchRoundedIcon)(({ theme }) => ({ | ||
marginLeft: theme.spacing(0.5), | ||
fontSize: '1rem', | ||
alignSelf: 'center', | ||
})); | ||
|
||
const FlexOutboundLink = styled(OutboundLink)({ | ||
display: 'flex', | ||
}); | ||
|
||
const PrimaryTextDivider = styled(Divider)(({ theme }) => ({ | ||
marginLeft: theme.spacing(0.5), | ||
marginRight: theme.spacing(0.5), | ||
height: '15px', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this height val be |
||
backgroundColor: theme.palette.text.primary, | ||
alignSelf: 'center', | ||
})); | ||
|
||
const StyledListItem = styled('li')({ | ||
display: 'flex', | ||
}); | ||
|
||
export { CwlIcon, FlexOutboundLink, PrimaryTextDivider, StyledListItem }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,20 @@ import React from 'react'; | |
|
||
import SectionHeader from 'js/shared-styles/sections/SectionHeader'; | ||
import { DetailPageSection } from 'js/components/detailPage/style'; | ||
import { useFlaskDataContext } from 'js/components/Contexts'; | ||
import { FilesContextProvider } from 'js/components/detailPage/files/FilesContext'; | ||
import BulkDataTransferPanels from './BulkDataTransferPanels'; | ||
import { StyledContainer } from './style'; | ||
import { SectionDescription } from '../ProcessedData/ProcessedDataset/SectionDescription'; | ||
|
||
function BulkDataTransfer() { | ||
const { | ||
entity: { entity_type }, | ||
} = useFlaskDataContext(); | ||
|
||
return ( | ||
<FilesContextProvider> | ||
<DetailPageSection id="bulk-data-transfer" data-testid="bulk-data-transfer"> | ||
<SectionHeader | ||
iconTooltipText={`Information about how to bulk download all files related to this ${entity_type?.toLowerCase()}.`} | ||
> | ||
Bulk Data Transfer | ||
</SectionHeader> | ||
<SectionHeader>Bulk Data Transfer</SectionHeader> | ||
<SectionDescription> | ||
This section explains how to download data in bulk from raw and processed datasets. Processed datasets have | ||
separate download directories in Globus or dbGaP, distinct from the raw dataset. | ||
</SectionDescription> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This text is longer and might be nice to have as a const. |
||
<StyledContainer> | ||
<BulkDataTransferPanels /> | ||
</StyledContainer> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ import React from 'react'; | |
|
||
import SectionHeader from 'js/shared-styles/sections/SectionHeader'; | ||
import PanelList from 'js/shared-styles/panels/PanelList'; | ||
import { useFlaskDataContext } from 'js/components/Contexts'; | ||
import { DetailPageSection } from 'js/components/detailPage/style'; | ||
import { buildCollectionsPanelsProps } from 'js/pages/Collections/utils'; | ||
import { CollectionHit } from 'js/pages/Collections/types'; | ||
import { SectionDescription } from '../ProcessedData/ProcessedDataset/SectionDescription'; | ||
|
||
interface CollectionsSectionProps { | ||
collectionsData: CollectionHit[]; | ||
|
@@ -14,15 +14,13 @@ interface CollectionsSectionProps { | |
function CollectionsSection({ collectionsData }: CollectionsSectionProps) { | ||
const panelsProps = buildCollectionsPanelsProps(collectionsData); | ||
|
||
const { | ||
entity: { entity_type }, | ||
} = useFlaskDataContext(); | ||
|
||
return ( | ||
<DetailPageSection id="collections"> | ||
<SectionHeader iconTooltipText={`List of collections that contain this ${entity_type?.toLowerCase()}.`}> | ||
Collections | ||
</SectionHeader> | ||
<SectionHeader>Collections</SectionHeader> | ||
<SectionDescription> | ||
Collections may contain references to either raw or processed datasets. If a processed dataset is not included | ||
in any collection, there will be no corresponding tabs in the table below. | ||
</SectionDescription> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here ^ |
||
<PanelList panelsProps={panelsProps} /> | ||
</DetailPageSection> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,14 @@ async function fetchPipelineInfo({ url, datasets, groupsToken }: PipelineInfoReq | |
if (datasets.length !== 1) { | ||
return Promise.resolve(''); | ||
} | ||
return (await fetchSoftAssay({ url, dataset: datasets[0], groupsToken }))['pipeline-shorthand']; | ||
const result = await fetchSoftAssay({ url, dataset: datasets[0], groupsToken }); | ||
|
||
// Handle image pyramids separately since their pipeline-shorthand is blank | ||
if (result.assaytype === 'image_pyramid') { | ||
return 'Image Pyramid Generation'; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a difference between this statement and checking for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There isn't, so I've changed this condition to match what we use in portal-visualization. |
||
|
||
return result['pipeline-shorthand']; | ||
} | ||
|
||
export function usePipelineInfo(datasets: string[]) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,10 @@ import Typography from '@mui/material/Typography'; | |
import { AccountTreeRounded, ExtensionRounded, SvgIconComponent } from '@mui/icons-material'; | ||
import Skeleton from '@mui/material/Skeleton'; | ||
import { Box } from '@mui/system'; | ||
import { datasetSectionId } from 'js/pages/Dataset/utils'; | ||
import StatusIcon from '../StatusIcon'; | ||
import { usePipelineInfo } from './hooks'; | ||
import { useProcessedDatasetDetails } from '../ProcessedData/ProcessedDataset/hooks'; | ||
|
||
interface CommonNodeInfo extends Record<string, unknown> { | ||
name: string; | ||
|
@@ -21,6 +23,7 @@ interface PipelineNodeInfo extends CommonNodeInfo { | |
|
||
interface DatasetNodeInfo extends CommonNodeInfo { | ||
datasetType?: string; | ||
uuid: string; | ||
status: string; | ||
} | ||
|
||
|
@@ -122,13 +125,15 @@ function PipelineNode({ | |
type ProcessedDatasetNodeProps = Node<DatasetNodeInfo, 'processedDataset'>; | ||
|
||
function ProcessedDatasetNode({ data }: NodeProps<ProcessedDatasetNodeProps>) { | ||
const { datasetDetails, isLoading } = useProcessedDatasetDetails(data.uuid); | ||
return ( | ||
<NodeTemplate | ||
rounded | ||
target | ||
href={`#${data.name}-section`} | ||
href={datasetDetails ? `#${datasetSectionId(datasetDetails, 'section')}` : undefined} | ||
icon={nodeIcons.processedDataset} | ||
bgColor={nodeColors.processedDataset} | ||
isLoading={isLoading} | ||
{...data} | ||
> | ||
{data.datasetType} | ||
|
@@ -139,13 +144,15 @@ function ProcessedDatasetNode({ data }: NodeProps<ProcessedDatasetNodeProps>) { | |
type ComponentDatasetNodeProps = Node<DatasetNodeInfo, 'componentDataset'>; | ||
|
||
function ComponentDatasetNode({ data }: NodeProps<ComponentDatasetNodeProps>) { | ||
const { datasetDetails, isLoading } = useProcessedDatasetDetails(data.uuid); | ||
return ( | ||
<NodeTemplate | ||
rounded | ||
target | ||
icon={nodeIcons.componentDataset} | ||
href={`#${data.name}-section`} | ||
href={datasetDetails ? `#${datasetSectionId(datasetDetails, 'section')}` : undefined} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be
? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer to explicitly pass |
||
bgColor={nodeColors.componentDataset} | ||
isLoading={isLoading} | ||
{...data} | ||
> | ||
{data.datasetType} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this into the
Dataset
type?