Skip to content

Commit

Permalink
260: Fixes pdf viewer path and cors error on prod (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpilone authored Sep 28, 2022
1 parent c21b9a2 commit 4c88e0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cdk/ingest/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export default class IngestBuckets extends Construct {
{
allowedHeaders: ['Authorization'],
allowedMethods: [HttpMethods.GET, HttpMethods.HEAD],
allowedOrigins: [`https://${websiteDistribution.distributionDomainName}`],
allowedOrigins: [
`https://${websiteDistribution.distributionDomainName}`,
'https://search.oceanbestpractices.org',
],
maxAge: 3000,
},
],
Expand Down
6 changes: 3 additions & 3 deletions website/src/js/components/Result.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Result extends Component {
formatStatisticsUrl(handle) {
return `https://repository.oceanbestpractices.org/handle/${handle}/statistics`
}

hashLinkScroll() {
const { hash } = window.location;
if (hash !== '') {
Expand Down Expand Up @@ -98,7 +98,7 @@ class Result extends Component {
}

launchPDF() {
const pdfURL = `viewer/index.html?file=https://s3.amazonaws.com/${documentBucketSource}-document-source/${this.props.uuid}.pdf&search=${constructViewerQuery(this.props.searchReducer.activeSearch, false)}`;
const pdfURL = `viewer/index.html?file=https://s3.amazonaws.com/${documentBucketSource}-document-source/pdf/${this.props.uuid}.pdf&search=${constructViewerQuery(this.props.searchReducer.activeSearch, false)}`;
window.open(pdfURL, '_blank');
this.setState({showDocument: true});
}
Expand Down Expand Up @@ -210,7 +210,7 @@ class Result extends Component {
export_citation_checkbox
}
{ result_title }

<div className="result__author">
{
authorList || null
Expand Down

0 comments on commit 4c88e0f

Please sign in to comment.