Skip to content

Commit

Permalink
Merge pull request #3798 from alisman/fxSum
Browse files Browse the repository at this point in the history
Query page sample count should show sum of each study's allSampleCount property
  • Loading branch information
alisman authored Jun 14, 2021
2 parents 6ba1ace + d1ac275 commit 064cb6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/shared/components/query/QueryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ export enum Focus {
// mobx observable
export class QueryStore {
constructor(urlWithInitialParams?: string) {
getBrowserWindow().activeQueryStore = this;

makeObservable(this);

this.initialize(urlWithInitialParams);
}

Expand Down Expand Up @@ -1018,6 +1021,10 @@ export class QueryStore {
},
});

@computed get sampleCountForSelectedStudies() {
return _.sumBy(this.selectableSelectedStudies, s => s.allSampleCount);
}

readonly sampleLists = remoteData({
invoke: async () => {
if (!this.isSingleNonVirtualStudySelected) {
Expand Down
5 changes: 1 addition & 4 deletions src/shared/components/query/StudySelectorStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export const StudySelectorStats: React.FunctionComponent<{
{numSelectedStudies === 1 ? 'study' : 'studies'}{' '}
selected (
<b>
{
props.store.profiledSamplesCount.result
.all
}
{props.store.sampleCountForSelectedStudies}
</b>{' '}
samples)
</a>
Expand Down

0 comments on commit 064cb6a

Please sign in to comment.