Skip to content

Commit

Permalink
update license to copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
jackiequach committed Oct 8, 2024
1 parent b147425 commit 4b74b2b
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGE LOG

## [Prerelease]

- Update license link for editions, works, and collections to copyright

## [0.18.3]

- Fix error when collections are empty
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/Search.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ describe("Renders Search Results Page", () => {
});
test("Shows license with links", () => {
expect(
screen.getByText("License: Public Domain").closest("a").href
screen.getByText("Copyright: Public Domain").closest("a").href
).toContain("/license");
});
test("Shows cover", () => {
Expand Down Expand Up @@ -415,7 +415,7 @@ describe("Renders Search Results Page", () => {
});
test("Shows Unknown license with links", () => {
expect(
screen.getByText("License: Unknown").closest("a").href
screen.getByText("Copyright: Unknown").closest("a").href
).toContain("/license");
});
test("Shows Placeholder cover", () => {
Expand Down Expand Up @@ -483,7 +483,7 @@ describe("Renders Search Results Page", () => {
expect(
screen
.getByText(
"License: Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain"
"Copyright: Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain Public Domain"
)
.closest("a").href
).toContain("/license");
Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/Collection.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe("Renders Collection Page", () => {
});
test("Shows license with links", () => {
expect(
screen.getByText("License: Public Domain").closest("a").href
screen.getByText("Copyright: Public Domain").closest("a").href
).toContain("/license");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("Collection Item Card", () => {
);
});
test("shows license", () => {
expect(screen.getByText("License: Unknown").closest("a").href).toContain(
expect(screen.getByText("Copyright: Unknown").closest("a").href).toContain(
"/license"
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from "react";
import { Rights } from "~/src/types/DataModel";
import Link from "~/src/components/Link/Link";

const LicenseLink: React.FC<{ rights: Rights }> = ({ rights }) => {
const CopyrightLink: React.FC<{ rights: Rights }> = ({ rights }) => {
return (
<Link to="/license">
{rights ? `License: ${rights.rightsStatement}` : "License: Unknown"}
{rights ? `Copyright: ${rights.rightsStatement}` : "Copyright: Unknown"}
</Link>
);
};

export default LicenseLink;
export default CopyrightLink;
4 changes: 2 additions & 2 deletions src/components/EditionCard/EditionCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("Edition Card with Valid Data", () => {
});
test("Shows license with links", () => {
expect(
screen.getByText("License: test rights statement").closest("a").href
screen.getByText("Copyright: test rights statement").closest("a").href
).toContain("/license");
});
test("Shows cover", () => {
Expand Down Expand Up @@ -79,7 +79,7 @@ describe("Edition Year with Minimal Data", () => {
expect(screen.getByText("Languages: Undetermined")).toBeInTheDocument();
});
test("Shows Unknown license with links", () => {
expect(screen.getByText("License: Unknown").closest("a").href).toContain(
expect(screen.getByText("Copyright: Unknown").closest("a").href).toContain(
"/license"
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditionDetail/Edition.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe("Renders edition component when given valid edition", () => {
expect(screen.getAllByAltText("").length).toBe(2);
expect(
screen
.getAllByText("License: Public Domain when viewed in the US")[0]
.getAllByText("Copyright: Public Domain when viewed in the US")[0]
.closest("a").href
).toContain("/license");
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/InstanceCard/InstanceCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("Instance Card with Valid Data", () => {
});
test("shows license", () => {
expect(
screen.getByText("License: test rights statement").closest("a").href
screen.getByText("Copyright: test rights statement").closest("a").href
).toContain("/license");
});
});
Expand Down Expand Up @@ -74,7 +74,7 @@ describe("Instance Card with Minmal Data", () => {
);
});
test("shows license", () => {
expect(screen.getByText("License: Unknown").closest("a").href).toContain(
expect(screen.getByText("Copyright: Unknown").closest("a").href).toContain(
"/license"
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/Work/Work.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe("Renders Work component when given valid work", () => {
).toBe(1);
expect(screen.getAllByText("Languages: English, German").length).toBe(1);
expect(
screen.getAllByText("License: Unknown")[0].closest("a").href
screen.getAllByText("Copyright: Unknown")[0].closest("a").href
).toContain("/license");
});
test("Shows Details Table", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/util/EditionCardUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ export default class EditionCardUtils {
// Rights
static getLicense(item: ApiItem): string {
return item && item.rights && item.rights.length > 0
? `License: ${item.rights[0].rightsStatement}`
: "License: Unknown";
? `Copyright: ${item.rights[0].rightsStatement}`
: "Copyright: Unknown";
}

static getReadLink = (item: ApiItem, type: "reader" | "embed"): ItemLink => {
Expand Down

0 comments on commit 4b74b2b

Please sign in to comment.