From 337ca873bbf5b1fdf5dd99b0a1f1d18b43e67f38 Mon Sep 17 00:00:00 2001 From: Onur Sumer Date: Thu, 5 Dec 2019 14:22:45 -0500 Subject: [PATCH] added an option to enable special click behavior for the protein impact type selector (related to cBioPortal/cbioportal/issues/6883) --- package.json | 2 +- src/component/filter/BadgeSelector.tsx | 2 ++ src/component/filter/ProteinImpactTypeBadgeSelector.tsx | 1 + yarn.lock | 8 ++++---- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ba9522e..4c971b2 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "autobind-decorator": "^2.4.0", - "cbioportal-frontend-commons": "^0.0.23", + "cbioportal-frontend-commons": "^0.0.25", "classnames": "^2.2.6", "jquery": "^3.3.1", "lodash": "^4.17.11", diff --git a/src/component/filter/BadgeSelector.tsx b/src/component/filter/BadgeSelector.tsx index 8f7643f..10b97b8 100644 --- a/src/component/filter/BadgeSelector.tsx +++ b/src/component/filter/BadgeSelector.tsx @@ -21,6 +21,7 @@ export type BadgeSelectorProps = { name?: string; placeholder?: string; isDisabled?: boolean; + unselectOthersWhenAllSelected?: boolean; numberOfColumnsPerRow?: number; onSelect?: (selectedOptionIds: string[], allValuesSelected?: boolean) => void; selectedValues?: {value: string}[]; @@ -106,6 +107,7 @@ export class BadgeSelector extends React.Component value={this.selectedValues} isDisabled={this.props.isDisabled} numberOfColumnsPerRow={this.props.numberOfColumnsPerRow} + unselectOthersWhenAllSelected={this.props.unselectOthersWhenAllSelected} /> ); } diff --git a/src/component/filter/ProteinImpactTypeBadgeSelector.tsx b/src/component/filter/ProteinImpactTypeBadgeSelector.tsx index a1d9579..493f118 100644 --- a/src/component/filter/ProteinImpactTypeBadgeSelector.tsx +++ b/src/component/filter/ProteinImpactTypeBadgeSelector.tsx @@ -47,6 +47,7 @@ export class ProteinImpactTypeBadgeSelector extends React.Component = { colors: DEFAULT_PROTEIN_IMPACT_TYPE_COLORS, + unselectOthersWhenAllSelected: true, numberOfColumnsPerRow: 2 }; diff --git a/yarn.lock b/yarn.lock index 6dfb40b..41d2678 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3170,10 +3170,10 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -cbioportal-frontend-commons@^0.0.23: - version "0.0.23" - resolved "https://registry.yarnpkg.com/cbioportal-frontend-commons/-/cbioportal-frontend-commons-0.0.23.tgz#1bd3f2d2a59f5b9b718eb66e862e9ca374a22cf8" - integrity sha512-6jdSgduNDCiJuXW05Of/eC6V3JVrEUcOWtao/tex0PdG6nAV0F5H+QeVIkiQ6GVF21LSrB9Loc+vrVklXOmWXQ== +cbioportal-frontend-commons@^0.0.25: + version "0.0.25" + resolved "https://registry.yarnpkg.com/cbioportal-frontend-commons/-/cbioportal-frontend-commons-0.0.25.tgz#26c5fe878f2f8e50331c891127219649aecc313a" + integrity sha512-ec20lCKBBc6ncQyxm868/phfzSOOlOFmaXZxhLh8mmlTb5OnhvUGeEpEbIGgl03uvOvaRQtoWTYflWq0nAHLBA== dependencies: autobind-decorator "^2.1.0" babel-polyfill "^6.22.0"