-
Notifications
You must be signed in to change notification settings - Fork 89
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
Optional doi fixes #1909
Optional doi fixes #1909
Conversation
@@ -152,6 +153,16 @@ export const save = (draft) => { | |||
type: DRAFT_SAVE_SUCCEEDED, | |||
payload: { data: response.data }, | |||
}); | |||
|
|||
if (draft.noINeedOne) { |
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.
sorry for commenting so late on this.
The variable name is a bit confusing without DOI context (it could be interpreted as anything and we will forget this)
how about something like
if (draft.noINeedOne) { | |
if (draft.DOIneededOption) { |
or at least noINeedDOI
please ignore if changing this is too complex now, can be done in a separate PR
return { | ||
...state, | ||
record: recordCopy, | ||
editorState: computeDepositState(recordCopy, action.payload.community), | ||
}; | ||
} | ||
case SET_DOI_NEEDED: { | ||
let recordCopy = { |
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.
let recordCopy = { | |
const recordCopy = { |
if "doi" not in required_schemes and not self.service.check_permission( | ||
identity, "pid_manage" | ||
): |
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.
for readability
if "doi" not in required_schemes and not self.service.check_permission( | |
identity, "pid_manage" | |
): | |
doi_required = "doi" in required_schemes | |
can_manage_dois = self.service.check_permission( | |
identity, "pid_manage" | |
) | |
if not doi_required and not can_manage_doi: |
bf7ebb2
to
4f8b7f9
Compare
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.
LGTM, I agree with the comments of Karolina :)
4f8b7f9
to
4b4650f
Compare
❤️ Thank you for your contribution!
Description
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: