cBioPortal/cbioportal-frontend

Name: cbioportal-frontend

Owner: cBioPortal

Description: React Frontend of cBioPortal :tada:

Created: 2016-08-25 15:41:44.0

Updated: 2017-08-21 21:26:48.0

Pushed: 2018-01-15 21:46:48.0

Homepage: http://cbioportal.org

Size: 11003

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

cbioportal-frontend

Join the chat at https://gitter.im/cBioPortal/public-chat

Live demo

Master: http://cbioportal-frontend.herokuapp.com/#/patient?studyId=prad_fhcrc&caseId=00-090

Rc: http://cbioportal-frontend-rc.herokuapp.com/#/patient?studyId=prad_fhcrc&caseId=00-090

Test status & Code Quality

| Branch | master | rc | | — | — | — | | Status | CircleCI | CircleCI |

codecov

Code Climate

Deployment

Deploy

This is the frontend code for cBioPortal using React, MobX and TypeScript. The frontend for the new patient view is now completely in this repo. The results view page is currently being replaced one tab at a time by mounting certain React components to the results page (JSP) in the backend repo

Make sure you have the latest stable node version installed:

https://nodejs.org/en/

To install all app and dev dependencies

install

To build DLLs in common-dist folder (must be done prior to start of dev server)

run buildDLL:dev

To start dev server with hot reload enabled

t the environment variables you want based on what branch you're branching
om
rt BRANCH_ENV=master # or rc if branching from rc
port any custom external API URLs by editing env/custom.sh
run start

A good example page is: http://localhost:3000/?cancer_study_id=lgg_ucsf_2014&case_id=P04

To run unit/integration tests (need to have API URL defined in .env)

run test

To run unit/integration tests in watch mode

run test:watch

To run unit/integration tests in watch mode (where specName is a fragment of the name of the spec file (before .spec.))

run test:watch -- --grep=#specName#

To run linting

run lint
precommit hook

There is a precommit hook installed that lint checks the typescript in this project. The hook can be viewed in package.json. You can skip it with

commit -n
Changing the URL of API

If the version of the desired API URL is the same as the one used to generate the typescipt client, one can hange the API_ROOT variable for development in my-index.ejs. If the version is different, make sure the API endpoint works with the checked in client by changing the API URL in package.json and running:

t the environment variables you want based on what branch you're branching
om
rt BRANCH_ENV=master # or rc if branching from rc
port any custom external API URLs by editing env/custom.sh
run updateAPI
run test
Check in cBioPortal context

Go to http://cbioportal-rc.herokuapp.com/case.do?cancer_study_id=lgg_ucsf_2014&case_id=P04

In your browser console set:

lStorage.setItem("localdev",true)

This will use whatever you are running on localhost:3000 to serve the JS (i.e. you need to have the frontend repo running on port 3000). To unset do:

lStorage.setItem("localdev",false)

or clear entire local storage

lStorage.clear()

You can also use a heroku deployed cbioportal-frontend pull request for serving the JS by setting localStorage to:

lStorage.setItem("heroku", "cbioportal-frontend-pr-x")

Change x to the number of your pull request.

Run e2e tests

Install webdriver-manager, which manages standalone Selenium installation:

install -g webdriver-manager

Run updater to get necessary binaries

river-manager update

Start the webdriver-manager

river-manager start

In one terminal run frontend (this will get mounted inside whatever CBIOPORTAL_URL is pointing to)

t the environment variables you want based on what branch you're branching
om
rt BRANCH_ENV=master # or rc if branching from rc
port any custom external API URLs by editing env/custom.sh
run start

In another terminal run the e2e tests

t the environment variables you want based on what branch you're branching
om
rt BRANCH_ENV=master # or rc if branching from rc
port any custom external API URLs in env/custom.sh
nd-to-end-tests
install
run test-webdriver-manager

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.