Skip to content

Commit

Permalink
Merge pull request #96 from alisman/styleUpdate
Browse files Browse the repository at this point in the history
get rid of tslint errors.  adjust patient table col width
  • Loading branch information
alisman authored Dec 6, 2016
2 parents d033949 + e15a7e3 commit 01e98b2
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 33 deletions.
26 changes: 14 additions & 12 deletions src/pages/datasetView/DatasetPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as React from "react";
import { connect } from 'react-redux';
import { Table, unsafe } from 'reactableMSK';
import * as _ from 'underscore';
import Connector, { DatasetDownloads } from './Connector';
import Connector from './Connector';

export interface IDatasetPageUnconnectedProps {

Expand All @@ -25,24 +23,28 @@ export default class DataSetPageUnconnected extends React.Component<IDatasetPage
const rows: Array<any> = [];
this.props.datasets.forEach((item) => {
const tempObj: any = {
"CancerStudy": unsafe(`<a href='http://www.cbioportal.org/study?id=${ item.cancer_study_identifier }#summary' target='_blank'> ${ item.name } </a> <a href='https://github.com/cBioPortal/datahub/blob/master/public/${ item.cancer_study_identifier }.tar.gz' download><i class='fa fa-download'></i></a>`),
"Reference": unsafe(`<a target='_blank' href='https://www.ncbi.nlm.nih.gov/pubmed/${ item.pmid }'>${ item.citation }</a>`),
CancerStudy: unsafe(`<a href='http://www.cbioportal.org/study?id=${ item.cancer_study_identifier }#summary' target='_blank'> ${ item.name } </a> <a href='https://github.com/cBioPortal/datahub/blob/master/public/${ item.cancer_study_identifier }.tar.gz' download><i class='fa fa-download'></i></a>`),
Reference: unsafe(`<a target='_blank' href='https://www.ncbi.nlm.nih.gov/pubmed/${ item.pmid }'>${ item.citation }</a>`),
"All": item.all,
"Sequenced": item.sequenced,
"CNA": item.cna,
Sequenced: item.sequenced,
CNA: item.cna,
"Tumor mRNA (RNA-Seq V2)": item.rna_seq_v2_mrna,
"Tumor mRNA (microarray)": item.microrna,
"Tumor miRNA": item.mrna,
"Methylation (HM27)": item.methylation_hm27,
"RPPA": item.rppa,
"Complete": item.complete
RPPA: item.rppa,
Complete: item.complete
};
rows.push(tempObj);
});
return <Table className="table" data={rows} sortable={true}
filterable={['CancerStudy','Reference','All','Sequenced','CNA','Tumor mRNA (RNA-Seq V2)','Tumor mRNA (microarray)','Tumor miRNA','Methylation (HM27)','RPPA','Complete']}/>;
return <Table
className="table"
data={rows}
sortable={true}
filterable={['CancerStudy','Reference','All','Sequenced','CNA','Tumor mRNA (RNA-Seq V2)','Tumor mRNA (microarray)','Tumor miRNA','Methylation (HM27)','RPPA','Complete']}
/>;
} else {
return <div>loading</div>
return <div>loading</div>;
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/pages/patientView/PatientViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ClinicalInformationContainer from './clinicalInformation/ClinicalInformat
import PatientHeaderUnconnected from './patientHeader/PatientHeader';
import {IPatientHeaderProps} from './patientHeader/PatientHeader';
import {RootState} from "../../redux/rootReducer";
import PageDecorator from '../../shared/components/PageDecorator/PageDecorator';

interface IPatientViewPageProps {
store?: RootState;
Expand Down Expand Up @@ -45,7 +44,7 @@ export default class PatientViewPage extends React.Component<IPatientViewPagePro

// this gives the parent (legacy) cbioportal code control to mount
// these components whenever and wherever it wants
exposeComponentRenderersToParentScript(){
exposeComponentRenderersToParentScript() {

const win: any = window;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface IClinicalInformationContainerProps {
status?: typeof _ClinicalInformationData.status;
patient?: typeof _ClinicalInformationData.patient;
samples?: typeof _ClinicalInformationData.samples;
nodes?: TODO;//PDXNode[];
nodes?: TODO;// PDXNode[];
loadClinicalInformationTableData?: () => void;
setTab?: (activeTab:number) => void;
store?: any;
Expand All @@ -26,16 +26,6 @@ export default class ClinicalInformationContainer extends React.Component<IClini
this.props.loadClinicalInformationTableData();
}

private buildTabs() {
return (
<div>
<ClinicalInformationPatientTable showTitleBar={true} data={this.props.patient && this.props.patient.clinicalData} />
<hr />
<ClinicalInformationSamples samples={this.props.samples} />
</div>
);
}

public render() {
switch (this.props.status) {
case 'fetching':
Expand All @@ -51,4 +41,16 @@ export default class ClinicalInformationContainer extends React.Component<IClini
return <div />;
}
}

private buildTabs() {
return (
<div>
<ClinicalInformationPatientTable showTitleBar={true} data={this.props.patient && this.props.patient.clinicalData} />
<hr />
<ClinicalInformationSamples samples={this.props.samples} />
</div>
);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {ClinicalData} from "../../../shared/api/CBioPortalAPI";
import {Table as DataTable} from "reactableMSK";
import TableExportButtons from "../../../shared/components/tableExportButtons/TableExportButtons";

import styles from './style/patientTable.module.scss';

export interface IClinicalInformationPatientTableProps {
data?: Array<ClinicalData>;
showTitleBar?: Boolean;
Expand All @@ -27,7 +29,7 @@ export default class ClinicalInformationPatientTable extends React.Component<ICl
</div>
: null
}
<DataTable className='table table-striped' columns={[{ key:'attribute', label:'Attribute'},{ key:'value', label:'Value'}]} data={tableData} />
<DataTable className={ `table table-striped ${styles.patientTable}` } columns={[{ key:'attribute', label:'Attribute'},{ key:'value', label:'Value'}]} data={tableData} />
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";
import {ClinicalDataBySampleId} from "./getClinicalInformationData";
import convertSamplesData, {IConvertedSamplesData} from "./lib/convertSamplesData";
import {SampleLabelHTML} from "../SampleLabel";
import {Table as DataTable, Tr, Td, Thead, Th} from "reactableMSK";
import {Table as DataTable, Thead, Th} from "reactableMSK";
import TableExportButtons from "../../../shared/components/tableExportButtons/TableExportButtons";

interface IClinicalInformationSamplesTableProps {
Expand All @@ -28,11 +28,10 @@ export default class ClinicalInformationSamplesTable extends React.Component<ICl
);
}

public buildHeaderCells(sampleInvertedData: IConvertedSamplesData){
public buildHeaderCells(sampleInvertedData: IConvertedSamplesData) {

const headerCells: Array<JSX.Element> = sampleInvertedData.columns.map((col, i) => {
return (<Th column={col.id} key={i}>
<SampleLabelHTML color={'black'} label={(i + 1).toString()} />
{' ' + col.id}
</Th>);
});
Expand All @@ -43,7 +42,7 @@ export default class ClinicalInformationSamplesTable extends React.Component<ICl
return headerCells;
}

public prepareData(sampleInvertedData: IConvertedSamplesData){
public prepareData(sampleInvertedData: IConvertedSamplesData) {

const tableData: Array<any> = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ h4 {
margin-top:20px;
}


}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.patientTable {

td:first-child {

width:300px;

}

}
2 changes: 1 addition & 1 deletion src/shared/components/PageDecorator/PageDecorator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default function (component: typeof React.Component): any {
}
}
};
};
};
4 changes: 3 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@
"no-unsafe-finally": true,
"no-var-keyword": true,
"only-arrow-functions": false,
"ordered-imports": false,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"quotemark": [
false,
"single"
],
"object-literal-sort-keys": false,
"semicolon": [
true,
"always"
],
"trailing-comma": [false],
"triple-equals": [
true,
"allow-null-check"
Expand Down

0 comments on commit 01e98b2

Please sign in to comment.