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-6815][ENG-6843] Update condition to show edit button #2460

Conversation

futa-ikeda
Copy link
Contributor

@futa-ikeda futa-ikeda commented Jan 8, 2025

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

Screenshot(s)

Side Effects

QA Notes

Copy link
Contributor

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One non-blocking comment.

@@ -78,8 +78,7 @@ module('Acceptance | preprints | detail', hooks => {
await visit('/preprints/osf/test');

// Check edit and new version buttons
assert.dom('[data-test-edit-preprint-button]').exists('Edit button is displayed');
assert.dom('[data-test-edit-preprint-button]').containsText('Edit', 'Edit button text is correct');
assert.dom('[data-test-edit-preprint-button]').doesNotExist('Edit button is not displayed for prior versions');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good opportunity to add tests for the other conditions this ticket covers.

app/preprints/detail/controller.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally 🎆

app/preprints/detail/controller.ts Show resolved Hide resolved
@futa-ikeda futa-ikeda changed the title [ENG-6815] Update condition to show edit button [ENG-6815][ENG-6843] Update condition to show edit button Jan 10, 2025
@futa-ikeda futa-ikeda merged commit 9366206 into CenterForOpenScience:feature/preprints-doi-versioning Jan 10, 2025
9 checks passed
@futa-ikeda futa-ikeda deleted the preprint-edit-button-conditional branch January 10, 2025 15:59
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