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

Cds velsera hotfix #202

Merged
merged 2 commits into from
Jun 11, 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
4 changes: 2 additions & 2 deletions src/bento/fileCentricCartWorkflowData.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export const myFilesPageData = {


export const manifestData = {
keysToInclude: ['file_id', 'file_name', 'subject_id', 'md5sum', 'associated_file', 'associated_drs_uri', 'associated_md5sum', 'study_acronym', 'phs_accession', 'sample_id', 'accesses', 'file_type', 'gender', 'race', 'primary_diagnosis', 'is_tumor', 'analyte_type', 'organ_or_tissue', 'study_data_type', 'library_strategy', 'image_modality', 'experimental_strategy', 'library_layouts', 'license', 'file_size'],
header: ['drs_uri', 'name', 'Participant ID', 'Md5sum', 'Associated File', 'Associated File DRS URI', 'Associated File md5sum', 'Study Name', 'Accession', 'Sample Id', 'Study Access', 'File Type', 'Gender', 'Race', 'Primary Diagnosis', 'Sample Tumor Status', 'Analyte Type', 'Organ or Tissue', 'Study Data Type', 'Library Strategy', ' Image Modality', 'Experimental Strategy', 'Library Layout', 'License', 'File Size (in bytes)', 'User Comments'],
keysToInclude: ['file_id', 'file_name', 'subject_id', 'md5sum', 'associated_file', 'associated_drs_uri', 'associated_md5sum', 'study_acronym', 'phs_accession', 'sample_id', 'accesses', 'file_type', 'gender', 'race', 'primary_diagnoses', 'is_tumor', 'analyte_type', 'organ_or_tissue', 'study_data_type', 'library_strategy', 'image_modality', 'experimental_strategy', 'library_layouts', 'license', 'file_size'],
header: ['drs_uri', 'name', 'Participant ID', 'Md5sum', 'Associated File', 'Associated File DRS URI', 'Associated File md5sum', 'Study Name', 'Accession', 'Sample Id', 'Study Access', 'File Type', 'Gender', 'Race', 'Primary Diagnoses', 'Sample Tumor Status', 'Analyte Type', 'Organ or Tissue', 'Study Data Type', 'Library Strategy', 'Image Modality', 'Experimental Strategy', 'Library Layout', 'License', 'File Size (in bytes)', 'User Comments'],
};

// --------------- GraphQL query - Retrieve selected cases info --------------
Expand Down
45 changes: 20 additions & 25 deletions src/pages/cart/customComponent/exportButton/exportButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Paper, Popper, Button, ClickAwayListener, Grow, MenuItem, MenuList, wit
import { noop } from 'lodash';
import { useQuery } from '@apollo/client';
import { MY_CART_MANIFEST_QUERY } from '../../../../bento/tableDownloadCSV'
import { manifestData } from '../../../../bento/fileCentricCartWorkflowData'
import arrowDownPng from './assets/arrowDown.png';
import cgcIcon from './assets/cgc.svg';
import { getManifestData } from './util/TableService';
Expand Down Expand Up @@ -69,31 +70,25 @@ const ExportButtonView = (props,) => {
if (!data) {
return null;
}
const processedStoreManifestPayload = data.filesInList.map((el) => ({
file_name: el ? el.file_name : undefined,
file_size: el ? el.file_size : undefined,
file_id: el ? el.file_id : undefined,
file_type: el ? el.file_type : undefined,
md5sum: el ? el.md5sum : undefined,
experimental_strategy: el ? el.experimental_strategy : undefined,
study_acronym: el ? el.study_acronym : undefined,
phs_accession: el ? el.phs_accession : undefined,
study_data_type: el ? el.study_data_type : undefined,
accesses: el ? el.accesses : undefined,
image_modality: el ? el.image_modality : undefined,
organ_or_tissue: el ? el.organ_or_tissue : undefined,
license: el ? el.license : undefined,
library_layouts: el ? el.library_layouts : undefined,
library_strategy: el ? el.library_strategy : undefined,
subject_id: el ? el.subject_id : undefined,
gender: el ? el.gender : undefined,
race: el ? el.race : undefined,
primary_diagnoses: el ? el.primary_diagnoses : undefined,
sample_id: el ? el.sample_id : undefined,
analyte_type: el ? el.analyte_type : undefined,
is_tumor: el ? el.is_tumor : undefined,
}));

const appendString = 'drs://nci-crdc.datacommons.io/'
const processedStoreManifestPayload = data.filesInList.map((el) => {
const obj = {}
for (let i = 0; i < manifestData.keysToInclude.length; i++) {
if (manifestData.keysToInclude[i] === 'file_id') {
obj[manifestData.header[i]] = el && el[manifestData.keysToInclude[i]] ?
appendString + el[manifestData.keysToInclude[i]]
:
"";
}
else {
obj[manifestData.header[i]] = el && el[manifestData.keysToInclude[i]] ?
el[manifestData.keysToInclude[i]]
:
"";
}
}
return obj;
});
return processedStoreManifestPayload;
};

Expand Down