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
Branch | master | rc |
---|---|---|
Status |
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 installed the node version specified in package.json. You might want to use NVM to install the particular version.
Remove old compiled node_modules
if exists
rm -rf node_modules
To install all app and dev dependencies
npm install
To build DLLs in common-dist folder (must be done prior to start of dev server)
npm run buildDLL:dev
To start dev server with hot reload enabled
# set the environment variables you want based on what branch you're branching
# from
export BRANCH_ENV=master # or rc if branching from rc
# export any custom external API URLs by editing env/custom.sh
npm run start
Example pages:
To run unit/integration tests (need to have API URL defined in .env
)
npm run test
To run unit/integration tests in watch mode
npm 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.))
npm run test:watch -- --grep=#specName#
To run linting
npm run lint
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
git commit -n
If the version of the desired API URL is the same as the one used to generate
the typescipt client, one can change 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:
# set the environment variables you want based on what branch you're branching
# from
export BRANCH_ENV=master # or rc if branching from rc
# export any custom external API URLs by editing env/custom.sh
npm run updateAPI
npm run test
Go to http://cbioportal.org (master
branch) or http://cbioportal.org/beta/ (rc
branch)
In your browser console set:
localStorage.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:
localStorage.setItem("localdev",false)
or clear entire local storage
localStorage.clear()
You can also use a heroku deployed cbioportal-frontend pull request for serving the JS by setting localStorage to:
localStorage.setItem("heroku", "cbioportal-frontend-pr-x")
Change x
to the number of your pull request.
Install webdriver-manager, which manages standalone Selenium installation:
npm install -g webdriver-manager
Run updater to get necessary binaries
webdriver-manager update
Start the webdriver-manager
webdriver-manager start
In one terminal run frontend (this will get mounted inside whatever
CBIOPORTAL_URL
is pointing to)
# set the environment variables you want based on what branch you're branching
# from
export BRANCH_ENV=master # or rc if branching from rc
# export any custom external API URLs by editing env/custom.sh
npm run start
In another terminal run the e2e tests
# set the environment variables you want based on what branch you're branching
# from
export BRANCH_ENV=master # or rc if branching from rc
# export any custom external API URLs in env/custom.sh
cd end-to-end-tests
npm install
npm run test-webdriver-manager