{"action":"created","issue":{"url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints/issues/626","repository_url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints","labels_url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints/issues/626/labels{/name}","comments_url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints/issues/626/comments","events_url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints/issues/626/events","html_url":"https://github.com/CenterForOpenScience/ember-osf-preprints/pull/626","id":362980651,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NTMzMzAz","number":626,"title":"[Ready for Review][Need QA Prep] Feature/Divorce Front End [ember-osf-preprints] [IN-98]","user":{"login":"pattisdr","id":9755598,"node_id":"MDQ6VXNlcjk3NTU1OTg=","avatar_url":"https://avatars2.githubusercontent.com/u/9755598?v=4","gravatar_id":"","url":"https://api.github.com/users/pattisdr","html_url":"https://github.com/pattisdr","followers_url":"https://api.github.com/users/pattisdr/followers","following_url":"https://api.github.com/users/pattisdr/following{/other_user}","gists_url":"https://api.github.com/users/pattisdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pattisdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattisdr/subscriptions","organizations_url":"https://api.github.com/users/pattisdr/orgs","repos_url":"https://api.github.com/users/pattisdr/repos","events_url":"https://api.github.com/users/pattisdr/events{/privacy}","received_events_url":"https://api.github.com/users/pattisdr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-23T21:52:14Z","updated_at":"2018-10-03T02:57:01Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints/pulls/626","html_url":"https://github.com/CenterForOpenScience/ember-osf-preprints/pull/626","diff_url":"https://github.com/CenterForOpenScience/ember-osf-preprints/pull/626.diff","patch_url":"https://github.com/CenterForOpenScience/ember-osf-preprints/pull/626.patch"},"body":"⭐️ Ember-osf-preprints changes stable, although I am still actively writing tests. Ready for review.\r\n### In progress\r\n- [x] Legacy front-end changes from demo (not part of this PR)\r\n- [x] Fix preprint files needing guids to render\r\n- [x] Spanish translations - skipping\r\n- [ ] Need to change the color of the disconnect button\r\n- [ ] Tests for new behavior\r\n- [ ] Auditing analytics - what analytics were added/removed/modified?\r\n- [ ] Uncaught error if supplemental project is private on preprint detail page (I am trying to catch it, I don't know what is wrong)\r\n- [ ] Double checking error-handling for new sections\r\n\r\n## Related Links\r\n[Back End](https://github.com/CenterForOpenScience/osf.io/pull/8640) \r\n[Ember-OSF\r\n](https://github.com/CenterForOpenScience/ember-osf/pull/417)[Front End](https://github.com/CenterForOpenScience/ember-osf-preprints/pull/626)\r\n\r\n[ Demo Round One\r\n](https://www.notion.so/cos/Intermediate-Demo-Divorce-Front-End-259e1002cca64025a21eb130c2ad58b1\r\n)[Demo Round Two\r\n](https://www.notion.so/cos/Demo-Round-Two-Divorce-Front-End-46eb2150a13b4449a877b5eb1379b6b6)\r\n\r\n## Purpose\r\nThis PR attempts to make the minimum number of changes necessary to get in the backend divorce code. The backend required a huge overhaul, so keeping the front-end changes as small as possible will help with testing.  We still save by section, but nodes are no longer edited on the preprint form.\r\n\r\n\r\n## Summary of Changes/Side Effects\r\n- No updates made to node. All fields are stored on the preprint.\r\n- \"upload\" choices reduced.  You can either create a new preprint, or copy a file from a project to create your preprint.\r\n- All contributors can access the \"Edit\" form.  Write contribs can make a considerable amount of edits now, aside from modifying contributors, resubmitting the preprint, etc. Write/read can remove themselves as contributors.\r\n- You can attach a node as a supplementary project.\r\n- Preprint detail page has removed supplemental files browser. Supplemental project is linked at the top by authors.\r\n\r\n\r\n## Testing Notes\r\n*Thorough* testing of creating a preprint, editing a preprint, and viewing a preprint needed.  Even if behavior appears the same in places, where the code is getting called has often been rearranged, so we need to make sure we're seeing what is expected.  Extra attention should be paid to \"File\" sections and \"Supplemental materials\" and \"Authors\"\r\n- General notes:  Verify behavior on osf preprints as well as multiple providers (a pre and post moderation provider).  Preprints should be created prior to the data migration for this, with preprints in different states - private preprints, preprints with file removed, preprints with project deleted, abandoned preprints, A-OK preprints...Verify that post-migration, you can see everything you expect to see.  The original project for those preprints is now their supplemental project. \r\n### File Section\r\n#### Upload from your computer\r\n- Uploading a file and adding a title should:\r\n1. Create a preprint with the added title and provider\r\n2. Upload file to created preprint\r\n3. Update the preprint with the newly updated file as the primary file\r\n- Verify \"Back\" button returns you to initial file choice and clears pre-uploaded file and title\r\n- Verify save button turns green when \"Save and continue\" is finished\r\n- Verify \"Save and continue\" button is disabled while file is saving\r\n- If part of the request series fails, and you attempt to hit \"Save and continue\" again, the requests should work and you should proceed to the next form section.  \r\n  - If file successfully uploaded, but not set as primary file, when you attempt to resave, file upload request not reattempted, as long as the file has stayed the same.  Instead, we fetch the already uploaded file (prevents 409's). \r\n- Verify that no nodes were created when you hit \"Save and continue\"\r\n#### Select from existing project\r\n- Choices in this section are reduced. There used to be four combinations of choices possible, now you only have one - to pick a file from an existing project that will be *copied* to your *preprint*. You pick a project, then pick a file, then add a title.\r\n- Projects that appear in dropdown are public projects and components that you have admin permissions to. It no longer matters if that project has been linked to multiple preprints. A project can now be the supplemental project for multiple preprints. The one preprint per provider per node constraint has been removed.\r\n- Verify that when you select your project, file picker automatically opened for you.\r\n- Verify that when you select your file, title section automatically opened for you, and it is pre-populated with the node's title.\r\n- Verify changing your project updates the file picker and removes the title section.\r\n- Verify changing your file does not change your already added title.\r\n- Verify hitting \"Back\" resets the project picker\r\n- Verify that you can't hit \"Save and continue\" without a title\r\n- Verify title length has increased to 512 characters\r\n- Hitting \"save and continue\" should:\r\n1. Create the preprint with the given title and provider\r\n2. Send a WB request to the node which copies that node's file to the preprint \r\n3. Updates the preprint with the node's description and tags and sets the newly copied file as the primary file on your preprint.  You can edit the description and tags later.\r\n4. All of the node's contributors are copied to the preprint.  If the request fails, this is ignored.\r\n- Verify \"Save and continue\" disabled while all these requests are occurring\r\n- Verify that no nodes were created when hitting \"Save and continue\"\r\n- Preprint file uploaded! toast message on success\r\n#### Updating file version or title\r\n- Verify when you click on \"File\" section after file has been uploaded, the nested \"Preprint File\" and \"Preprint Title\" sections are collapsed.\r\n- Verify editing the title only sends a request to update the title \r\n- Verify that updating the file with a file of a different name fails with a \"This is not a version of the current preprint file\" or similar toast message\r\n- Verify behavior when uploading a new version (that hasn't actually changed). Uploading a version 2 will say Version 2 in preview. Upon \"Save and continue\", after attempting to update WB, it will realize the file hasn't actually changed and revert back to Version 1 in the preview.\r\n- Staged (unsaved) edits to a primary file or title will turn the save button red.\r\n- A save will automatically advance to the next section \r\n- Verify \"write\" contributors can now edit all parts of this section on Edit Preprint page\r\n\r\n### Basics section\r\n- Section has swapped places with discipline.\r\n- Verify that if you chose an existing file from a project, the original node's description and tags have been copied into the form. If you uploaded a new preprint file, the fields are blank.\r\n- Hitting \"Save and continue\" updates the preprint with license information, tags, description, original publication date, and doi if these items were updated.\r\n- Verified no node requests are made, just preprint.\r\n- Verify discard changes resets the basics section to the last saved state\r\n- Verify only saved changes show up in Basics preview\r\n- Verify unsaved changes in description, tags, doi, license, or original pub date turn the save button red. Manually undoing the changes or hitting \"discard\" resets the save button to green.\r\n- Bug fix, changing original pub date, then changing back to already saved date turns save button green. savedstate recognizes that date is the same.\r\n- Verify bug fix, after you've saved an original publication date, you can then clear it and save (use case, original publication date saved in error)\r\n- Hitting the \"save\" button turns the save button green and advances to the discipline section\r\n- Verify \"write\" contributors can now edit all parts of this section on Edit Preprint page\r\n\r\n### Discipline Section\r\n- Barely any changes made to this section - Discipline section only swapped places with basics section\r\n- Verify \"write\" contributors can now edit all parts of this section on Edit Preprint page\r\n- Verify that saving discipline section advances to the authors section\r\n- Verify a request is made to the update the preprint \r\n- Verify unsaved changes turn the save button red, that 'discard changes' reverts to the last save state, and 'save and continue' saves changes and turns the save button green\r\n- Verify manually setting the disciplines back to the last save state turns the save button green\r\n\r\n### Authors section\r\n- Verify that if you copied a preprint file from an existing node, that node's contributors have been copied to the preprint.  If you uploaded a new preprint file, you should see only one contributor, yourself.\r\n- Verify that any edits to contributors are making changes to *preprint contributors*, no requests are being made to the node.\r\n- Verify that the creator of the preprint *cannot* remove themselves on the Submit page, but can remove themselves on the Edit page, provided contributor rules are adhered to (at least one other admin contrib/bibliographic contrib)\r\n- Verify that if you remove yourself as an author, you are automatically redirected to the Preprints Index page, with a toast message saying you've removed yourself\r\n- Verify that if an admin contributor downgrades their own permissions from \"Admin\" -> \"Write\", the UI instantly disables their contributor options, to only being able to remove themselves.\r\n- Verify that if an admin contributor downgrades their own perms from \"Admin\" -> \"Read\" on Edit, the UI instantly disables their contributor options, and all form sections but Authors are removed. Their only option is to now remove themselves as author, as they are only a Read author.\r\n- Verify that Write contributors and Edit contributors can remove themselves only. This is the only edit they can make to the authors section.  Anything else they try to click on is disabled.\r\n- Verify that Read contributors only see the authors section on Edit, and that the Authors section is automatically opened for them. \r\n- Verify UI always prevents author rules from being broken.  If you only have one bibliographic contributor left, you cannot remove it, or remove their bibliographic status. If you only have one admin contributor left, you cannot remove them, or downgrade their permissions.  These form options will be disabled.\r\n- Verify searching for authors works\r\n- Verify adding contributors works (on Submit, no email is sent). They are given write perms and bibliographic = True by default\r\n- Verify changing permission/bibliographic updates preprint contributor and request is sent immediately\r\n- Verify removing preprint contributor deletes preprint contributor immediately\r\n- Verify adding unregistered author works\r\n- Verify continue button advances to next form section\r\n- Verify reordering contributors works as expected\r\n\r\n### Supplemental Materials section\r\n#### Submit\r\n##### Connecting an existing project\r\n- Verify that Supplemental Materials(optional) section starts with no project connected\r\n- Verify clicking on \"Connect an existing OSF Project\" opens to the project picker\r\n- Verify selecting a project turns the \"Save\" button red\r\n- Verify hitting \"Back\" clears the project\r\n- Verify hitting \"Save and continue\" turns the save button green, and *locally* stages that project as the connected project.  The form preview will say \"Connected OSF Project\", but we won't actually send a request to connect this until \"Submit preprint\" is clicked.\r\n- Verify hitting \"Back\" after the selected project has been locally staged does not clear the project\r\n- Verify you can't click save and continue without project being selected\r\n- Verify hitting \"Skip\" clears the project.\r\n- Verify hitting \"Submit preprint\" sends a request to turn the selected project public if it wasn't already and sets the project as the supplemental project on the preprint\r\n\r\n##### Create a new OSF Project\r\n- Verify clicking \"Create a new OSF project\" opens to a title editor with \"Supplemental materials for + <preprint title> autopopulated\r\n- Verify you can't click save and continue without title being populated\r\n- Verify \"Back\" clears the title\r\n- Verify \"Save and continue\" locally stages that title - You will see Connected OSF Project: <the title I just entered>.  However we don't actually send the request to create the project until \"Submit preprint\" is clicked. This is to prevent a bunch of extra projects inadvertently being created as the user changes their mind\r\n- Verify hitting back after save does not remove the staged title. \r\n- Verify hitting \"Skip\" removes the staged title.\r\n- Verify hitting \"Submit Preprint\" sends a request to create a new public OSF project with the title you specified. This newly created project is set as your supplemental project.\r\n\r\n### Supplemental Materials - EDIT\r\n- Verify both admin/write can edit\r\n- If supplemental project is connected, and you are on the Edit preprint page, you either have an option to \"Change the connected project\" or \"Disconnect the project\"\r\n- Verify \"Skip\" closes the form section and discards any unsaved changes.  If project was previously connected, this project should remain connected\r\n- Clicking \"Change the connected project\" gives you the same Supplemental materials options you had on Submit: \"Connect an existing OSF project\" or \"Create a new OSF project\".  The \"Back\" button moves you back to your first option: Change or Disconnect.\r\n- Verify selecting a project from the dropdown that is already connected shows the green save button because saving won't actually do anything.\r\n- If you connect an existing project and click \"Save and continue\", your changes are saved immediately, unlike Submit. The project is turned public, if it wasn't already.\r\n- If you connect a new project, and click \"Save and continue\", a public project is created immediately and saved as your supplemental project. Title was autopopulated for you on the first time the section was opened, but you can edit.\r\n- When connecting a new project, if you enter in an identical title to the already connected supplemental project, the save button is red, because you are intending to create a new project.\r\n- Clicking \"Disconnect\" immediately sends a PATCH request to remove the project from your preprint.  You get a toast message confirming it was removed and the form section is closed. If you reopen the supplemental section, you go straight to your \"Connect an existing\" or \"Create new project\" options.  You don't see the \"Change or Disconnect\" optinos because no project is connected.\r\n- If the supplemental project has been made private, and I don't have permissions to that project, the preview section says \"Private supplemental project\"\r\n\r\n### Submitting your preprint - Edit section\r\n- If pre-moderation and preprint is rejected, write contributors should see a message that they have to be an admin to resubmit\r\n- Write/read can only return to preprint\r\n- Where applicable, admin only have the option to resubmit preprint \r\n\r\n### Preprint Detail Page\r\n- Verify supplemental project is linked at the top, if one exists\r\n- Verify if no supplemental project, or supplemental project has been turned private, there is no link\r\n- Verify that if preprint is private (spam preprints or legacy preprints, usually), a red banner shows that they need to contact support\r\n- If preprint uses pre-moderation or post-moderation and preprint is also private, only private banner is shown, not reviews banner\r\n- Verify supplemental files browser is gone from beneath the preprint.\r\n- Verify you can still download the preprint from the top right button\r\n- Verify preprint download button is removed from below the preprint\r\n- Verify you can still download preprint versions and the downloaded files are what you expect\r\n- Verify toggling to make preprint full screen still works and no javascript errors in console\r\n- Verify \"Edit preprint\" button now shows for *all* preprint authors, not just admin.  Non-authors, unauthenticated still can't see this button.\r\n- Verify preprints can only be viewed by non-authors if they are published and public.  Preprints that were abandoned halfway through, preprints that have been made private, preprints whose files have been deleted (still possible w/ legacy preprints), preprints w/ pre-moderation that are still pending, or pre-mod/post-mod that have been rejected....verify that they are not visible! You will see a Not Found page.\r\n- Verify that a private supplemental project that the logged-in user does not have permission to see does not affect the preprint itself from loading\r\n- Cannot manually navigate to \"Edit\" if you are not a contributor on the *preprint*\r\n- Verify \"can comment\" behavior works as before\r\n\r\n\r\n\r\n## Ticket\r\n\r\nhttps://openscience.atlassian.net/browse/IN-98\r\n\r\n## Notes for Reviewer\r\n<!-- Any area you want the reviewer to pay special attention to or areas of concern?-->\r\n\r\n\r\n# Reviewer Checklist\r\n\r\n- [ ] meets requirements\r\n- [ ] easy to understand\r\n- [ ] DRY\r\n- [ ] testable and includes test(s)\r\n- [ ] changes described in `CHANGELOG.md`\r\n\r\n<!-- Please strike through any checks that you think are not relevant for this PR and indicate why, e.g.\r\n\r\n     - [ ] ~~easy to understand~~ *(necessarily complex)*\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints/issues/comments/426496125","html_url":"https://github.com/CenterForOpenScience/ember-osf-preprints/pull/626#issuecomment-426496125","issue_url":"https://api.github.com/repos/CenterForOpenScience/ember-osf-preprints/issues/626","id":426496125,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjQ5NjEyNQ==","user":{"login":"alexschiller","id":1322421,"node_id":"MDQ6VXNlcjEzMjI0MjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1322421?v=4","gravatar_id":"","url":"https://api.github.com/users/alexschiller","html_url":"https://github.com/alexschiller","followers_url":"https://api.github.com/users/alexschiller/followers","following_url":"https://api.github.com/users/alexschiller/following{/other_user}","gists_url":"https://api.github.com/users/alexschiller/gists{/gist_id}","starred_url":"https://api.github.com/users/alexschiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexschiller/subscriptions","organizations_url":"https://api.github.com/users/alexschiller/orgs","repos_url":"https://api.github.com/users/alexschiller/repos","events_url":"https://api.github.com/users/alexschiller/events{/privacy}","received_events_url":"https://api.github.com/users/alexschiller/received_events","type":"User","site_admin":false},"created_at":"2018-10-03T02:57:01Z","updated_at":"2018-10-03T02:57:01Z","author_association":"MEMBER","body":"Also, I think my goal right now is determine what are blockers vs nice to haves. Would be lovely to get this on Staging 2 or 3 and then Yuhuai and I can help knock out some of the smaller updates/bugs that inevitably come up. "}}
{"actor":{"display_login":"alexschiller"}}