Giter VIP home page Giter VIP logo

socibp-cbioportal-frontend's Introduction

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 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

yarn install --frozen-lockfile

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

yarn 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
yarn run start

Example pages:

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

yarn run test

To run unit/integration tests in watch mode

yarn 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.))

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

To run linting

yarn 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

git 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 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
yarn run updateAPI
yarn run test

Check in cBioPortal context

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.

Run e2e tests

Install webdriver-manager, which manages standalone Selenium installation:

yarn 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
yarn 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
yarn install
yarn run test-webdriver-manager

Components

cbioportal-frontend-commons

cbioportal-frontend-commons is a separate npm library which is internally hosted under the src/public-lib directory. This library contains basic utility functions and components, and it is designed as a dependency for external react libraries and applications.

Components/utils added under src/public-lib should only depend on either external node modules or components/utils under src/public-lib. Please make sure to not introduce any internal dependencies (from directories under src other than public-lib) when updating or adding new files under src/public-lib.

react-mutation-mapper

Mutation Mapper component has been moved to a separate GitHub repository: cBioPortal/react-mutation-mapper. For more information about react-mutation-mapper development please see react-mutation-mapper.md.

socibp-cbioportal-frontend's People

Contributors

alisman avatar inodb avatar adamabeshouse avatar onursumer avatar zhx828 avatar kalletlak avatar dippindots avatar ersinciftci avatar adufilie avatar oplantalech avatar fedde-s avatar tamaccount avatar leexgh avatar yichaos avatar pvannierop avatar jjgao avatar pieterlukasse avatar lemccarthy avatar coderrsid avatar jxu8 avatar agarwalrounak avatar ayushns9 avatar chriswakefield avatar sheridancbio avatar brettvanderwerff avatar ao508 avatar meow1729 avatar averyniceday avatar jiaojiao123 avatar rnugraha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.