diff --git a/__tests__/synonyms.server.ts b/__tests__/synonyms.server.ts index 84f020558..d5bd3b847 100644 --- a/__tests__/synonyms.server.ts +++ b/__tests__/synonyms.server.ts @@ -1,3 +1,10 @@ +/*! + * Copyright © 2023 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * SPDX-License-Identifier: Apache-2.0 + */ import { tables } from '@architect/functions' import type { AWSError, DynamoDB } from 'aws-sdk' import * as awsSDKMock from 'aws-sdk-mock' diff --git a/app/routes/circulars.$circularId.($version)/AstroData.components.module.scss b/app/components/circularDisplay/AstroData.components.module.scss similarity index 100% rename from app/routes/circulars.$circularId.($version)/AstroData.components.module.scss rename to app/components/circularDisplay/AstroData.components.module.scss diff --git a/app/routes/circulars.$circularId.($version)/AstroData.components.tsx b/app/components/circularDisplay/AstroData.components.tsx similarity index 100% rename from app/routes/circulars.$circularId.($version)/AstroData.components.tsx rename to app/components/circularDisplay/AstroData.components.tsx diff --git a/app/routes/circulars.$circularId.($version)/AstroData.tsx b/app/components/circularDisplay/AstroData.tsx similarity index 100% rename from app/routes/circulars.$circularId.($version)/AstroData.tsx rename to app/components/circularDisplay/AstroData.tsx diff --git a/app/routes/circulars.$circularId.($version)/AstroDataContext.module.scss b/app/components/circularDisplay/AstroDataContext.module.scss similarity index 100% rename from app/routes/circulars.$circularId.($version)/AstroDataContext.module.scss rename to app/components/circularDisplay/AstroDataContext.module.scss diff --git a/app/routes/circulars.$circularId.($version)/AstroDataContext.tsx b/app/components/circularDisplay/AstroDataContext.tsx similarity index 98% rename from app/routes/circulars.$circularId.($version)/AstroDataContext.tsx rename to app/components/circularDisplay/AstroDataContext.tsx index 01ff3841a..d45bd59a2 100644 --- a/app/routes/circulars.$circularId.($version)/AstroDataContext.tsx +++ b/app/components/circularDisplay/AstroDataContext.tsx @@ -29,6 +29,7 @@ export const AstroDataContext = createContext({}) /** * An Astro Flavored Markdown enriched link. */ +// eslint-disable-next-line react/display-name export const AstroDataLink = forwardRef( ( { diff --git a/app/routes/circulars.$circularId.($version)/Body.tsx b/app/components/circularDisplay/Body.tsx similarity index 100% rename from app/routes/circulars.$circularId.($version)/Body.tsx rename to app/components/circularDisplay/Body.tsx diff --git a/app/routes/circulars.$circularId.($version)/FrontMatter.tsx b/app/components/circularDisplay/FrontMatter.tsx similarity index 95% rename from app/routes/circulars.$circularId.($version)/FrontMatter.tsx rename to app/components/circularDisplay/FrontMatter.tsx index 1f5fb3ce2..84da2f958 100644 --- a/app/routes/circulars.$circularId.($version)/FrontMatter.tsx +++ b/app/components/circularDisplay/FrontMatter.tsx @@ -8,8 +8,8 @@ import { Grid } from '@trussworks/react-uswds' import type { ReactNode } from 'react' -import { type Circular, formatDateISO } from '../circulars/circulars.lib' import TimeAgo from '~/components/TimeAgo' +import { type Circular, formatDateISO } from '~/routes/circulars/circulars.lib' const submittedHowMap = { web: 'Web form', diff --git a/app/routes/circulars.$circularId.($version)/PlainTextBody.module.scss b/app/components/circularDisplay/PlainTextBody.module.scss similarity index 100% rename from app/routes/circulars.$circularId.($version)/PlainTextBody.module.scss rename to app/components/circularDisplay/PlainTextBody.module.scss diff --git a/app/routes/circulars.$circularId.($version)/rehypeAutolinkLiteral.ts b/app/components/circularDisplay/rehypeAutolinkLiteral.ts similarity index 100% rename from app/routes/circulars.$circularId.($version)/rehypeAutolinkLiteral.ts rename to app/components/circularDisplay/rehypeAutolinkLiteral.ts diff --git a/app/components/pagination/Pagination.tsx b/app/components/pagination/Pagination.tsx index 481b92312..a527d462c 100644 --- a/app/components/pagination/Pagination.tsx +++ b/app/components/pagination/Pagination.tsx @@ -17,19 +17,22 @@ function getPageLink({ query, startDate, endDate, + view, }: { page: number limit?: number query?: string startDate?: string endDate?: string + view?: string }) { const searchParams = new URLSearchParams() if (page > 1) searchParams.set('page', page.toString()) - if (limit && limit != 100) searchParams.set('limit', limit.toString()) + if (limit) searchParams.set('limit', limit.toString()) if (query) searchParams.set('query', query) if (startDate) searchParams.set('startDate', startDate) if (endDate) searchParams.set('endDate', endDate) + searchParams.set('view', view || 'index') const searchString = searchParams.toString() return searchString && `?${searchString}` @@ -38,6 +41,7 @@ function getPageLink({ export default function Pagination({ page, totalPages, + view, ...queryStringProps }: { page: number @@ -46,8 +50,10 @@ export default function Pagination({ query?: string startDate?: string endDate?: string + view?: string }) { const pages = usePagination({ currentPage: page, totalPages }) + return (