Skip to content
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

Austenem/Minor group updates (CAT-795, CAT-972, & CAT-982) #3585

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG-minor-group-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Label centrally processed dataset groups as HIVE in the helper panel.
- Fix typo in publication collections summary.
- Add group name to raw dataset summary section.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { LineClampWithTooltip } from 'js/shared-styles/text';
import { SecondaryBackgroundTooltip } from 'js/shared-styles/tooltips';

import { formatDate } from 'date-fns/format';
import ProcessedDataGroup from 'js/components/detailPage/ProcessedData/ProcessedDatasetGroup';
import { HelperPanelPortal } from '../../DetailLayout/DetailLayout';
import StatusIcon from '../../StatusIcon';
import { getDateLabelAndValue, useCurrentDataset } from '../../utils';
Expand Down Expand Up @@ -68,22 +69,24 @@ function HelperPanelBody() {
return null;
}
const [dateLabel, date] = getDateLabelAndValue(currentDataset);

const { title, description, pipeline, assay_display_name, creation_action, group_name } = currentDataset;
return (
<>
{currentDataset.title && (
{title && (
<HelperPanelBodyItem label="Title" noWrap>
{currentDataset.title}
{title}
</HelperPanelBodyItem>
)}
{currentDataset.description && (
{description && (
<HelperPanelBodyItem label="Description" noWrap>
{currentDataset.description}
{description}
</HelperPanelBodyItem>
)}
<HelperPanelBodyItem label="Analysis Type">
{currentDataset.pipeline ?? currentDataset.assay_display_name[0]}
<HelperPanelBodyItem label="Analysis Type">{pipeline ?? assay_display_name[0]}</HelperPanelBodyItem>
<HelperPanelBodyItem label="Group">
<ProcessedDataGroup creation_action={creation_action} group_name={group_name} />
</HelperPanelBodyItem>
<HelperPanelBodyItem label="Group">{currentDataset.group_name}</HelperPanelBodyItem>
<HelperPanelBodyItem label={dateLabel}>{date && formatDate(date, 'yyyy-MM-dd')}</HelperPanelBodyItem>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { getDateLabelAndValue } from 'js/components/detailPage/utils';
import { useSelectedVersionStore } from 'js/components/detailPage/VersionSelect/SelectedVersionStore';
import { useVersions } from 'js/components/detailPage/VersionSelect/hooks';
import { useTrackEntityPageEvent } from 'js/components/detailPage/useTrackEntityPageEvent';
import InfoTextTooltip from 'js/shared-styles/tooltips/InfoTextTooltip';
import ProcessedDataGroup from 'js/components/detailPage/ProcessedData/ProcessedDatasetGroup';

import { DatasetTitle } from './DatasetTitle';
import { ProcessedDatasetAccordion } from './ProcessedDatasetAccordion';
Expand Down Expand Up @@ -74,18 +74,12 @@ function SummaryAccordion() {
const { group_name, mapped_consortium, creation_action } = dataset;
const [dateLabel, dateValue] = getDateLabelAndValue(dataset);

const isHiveProcessed = creation_action === 'Central Process';

return (
<Subsection title="Summary" icon={<SummarizeRounded />}>
<Stack spacing={1}>
<ProcessedDatasetDescription />
<LabelledSectionText label="Group">
{isHiveProcessed ? (
<InfoTextTooltip tooltipTitle="HuBMAP Integration, Visualization & Engagement.">HIVE</InfoTextTooltip>
) : (
group_name
)}
<ProcessedDataGroup creation_action={creation_action} group_name={group_name} />
</LabelledSectionText>
<LabelledSectionText label="Consortium">{mapped_consortium}</LabelledSectionText>
<Contact />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import InfoTextTooltip from 'js/shared-styles/tooltips/InfoTextTooltip';
import { ProcessedDatasetDetails } from 'js/components/detailPage/ProcessedData/ProcessedDataset/hooks';

function ProcessedDataGroup({
creation_action,
group_name,
}: Pick<ProcessedDatasetDetails, 'creation_action' | 'group_name'>) {
const isHiveProcessed = creation_action === 'Central Process';

return isHiveProcessed ? (
<InfoTextTooltip tooltipTitle="HuBMAP Integration, Visualization & Engagement.">HIVE</InfoTextTooltip>
) : (
group_name
);
}

export default ProcessedDataGroup;
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ function DatasetConsortium() {
return <LabelledSectionText label="Consortium">{mapped_consortium}</LabelledSectionText>;
}

function DatasetGroup() {
const { entity } = useFlaskDataContext();

if (!isDataset(entity)) {
return null;
}

const { group_name } = entity;

if (!group_name) {
return null;
}

return <LabelledSectionText label="Group">{group_name}</LabelledSectionText>;
}

function CollectionCitation() {
const { entity } = useFlaskDataContext();

Expand Down Expand Up @@ -122,6 +138,7 @@ function SummaryBodyContent({
<Stack component={SummaryPaper} direction={direction} spacing={1} {...stackProps}>
<CollectionName />
<SummaryDescription description={description} clamp={isEntityHeader} />
<DatasetGroup />
<DatasetConsortium />
<DatasetCitation />
<CollectionCitation />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function PublicationCollections({ collectionsData = [], isCollectionPublication
<CollapsibleDetailPageSection id="data" title="Data">
<StyledSectionPaper $isCollectionPublication={isCollectionPublication}>
<LabelledSectionText label="Collections">
Datasets associated with this publication are included in the Collections listed below.
Datasets associated with this publication are included in the collections listed below.
</LabelledSectionText>
</StyledSectionPaper>
<PanelList panelsProps={panelsProps} />
Expand Down
Loading