Skip to content

Commit

Permalink
Rename Preprint.preprintVersion property to version
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda committed Dec 26, 2024
1 parent f109ead commit f395bed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/models/preprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class PreprintModel extends AbstractNodeModel {
@attr('string') whyNoData!: string | null;
@attr('string') whyNoPrereg!: string | null;
@attr('string') preregLinkInfo!: PreprintPreregLinkInfoEnum;
@attr('number') preprintVersion!: number;
@attr('number') version!: number;
@attr('boolean') isLatestVersion!: boolean;

@belongsTo('node', { inverse: 'preprints' })
Expand Down
4 changes: 2 additions & 2 deletions app/preprints/-components/preprint-doi/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
as |version|
>
<span
data-test-preprint-version={{version.preprintVersion}}
data-test-preprint-version={{version.version}}
>
{{t 'preprints.detail.version_doi_title' number=version.preprintVersion}}
{{t 'preprints.detail.version_doi_title' number=version.version}}
</span>
</PowerSelect>
{{else}}
Expand Down
4 changes: 2 additions & 2 deletions app/preprints/detail/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
{{#each this.model.versions as |version|}}
<li local-class='version'>
<OsfLink
data-test-version-link='{{version.preprintVersion}}'
data-test-version-link='{{version.version}}'
@route='preprints.detail'
@models={{array this.model.provider.id version.id}}
>
{{t 'preprints.detail.preprint_version_number' number=version.preprintVersion}}
{{t 'preprints.detail.preprint_version_number' number=version.version}}
</OsfLink>
</li>
{{else}}
Expand Down
6 changes: 3 additions & 3 deletions mirage/factories/preprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default Factory.extend<PreprintMirageModel & PreprintTraits>({
dateWithdrawn: null,

doi: null,
preprintVersion: 1,
version: 1,
isLatestVersion: true,

tags() {
Expand Down Expand Up @@ -253,13 +253,13 @@ export default Factory.extend<PreprintMirageModel & PreprintTraits>({
provider: preprint.provider,
id: `${baseId}_v${version}`,
reviewsState: preprint.reviewsState,
preprintVersion: version,
version,
isLatestVersion,
});
});
preprint.update({
// A bit of a workaround since the API will return the latest version when getting baseId
preprintVersion: 3,
version: 3,
isLatestVersion: true,
});

Expand Down

0 comments on commit f395bed

Please sign in to comment.