diff --git a/src/pages/abs/[id]/citations.tsx b/src/pages/abs/[id]/citations.tsx
index 105c2dd42..9a1548015 100644
--- a/src/pages/abs/[id]/citations.tsx
+++ b/src/pages/abs/[id]/citations.tsx
@@ -9,6 +9,8 @@ import { ItemsSkeleton } from '@/components/ResultList';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
import { useGetAbstractParams } from '@/lib/useGetAbstractParams';
import { parseAPIError } from '@/utils/common/parseAPIError';
+import { RecordNotFound } from '@/components/RecordNotFound';
+import { feedbackItems } from '@/components/NavBar';
const CitationsPage: NextPage = () => {
const router = useRouter();
@@ -36,30 +38,42 @@ const CitationsPage: NextPage = () => {
const isEmpty = isSuccess && !isFetching && (!data?.docs || data.docs.length === 0);
const citationsParams = getCitationsParams(doc?.bibcode, 0, rows);
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isLoading || isFetching ? : null}
- {hasError && }
- {isEmpty && (
-
- )}
- {isSuccess && !isEmpty && (
-
+ {!doc ? (
+
+ ) : (
+ <>
+ {isLoading || isFetching ? : null}
+ {hasError && }
+ {isEmpty && (
+
+ )}
+ {isSuccess && !isEmpty && (
+
+ )}
+ >
)}
);
diff --git a/src/pages/abs/[id]/coreads.tsx b/src/pages/abs/[id]/coreads.tsx
index b74b54f8a..9487b0c7e 100644
--- a/src/pages/abs/[id]/coreads.tsx
+++ b/src/pages/abs/[id]/coreads.tsx
@@ -9,6 +9,8 @@ import { ItemsSkeleton } from '@/components/ResultList';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
import { useGetAbstractParams } from '@/lib/useGetAbstractParams';
import { parseAPIError } from '@/utils/common/parseAPIError';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const CoreadsPage: NextPage = () => {
const router = useRouter();
@@ -29,30 +31,42 @@ const CoreadsPage: NextPage = () => {
const isEmpty = isSuccess && !isFetching && (!data?.docs || data.docs.length === 0);
const coreadsParams = getCoreadsParams(doc?.bibcode, 0, rows);
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isLoading || isFetching ? : null}
- {isError && }
- {isEmpty && (
-
- )}
- {isSuccess && !isEmpty && (
-
+ {!doc ? (
+
+ ) : (
+ <>
+ {isLoading || isFetching ? : null}
+ {isError && }
+ {isEmpty && (
+
+ )}
+ {isSuccess && !isEmpty && (
+
+ )}
+ >
)}
);
diff --git a/src/pages/abs/[id]/credits.tsx b/src/pages/abs/[id]/credits.tsx
index b36655811..f5f99dc99 100644
--- a/src/pages/abs/[id]/credits.tsx
+++ b/src/pages/abs/[id]/credits.tsx
@@ -9,6 +9,8 @@ import { ItemsSkeleton } from '@/components/ResultList';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
import { useGetAbstractParams } from '@/lib/useGetAbstractParams';
import { parseAPIError } from '@/utils/common/parseAPIError';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const CreditsPage: NextPage = () => {
const router = useRouter();
@@ -36,30 +38,42 @@ const CreditsPage: NextPage = () => {
const isEmpty = isSuccess && !isFetching && (!data?.docs || data.docs.length === 0);
const creditsParams = getCreditsParams(doc?.bibcode, 0, rows);
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isLoading || isFetching ? : null}
- {hasError && }
- {isEmpty && (
-
- )}
- {isSuccess && !isEmpty && (
-
+ {!doc ? (
+
+ ) : (
+ <>
+ {isLoading || isFetching ? : null}
+ {hasError && }
+ {isEmpty && (
+
+ )}
+ {isSuccess && !isEmpty && (
+
+ )}
+ >
)}
);
diff --git a/src/pages/abs/[id]/exportcitation/[format].tsx b/src/pages/abs/[id]/exportcitation/[format].tsx
index 37c97c457..b84c93368 100644
--- a/src/pages/abs/[id]/exportcitation/[format].tsx
+++ b/src/pages/abs/[id]/exportcitation/[format].tsx
@@ -12,13 +12,17 @@ import { useGetAbstract } from '@/api/search/search';
import { IDocsEntity } from '@/api/search/types';
import { useExportFormats } from '@/lib/useExportFormats';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const ExportCitationPage: NextPage = () => {
const router = useRouter();
const { isValidFormat } = useExportFormats();
- const { data } = useGetAbstract({ id: router.query.id as string });
+ const id = router.query.id as string;
+
+ const { data } = useGetAbstract({ id });
const doc = path(['docs', 0], data);
@@ -47,19 +51,29 @@ const ExportCitationPage: NextPage = () => {
maxauthor: parseInt(settings.bibtexMaxAuthors, 10),
};
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
-
-
-
+ {!doc ? (
+
+ ) : (
+
+
+
+ )}
);
};
diff --git a/src/pages/abs/[id]/graphics.tsx b/src/pages/abs/[id]/graphics.tsx
index a395db7a5..1bc6a2a5c 100644
--- a/src/pages/abs/[id]/graphics.tsx
+++ b/src/pages/abs/[id]/graphics.tsx
@@ -13,10 +13,13 @@ import { useGetGraphics } from '@/api/graphics/graphics';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faImage } from '@fortawesome/free-solid-svg-icons';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const GraphicsPage: NextPage = () => {
const router = useRouter();
- const { data } = useGetAbstract({ id: router.query.id as string });
+ const id = router.query.id as string;
+ const { data } = useGetAbstract({ id });
const doc = path(['docs', 0], data);
const {
@@ -25,62 +28,75 @@ const GraphicsPage: NextPage = () => {
isError,
isSuccess,
} = useGetGraphics(doc?.bibcode, { enabled: !!doc?.bibcode, keepPreviousData: true, retry: false });
+
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isError && (
-
- Unable to fetch graphics
-
- )}
- {!isError && !isLoading && !graphics && (
-
-
-
-
-
-
- No graphics available
-
-
-
- )}
- {isLoading && }
- {isSuccess && graphics && (
+ {!doc ? (
+
+ ) : (
<>
-
-
- {graphics.figures.map((figure) => {
- return (
-
+ Unable to fetch graphics
+
+ )}
+ {!isError && !isLoading && !graphics && (
+
+
+
-
- {figure.figure_label}
-
- );
- })}
-
+
+
+
+ No graphics available
+
+
+
+ )}
+ {isLoading && }
+ {isSuccess && graphics && (
+ <>
+
+
+ {graphics.figures.map((figure) => {
+ return (
+
+
+ {figure.figure_label}
+
+ );
+ })}
+
+ >
+ )}
>
)}
diff --git a/src/pages/abs/[id]/mentions.tsx b/src/pages/abs/[id]/mentions.tsx
index d5b6b736a..7e4db3cfb 100644
--- a/src/pages/abs/[id]/mentions.tsx
+++ b/src/pages/abs/[id]/mentions.tsx
@@ -9,6 +9,8 @@ import { ItemsSkeleton } from '@/components/ResultList';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
import { useGetAbstractParams } from '@/lib/useGetAbstractParams';
import { parseAPIError } from '@/utils/common/parseAPIError';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const MentionsPage: NextPage = () => {
const router = useRouter();
@@ -36,30 +38,42 @@ const MentionsPage: NextPage = () => {
const isEmpty = isSuccess && !isFetching && (!data?.docs || data.docs.length === 0);
const mentionsParams = getMentionsParams(doc?.bibcode, 0, rows);
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isLoading || isFetching ? : null}
- {hasError && }
- {isEmpty && (
-
- )}
- {isSuccess && !isEmpty && (
-
+ {!doc ? (
+
+ ) : (
+ <>
+ {isLoading || isFetching ? : null}
+ {hasError && }
+ {isEmpty && (
+
+ )}
+ {isSuccess && !isEmpty && (
+
+ )}
+ >
)}
);
diff --git a/src/pages/abs/[id]/metrics.tsx b/src/pages/abs/[id]/metrics.tsx
index d2a1da33d..87dd0cc20 100644
--- a/src/pages/abs/[id]/metrics.tsx
+++ b/src/pages/abs/[id]/metrics.tsx
@@ -10,10 +10,13 @@ import { useGetAbstract } from '@/api/search/search';
import { IDocsEntity } from '@/api/search/types';
import { useGetMetrics } from '@/api/metrics/metrics';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const MetricsPage: NextPage = () => {
const router = useRouter();
- const { data } = useGetAbstract({ id: router.query.id as string });
+ const id = router.query.id as string;
+ const { data } = useGetAbstract({ id });
const doc = path(['docs', 0], data);
const {
@@ -26,19 +29,33 @@ const MetricsPage: NextPage = () => {
const hasCitations = isSuccess && metrics && metrics[MetricsResponseKey.CS][CitationsStatsKey.TNC] > 0;
const hasReads = isSuccess && metrics && metrics[MetricsResponseKey.BS][BasicStatsKey.TNR] > 0;
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isError && (
-
- Unable to fetch metrics
-
- )}
- {!isError && !isLoading && !hasCitations && !hasReads ? (
-
- No metrics data
-
+ {!doc ? (
+
) : (
- <>{isLoading ? : } >
+ <>
+ {isError && (
+
+ Unable to fetch metrics
+
+ )}
+ {!isError && !isLoading && !hasCitations && !hasReads ? (
+
+ No metrics data
+
+ ) : (
+ <>
+ {isLoading ? : }{' '}
+ >
+ )}
+ >
)}
);
diff --git a/src/pages/abs/[id]/references.tsx b/src/pages/abs/[id]/references.tsx
index 0ed5a036f..51a346158 100644
--- a/src/pages/abs/[id]/references.tsx
+++ b/src/pages/abs/[id]/references.tsx
@@ -9,6 +9,8 @@ import { ItemsSkeleton } from '@/components/ResultList';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
import { useGetAbstractParams } from '@/lib/useGetAbstractParams';
import { parseAPIError } from '@/utils/common/parseAPIError';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const ReferencesPage: NextPage = () => {
const router = useRouter();
@@ -36,30 +38,42 @@ const ReferencesPage: NextPage = () => {
const isEmpty = isSuccess && !isFetching && (!data?.docs || data.docs.length === 0);
const referencesParams = getReferencesParams(doc?.bibcode, 0, rows);
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isLoading || isFetching ? : null}
- {hasError && }
- {isEmpty && (
-
- )}
- {isSuccess && !isEmpty && (
-
+ {!doc ? (
+
+ ) : (
+ <>
+ {isLoading || isFetching ? : null}
+ {hasError && }
+ {isEmpty && (
+
+ )}
+ {isSuccess && !isEmpty && (
+
+ )}
+ >
)}
);
diff --git a/src/pages/abs/[id]/similar.tsx b/src/pages/abs/[id]/similar.tsx
index bc36d5629..2d5368d0b 100644
--- a/src/pages/abs/[id]/similar.tsx
+++ b/src/pages/abs/[id]/similar.tsx
@@ -9,6 +9,8 @@ import { ItemsSkeleton } from '@/components/ResultList';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
import { useGetAbstractParams } from '@/lib/useGetAbstractParams';
import { parseAPIError } from '@/utils/common/parseAPIError';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const SimilarPage: NextPage = () => {
const router = useRouter();
@@ -29,30 +31,42 @@ const SimilarPage: NextPage = () => {
const isEmpty = isSuccess && !isFetching && (!data?.docs || data.docs.length === 0);
const similarParams = getSimilarParams(doc?.bibcode, 0, rows);
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isLoading || isFetching ? : null}
- {isError && }
- {isEmpty && (
-
- )}
- {isSuccess && !isEmpty && (
-
+ {!doc ? (
+
+ ) : (
+ <>
+ {isLoading || isFetching ? : null}
+ {isError && }
+ {isEmpty && (
+
+ )}
+ {isSuccess && !isEmpty && (
+
+ )}
+ >
)}
);
diff --git a/src/pages/abs/[id]/toc.tsx b/src/pages/abs/[id]/toc.tsx
index 90ee8ddaf..fef6974e8 100644
--- a/src/pages/abs/[id]/toc.tsx
+++ b/src/pages/abs/[id]/toc.tsx
@@ -9,6 +9,8 @@ import { ItemsSkeleton } from '@/components/ResultList';
import { createAbsGetServerSideProps } from '@/lib/serverside/absCanonicalization';
import { useGetAbstractParams } from '@/lib/useGetAbstractParams';
import { parseAPIError } from '@/utils/common/parseAPIError';
+import { feedbackItems } from '@/components/NavBar';
+import { RecordNotFound } from '@/components/RecordNotFound';
const VolumePage: NextPage = () => {
const router = useRouter();
@@ -27,30 +29,42 @@ const VolumePage: NextPage = () => {
const isEmpty = isSuccess && !isFetching && (!data?.docs || data.docs.length === 0);
const tocParams = doc?.bibcode ? getTocParams(doc.bibcode, 0, rows) : undefined;
+ const handleMissingRecordFeedback = () => {
+ void router.push({
+ pathname: feedbackItems.record.path,
+ });
+ };
+
return (
- {isLoading || isFetching ? : null}
- {isError && }
- {isEmpty && (
-
- )}
- {isSuccess && !isEmpty && (
-
+ {!doc ? (
+
+ ) : (
+ <>
+ {isLoading || isFetching ? : null}
+ {isError && }
+ {isEmpty && (
+
+ )}
+ {isSuccess && !isEmpty && (
+
+ )}
+ >
)}
);