[this.props.store.resourceIdToResourceData],
+ render: () => {
+ const shouldShowNoResource = () => {
+ if (this.props.store.resourceIdToResourceData.isComplete) {
+ return !_.some(
+ this.props.store.resourceIdToResourceData.result,
+ data => data.length > 0
+ );
+ }
+ return true;
+ };
+
+ if (shouldShowNoResource()) {
+ return (
+
+
+ Resources for {this.props.store.patientId}
+
+
+
+ );
+ } else {
+ return null;
+ }
+ },
+ });
+
render() {
return (
@@ -136,6 +170,7 @@ export default class ResourcesTab extends React.Component<
{this.patientResources.component}
{this.sampleResources.component}
{this.studyResources.component}
+ {this.showNoResource.component}
);
diff --git a/src/shared/components/resources/ResourceTable.tsx b/src/shared/components/resources/ResourceTable.tsx
index 2939bb7c33d..53e20061e9a 100644
--- a/src/shared/components/resources/ResourceTable.tsx
+++ b/src/shared/components/resources/ResourceTable.tsx
@@ -58,38 +58,48 @@ const ResourceTable = observer(
Resource |
|
- Description |
+ {resourceTable.data.length > 0 && Description | }
- {resourceTable.data.map(resource => (
+ {resourceTable.data.length === 0 ? (
-
- openResource(resource)}>
- {icon(resource)}
- {resource.resourceDefinition.displayName ||
- resource.url}
-
+ |
+ There are no results
|
-
-
-
- Open in new window
-
- |
- {resource.resourceDefinition.description} |
- ))}
+ ) : (
+ resourceTable.data.map(resource => (
+
+
+ openResource(resource)}>
+ {icon(resource)}
+ {resource.resourceDefinition
+ .displayName || resource.url}
+
+ |
+
+
+
+ Open in new window
+
+ |
+
+ {resource.resourceDefinition.description}
+ |
+
+ ))
+ )}
);