Skip to content

Commit

Permalink
public changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
avertrees committed Jan 28, 2025
2 parents 674bc7b + 3ed9cc1 commit 4bc5ad5
Show file tree
Hide file tree
Showing 22 changed files with 1,688 additions and 1,370 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- name: Update ECS service
run: |
aws ecs update-service --cluster dc-frontend-qa --service dc-frontend-qa --force-new-deployment
aws ecs update-service --cluster new-digitalcollections-qa --service new-digitalcollections-qa --force-new-deployment
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.2.6] 2025-1-13
### Added

- Added skeleton for search page and filter component (DR-3364)

## [0.3.0] 2025-01-23

## Updated

- Public domain link correction (DR-3378)
- Updated middleware to no longer include `/collections` and `collections/lane/:slug`
- Updated QA cluster name

## [0.2.6] 2025-01-13

### Updated

Expand All @@ -20,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added "no results" view for the `/collections` page (DR-3324, DR-3357)

## [0.2.5] 2025-1-02
## [0.2.5] 2025-01-02

### Removed

Expand Down
18 changes: 18 additions & 0 deletions __tests__/pages/searchpage.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import SearchPage from "@/src/components/pages/searchPage/searchPage";
import { render } from "@testing-library/react";
import { mockItems } from "__tests__/__mocks__/data/mockItems";

import { axe } from "jest-axe";
import React from "react";

jest.mock("next/navigation", () => ({
useRouter: jest.fn(),
usePathname: jest.fn(),
}));

describe("Search page accessibility", () => {
it("passes axe accessibility test", async () => {
const { container } = render(<SearchPage data={mockItems} />);
expect(await axe(container)).toHaveNoViolations();
}, 60000);
});
7 changes: 2 additions & 5 deletions app/collections/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { Metadata } from "next";
import PageLayout from "../../src/components/pageLayout/pageLayout";
import SearchResults from "@/src/components/search/results";
import { mockItems } from "__tests__/__mocks__/data/mockItems";
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";

Expand All @@ -21,7 +20,7 @@ export async function generateMetadata({
};
}

export default function Collections({ params }: CollectionProps) {
export default function Collection({ params }: CollectionProps) {
return (
<PageLayout
activePage="lane"
Expand All @@ -37,8 +36,6 @@ export default function Collections({ params }: CollectionProps) {
"collections",
params.slug
)}
>
<SearchResults showFilter={false} isSearchPage={false} data={mockItems} />
</PageLayout>
></PageLayout>
);
}
6 changes: 3 additions & 3 deletions app/search/index/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import PageLayout from "../../src/components/pageLayout/pageLayout";
import SearchResults from "../../src/components/search/results";
import { mockItems } from "../../../__tests__/__mocks__/data/mockItems"; // TODO: render mockItems
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";
import SearchPage from "@/src/components/pages/searchPage/searchPage";

export type SearchProps = {
params: { slug: string };
Expand All @@ -12,7 +12,7 @@ export type SearchProps = {
export default async function Search() {
return (
<PageLayout
activePage="collections"
activePage="search"
breadcrumbs={[
{ text: "Home", url: "/" },
{ text: "Keyword Search", url: "/search/index" },
Expand All @@ -22,7 +22,7 @@ export default async function Search() {
""
)} //TODO: if there are no query params, page name should be createAdobeAnalyticsPageName("all-items", "")
>
<SearchResults showFilter={false} isSearchPage data={mockItems} />
<SearchPage data={[...mockItems, ...mockItems]} />
</PageLayout>
);
}
5 changes: 4 additions & 1 deletion app/src/components/featuredContent/featuredContent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ describe("Featured Content component renders with expected props", () => {
);

const button = within(component).getByTestId("featured-learn-more");
expect(button).toHaveAttribute("href", "https://publicdomain.nypl.org");
expect(button).toHaveAttribute(
"href",
"https://www.nypl.org/research/resources/public-domain-collections"
);
});
});

Expand Down
6 changes: 3 additions & 3 deletions app/src/components/pageLayout/pageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import {
Breadcrumbs,
DSProvider,
SkipNavigation,
useFeedbackBox,
Box,
Button,
} from "@nypl/design-system-react-components";
import React, { useEffect } from "react";
import { type PropsWithChildren } from "react";
Expand Down Expand Up @@ -55,7 +53,9 @@ const PageLayout = ({
{activePage === "home" ||
activePage === "about" ||
activePage === "notFound" ||
activePage === "serverError" ? (
activePage === "serverError" ||
activePage === "search" ||
activePage === "collection" ? (
children
) : (
<>
Expand Down
104 changes: 55 additions & 49 deletions app/src/components/pages/collectionLanePage/collectionLanePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,58 +72,64 @@ export default function CollectionLanePage({ data }: any) {
slug
)}
>
<Box
sx={{
display: "flex",
flexDirection: "column",
[`@media screen and (min-width: ${headerBreakpoints.smTablet})`]: {
maxWidth: "715px",
},
gap: "m",
}}
>
<Heading sx={{ marginBottom: 0 }} level="h1" id={slug} text={title} />
</Box>
<HorizontalRule sx={{ marginTop: "xxl", marginBottom: "xxl" }} />
<Heading
size="heading5"
sx={{ marginBottom: "l" }}
ref={headingRef}
tabIndex={-1}
id={slug}
width="max-content"
>
{`Displaying ${displayResults(data.numResults, data.perPage, data.page)}
results`}
</Heading>
{isLoaded ? (
<CardsGrid records={data.collection} />
) : (
Array(Math.ceil(data.collection?.length / 4))
.fill(null)
.map((_, index) => (
<LaneLoading
id={`lane-loading-${index}`}
key={`lane-loading-${index}`}
withTitle={false}
/>
))
)}
{totalPages > 1 && (
<Pagination
id="pagination-id"
initialPage={currentPage}
currentPage={currentPage}
pageCount={totalPages}
onPageChange={updatePageURL}
<>
<Box
sx={{
display: "flex",
justifyContent: "center",
gap: "s",
marginTop: "xxl",
flexDirection: "column",
[`@media screen and (min-width: ${headerBreakpoints.smTablet})`]: {
maxWidth: "715px",
},
gap: "m",
}}
/>
)}
>
<Heading sx={{ marginBottom: 0 }} level="h1" id={slug} text={title} />
</Box>
<HorizontalRule sx={{ marginTop: "xxl", marginBottom: "xxl" }} />
<Heading
size="heading5"
sx={{ marginBottom: "l" }}
ref={headingRef}
tabIndex={-1}
id={slug}
width="max-content"
>
{`Displaying ${displayResults(
data.numResults,
data.perPage,
data.page
)}
results`}
</Heading>
{isLoaded ? (
<CardsGrid records={data.collection} />
) : (
Array(Math.ceil(data.collection?.length / 4))
.fill(null)
.map((_, index) => (
<LaneLoading
id={`lane-loading-${index}`}
key={`lane-loading-${index}`}
withTitle={false}
/>
))
)}
{totalPages > 1 && (
<Pagination
id="pagination-id"
initialPage={currentPage}
currentPage={currentPage}
pageCount={totalPages}
onPageChange={updatePageURL}
sx={{
display: "flex",
justifyContent: "center",
gap: "s",
marginTop: "xxl",
}}
/>
)}
</>
</PageLayout>
);
}
Loading

0 comments on commit 4bc5ad5

Please sign in to comment.