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 15 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 12775079441

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 199 of 265 (75.09%) changed or added relevant lines in 12 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.3%) to 68.251%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/preprints/new-version/controller.ts 0 1 0.0%
app/preprints/-components/preprint-status-banner/component.ts 12 15 80.0%
app/preprints/-components/withdrawal-preprint/component.ts 1 5 20.0%
app/preprints/new-version/route.ts 9 13 69.23%
app/preprints/detail/route.ts 16 22 72.73%
app/preprints/detail/controller.ts 21 39 53.85%
app/preprints/-components/submit/preprint-state-machine/component.ts 58 88 65.91%
Totals Coverage Status
Change from base Build 12636251551: 3.3%
Covered Lines: 7421
Relevant Lines: 10493

💛 - 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
futa-ikeda and others added 9 commits January 2, 2025 09:29
-   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
-   Ticket: [ENG-6814]
-   Feature flag: n/a

## Purpose
- Show helpful toast message if the request to create a new version returns a 409 error

## Summary of Changes
- Fix logic for how to display toast error
- Update template so the "Create new version" button is disabled when the task is running
- Update page-not-found reroute logic to be more robust
-   Ticket: [ENG-6815] [ENG-6843]
-   Feature flag: n/a

## Purpose
- Fix issues of "Edit" and "Edit and Resubmit" button showing up at inappropriate preprint states

## Summary of Changes
- Update condition to show Edit button
  - Only read-write and admin contributors should be able to edit
  - Only latest version should be editable
  - Non-initial, rejected (pre-mod) versions should not be editable
-   Ticket: [ENG-6822] [ENG-6871]
-   Feature flag: n/a

## Purpose
- Fix an issue where the preprint status banner doesn't update when selecting a different version

## Summary of Changes
- Refactor status banner component to use arguments instead of a cached arg reference
-   Ticket: [ENG-6461] [ENG-6462]
-   Feature flag: n/a

## Purpose
- Move "Withdraw" button out of the edit workflow and onto preprint detail page

## Summary of Changes
- Move the "Withdraw" button out of the `ActionFlow` component and onto the detail page
  - Move logic for fetching preprint/withdraw-request state out of the `ActionFlow` component and into route's `model` hook
  - Move `onWithdrawal` callback to detail controller
  - Refactor `withdraw-preprint` component to take multiple arguments instead of relying on a manager component
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