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

Disable Rapido 'not found' links #6

Merged
merged 2 commits into from
Mar 5, 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
17 changes: 16 additions & 1 deletion cypress/e2e/search-results.cy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import { SearchPage } from "../pages";
import { inViews } from "../support/e2e";
import { inViews, inAllViews } from "../support/e2e";
import { View } from "@src/view-code";

// TODO: ArchivesSpace availability?

describe("Search Results", () => {
let page: SearchPage;

inAllViews((view) => {
before(() => {
page = new SearchPage(view);
page.visit();
});

it("does not display the Rapido 'still not found' link", () => {
page.searchFor("baseball");
cy.get("prm-search-result-list").should("be.visible");
cy.get("prm-ngrs-results-button button#ill-request-link").should(
"not.exist"
);
});
});

inViews([View.TWINCITIES, View.DULUTH, View.MORRIS], (view) => {
before(() => {
page = new SearchPage(view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import "./full-view.scss";
import "./recommendations.scss";

import { GetItModule } from "./get-it";
import { NgrsModule } from "./ngrs";
import { PrmServiceDetailsAfterComponent } from "./prm-service-details-after.component";

export const FullViewModule = angular
.module("fullView", [GetItModule])
.module("fullView", [GetItModule, NgrsModule])
.component("prmServiceDetailsAfter", PrmServiceDetailsAfterComponent).name;
1 change: 1 addition & 0 deletions src/shared/components/search/full-view/ngrs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./ngrs.module";
8 changes: 8 additions & 0 deletions src/shared/components/search/full-view/ngrs/ngrs.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { PrmNgrsResultsButtonAfterComponent } from "./prm-ngrs-results-button-after.component";

export const NgrsModule = angular
.module("ngrs", [])
.component(
"prmNgrsResultsButtonAfter",
PrmNgrsResultsButtonAfterComponent
).name;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class PrmNgrsResultsButtonAfterController implements ng.IController {
private parentCtrl: ng.IController;

$onInit(): void {
this.disableStillNotFoundLink();
}

/**
* By default, Rapido will display a link to a blank resource sharing
* request form. This disables the link.
*/
private disableStillNotFoundLink(): void {
if (this.parentCtrl.isStillNotFoundRequired()) {
this.parentCtrl.isRapidoLinksTileRequired = () => false;
}
}
}

export const PrmNgrsResultsButtonAfterComponent: ng.IComponentOptions = {
controller: PrmNgrsResultsButtonAfterController,
bindings: { parentCtrl: "<" },
};
Loading