Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions static-site/app/pathogens/files/page.tsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a separate change, but I think we still want to add the language for acknowledging data contributors and to avoid scooping

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to this PR as ad87c1f.

This block of intro text is getting quite lengthy. After merging this we should explore ways to condense it while keeping all the important points.

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ export default function PathogenWorkflowFiles(): React.ReactElement {
<br/>
<br/>
{`The 'show full history' link details the temporal history of files for a given pathogen.`}
<br/>
<br/>
{`Some of these files contain Restricted Data from Pathoplexus.`}
<br/>
{`To use these in your own analysis, please read `}
<a href="https://pathoplexus.org/about/terms-of-use/restricted-data" target="_blank" rel="noreferrer">
Pathoplexus Restricted Data Terms of Use
</a>
{`.`}
</FocusParagraphCentered>
</FlexCenter>

Expand Down
4 changes: 4 additions & 0 deletions static-site/components/list-resources/icon-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useState } from "react";

import { IconType } from "react-icons";
import { MdFormatListBulleted, MdHistory, MdOutlineWarningAmber } from "react-icons/md";
import { RiErrorWarningLine } from "react-icons/ri";

import { InternalError } from "../error-boundary";

Expand Down Expand Up @@ -57,6 +58,9 @@ export default function IconContainer({
case "bullet-list":
Icon = MdFormatListBulleted;
break;
case "restricted":
Icon = RiErrorWarningLine;
break;
case "out-of-date":
Icon = MdOutlineWarningAmber;
break;
Expand Down
7 changes: 7 additions & 0 deletions static-site/components/list-resources/individual-resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ export function IndividualResource({
return null;
}

const restricted = resource.restrictedDataWarning ? (
<TooltipWrapper description={resource.restrictedDataWarning}>
<IconContainer iconName="restricted" text={''}/>
</TooltipWrapper>
) : null;

// If an out of date warning exists then show it. Otherwise show cadence information if it's available
let history: React.JSX.Element | null = null;
if (resource.outOfDateWarning) {
Expand Down Expand Up @@ -115,6 +121,7 @@ export function IndividualResource({
/>
</TooltipWrapper>

{restricted}
{history}
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions static-site/components/list-resources/listResourcesApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ function groupIntermediatesByPathogen(
url,
lastUpdated,
};
if (nameParts.at(-1)?.includes("restricted")) {
// "restricted" in filename
resourceDetails.restrictedDataWarning = "Warning! This file may contain restricted data. Please refer to Restricted Data Terms of Use linked above.";
}
const nDaysOld = _timeDelta(lastUpdated);
if (nDaysOld && nDaysOld>365) {
resourceDetails.outOfDateWarning = `Warning! This file may be over a year old. Last known update on ${lastUpdated}`;
Expand Down
3 changes: 3 additions & 0 deletions static-site/components/list-resources/resource-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ function _getMaxResourceWidth(
(w: number, r: DisplayNamedResource): number => {
/* add the pixels for the display name */
let _w = r.displayName.default.length * namePxPerChar;
if (r.restrictedDataWarning) {
_w += 40; // icon + padding
}
if (r.outOfDateWarning) {
_w += 40; // icon + padding
} else if (r.nVersions && r.updateCadence) {
Expand Down
3 changes: 3 additions & 0 deletions static-site/components/list-resources/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export interface Resource {
nVersions?: number;
updateCadence?: UpdateCadence;

/** Warning is set if the resource potentially uses restricted data. */
restrictedDataWarning?: string;

/** If the resource is (potentially) out of date (according to the `lastUpdated` property)
* the `outOfDateWarning` may be set */
outOfDateWarning?: string;
Expand Down