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

Query component #107

Closed
wants to merge 133 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
6fe0f2b
squashed commits for Cancer study selector
adufilie Dec 16, 2016
edbbe01
squashed commits for styling changes
brittanydionigi Jan 13, 2017
9d62a93
fix styling errors (overflow)
adufilie Jan 26, 2017
67319dd
move computed stuff to QueryStore and add devMode components
adufilie Jan 26, 2017
791d101
Use MobxPromise
adufilie Jan 30, 2017
fc6c671
update genetic profile selector to use mobx
adufilie Jan 30, 2017
70d0637
no longer need @computed getter to use MobxPromise
adufilie Jan 31, 2017
17d7d07
Fix key warning in render
adufilie Jan 31, 2017
6a77dfa
Fix key warning in StudyList
adufilie Jan 31, 2017
fb072cf
Add "Show work in progress" checkbox
adufilie Jan 31, 2017
f0e63d8
Clean up profile selector and dev controls
adufilie Jan 31, 2017
9bbddba
overflow
adufilie Feb 1, 2017
3eb6c54
minor changes
adufilie Feb 1, 2017
f69388a
refactoring more code to use mobx
adufilie Feb 2, 2017
a7b9413
fix compile errors
adufilie Feb 2, 2017
5a151a0
Show all selected studies
brittanydionigi Feb 3, 2017
3072bc0
Add two new components and clean up code
adufilie Feb 3, 2017
48b282f
fix binding issue
adufilie Feb 3, 2017
c5b40d0
fix selected logic bug
adufilie Feb 3, 2017
bae6f27
fix logic issue
adufilie Feb 3, 2017
4f85306
fix logic bugs
adufilie Feb 3, 2017
4d106e5
fix radio button bugs
adufilie Feb 3, 2017
b11cc93
fix styling issues, add gene set selector
adufilie Feb 3, 2017
3be9c89
styling
adufilie Feb 3, 2017
14cd3e9
cancer types w/ selected studies now appear bold
adufilie Feb 3, 2017
017b047
add funcitonality to SampleListSelector and GeneSetSelector
adufilie Feb 3, 2017
fb7d35e
sorting sample lists
adufilie Feb 3, 2017
6718b8b
interface for custom case ids
adufilie Feb 3, 2017
2e29ed8
Using new SampleList.sampleCount field
adufilie Feb 3, 2017
528c271
implement priority studies
adufilie Feb 7, 2017
7193c78
Add default selection logic for genetic profiles and sample list, add…
adufilie Feb 9, 2017
7d15749
Make genetic profile selector match existing behavior
adufilie Feb 10, 2017
cb842be
preliminary work for gene validation
adufilie Feb 14, 2017
18793a4
added gene validation, sans gui
adufilie Feb 15, 2017
70aa2d0
Update selected category indicator
brittanydionigi Feb 16, 2017
d125582
use async/await
adufilie Feb 16, 2017
9237d37
added gene validation buttons
adufilie Feb 16, 2017
939198c
small changes
adufilie Feb 16, 2017
6c40ef5
fixed some styling issues
adufilie Feb 16, 2017
65be328
added empty popups for mutsig/gistic gene selection
adufilie Feb 17, 2017
e1b0e26
Improve gene validation behavior (debounced)
adufilie Feb 18, 2017
cc56828
documentation
adufilie Feb 19, 2017
a09070a
improved concurrency inside gene suggestion code
adufilie Feb 19, 2017
eec5e1d
Styling overrides
brittanydionigi Feb 21, 2017
c2f85ad
Fix input margins
brittanydionigi Feb 21, 2017
0a9e6b1
Label display override
brittanydionigi Feb 21, 2017
3f6da51
Update max tree depth to 3
brittanydionigi Feb 21, 2017
c03e057
Reduce max-width for study names
brittanydionigi Feb 21, 2017
d777cfa
MutSigGeneSelector progress
adufilie Feb 21, 2017
6165ad7
move devMode controls from QueryContainer to HomePage
adufilie Feb 22, 2017
ee668fe
Use new reactable typings
adufilie Feb 22, 2017
757c599
Gistic popup selection functionality and styling fixes
adufilie Feb 23, 2017
cf42dfe
improved feedback for pending data
adufilie Feb 24, 2017
6a2483b
showPagination: true
adufilie Feb 27, 2017
91f856d
Replace relative ../node_modules imports
adufilie Feb 27, 2017
ade2f32
Code cleanup
adufilie Feb 28, 2017
ac709b6
mutsig popup header checkbox
adufilie Feb 28, 2017
9af0051
linting
adufilie Mar 1, 2017
62eb033
Finishing touches on mutsig/gistic popups
adufilie Mar 1, 2017
99374b6
Fix react-fontawesome issue
adufilie Mar 1, 2017
852cb87
Fix initial sort in gistic popup
adufilie Mar 1, 2017
62419a5
New locations of generated API files
adufilie Mar 2, 2017
61ecc06
using mobxpromise npm module
adufilie Mar 2, 2017
91d5905
use AppConfig
adufilie Mar 2, 2017
fcafd81
Revert "using mobxpromise npm module"
adufilie Mar 2, 2017
658ceab
draggable popups
adufilie Mar 3, 2017
7fb57cd
Remove old code
adufilie Mar 3, 2017
24e72de
Revert unnecessary changes
adufilie Mar 3, 2017
980b7b8
adjust css references
adufilie Mar 3, 2017
4cefa43
Move global styles to scss module
adufilie Mar 3, 2017
0478752
typing for react-select and styling changes
adufilie Mar 3, 2017
c07c3ad
fixed gene list selection bug
adufilie Mar 3, 2017
99a2027
code cleanup
adufilie Mar 3, 2017
3d27f09
simplifying code
adufilie Mar 4, 2017
b3ea7f4
add download tab
adufilie Mar 9, 2017
687026e
update to use urls.ts
adufilie Mar 9, 2017
399a0bb
stuf
adufilie Mar 9, 2017
4c45793
Fix max-widths on labels
brittanydionigi Mar 10, 2017
4065337
Fix label alignments
brittanydionigi Mar 10, 2017
4cb3e4b
Update button styles
brittanydionigi Mar 10, 2017
00f3d0e
oql syntax error highlight works now
adufilie Mar 10, 2017
b05ad30
fix bug in oql syntax error highlighting
adufilie Mar 10, 2017
ac69328
Progress on submit button
adufilie Mar 10, 2017
184702e
fix errors in generating url
adufilie Mar 10, 2017
76a5d1f
Use React context instead of static instance of QueryStore
adufilie Mar 14, 2017
6993b94
linting
adufilie Mar 14, 2017
6204a24
slight adjustment for height of cancer study selector
adufilie Mar 14, 2017
c9cbed8
Add lint-fix npm script
adufilie Mar 14, 2017
a645d48
Minor changes. Genome Space button callback added.
adufilie Mar 15, 2017
06743ba
Hide GenomeSpace button
adufilie Mar 15, 2017
3b08623
query params loading from url and saving in history
adufilie Mar 16, 2017
9da5cd7
Various changes
adufilie Mar 16, 2017
505d037
Disable cancer type checkbox in download tab
adufilie Mar 16, 2017
4f7f7f7
Fix typescript error
adufilie Mar 17, 2017
e3ee34c
fixed bug w/ custom case set
adufilie Mar 17, 2017
20640a7
Update h2s
brittanydionigi Mar 17, 2017
c6f137d
Fix left margin on labels
brittanydionigi Mar 17, 2017
084ac74
Buttons & Popups
brittanydionigi Mar 17, 2017
d6155ff
Add red/green colors
brittanydionigi Mar 17, 2017
873b094
Select controls
brittanydionigi Mar 17, 2017
be661be
custom case set now works w/ patient ids
adufilie Mar 17, 2017
8b2f121
Re-add borders
brittanydionigi Mar 17, 2017
9fabcfc
Minor styling fixes
adufilie Mar 18, 2017
33a1338
Tooltips and "Deselect all"
adufilie Mar 20, 2017
ddbf176
Using react-bootsrap Modal instead of PopupWindow/react-draggable
adufilie Mar 20, 2017
2494348
Fix bug where "Selected Studies" overlay was affected by search text
adufilie Mar 20, 2017
4eee9f4
Improved error display
adufilie Mar 20, 2017
641237d
Custom case set validation & submit button disabling
adufilie Mar 22, 2017
8614001
Upgrade mobxpromise
adufilie Mar 22, 2017
9b27b4c
Use @types/classnames
adufilie Mar 22, 2017
35671ab
Remove unused files
adufilie Mar 22, 2017
aafb196
Add hack to contend with mobx-react-router changes
adufilie Mar 22, 2017
6bb848f
Selected Studies view no longer shows priority studies (duplicates)
adufilie Mar 23, 2017
4ad732f
Fix font sizes
brittanydionigi Mar 23, 2017
a4416e6
Fix margins paddings and height
brittanydionigi Mar 23, 2017
11f4427
Fix colors and line heights
brittanydionigi Mar 23, 2017
b5e5346
Update tabs
brittanydionigi Mar 23, 2017
33434a7
Update buttons
brittanydionigi Mar 23, 2017
e901716
SectionHeader displays busy status and errors
adufilie Mar 23, 2017
1f9adbf
Added error msg and removed duplicate styling for h2
adufilie Mar 23, 2017
bd47061
Fix case set dropdown tooltip positioning
adufilie Mar 24, 2017
7df3d9c
Refactored StudyListLogic to fix obscure filtering bugs and ported ol…
adufilie Mar 24, 2017
bb5ff96
Enable submit button when OQL error present
adufilie Apr 13, 2017
1fb1e8e
Add back enhancedReactTable
adufilie Apr 13, 2017
5e7da11
Fix gene validation upper/lower case issue
adufilie Apr 13, 2017
6d8bdb2
Fix .cta global style selector
adufilie Apr 13, 2017
382c7b3
Clean up homepage scss
adufilie Apr 13, 2017
34ec7db
Background and borders
brittanydionigi Mar 23, 2017
4c22fd9
Containers
brittanydionigi Apr 14, 2017
3a4e77a
Consistent error styling and margins
brittanydionigi Apr 14, 2017
e02c479
Remove temporary hacks
adufilie Apr 20, 2017
a171a98
Fix performance issue in cancer study selector
adufilie Apr 21, 2017
340746f
Move selected studies view to modal dialog
adufilie Apr 24, 2017
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
2 changes: 1 addition & 1 deletion my-index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title><%= htmlWebpackPlugin.options.title %></title>
<script>
window.devContext = true;
window.defaultRoute = "/patient";
window.defaultRoute = "/home";
// uncomment to enable Darwin internal MSKCC service patient view link
// uses checkDarwinAccess.do service from cbioportal/cbioportal
// window.enableDarwin = true;
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"test": "karma start karma.conf.js",
"test:watch": "npm run test -- --watch",
"lint": "tslint 'src/**/*.ts' 'src/**/*.tsx' --exclude 'src/shared/api/generated/**'",
"lint-fix": "tslint --fix 'src/**/*.ts' 'src/**/*.tsx' --exclude 'src/shared/api/generated/**'",
"eslint": "eslint src/** --ext .js --ext .jsx --cache",
"syncmock": "node src/test/fetchMockData.js --diff",
"validate": "npm ls"
Expand All @@ -43,9 +44,11 @@
"@types/react": "15.0.4",
"@types/react-bootstrap": "^0.0.43",
"@types/react-dom": "^0.14.21",
"@types/react-fontawesome": "^1.5.0",
"@types/react-redux": "^4.4.36",
"@types/react-router": "^2.0.46",
"@types/react-spinkit": "^1.1.29",
"@types/recompose": "^0.20.4",
"@types/reselect": "^2.0.27",
"@types/route-parser": "0.0.0",
"@types/seamless-immutable": "^6.1.2",
Expand Down Expand Up @@ -91,6 +94,7 @@
"less": "^2.7.2",
"lodash": "^4.17.4",
"lolex": "^1.6.0",
"memoize-weak-decorator": "^1.0.3",
"mobx": "^3.1.7",
"mobx-react": "^4.1.3",
"mobx-react-devtools": "^4.2.11",
Expand All @@ -113,19 +117,22 @@
"react-collapse": "^2.3.3",
"react-dom": "^15.4.2",
"react-file-download": "^0.3.2",
"react-fontawesome": "^1.5.0",
"react-height": "^2.2.0",
"react-if": "^2.1.0",
"react-motion": "^0.4.7",
"react-redux": "^5.0.2",
"react-renderif": "^1.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"react-select": "^1.0.0-rc.3",
"react-spinkit": "^1.1.0",
"react-tooltip": "^3.2.2",
"react-zeroclipboard": "^3.2.2",
"reactable": "^0.14.1",
"reactableMSK": "git+https://github.com/alisman/reactable.git",
"recharts": "^0.20.5",
"recompose": "^0.22.0",
"redux": "^3.6.0",
"redux-actions": "^1.2.1",
"redux-api-middleware": "^1.0.2",
Expand Down
1 change: 1 addition & 0 deletions src/config/IAppConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export interface IAppConfig {
genomespaceEnabled: boolean;
cancerStudySearchPresets: string[];
priorityStudies: PriorityStudies;
}
Expand Down
1 change: 1 addition & 0 deletions src/config/development.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {IAppConfig} from "./IAppConfig";

const config:IAppConfig = {
//host: 'cbioportal-rc.herokuapp.com',
genomespaceEnabled: false,
cancerStudySearchPresets: [
'tcga',
'tcga -provisional',
Expand Down
1 change: 1 addition & 0 deletions src/config/production.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {IAppConfig} from "./IAppConfig";

const config:IAppConfig = {
//host: 'cbioportal-rc.herokuapp.com',
genomespaceEnabled: false,
cancerStudySearchPresets: [
'tcga',
'tcga -provisional',
Expand Down
1 change: 1 addition & 0 deletions src/config/test.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {IAppConfig} from "./IAppConfig";

const config:IAppConfig = {
//host: 'cbioportal-rc.herokuapp.com',
genomespaceEnabled: false,
cancerStudySearchPresets: [
'tcga',
'tcga -provisional',
Expand Down
41 changes: 34 additions & 7 deletions src/globalStyles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,39 @@ body {

/* fix for legacy style isses. makes it bootstrap */
#content .cbioportal-frontend {
h4 {
font-size:18px;
margin-top:10px;
margin-bottom:10px;
font-weight:500;
line-height:1.1;
color:$text-color;
h4 {
color: $text-color;
font-size: 18px;
margin-top: 10px;
margin-bottom: 10px;
font-weight: 500;
line-height: 1.1;
}
}

/* Buttons */

.cta { // "Call To Action"
background: linear-gradient(to bottom, #1f8cc5 50%, #1982b8 100%);
border: 0;
border-bottom: 1px solid rgba(0,0,0,0.2);
border-radius: 2px;
color: rgba(255, 255, 255, 1);
display: block;
text-align: center;
font: normal normal 500 11px/19px 'Helvetica Neue', Helvetica, Arial, sans-serif;
padding: 5px 10px;

&:hover:not(:disabled) {
cursor: pointer;
background: linear-gradient(to bottom, #1982b8 50%, #1f8cc5 100%);
color: #fff;
}
&:disabled {
cursor: default;
background: $lightGrey;
border-bottom: 0;
color: $darkGrey;
}
}

Expand All @@ -26,6 +52,7 @@ body {
margin:0 auto;
}

/* Tables */
th.reactable-header-sortable {

&:focus {outline:0;}
Expand Down
23 changes: 20 additions & 3 deletions src/globalStyles/variables.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
//e.g. $mutationColor:#990000; will then be usable in any local scss file or css module
// e.g. $mutationColor:#990000; will then be usable in any local scss file or css module

$mutationColor:blue;
/* Colors */
$mutationColor: blue;

$cream: #F6F4EF;
$darkCream: #ECE7DB;
$darkestCream: #DAD1BC;
$darkBrown: #585755;

$lightBlue: #dee9f1;
$mediumBlue: #1982b8;


$lightGrey: #ececec;
$mediumGrey: #ddd;
$darkGrey: #999;

$redError: #a71111;
$greenSuccess: #11a747;

.portalWidth{
padding-left:20px;
padding-right:20px;
min-width:800px;
}
}
78 changes: 50 additions & 28 deletions src/pages/home/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,62 @@
import * as React from 'react';
import CBioPortalAPI from "../../shared/api/generated/CBioPortalAPI";
import {CancerStudy} from "../../shared/api/generated/CBioPortalAPI";
import AppConfig from 'appConfig';
import {getCbioPortalApiUrl} from "../../shared/api/urls";
import exposeComponentRenderer from 'shared/lib/exposeComponentRenderer';
import * as styles_any from './styles.module.scss';
import {FlexCol, FlexRow} from "../../shared/components/flexbox/FlexBox";
import {observer} from "mobx-react";
import DevTools from "mobx-react-devtools";
import {toJS, observable, action, computed, whyRun, expr} from "mobx";
import LabeledCheckbox from "../../shared/components/labeledCheckbox/LabeledCheckbox";
import ReactSelect from 'react-select';
import 'react-select/dist/react-select.css';
import QueryAndDownloadTabs from "../../shared/components/query/QueryAndDownloadTabs";
import {QueryStore} from "../../shared/components/query/QueryStore";

function getRootElement()
{
for (let node of document.childNodes)
if (node instanceof HTMLElement)
return node;
throw new Error("No HTMLElement found");
}

const styles = styles_any as {
HomePage: string,
};

interface IHomePageProps
{
}

interface IHomePageState
{
data?:CancerStudy[];
}

@observer
export default class HomePage extends React.Component<IHomePageProps, IHomePageState>
{
constructor(props:IHomePageProps)
{
super(props);
this.state = {};
}

client = new CBioPortalAPI(getCbioPortalApiUrl());

componentDidMount()
{
this.client.getAllStudiesUsingGET({
projection: "DETAILED"
}).then(data => {
this.setState({data});
});
}

public render() {
return <pre>
{ JSON.stringify(this.state.data, null, 4) }
</pre>;
}
};
constructor(props:IHomePageProps)
{
super(props);
}

store = new QueryStore(window.location.href);

public componentDidMount()
{
this.exposeComponentRenderersToParentScript();
}

exposeComponentRenderersToParentScript()
{
exposeComponentRenderer('renderQueryContainer', QueryAndDownloadTabs);
}

public render()
{
return (
<FlexRow padded flex={1} className={styles.HomePage}>
<QueryAndDownloadTabs store={this.store}/>
</FlexRow>
);
}
}
3 changes: 3 additions & 0 deletions src/pages/home/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.HomePage {
padding: 10px;
}
4 changes: 4 additions & 0 deletions src/pages/pageHeader/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
}
display:none;

label {
color: #fff;
}

}

}
91 changes: 91 additions & 0 deletions src/shared/api/gsuploadwindow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Copyright 2013 Broad Institute, Inc. All rights reserved.

import request from 'superagent';

let jsuiRoot = "https://gsui.genomespace.org/jsui/";

type Callback = (data:any) => void;

export function gsUploadByGet(config:{url:string, filename?:string, successCallback?:Callback, errorCallback?:Callback}) {
// expect an object with url, filename (optional), successCallback(optional), errorCallback (optional)

let gsUploadUrl = jsuiRoot + "/upload/loadUrlToGenomespace.html?uploadUrl=";
let dest = encodeURIComponent(config.url);
let filenameParam = "";
if (config['filename'] != null) {
filenameParam = "&fileName=" + config.filename;
}

let newWin = window.open(gsUploadUrl + dest + filenameParam, "GenomeSpace Upload", "height=340px,width=550px");
if (!newWin)
return alert('GenomeSpace popup was blocked by the browser');
newWin.focus();

if (config['successCallback'] != null) (newWin as any).setCallbackOnGSUploadComplete = config['successCallback'];

if (config['errorCallback'] != null) (newWin as any).setCallbackOnGSUploadError = config['errorCallback'];
}

export function gsLocationByGet(config:{successCallback:Callback, errorCallback?:Callback}){
// expect an object with url, filename (optional), successCallback, errorCallback (optional)

let gsUploadUrl = jsuiRoot +"/upload/loadUrlToGenomespace.html?getLocation=true";

let newWin = window.open(gsUploadUrl, "GenomeSpace Upload", "height=360px,width=600px");

let successCallback = config['successCallback'];
window.addEventListener( "message",
function (e) {
successCallback(e.data);
},
false);

newWin.focus();

if (config['errorCallback'] != null) (newWin as any).setCallbackOnGSUploadError = config['errorCallback'];
}

export function gsSelectFileByGet(config:{successCallback:Callback, errorCallback?:Callback}){
// expect an object with url, filename (optional), successCallback, errorCallback (optional)
let gsUploadUrl = jsuiRoot +"/upload/loadUrlToGenomespace.html?getFile=true";
let newWin = window.open(gsUploadUrl , "GenomeSpace Upload", "height=340px,width=550px");
newWin.focus();

(newWin as any).setCallbackOnGSLocationComplete = config['successCallback'];

if (config['errorCallback'] != null) (newWin as any).setCallbackOnGSUploadError = config['errorCallback'];
}

export async function gsUploadByPost(formData:any){
// expects an object with formData( the file(s)),

function gsUploadByPostErrorHandler(err:any){
alert('An error occurred while posting the file to GenomeSpace');
};

function gsUploadByPostCompleteHandler(responseObj:any){
if (typeof responseObj == "string"){
responseObj = JSON.parse(responseObj);
}
let newWin = window.open(responseObj.completionUrl, "GenomeSpace Upload", "height=340px,width=550px");
newWin.focus();
};
let params = {
url: jsuiRoot + '/postToGenomeSpace', //server script to process data
type: 'POST',
crossDomain: true,
success: gsUploadByPostCompleteHandler,
error: gsUploadByPostErrorHandler,
data: formData,
//Options to tell JQuery not to process data or worry about content-type
cache: false,
contentType: false,
processData: false
};

// $.ajax(params);

let req = request.agent()
.post(params.url, (err, res) => err ? params.error(err) : params.success(res))
.send(params.data);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as EnhancedReactTable from './EnhancedReactTable';
import React from 'react';
import { assert } from 'chai';
import { shallow, mount } from 'enzyme';
import sinon from 'sinon';

describe('EnhancedReactTable', () => {

before(()=>{

});

after(()=>{

});

it('what does it do?', ()=>{

});

});
Loading