Skip to content

Commit

Permalink
Merge pull request #241 from NYPL/release/0.2.0
Browse files Browse the repository at this point in the history
Release/0.2.0
  • Loading branch information
avertrees authored Nov 20, 2024
2 parents e9cfd1b + 660d5a2 commit d54868d
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 16 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.2.0] 2024-11-20

### Removed

- Remove banner that links to OG Digital Collections (DR-3263)

### Updated

- Update links on /divisions page to point to /divisions/:slug pages (DR-3142)
- Updating pagination text on division landing page
- Updating Next Image quality

## [0.1.19] 2024-11-18

## Updated
### Updated

- Moved `/divisions` and `/divisions/[slug]` from behind middleware, now accessible (DR-3132, DR-3133)
- Updated collection card urls to use uuid
- Moved `/divisions` and `/divisions/[slug]` from behind middleware, now accessible
- Updated item card urls to use uuid
- Updated collection card urls to use legacy url
- Updated prod ECS cluster name to `new-digitalcollections-prod`

## [0.1.18] 2024-11-18

- merged into 0.1.19

## [0.1.17] 2024-11-14

### Updated
Expand Down
1 change: 1 addition & 0 deletions app/src/components/card/cardImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const CardImage = ({ record, imageHeight }: CardImageProps) => {
minHeight: "100%",
height: "auto",
}}
quality={100}
placeholder="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mN8WQ8AAlcBas53/MIAAAAASUVORK5CYII="
width={initialImageHeight * 2}
height={initialImageHeight}
Expand Down
2 changes: 0 additions & 2 deletions app/src/components/pageLayout/pageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import React, { useEffect } from "react";
import { type PropsWithChildren } from "react";
import Header from "../header/header";
import NotificationBanner from "../notificationBanner/notificationBanner";
import Script from "next/script";
import { BreadcrumbsDataProps } from "@nypl/design-system-react-components/dist/src/components/Breadcrumbs/Breadcrumbs";
import { ADOBE_EMBED_URL } from "../../config/constants";
Expand Down Expand Up @@ -52,7 +51,6 @@ const PageLayout = ({
<DSProvider>
<FeedbackProvider>
<SkipNavigation />
<NotificationBanner />
<Header />
{activePage === "home" ||
activePage === "about" ||
Expand Down
5 changes: 3 additions & 2 deletions app/src/components/pages/divisionPage/divisionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ export default function DivisionPage({ data }: any) {

<Heading
size="heading5"
sx={{ marginBottom: "m" }}
sx={{ marginBottom: "l" }}
ref={headingRef}
tabIndex={-1}
id={slug}
width="max-content"
>
{displayResults(data.numFound, data.perPage, data.page)}
{`Displaying ${displayResults(data.numFound, data.perPage, data.page)}
results`}
</Heading>

<Heading level="h2" size="heading3" style={{ width: "fit-content" }}>
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/pages/divisionsPage/divisionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function DivisionsPage({ summary, divisions }: DivisionsProps) {
<DCLane
key={key}
records={division.collections}
seeMoreLink={`${DC_URL}/divisions`}
seeMoreLink={`/divisions`}
laneName={division.name}
laneSlug={division.slug}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/src/data/dcNavLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const dcNavLinks = [
text: "Collections",
},
{
href: `${DC_URL}/divisions`,
href: `/divisions`,
text: "Divisions",
},
{
Expand Down
12 changes: 6 additions & 6 deletions app/src/utils/utils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,26 +180,26 @@ describe("createAdobeAnalyticsPageName generates the correct Adobe Analytics pag

describe("displayResults", () => {
test("displays correct result range for first page with enough results", () => {
expect(displayResults(100, 10, 1)).toBe("Results: 1-10 of 100");
expect(displayResults(100, 10, 1)).toBe("1-10 of 100");
});

test("displays correct result range for middle page", () => {
expect(displayResults(100, 10, 5)).toBe("Results: 41-50 of 100");
expect(displayResults(100, 10, 5)).toBe("41-50 of 100");
});

test("displays correct result range for last page when there are fewer results than perPage", () => {
expect(displayResults(45, 10, 5)).toBe("Results: 41-45 of 45");
expect(displayResults(45, 10, 5)).toBe("41-45 of 45");
});

test("displays correct result range when numFound is less than perPage", () => {
expect(displayResults(8, 10, 1)).toBe("Results: 1-8 of 8");
expect(displayResults(8, 10, 1)).toBe("1-8 of 8");
});

test("displays correct result range for the last page when it's the same as perPage", () => {
expect(displayResults(50, 10, 5)).toBe("Results: 41-50 of 50");
expect(displayResults(50, 10, 5)).toBe("41-50 of 50");
});

test("displays correct range when perPage is greater than numFound", () => {
expect(displayResults(5, 10, 1)).toBe("Results: 1-5 of 5");
expect(displayResults(5, 10, 1)).toBe("1-5 of 5");
});
});
2 changes: 1 addition & 1 deletion app/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ export function displayResults(
) {
const start = (page - 1) * perPage + 1;
const end = Math.min(page * perPage, numFound);
return `Results: ${start}-${end} of ${numFound}`;
return `${start}-${end} of ${numFound}`;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "digital-collections",
"version": "0.1.19",
"version": "0.2.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
20 changes: 20 additions & 0 deletions public/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.2.0] 2024-11-20

### Removed
- Remove banner that links to OG Digital Collections (DR-3263)

### Updated
- Update links on /divisions page to point to /divisions/:slug pages (DR-3142)

## [0.1.19] 2024-11-18

### Updated
- Moved `/divisions` and `/divisions/[slug]` from behind middleware, now accessible (DR-3132, DR-3133)
- Updated collection card urls to use uuid
- Updated item card urls to use uuid
- Updated collection card urls to use legacy url
- Updated prod ECS cluster name to `new-digitalcollections-prod`

## [0.1.18] 2024-11-18
- merged into 0.1.19

## [0.1.17] 2024-11-14

### Updated
Expand Down

0 comments on commit d54868d

Please sign in to comment.