Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove max_cache_age parameter (PP-1962) #141

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/components/CatalogPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ export default class CatalogPage extends React.Component<CatalogPageProps, {}> {
}

expandCollectionUrl(url: string): string {
return url
? `${document.location.origin}/${url}${
url.includes("?") ? "&" : "?"
}max_cache_age=0`
: url;
return url ? `${document.location.origin}/${url}` : url;
}

expandBookUrl(url: string): string {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class Header extends React.Component<HeaderProps, HeaderState> {

// Links that will be rendered in a NavItem Bootstrap component.
const libraryNavItems = [
{ label: "Catalog", href: "%2Fgroups?max_cache_age=0" },
{ label: "Catalog", href: "%2Fgroups" },
{ label: "Hidden Books", href: "%2Fadmin%2Fsuppressed" },
];
// Other links that will be rendered in a Link router component and are library specific.
Expand Down Expand Up @@ -231,7 +231,7 @@ export class Header extends React.Component<HeaderProps, HeaderState> {
let library = this.libraryRef.current.getValue();
if (library) {
this.context.router.push(
"/admin/web/collection/" + library + "%2Fgroups?max_cache_age=0"
"/admin/web/collection/" + library + "%2Fgroups"
);
this.forceUpdate();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/__tests__/CatalogPage-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("CatalogPage", () => {
it("renders OPDSCatalog", () => {
const catalog = wrapper.find(OPDSCatalog);
expect(catalog.prop("collectionUrl")).to.equal(
host + "/library/collectionurl?max_cache_age=0"
host + "/library/collectionurl"
);
expect(catalog.prop("bookUrl")).to.equal(host + "/library/works/bookurl");
expect(catalog.prop("BookDetailsContainer").name).to.equal(
Expand All @@ -45,7 +45,7 @@ describe("CatalogPage", () => {
it("handles the case in which the URL already contains a query string", () => {
const queryUrl = "library/collectionurl?samplequery=test";
expect(wrapper.instance().expandCollectionUrl(queryUrl)).to.equal(
host + "/library/collectionurl?samplequery=test&max_cache_age=0"
host + "/library/collectionurl?samplequery=test"
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/Header-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ describe("Header", () => {

expect(fullContext.router.push.callCount).to.equal(1);
expect(fullContext.router.push.args[0][0]).to.equal(
"/admin/web/collection/bpl%2Fgroups?max_cache_age=0"
"/admin/web/collection/bpl%2Fgroups"
);
});

Expand Down