Skip to content

Commit 236397f

Browse files
committed
Merge remote-tracking branch 'origin/main' into bug-1738
2 parents ae329dd + 6bd3ec8 commit 236397f

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

packages/libs/eda/src/lib/core/components/EDAAnalysisListContainer.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ import {
1313
import { DownloadClient } from '../api/DownloadClient';
1414
import { ComputeClient } from '../api/ComputeClient';
1515
import { useDeepValue } from '../hooks/immutability';
16+
import Banner from '@veupathdb/coreui/lib/components/banners/Banner';
1617

1718
interface Props {
1819
studyId: string;
19-
children: React.ReactChild | React.ReactChild[];
20+
children: React.ReactNode;
2021
className?: string;
2122
analysisClient: AnalysisClient;
2223
subsettingClient: SubsettingClient;
@@ -48,6 +49,17 @@ export function EDAAnalysisListContainer(props: Props) {
4849
computeClient,
4950
});
5051

52+
if (studyMetadata.error)
53+
return (
54+
<Banner
55+
banner={{
56+
type: 'warning',
57+
message:
58+
'The dataset you requested could not be found. Please check the URL and try again.',
59+
}}
60+
/>
61+
);
62+
5163
if (
5264
contextValue.studyRecord == null ||
5365
contextValue.studyRecordClass == null ||

packages/libs/eda/src/lib/core/components/EDAWorkspaceContainer.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ReactNode, useMemo } from 'react';
1+
import { ReactNode, useMemo } from 'react';
22

33
import { Loading } from '@veupathdb/wdk-client/lib/Components';
44
import { TreeNode } from '@veupathdb/wdk-client/lib/Components/AttributeFilter/Types';
@@ -23,6 +23,7 @@ import { DownloadClient } from '../api/DownloadClient';
2323
import { entityTreeToArray } from '../utils/study-metadata';
2424
import { ComputeClient } from '../api/ComputeClient';
2525
import { useDeepValue } from '../hooks/immutability';
26+
import Banner from '@veupathdb/coreui/lib/components/banners/Banner';
2627

2728
export interface Props {
2829
studyId: string;
@@ -44,8 +45,21 @@ export function EDAWorkspaceContainer(props: Props) {
4445

4546
const wdkStudyRecordState = useWdkStudyRecord(studyId);
4647
const studyMetadata = useStudyMetadata(studyId, subsettingClient);
48+
49+
if (studyMetadata.error)
50+
return (
51+
<Banner
52+
banner={{
53+
type: 'warning',
54+
message:
55+
'The dataset you requested could not be found. Please check the URL and try again.',
56+
}}
57+
/>
58+
);
59+
4760
if (wdkStudyRecordState == null || studyMetadata.value == null)
4861
return <Loading />;
62+
4963
return (
5064
<EDAWorkspaceContainerWithLoadedData
5165
{...props}

0 commit comments

Comments
 (0)