Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-6813] FE Reference PR for Preprints DOI Versioning #2447

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

cslzchen
Copy link
Collaborator

@cslzchen cslzchen commented Jan 1, 2025

Purpose

FE Reference PR for Preprints DOI Versioning

This is an reference PR for the project implementation; this is not the final PR for code review.

Summary of Changes

N/A

Screenshot(s)

N/A

Side Effects

N/A

QA Notes

N/A

-   Ticket: [ENG-6447]
-   Feature flag: n/a

## Purpose
- Update the Preprint model to add new version-specific fields

## Summary of Changes
- Add new `preprintVersion` and `isLatestVersion` attrs to Preprint
- Add new `versions` relationship to Preprint
  - This won't be returned from the API, but the preprint response should have a `preprint_version` URL that can be used to get versions, hence the chicanery with the preprint-serializer
- Add new mirage view to handle fetching versions
- Add new trait to preprint factory to quickly create versions for a given preprint
-   Ticket: [ENG-6448]
-   Feature flag: n/a

## Purpose
- Update preprint-doi component to handle versions

## Summary of Changes
- Update Preprints::PreprintDoi component 
  - Takes an array of versions, rather than a single preprint
  - Add dropdown to select a specific version
  - Tests
)

-   Ticket: [ENG-6434]
-   Feature flag: n/a

## Purpose
- Add logic to show/hide the file upload step on the preprint submission/edit workflow

## Summary of Changes
- Add a new flag `displayFileUploadStep` that controls whether or not the file upload step is shown
  - Should be shown for initial preprint submission
  - Should be shown for rejected preprint re-submission
…#2423)

-   Ticket: [ENG-6459] [ENG-6637] [ENG-6638]
-   Feature flag: n/a

## Purpose
- Add a new "Create new version" button to the preprint detail page

## Summary of Changes
- Add a new `canCreateNewVersion` attr to preprint model
  - Only admins can create a new version
  - Only preprints that is the latest version can create a new version
  - Only preprints that are were published at some point (whether they are withdrawn or not, doesn't matter)
- Update tombstone page for preprint versions
-   Ticket: [ENG-6460] [ENG-6640]
-   Feature flag: n/a

## Purpose
- Add a new workflow to create a new preprint version

## Summary of Changes
- Add a new `preprint.new-version` route
- Add a new `newVersion` argument to the submission-flow component
  - Invoke `submission-flow` component in the new-version route
-   Ticket: [ENG-6470]
-   Feature flag: n/a

## Purpose
- Add a version select dropdown to the tombstone page

## Summary of Changes
- Add dropdown to tombstone page header to view prior versions
- Update tests
@coveralls
Copy link

coveralls commented Jan 1, 2025

Pull Request Test Coverage Report for Build 12600881784

Details

  • 155 of 200 (77.5%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.1%) to 68.034%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/preprints/detail/route.ts 1 2 50.0%
app/preprints/new-version/controller.ts 0 1 0.0%
app/preprints/new-version/route.ts 9 13 69.23%
app/preprints/detail/controller.ts 4 13 30.77%
app/preprints/-components/submit/preprint-state-machine/component.ts 59 89 66.29%
Totals Coverage Status
Change from base Build 12282491781: 3.1%
Covered Lines: 7399
Relevant Lines: 10483

💛 - Coveralls

@cslzchen cslzchen changed the title [ENG-6812] FE Reference PR for Preprints DOI Versioning [ENG-6813] FE Reference PR for Preprints DOI Versioning Jan 1, 2025
-   Ticket: [ENG-6471]
-   Feature flag: n/a

## Purpose
- Add version statuses for pending, rejected, and withdrawn versions

## Summary of Changes
- Add version status to Version DOI selector
- Add version status to Withdrawn page's version selector dropdown
-   Ticket: [ENG-6803]
-   Feature flag: n/a

## Purpose
- Indicate currently viewed version in the preprint DOI selection dropdown

## Summary of Changes
- Add a `currentVersion` param to the preprint-doi component
  - Have this version be the selected one by default
  - Add bold font style to current version
-   Ticket: [ENG-6804]
-   Feature flag: n/a

## Purpose
- Add a link to the version when selecting a different version in the DOI selection dropdown

## Summary of Changes
- Add link to preprint DOI dropdown
- Update tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants