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

feat(explorer): wider experiment result view modal + more download types #318

Merged
merged 14 commits into from
Oct 30, 2023
Merged
18 changes: 11 additions & 7 deletions src/components/explorer/IndividualExperiments.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ const ExperimentResultActions = ({ result }) => {

return <>
{resultViewable ? <>
<Modal title={<span>View: {result.filename}</span>} visible={viewModalVisible} onCancel={onViewCancel}>
<Modal
title={<span>View: {result.filename}</span>}
visible={viewModalVisible}
onCancel={onViewCancel}
width={1080}
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
marginTop: "-50px"}}>
{hasTriggeredViewModal && (
<FileDisplay uri={url} fileName={result.filename} />
)}
Expand Down Expand Up @@ -266,8 +275,7 @@ const Experiments = ({ individual, handleExperimentClick }) => {
.map((r) => ({ // enforce file_format property
...r,
file_format: r.file_format ?? guessFileType(r.filename),
}))
.filter(isDownloadable);
}));

dispatch(getFileDownloadUrlsFromDrs(downloadableFiles));
}, [experimentsData]);
Expand Down Expand Up @@ -351,10 +359,6 @@ const IndividualExperiments = ({ individual }) => {
);
};

// expand here accordingly
const isDownloadable = (result) =>
["vcf", "cram", "bw", "bigwig"].includes(result.file_format?.toLowerCase());

IndividualExperiments.propTypes = {
individual: individualPropTypesShape,
};
Expand Down
23 changes: 3 additions & 20 deletions src/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,26 +312,9 @@ export const experimentResultPropTypesShape = PropTypes.shape({
description: PropTypes.string,
filename: PropTypes.string,
file_format: PropTypes.oneOf([
"SAM",
noctillion marked this conversation as resolved.
Show resolved Hide resolved
"BAM",
"CRAM",
"BAI",
"CRAI",
"VCF",
"BCF",
"GVCF",
"BigWig",
"BigBed",
"FASTA",
"FASTQ",
"TAB",
"SRA",
"SRF",
"SFF",
"GFF",
"TABIX",
"UNKNOWN",
"OTHER",
"SAM", "BAM", "CRAM", "BAI", "CRAI", "VCF", "BCF", "MAF", "GVCF", "BigWig", "BigBed", "FASTA",
"FASTQ", "TAB", "SRA", "SRF", "SFF", "GFF", "TABIX", "PDF", "CSV", "TSV", "JPEG", "PNG", "GIF",
"MARKDOWN", "MP3", "M4A", "MP4", "DOCX", "XLS", "XLSX", "UNKNOWN", "OTHER",
]),
data_output_type: PropTypes.oneOf(["Raw data", "Derived data"]),
usage: PropTypes.string,
Expand Down