Skip to content

Commit

Permalink
Merge branch 'main' into kiahna-tucker/workflows/obscure-advanced-mat…
Browse files Browse the repository at this point in the history
…erialization-settings
  • Loading branch information
travjenkins authored Jan 21, 2025
2 parents 60b03f5 + 2715060 commit 27598ba
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
<MessageWithButton
messageId="collectionsPreview.notFound.message"
clickHandler={() => {
navigate(authenticatedRoutes.captures.fullPath);
}}
/>
);
}
12 changes: 11 additions & 1 deletion src/components/collection/DataPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand All @@ -37,6 +39,8 @@ export function DataPreview({ collectionName }: Props) {
// setPreviewMode(newValue);
// };

const isDerivation = useIsCollectionDerivation();

const { error: tenantHidesError, hide } =
useTenantHidesDataPreview(collectionName);

Expand Down Expand Up @@ -132,7 +136,13 @@ export function DataPreview({ collectionName }: Props) {
<JournalAlerts
journalData={journalData}
journalsData={journalsData}
notFoundTitleMessage="collectionsPreview.notFound.message"
notFoundTitleMessage={
isDerivation ? (
'collectionsPreview.notFound.message.derivation'
) : (
<NoCollectionJournalsAlert />
)
}
/>
) : null}

Expand Down
6 changes: 5 additions & 1 deletion src/lang/en-US/Collections.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { CommonMessages } from './CommonMessages';
import { Details } from './Details';
import { RouteTitles } from './RouteTitles';

export const Collections: Record<string, string> = {
'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.`,
};

0 comments on commit 27598ba

Please sign in to comment.