-
Notifications
You must be signed in to change notification settings - Fork 325
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
[Need QA Prep] Feature/The Node-Preprint Divorce [PLAT-555][PLAT-480][PLAT-559][PLAT-561][PLAT-1168] #8640
[Need QA Prep] Feature/The Node-Preprint Divorce [PLAT-555][PLAT-480][PLAT-559][PLAT-561][PLAT-1168] #8640
Conversation
[#PLAT-509]Django-guardian for preprint permissions
400c5d0
to
849436f
Compare
…ize CollectionWriteOrPublicForRelationshipPointers.
…ctions2 [Migration Required] Feature/NPD Add Preprints to Collections [PLAT-1190]
Latest commits headed to staging3 |
[fix] Add CollectionMixin to CollectionList view [PLAT-1190]
Can you get these latest few commits on staging3 @sloria ? |
Latest commits are headed to staging3. |
@@ -11,7 +11,7 @@ | |||
<% from osf.models import Guid %> | |||
${Guid.objects.get(_id=key).referent.title} | |||
%if parent : | |||
<small style="font-size: 14px;color: #999;"> in ${AbstractNode.load(parent).title}</small> | |||
<small style="font-size: 14px;color: #999;"> in ${Guid.objects.get(_id=parent).referent.title}</small> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ivate if turning the project private.
- Add is_deleted property to Preprint model.
…o see preprint status.
@@ -665,7 +665,7 @@ def check_external_auth(user): | |||
|
|||
@block_bing_preview | |||
@collect_auth | |||
@must_be_valid_project | |||
@must_be_valid_project(preprints_valid=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -84,6 +84,8 @@ def must_be_valid_project_inner(func): | |||
@functools.wraps(func) | |||
def wrapped(*args, **kwargs): | |||
if preprints_valid and Preprint.load(kwargs.get('pid')): | |||
_inject_nodes(kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must_be_valid_project
was modified as a part of the divorce if preprints_valid=True
passed in, then it would work for preprints. called _inject_nodes
will add kwargs['node'] = Preprint object. Then claim_user_registered
will have the Preprint object as node
, and all methods in that function will work for a node or preprint.
There might be some confusion over "node" language referring to a preprint - at some point, we might want to generalize the language in a few places that nodes and preprints both use, (resource, or similar), but I think this is low priority.
…s as a valid collected_type for existing collections. - Use the Collection - collected_types through table to remove preprints from collected_types.
a229204
to
e1852c4
Compare
This is merged into master via |
Reticketed from #8422
Related PR's
Back End
Ember-OSF
Front End
TODO List
❗️ After running data migration, you need to run this elastic search migration script
Purpose
Removes the dependency of Preprints on Nodes. Nodes can house supplemental files for a preprint, but beyond that, Preprints are completely independent.
Ticket contains:
How to create a preprint in the API
Step 1: Start Preprint
POST http://localhost:8000/v2/preprints/
Required fields are title and provider
Step 2 Upload new file to preprint, or copy file from existing node:
Uploading new file
GET http://localhost:8000/v2/preprints/nmqp6/files/
and thenCopying file from supplementary node
Get "move" link from supplementary node and then POST to move link where resource is the preprint id, action is copy, and provider is osfstorage.
GET http://localhost:8000/v2/nodes/4u3mk/files/osfstorage/
and thenStep 3 - Update preprint to set newly uploaded file as primary file, add subjects if not there already, (supplementary node optional) and publish
Changes
Too many to list, here are some of them.
Admin App
API
v2/preprints/
(title, provider are required fields) 2) Use WB links to upload or move file to created preprint 3) PATCH tov2/preprints/<preprint_id>/
to finish up process.Elastic Search
scripts/remove_after_use/node_preprint_es.py
)Modeling
Preprint File
Legacy UI
Supplemental project attached to withdrawn preprint - status says Withdrawn
Withdrawn preprint still shows up for a user on My Projects page. Is marked as withdrawn.
Published preprints show up on My Projects page
My private preprints still show up on My Projects page
Selecting multiple preprints on My Projects page
Elastic search before migration - 2 preprints 3 projects
Elastic search after migration - 2 preprints 5 projects (2 projects formerly indexed as preprints were reindexed as projects)
Preprint files don't have links, but you can click on preprint link. File detail for preprint page is blocked.
QA Notes
Many many things to test. A lot of Node code was adapted to work for preprints so we want to make sure we didn't break things. Preprints front-end is not addressed here.
To check on Node
To check on preprint
Checking migration
Side Effects
Ticket