diff --git a/src/components/collection/DataPreview/NoCollectionJournalsAlert.tsx b/src/components/collection/DataPreview/NoCollectionJournalsAlert.tsx new file mode 100644 index 000000000..b6712bca2 --- /dev/null +++ b/src/components/collection/DataPreview/NoCollectionJournalsAlert.tsx @@ -0,0 +1,16 @@ +import { authenticatedRoutes } from 'app/routes'; +import MessageWithButton from 'components/content/MessageWithButton'; +import { useNavigate } from 'react-router'; + +export default function NoCollectionJournalsAlert() { + const navigate = useNavigate(); + + return ( + { + navigate(authenticatedRoutes.captures.fullPath); + }} + /> + ); +} diff --git a/src/components/collection/DataPreview/index.tsx b/src/components/collection/DataPreview/index.tsx index 7c863b0d0..8a2d3ee2a 100644 --- a/src/components/collection/DataPreview/index.tsx +++ b/src/components/collection/DataPreview/index.tsx @@ -5,6 +5,7 @@ import { useEditorStore_specs } from 'components/editor/Store/hooks'; import JournalAlerts from 'components/journals/Alerts'; import AlertBox from 'components/shared/AlertBox'; import CardWrapper from 'components/shared/CardWrapper'; +import useIsCollectionDerivation from 'components/shared/Entity/Details/useIsCollectionDerivation'; import Error from 'components/shared/Error'; import { useJournalData, @@ -18,6 +19,7 @@ import { FormattedMessage } from 'react-intl'; import { BASE_ERROR } from 'services/supabase'; import { hasLength } from 'utils/misc-utils'; import ListViewSkeleton from './ListViewSkeleton'; +import NoCollectionJournalsAlert from './NoCollectionJournalsAlert'; interface Props { collectionName: string; @@ -37,6 +39,8 @@ export function DataPreview({ collectionName }: Props) { // setPreviewMode(newValue); // }; + const isDerivation = useIsCollectionDerivation(); + const { error: tenantHidesError, hide } = useTenantHidesDataPreview(collectionName); @@ -132,7 +136,13 @@ export function DataPreview({ collectionName }: Props) { + ) + } /> ) : null} diff --git a/src/lang/en-US/Collections.ts b/src/lang/en-US/Collections.ts index 93c448659..bf406ad75 100644 --- a/src/lang/en-US/Collections.ts +++ b/src/lang/en-US/Collections.ts @@ -1,9 +1,13 @@ import { CommonMessages } from './CommonMessages'; +import { Details } from './Details'; +import { RouteTitles } from './RouteTitles'; export const Collections: Record = { 'collectionsTable.title': `Collections`, 'collectionsTable.cta.new': `New ${CommonMessages['terms.transformation']}`, 'collectionsTable.detailsCTA': `Details`, 'collectionsTable.filterLabel': `Filter collections`, - 'collectionsPreview.notFound.message': `We were unable to find any data which could mean the capture has not ingested data yet or is not running. Check the status on the Captures page to make sure it is running.`, + 'collectionsPreview.notFound.message': `We were unable to find any data which could mean the capture has not ingested data yet or is not running. Check the status on the {button} to make sure it is running.`, + 'collectionsPreview.notFound.message.button': `${RouteTitles['routeTitle.captures']} page`, + 'collectionsPreview.notFound.message.derivation': `We were unable to find any data which could mean the derivation has not ingested data yet or is not running. Check the status in the ${Details['detailsPanel.shardDetails.title']} section to make sure it is running.`, };