Skip to content

Commit

Permalink
Disable Rapido 'not found' links
Browse files Browse the repository at this point in the history
Conditionally hide the Rapido search results banner so that it
does not display links to the resource sharing request form.
  • Loading branch information
gpeterso committed Mar 5, 2024
1 parent 9432125 commit 2a7fffc
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
15 changes: 14 additions & 1 deletion cypress/e2e/search-results.cy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
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").should("not.be.visible");
});
});

inViews([View.TWINCITIES, View.DULUTH, View.MORRIS], (view) => {
before(() => {
page = new SearchPage(view);
Expand Down
3 changes: 2 additions & 1 deletion src/shared/components/search/full-view/full-view.module.ts
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: "<" },
};

0 comments on commit 2a7fffc

Please sign in to comment.