Skip to content

Commit

Permalink
Do not retrieve tags for virtual studies
Browse files Browse the repository at this point in the history
  • Loading branch information
oplantalech committed Jul 19, 2019
1 parent 4dbd095 commit eda0ed0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/shared/components/query/studyList/StudyList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ export default class StudyList extends QueryStoreComponent<IStudyListProps, {}>
key={i}
studyDescription={this.store.isVirtualStudy(study.studyId) ? study.description.replace(/\r?\n/g, '<br />') : study.description}
studyId={study.studyId}
isVirtualStudy={this.store.isVirtualStudy(study.studyId)}
mouseEnterDelay={0}
placement="top"
>
Expand Down
6 changes: 6 additions & 0 deletions src/shared/components/studyTagsTooltip/StudyTagsTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Loader from '../loadingIndicator/LoadingIndicator';
export type StudyTagsTooltipProps = {
studyDescription: string;
studyId: string;
isVirtualStudy: boolean;
key: number;
mouseEnterDelay: number;
placement: string;
Expand All @@ -43,12 +44,16 @@ export type StudyTagsTooltipProps = {
export type BuildOverlayTooltipProps = {
studyDescription: string;
studyId: string;
isVirtualStudy: boolean;
};

@observer
default class BuildOverlay extends React.Component<BuildOverlayTooltipProps, {}> {
@observable readonly studyMetadata = remoteData({
invoke: async () => {
if (this.props.isVirtualStudy) {
return '';
}
return client.getTagsUsingGET({studyId: this.props.studyId});
},
onError: (error) => {
Expand Down Expand Up @@ -88,6 +93,7 @@ export default class StudyTagsTooltip extends React.Component<StudyTagsTooltipPr
overlay={<BuildOverlay
studyDescription={this.props.studyDescription}
studyId={this.props.studyId}
isVirtualStudy={this.props.isVirtualStudy}
/>}
children={this.props.children}
/>);
Expand Down

0 comments on commit eda0ed0

Please sign in to comment.