From 91540c73ae0c5dc84d4f1017857037e836631076 Mon Sep 17 00:00:00 2001 From: oplantalech Date: Fri, 19 Jul 2019 11:09:38 +0200 Subject: [PATCH] Implement changes --- .../studyTagsTooltip/StudyTagsTooltip.tsx | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/shared/components/studyTagsTooltip/StudyTagsTooltip.tsx b/src/shared/components/studyTagsTooltip/StudyTagsTooltip.tsx index ff97dd99856..0a0c2f046db 100644 --- a/src/shared/components/studyTagsTooltip/StudyTagsTooltip.tsx +++ b/src/shared/components/studyTagsTooltip/StudyTagsTooltip.tsx @@ -41,19 +41,16 @@ export type StudyTagsTooltipProps = { children: any; }; -export type BuildOverlayTooltipProps = { +export type StudyInfoOverlayTooltipProps = { studyDescription: string; studyId: string; isVirtualStudy: boolean; }; @observer -default class BuildOverlay extends React.Component { +default class StudyInfoOverlay extends React.Component { @observable readonly studyMetadata = remoteData({ invoke: async () => { - if (this.props.isVirtualStudy) { - return ''; - } return client.getTagsUsingGET({studyId: this.props.studyId}); }, onError: (error) => { @@ -67,17 +64,22 @@ default class BuildOverlay extends React.Component render() { let overlay:any = ''; - if (this.studyMetadata.isPending) { - overlay = ; - } - else if (this.studyMetadata.isComplete) { - const resultKeyLength = Object.keys(this.studyMetadata.result).length; - const description =
; - overlay = resultKeyLength > 0 ? ([description,
,
]) : description; - } - else if (this.studyMetadata.isError) { - overlay = 'error'; + if (this.props.isVirtualStudy) { + overlay =
; + } else { + if (this.studyMetadata.isPending) { + overlay = ; + } + else if (this.studyMetadata.isComplete) { + const resultKeyLength = Object.keys(this.studyMetadata.result).length; + const description =
; + overlay = resultKeyLength > 0 ? ([description,
,
]) : description; + } + else if (this.studyMetadata.isError) { + overlay = 'error'; + } } + return overlay; } } @@ -90,7 +92,7 @@ export default class StudyTagsTooltip extends React.Component