Skip to content

Commit

Permalink
Merge branch 'master' into mutation-pie-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
7xuanlu authored Jan 18, 2024
2 parents ba8110c + 5f850c2 commit e3690e1
Show file tree
Hide file tree
Showing 33 changed files with 562 additions and 196 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions end-to-end-test/remote/specs/core/oncoprinterColorConfig.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
var assertScreenShotMatch = require('../../../shared/lib/testUtils')
.assertScreenShotMatch;
var assert = require('assert');
var waitForOncoprint = require('../../../shared/specUtils').waitForOncoprint;
var goToUrlAndSetLocalStorage = require('../../../shared/specUtils')
.goToUrlAndSetLocalStorage;
var getNthOncoprintTrackOptionsElements = require('../../../shared/specUtils')
.getNthOncoprintTrackOptionsElements;
var {
checkOncoprintElement,
getElementByTestHandle,
} = require('../../../shared/specUtils.js');

const TIMEOUT = 6000;

const ONCOPRINT_TIMEOUT = 60000;

const CBIOPORTAL_URL = process.env.CBIOPORTAL_URL.replace(/\/$/, '');

describe('oncoprinter clinical example data, color configuration', () => {
it('oncoprinter color configuration modal reflects user selected colors', function() {
goToUrlAndSetLocalStorage(`${CBIOPORTAL_URL}/oncoprinter`);
$('.oncoprinterClinicalExampleData').waitForExist();
$('.oncoprinterClinicalExampleData').click();
$('.oncoprinterSubmit').click();
waitForOncoprint(TIMEOUT);

var trackOptionsElts = getNthOncoprintTrackOptionsElements(2);
// open menu
$(trackOptionsElts.button_selector).click();
$(trackOptionsElts.dropdown_selector).waitForDisplayed({
timeout: 1000,
});
// click "Edit Colors" to open modal
$(trackOptionsElts.dropdown_selector + ' li:nth-child(11)').click();
browser.pause(1000);

// select new colors for track values
getElementByTestHandle('color-picker-icon').click();
$('.circle-picker').waitForDisplayed({ timeout: 1000 });
$('.circle-picker [title="#990099"]').click();
waitForOncoprint(ONCOPRINT_TIMEOUT);
getElementByTestHandle('color-picker-icon').waitForDisplayed();
getElementByTestHandle('color-picker-icon').click();
$('.circle-picker').waitForDisplayed({ reverse: true });

$$('[data-test="color-picker-icon"]')[1].click();
$('.circle-picker').waitForDisplayed({ timeout: 1000 });
$('.circle-picker [title="#109618"]').click();
waitForOncoprint(ONCOPRINT_TIMEOUT);
getElementByTestHandle('color-picker-icon').waitForDisplayed();
$$('[data-test="color-picker-icon"]')[1].click();
$('.circle-picker').waitForDisplayed({ reverse: true });

$$('[data-test="color-picker-icon"]')[2].click();
$('.circle-picker').waitForDisplayed({ timeout: 1000 });
$('.circle-picker [title="#8b0707"]').click();
waitForOncoprint(ONCOPRINT_TIMEOUT);

assert.strictEqual(
$('[data-test="color-picker-icon"] rect').getAttribute('fill'),
'#990099'
);
assert.strictEqual(
$$('[data-test="color-picker-icon"] rect')[1].getAttribute('fill'),
'#109618'
);
assert.strictEqual(
$$('[data-test="color-picker-icon"] rect')[2].getAttribute('fill'),
'#8b0707'
);
});

it('oncoprinter reflects user selected colors', () => {
// close modal
$('a.tabAnchor_oncoprint').click();
var res = checkOncoprintElement();
assertScreenShotMatch(res);
});

it('oncoprinter reset colors button is visible when default colors not used', () => {
// click "Edit Colors" to open modal and check "Reset Colors" button in modal
var trackOptionsElts = getNthOncoprintTrackOptionsElements(2);
$(trackOptionsElts.button_selector).click();
$(trackOptionsElts.dropdown_selector).waitForDisplayed({
timeout: 1000,
});
$(trackOptionsElts.dropdown_selector + ' li:nth-child(11)').click();
getElementByTestHandle('resetColors').waitForDisplayed();
});

it('oncoprinter color configuration modal reflects default colors', () => {
// click "Reset Colors" track
getElementByTestHandle('resetColors').click();
waitForOncoprint(ONCOPRINT_TIMEOUT);

assert.strictEqual(
$('[data-test="color-picker-icon"] rect').getAttribute('fill'),
'#dc3912'
);
assert.strictEqual(
$$('[data-test="color-picker-icon"] rect')[1].getAttribute('fill'),
'#3366cc'
);
assert.strictEqual(
$$('[data-test="color-picker-icon"] rect')[2].getAttribute('fill'),
'#ff9900'
);
});

it('oncoprinter reflects default colors', () => {
// close modal
$('a.tabAnchor_oncoprint').click();
var res = checkOncoprintElement();
assertScreenShotMatch(res);
});

it('oncoprinter reset colors button is hidden when default colors are used', () => {
// click "Edit Colors" to open modal and check "Reset Colors" button in modal
var trackOptionsElts = getNthOncoprintTrackOptionsElements(2);
$(trackOptionsElts.button_selector).click();
$(trackOptionsElts.dropdown_selector).waitForDisplayed({
timeout: 1000,
});
$(trackOptionsElts.dropdown_selector + ' li:nth-child(11)').click();
getElementByTestHandle('resetColors').waitForDisplayed({
reverse: true,
});
});
});
2 changes: 0 additions & 2 deletions env/custom.sh
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
#export CBIOPORTAL_URL="http://localhost:8081"
#export GENOME_NEXUS_URL="https://www.genomenexus.org"
4 changes: 2 additions & 2 deletions env/master.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export CBIOPORTAL_URL="${CBIOPORTAL_URL:-https://beta.cbioportal.org}"
export GENOME_NEXUS_URL="${GENOME_NEXUS_URL:-https://www.genomenexus.org}"
export CBIOPORTAL_URL="${CBIOPORTAL_URL:-https://www.cbioportal.org}"
export GENOME_NEXUS_URL="${GENOME_NEXUS_URL:-https://www.genomenexus.org}"
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cbioportal-frontend",
"private": true,
"version": "3.3.264",
"version": "3.3.266",
"workspaces": {
"packages": [
".",
Expand Down Expand Up @@ -31,8 +31,8 @@
"heroku-postbuild": "yarn run build && yarn add pushstate-server@3.0.1 -g",
"updateAPI": "yarn run fetchAPI && yarn run buildAPI && yarn run updateOncoKbAPI && yarn run updateGenomeNexusAPI",
"convertToSwagger2": "./scripts/convert_to_swagger2.sh && yarn run extendSwagger2Converter",
"fetchAPILocal": "export CBIOPORTAL_URL=http://localhost:8090 && curl -s -L -k ${CBIOPORTAL_URL}/v3/api-docs/public | json | grep -v basePath | grep -v termsOfService | grep -v host > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPI-docs.json && curl -s -L -k ${CBIOPORTAL_URL}/v3/api-docs/internal | json | grep -v host | grep -v basePath | grep -v termsOfService > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json",
"fetchAPI": "./scripts/env_vars.sh && eval \"$(./scripts/env_vars.sh)\" && curl -s -L -k ${CBIOPORTAL_URL}/v3/api-docs/public > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPI-docs.json && curl -s -L -k ${CBIOPORTAL_URL}/v3/api-docs/internal | json > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json && yarn run convertToSwagger2",
"fetchAPILocal": "export CBIOPORTAL_URL=http://localhost:8090 && curl -s -L -k ${CBIOPORTAL_URL}/api/v3/api-docs/public | json | grep -v basePath | grep -v termsOfService | grep -v host > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPI-docs.json && curl -s -L -k ${CBIOPORTAL_URL}/api/v3/api-docs/internal | json | grep -v host | grep -v basePath | grep -v termsOfService > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json",
"fetchAPI": "./scripts/env_vars.sh && eval \"$(./scripts/env_vars.sh)\" && curl -s -L -k ${CBIOPORTAL_URL}/api/v3/api-docs/public > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPI-docs.json && curl -s -L -k ${CBIOPORTAL_URL}/api/v3/api-docs/internal | json > packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json && yarn run convertToSwagger2",
"extendSwagger2Converter": "node scripts/extend_converter.js packages/cbioportal-ts-api-client/src/generated CBioPortalAPI CBioPortalAPIInternal",
"buildAPI": "node scripts/generate-api.js packages/cbioportal-ts-api-client/src/generated CBioPortalAPI CBioPortalAPIInternal",
"updateOncoKbAPI": "yarn run fetchOncoKbAPI && yarn run buildOncoKbAPI",
Expand All @@ -42,7 +42,7 @@
"fetchG2SAPI": "curl -s -k http://g2s.genomenexus.org/v2/api-docs?group=api > packages/genome-nexus-ts-api-client/src/generated/Genome2StructureAPI-docs.json",
"buildG2SAPI": "node scripts/generate-api.js packages/genome-nexus-ts-api-client/src/generated Genome2StructureAPI",
"updateGenomeNexusAPI": "yarn run fetchGenomeNexusAPI && yarn run buildGenomeNexusAPI",
"fetchGenomeNexusAPI": "./scripts/env_vars.sh && eval \"$(./scripts/env_vars.sh)\" && curl -s -k ${GENOME_NEXUS_URL}/v2/api-docs | json | grep -v basePath | grep -v termsOfService | grep -v host > packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI-docs.json && curl -s -k ${GENOME_NEXUS_URL}/v2/api-docs?group=internal | json | grep -v basePath | grep -v termsOfService | grep -v host > packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPIInternal-docs.json",
"fetchGenomeNexusAPI": "./scripts/env_vars.sh && eval \"$(./scripts/env_vars.sh)\" && curl -s -L -k ${GENOME_NEXUS_URL}/v2/api-docs | json | grep -v basePath | grep -v termsOfService | grep -v host > packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI-docs.json && curl -s -L -k ${GENOME_NEXUS_URL}/v2/api-docs?group=internal | json | grep -v basePath | grep -v termsOfService | grep -v host > packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPIInternal-docs.json",
"buildGenomeNexusAPI": "node scripts/generate-api.js packages/genome-nexus-ts-api-client/src/generated GenomeNexusAPI GenomeNexusAPIInternal",
"updateHotspotGenes": "./scripts/get_hotspot_genes.sh > src/shared/static-data/hotspotGenes.json",
"compileOqlParser": "cd src/shared/lib/oql && pegjs oql-parser.pegjs",
Expand Down Expand Up @@ -158,10 +158,10 @@
"bootstrap-sass": "3.4.1",
"bowser": "^1.7.1",
"bundle-loader": "^0.5.4",
"cbioportal-clinical-timeline": "^0.3.72",
"cbioportal-frontend-commons": "^0.5.57",
"cbioportal-ts-api-client": "^0.9.64",
"cbioportal-utils": "^0.3.36",
"cbioportal-clinical-timeline": "^0.3.74",
"cbioportal-frontend-commons": "^0.5.58",
"cbioportal-ts-api-client": "^0.9.65",
"cbioportal-utils": "^0.3.37",
"chart.js": "^2.6.0",
"classnames": "^2.2.5",
"clinical-timeline": "0.0.30",
Expand All @@ -188,7 +188,7 @@
"fmin": "^0.0.2",
"font-awesome": "^4.7.0",
"fork-ts-checker-webpack-plugin": "^6.3.3",
"genome-nexus-ts-api-client": "^1.1.30",
"genome-nexus-ts-api-client": "^1.1.31",
"git-revision-webpack-plugin": "^5.0.0",
"history": "4.10.1",
"html-webpack-plugin": "^5.3.2",
Expand Down Expand Up @@ -227,7 +227,7 @@
"mobxpromise": "github:cbioportal/mobxpromise#c3429672eb39be54e54ce14a8636e8d843729db3",
"numeral": "^2.0.6",
"object-sizeof": "^1.2.0",
"oncokb-frontend-commons": "^0.0.20",
"oncokb-frontend-commons": "^0.0.21",
"oncokb-styles": "~1.4.2",
"oncokb-ts-api-client": "^1.3.3",
"oncoprintjs": "^6.0.5",
Expand Down Expand Up @@ -272,7 +272,7 @@
"react-markdown": "^7.0.1",
"react-mfb": "^0.6.0",
"react-motion": "^0.4.7",
"react-mutation-mapper": "^0.8.100",
"react-mutation-mapper": "^0.8.101",
"react-overlays": "0.7.4",
"react-portal": "^4.2.0",
"react-rangeslider": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cbioportal-clinical-timeline/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cbioportal-clinical-timeline",
"description": "cBioPortal Clinical Timeline",
"version": "0.3.72",
"version": "0.3.74",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
Expand Down Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"autobind-decorator": "^2.1.0",
"cbioportal-frontend-commons": "^0.5.57",
"cbioportal-frontend-commons": "^0.5.58",
"lodash": "^4.17.11",
"react-bootstrap": "^0.31.5",
"react-overlays": "0.7.4",
Expand Down
21 changes: 17 additions & 4 deletions packages/cbioportal-clinical-timeline/src/TimelineStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,23 @@ export class TimelineStore {
>
{point}
{uid === this.hoveredTooltipUid && (
<span>
{tooltipIndex + 1} of{' '}
{tooltipModel.events.length}. Use spacebar or
arrow keys to see others.
<span className="btn-group">
<button
className="btn btn-default btn-xs"
onClick={() => this.prevTooltipEvent()}
>
&lt;
</button>
<span className="btn btn-default btn-xs">
{tooltipIndex + 1} of{' '}
{tooltipModel.events.length} events
</span>
<button
className="btn btn-default btn-xs"
onClick={() => this.nextTooltipEvent()}
>
&gt;
</button>
</span>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/cbioportal-frontend-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cbioportal-frontend-commons",
"description": "cBioPortal Frontend Modules",
"version": "0.5.57",
"version": "0.5.58",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
Expand Down Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"autobind-decorator": "^2.1.0",
"cbioportal-utils": "^0.3.36",
"cbioportal-utils": "^0.3.37",
"classnames": "^2.2.5",
"jquery": "^3.2.1",
"lodash": "^4.17.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/cbioportal-ts-api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cbioportal-ts-api-client",
"description": "cBioPortal API Client for TypeScript",
"version": "0.9.64",
"version": "0.9.65",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
],
"parameters": [
{
"description": "Secret API key passed in HTTP header. The key is configured in portal.properties of the portal instance.",
"description": "Secret API key passed in HTTP header. The key is configured in application.properties of the portal instance.",
"in": "header",
"name": "X-API-KEY",
"required": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ export default class CBioPortalAPIInternal {
* Clear and reinitialize caches
* @method
* @name CBioPortalAPIInternal#clearAllCachesUsingDELETE
* @param {string} xApiKey - Secret API key passed in HTTP header. The key is configured in portal.properties of the portal instance.
* @param {string} xApiKey - Secret API key passed in HTTP header. The key is configured in application.properties of the portal instance.
* @param {boolean} springManagedCache - Clear Spring-managed caches
*/
clearAllCachesUsingDELETEWithHttpInfo(parameters: {
Expand Down Expand Up @@ -1411,7 +1411,7 @@ export default class CBioPortalAPIInternal {
* Clear and reinitialize caches
* @method
* @name CBioPortalAPIInternal#clearAllCachesUsingDELETE
* @param {string} xApiKey - Secret API key passed in HTTP header. The key is configured in portal.properties of the portal instance.
* @param {string} xApiKey - Secret API key passed in HTTP header. The key is configured in application.properties of the portal instance.
* @param {boolean} springManagedCache - Clear Spring-managed caches
*/
clearAllCachesUsingDELETE(parameters: {
Expand Down
4 changes: 2 additions & 2 deletions packages/cbioportal-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cbioportal-utils",
"description": "cBioPortal Utilities",
"version": "0.3.36",
"version": "0.3.37",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"buffer": "^6.0.3",
"genome-nexus-ts-api-client": "^1.1.30",
"genome-nexus-ts-api-client": "^1.1.31",
"lodash": "^4.17.15",
"oncokb-ts-api-client": "^1.3.3",
"superagent": "^3.8.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/genome-nexus-ts-api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "genome-nexus-ts-api-client",
"description": "Genome Nexus API Client for TypeScript",
"version": "1.1.30",
"version": "1.1.31",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1594,15 +1594,6 @@
},
"ncitCode": {
"type": "string"
},
"synonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"uuid": {
"type": "string"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ export type Drug = {

'ncitCode': string

'synonyms': Array < string >

'uuid': string

};
export type EnsemblFilter = {
'geneIds': Array < string >
Expand Down
4 changes: 2 additions & 2 deletions packages/oncokb-frontend-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oncokb-frontend-commons",
"version": "0.0.20",
"version": "0.0.21",
"description": "OncoKB Frontend Modules",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down Expand Up @@ -35,7 +35,7 @@
"react-dom": "^15.0.0 || ^16.0.0"
},
"dependencies": {
"cbioportal-utils": "^0.3.36",
"cbioportal-utils": "^0.3.37",
"classnames": "^2.2.5",
"lodash": "^4.17.15",
"oncokb-styles": "~1.4.2",
Expand Down
Loading

0 comments on commit e3690e1

Please sign in to comment.