Skip to content

Commit

Permalink
Merge pull request #2151 from NYPL/development
Browse files Browse the repository at this point in the history
Merge development into production
  • Loading branch information
dgcohen authored May 9, 2024
2 parents 24812a9 + 8e3221b commit 0805191
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
18 changes: 15 additions & 3 deletions src/app/components/BibPage/BibDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,28 @@ const BibDetails = (props) => {
router.push(`${appConfig.baseUrl}/search?${query}`);
};

return (
<DSLink dir={stringDirection(label, useParallels)}>
// In the reverse proxy state, we want to navigate to the page and
// cause a refresh. Otherwise, we want to use react-router to
// stay within the app. This is to work with the new
// Research Catalog update.
return (appConfig.reverseProxyEnabled ? (
<DSLink
dir={stringDirection(label, useParallels)}
key={label.trim().replace(/ /g, '')}
href={`${appConfig.baseUrl}/search?${query}`}
>
{label}
</DSLink>
) : (
<Link
dir={stringDirection(label, useParallels)}
key={label.trim().replace(/ /g, '')}
onClick={onClick}
to={`${appConfig.baseUrl}/search?${query}`}
>
{label}
</Link>
</DSLink>
)
);
};

Expand Down
16 changes: 2 additions & 14 deletions src/app/pages/AccountPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ import {
basicQuery,
ajaxCall,
} from '../utils/utils';
import {
setCookieWithExpiration,
} from '../utils/cookieUtils';

const AccountPage = (props, context) => {
const { patron, accountHtml, appConfig } = useSelector(state => ({
Expand Down Expand Up @@ -67,8 +64,8 @@ const AccountPage = (props, context) => {
if (currentCount > 3) {
ajaxCall(
`${baseUrl}/api/accountError?type=redirect_loop&page=${encodeURI(window.location.href)}`,
() => {},
() => {},
() => { },
() => { },
);
window.location.replace(`${baseUrl}/accountError`);
return true;
Expand Down Expand Up @@ -160,15 +157,6 @@ const AccountPage = (props, context) => {
activeSection="account"
pageTitle="Account"
>
<div className="content-header research-search">
<div className="research-search__inner-content">
<Search
router={context.router}
createAPIQuery={basicQuery()}
/>
<EDSLink />
</div>
</div>
<div className="nypl-patron-page">
<Heading
level="two"
Expand Down
8 changes: 2 additions & 6 deletions test/unit/AccountPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('AccountPage', () => {
// the test from ever terminating.
// This disables the clock.
sandbox = sinon.createSandbox();
sandbox.stub(global, 'setTimeout').callsFake(() => {});
sandbox.stub(global, 'setTimeout').callsFake(() => { });
});

after(() => {
Expand All @@ -34,10 +34,6 @@ describe('AccountPage', () => {
component = mountTestRender(<AccountPage params={{}} />, { store: mockStore });
});

it('should render a `Search` component', () => {
expect(component.find('Search').length).to.equal(1);
});

it('should render a <div> with class .nypl-patron-page', () => {
expect(component.find('.nypl-patron-page').hostNodes()).to.have.length(1);
});
Expand Down Expand Up @@ -147,7 +143,7 @@ describe('AccountPage', () => {
let clock;
before(() => {
clock = sinon.useFakeTimers();
replaceSpy = sandbox.stub(window.location, 'replace').callsFake(() => {});
replaceSpy = sandbox.stub(window.location, 'replace').callsFake(() => { });
const mockStore = makeTestStore({ accountHtml: { error: true } });
document.cookie = 'nyplAccountRedirectTracker=25expMon, 05 Apr 2021 20:06:13 GMT';
component = mountTestRender(<AccountPage params={{}} />, { store: mockStore });
Expand Down

0 comments on commit 0805191

Please sign in to comment.