Skip to content

Commit

Permalink
Merge pull request #2878 from kalletlak/fix-6793
Browse files Browse the repository at this point in the history
SV: select more than one category on custom charts
Former-commit-id: 75cb3f7b6b3b76f6403197df5c99c28676ee6dfa
  • Loading branch information
zhx828 authored Nov 15, 2019
2 parents 7f68f06 + fcf71bb commit c7aea9f
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/pages/studyView/StudyViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4056,10 +4056,24 @@ export class StudyViewPageStore {
await: () => {
return _.includes([UniqueKey.WITH_MUTATION_DATA, UniqueKey.WITH_CNA_DATA], uniqueKey) ? [this.molecularProfileSampleCounts, this.selectedSamples] : [this.selectedSamples];
},
invoke: () => {
invoke: async () => {
let dataCountSet: { [id: string]: ClinicalDataCount } = {};
dataCountSet = _.reduce(this.selectedSamples.result, (acc, sample) => {
const matchedCases = _.filter(this._customChartsSelectedCases.get(uniqueKey), (selectedCase: CustomChartIdentifierWithValue) => selectedCase.sampleId === sample.sampleId);

let selectedSamples: Sample[] = [];
if (this._chartSampleIdentifiersFilterSet.has(uniqueKey)) {
selectedSamples = await getSamplesByExcludingFiltersOnChart(
uniqueKey,
this.filters,
this._chartSampleIdentifiersFilterSet.toJS(),
this.queriedSampleIdentifiers.result,
this.queriedPhysicalStudyIds.result
);
} else {
selectedSamples = this.selectedSamples.result
}

dataCountSet = _.reduce(selectedSamples, (acc, sample) => {
const matchedCases = _.filter(this._customChartsSelectedCases.get(uniqueKey), (selectedCase: CustomChartIdentifierWithValue) => (selectedCase.studyId === sample.studyId) && (selectedCase.sampleId === sample.sampleId));
const valDefault = Datalabel.NA;
let matchedValues: string[] = [];
if (matchedCases.length >= 1) {
Expand Down

0 comments on commit c7aea9f

Please sign in to comment.