Skip to content

Commit

Permalink
stop loading node in route model hook (#2077)
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius authored Dec 7, 2023
1 parent 8a16ce3 commit 7ce1e37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions app/preprints/detail/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ export default class PreprintsDetail extends Route {

const license = await preprint?.get('license');

const node = await preprint?.get('node');

const subjects = await preprint?.queryHasMany('subjects');

return {
Expand All @@ -79,7 +77,6 @@ export default class PreprintsDetail extends Route {
primaryFile,
license,
subjects,
node,
};

} catch (error) {
Expand Down
14 changes: 7 additions & 7 deletions app/preprints/detail/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<div local-class='file-description'>
<div>{{t this.dateLabel}}: {{moment-format this.model.dateCreated 'MMMM DD, YYYY'}}</div>
{{#unless this.isMobile}}
<div> | </div>
<div> | </div>
{{/unless}}
{{#if this.isWithdrawn}}
<div>{{t 'preprints.detail.header.withdrawn_on'}}: {{moment-format this.model.preprint.dateWithdrawn 'MMMM DD, YYYY'}}</div>
Expand All @@ -87,7 +87,7 @@
@type='default'
>
{{if this.fullScreenMFR (t 'preprints.detail.collapse') (t 'preprints.detail.expand')}}
<FaIcon @icon='chevron-{{if this.fullScreenMFR 'left' 'right'}}' />
<FaIcon @icon='chevron-{{if this.fullScreenMFR 'left' 'right'}}' />
</Button>
</div>
{{/unless}}
Expand All @@ -111,7 +111,7 @@
data-test-download-button
data-analytics-name='downloads'
local-class='btn btn-primary'
@href={{ this.fileDownloadUrl }}
@href={{ this.fileDownloadUrl }}
>
{{t 'preprints.detail.share.download' documentType=this.model.provider.documentType.singular}}
</OsfLink>
Expand Down Expand Up @@ -153,15 +153,15 @@
</SharingIcons>
</div>
<Preprints::-Components::PreprintAbstract @preprint={{this.model.preprint}} />
{{#if this.model.node}}
{{#if this.model.preprint.node}}
<div>
<h4>{{t 'preprints.detail.supplemental_materials'}}</h4>
<OsfLink
data-test-supplemental-materials
data-analytics-name='supplemental material'
@href={{this.model.node.links.html}}
@href={{this.model.prepint.node.links.html}}
>
{{this.model.node.links.html}}
{{this.model.preprint.node.links.html}}
<FaIcon @icon='external-link-alt' />
</OsfLink>
</div>
Expand All @@ -173,7 +173,7 @@
<OsfLink
data-test-article-doi
data-analytics-name='peer review publication doi'
@href={{this.model.preprint.articleDoiUrl}}
@href={{this.model.preprint.articleDoiUrl}}
>
{{this.model.preprint.articleDoiUrl}}
</OsfLink>
Expand Down

0 comments on commit 7ce1e37

Please sign in to comment.