Skip to content

Commit

Permalink
Fix sample/study counter in VS description (#5028)
Browse files Browse the repository at this point in the history
The counters were 0 on first time popup showed
  • Loading branch information
forus authored Nov 18, 2024
1 parent 17526f2 commit 69f34fb
Showing 1 changed file with 40 additions and 28 deletions.
68 changes: 40 additions & 28 deletions src/pages/studyView/virtualStudy/VirtualStudyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as React from 'react';
import VirtualStudy from 'pages/studyView/virtualStudy/VirtualStudy';
import { AppStore } from 'AppStore';
import { StudyViewPageStore } from 'pages/studyView/StudyViewPageStore';
import { JsxElement } from 'typescript';
import { observer } from 'mobx-react';
import LoadingIndicator from 'shared/components/loadingIndicator/LoadingIndicator';

export interface IVirtualStudyModalProps {
appStore: AppStore;
Expand All @@ -12,43 +13,54 @@ export interface IVirtualStudyModalProps {
onHide: () => void;
}

export const VirtualStudyModal: React.FunctionComponent<IVirtualStudyModalProps> = function({
export const VirtualStudyModal: React.FunctionComponent<IVirtualStudyModalProps> = observer(({
appStore,
pageStore,
message,
onHide,
}) {
}) => {
const isLoading = [
pageStore.filteredVirtualStudies,
pageStore.studyWithSamples,
pageStore.filteredVirtualStudies,
pageStore.molecularProfileNameSet,
pageStore.molecularProfileNameSet,
].some(result => result.isPending);
return (
<Modal onHide={onHide} show={true}>
<Modal.Header closeButton>
<Modal.Title>Create a Virtual Study</Modal.Title>
</Modal.Header>
<Modal.Body>
{message || null}
<VirtualStudy
user={appStore.userName}
name={
pageStore.isSingleVirtualStudyPageWithoutFilter
? pageStore.filteredVirtualStudies.result[0].data
.name
: undefined
}
description={
pageStore.isSingleVirtualStudyPageWithoutFilter
? pageStore.filteredVirtualStudies.result[0].data
.description
: undefined
}
studyWithSamples={pageStore.studyWithSamples.result}
selectedSamples={pageStore.selectedSamples.result}
filter={pageStore.userSelections}
attributesMetaSet={pageStore.chartMetaSet}
molecularProfileNameSet={
pageStore.molecularProfileNameSet.result || {}
}
caseListNameSet={pageStore.caseListNameSet.result || {}}
/>
{isLoading ?
<LoadingIndicator isLoading={true}/>
: <>
{message || null}
<VirtualStudy
user={appStore.userName}
name={
pageStore.isSingleVirtualStudyPageWithoutFilter
? pageStore.filteredVirtualStudies.result[0].data
.name
: undefined
}
description={
pageStore.isSingleVirtualStudyPageWithoutFilter
? pageStore.filteredVirtualStudies.result[0].data
.description
: undefined
}
studyWithSamples={pageStore.studyWithSamples.result}
selectedSamples={pageStore.selectedSamples.result}
filter={pageStore.userSelections}
attributesMetaSet={pageStore.chartMetaSet}
molecularProfileNameSet={
pageStore.molecularProfileNameSet.result || {}
}
caseListNameSet={pageStore.caseListNameSet.result || {}}
/>
</>}
</Modal.Body>
</Modal>
);
};
});

0 comments on commit 69f34fb

Please sign in to comment.