-
Notifications
You must be signed in to change notification settings - Fork 172
feat: file modification #3204
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
base: master
Are you sure you want to change the base?
feat: file modification #3204
Conversation
74fd0db to
d084022
Compare
6399b48 to
31db9d0
Compare
|
tests pass locally. it's because it needs rdm-records to be merged |
| rd_allowed = immediate.allowed or request.allowed | ||
| existing_request = get_existing_deletion_request(record.id) | ||
|
|
||
| if rd_allowed: |
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.
isn't the feature behind a flag? should we return all this information if f.e. we in CDS do not allow any record deletions?
4e69f25 to
dc62dd4
Compare
* currently the permission is whether you can unlock the files * but the files are only unlocked when you create the draft * as such as an admin when you edit a published draft, if it was created by a user it will look like the files are unlocked but this is false this PR correctly sets files_locked to whether the files are locked
e9b21d6 to
217bf3e
Compare
yashlamba
left a comment
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.
Reviewed avec @kpsherva
| "files": record["files"]["count"], | ||
| "internalDoi": record["pids"]["doi"]["provider"] != "external", |
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.
Question: Could you share why was this required here?
| fm_allowed = file_mod.allowed | ||
|
|
||
| file_modification = { | ||
| "enabled": file_mod.enabled, | ||
| "valid_user": file_mod.valid_user, | ||
| "allowed": fm_allowed, | ||
| } |
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.
| fm_allowed = file_mod.allowed | |
| file_modification = { | |
| "enabled": file_mod.enabled, | |
| "valid_user": file_mod.valid_user, | |
| "allowed": fm_allowed, | |
| } | |
| fm_allowed = file_mod.allowed | |
| file_modification = { | |
| "enabled": file_mod.enabled, | |
| "valid_user": file_mod.valid_user, | |
| "allowed": file_mod.allowed, | |
| } |
Also, the var names are a bit confusing given we have file_mod, file_modification, and then subkeys. Could it be refactored to something intuitive? (@kpsherva and I would like to understand the naming better for ex: file mod and file_modification, why are they different?)
| return null; | ||
| } | ||
|
|
||
| if (!filesLocked && record.is_published && fileModification.context?.days_until) { |
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.
nit: could be extract this logic out to a var?
| margin-bottom: 2rem; | ||
|
|
||
| .title { | ||
| .title:not(.ui) { |
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.
| .title:not(.ui) { | |
| & > .title { |
Suggested in other UI PR
❤️ Thank you for your contribution!
Description
See inveniosoftware/invenio-rdm-records#2178
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: