Skip to content

Commit bd390a1

Browse files
committed
Merge remote-tracking branch 'origin/qa' into feature/DR-4029/facet-filters
2 parents 8b55033 + 915da42 commit bd390a1

File tree

8 files changed

+36
-12
lines changed

8 files changed

+36
-12
lines changed

app/shuffle/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import ShufflePage from "@/src/components/pages/shufflePage/shufflePage";
12
import { CollectionsApi } from "@/src/utils/apiClients/apiClients";
23
import { Metadata } from "next";
34
import { headers } from "next/headers";
@@ -13,5 +14,5 @@ export default async function Shuffle() {
1314
await headers();
1415

1516
const url: string = await CollectionsApi.getRandomCollectionOrItem();
16-
return redirect(url);
17+
return <ShufflePage redirectPath={url} />;
1718
}

app/src/components/items/uv/universalViewer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ const UniversalViewer: React.FC<UniversalViewerProps> = React.memo(
288288
/>
289289
</>
290290
);
291-
}
291+
},
292+
(prevProps, nextProps) => prevProps.manifestId === nextProps.manifestId
292293
);
293294

294295
UniversalViewer.displayName = "UniversalViewer";

app/src/components/items/uv/universalViewerLazy.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/src/components/items/viewer/viewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { ItemModel } from "../../../models/item";
44
import React from "react";
5-
import { UniversalViewer } from "../uv/universalViewerLazy";
5+
import UniversalViewer from "../uv/universalViewer";
66
import "universalviewer/dist/esm/index.css";
77
import { PlyrPlayer } from "../plyr/dynamic";
88

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use client";
2+
import { useEffect } from "react";
3+
import { useRouter } from "next/navigation";
4+
import { trackCTA } from "@/src/utils/ga4Utils";
5+
6+
interface ShufflePageProps {
7+
redirectPath: string;
8+
}
9+
10+
export default function ShufflePage({ redirectPath }: ShufflePageProps) {
11+
const router = useRouter();
12+
useEffect(() => {
13+
trackCTA("Shuffle", redirectPath, "Digital Collections Shuffle");
14+
router.push(redirectPath);
15+
});
16+
return null;
17+
}

app/src/data/lanesData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const lanesData = {
99
uuid: "90d41660-53a5-0130-2430-58d385a7b928",
1010
title: "Opportunity: journal of Negro life",
1111
url: "https://digitalcollections.nypl.org/collections/opportunity#/?tab=navigation",
12-
imageID: "58864967",
12+
imageID: "58886276",
1313
},
1414
{
1515
uuid: "66d899e0-b7b9-013c-626c-0242ac110002",
@@ -25,7 +25,7 @@ const lanesData = {
2525
},
2626
{
2727
uuid: "924921a0-3cd0-0136-c557-0af54bc5b55e",
28-
title: "Reform Advocate",
28+
title: "The Reform Advocate",
2929
url: "https://digitalcollections.nypl.org/collections/the-reform-advocate#/?tab=navigation",
3030
imageID: "57880025",
3131
},

app/src/utils/ga4Utils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ export const trackAVProgress = (
5858
});
5959
};
6060

61+
export const trackCTA = (text: string, url: string, type: string) => {
62+
const dataLayer = window["dataLayer"] || [];
63+
dataLayer.push({
64+
event: "cta_click",
65+
click_text: text,
66+
click_url: url,
67+
click_type: type,
68+
});
69+
};
70+
6171
export const trackSearchResults = (
6272
searchResultsLayout: "grid" | "list",
6373
filterNames: string[],

playwright/pages/homepage.page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class DCHomepage {
8686

8787
//collections
8888
this.recentlyDigitizedCollection = this.page.getByRole("link", {
89-
name: "Reform Advocate",
89+
name: "The Reform Advocate",
9090
exact: true,
9191
});
9292
this.farmSecurityAdministrationPhotographsCollection = this.page.locator(
@@ -96,7 +96,7 @@ export class DCHomepage {
9696
//collections' items total count
9797
//these locators are used to verify that the collections have items
9898
this.recentlyDigitizedCollectionItems = this.page.locator(
99-
"#item-count-reform-advocate-3"
99+
"#item-count-the-reform-advocate-3"
100100
);
101101
this.farmSecurityAdministrationPhotographsCollectionItems =
102102
this.page.locator(

0 commit comments

Comments
 (0)