Skip to content

Commit

Permalink
Merge pull request #318 from bento-platform/features/docs-ingestion
Browse files Browse the repository at this point in the history
feat(explorer): wider experiment result view modal + more download types
  • Loading branch information
noctillion authored Oct 30, 2023
2 parents 9f9f92c + ab4a822 commit 3c26902
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
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",
"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

0 comments on commit 3c26902

Please sign in to comment.