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

Optional doi fixes #1909

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Conversation

zzacharo
Copy link
Member

❤️ Thank you for your contribution!

Description

Please describe briefly your pull request.

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:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@@ -152,6 +153,16 @@ export const save = (draft) => {
type: DRAFT_SAVE_SUCCEEDED,
payload: { data: response.data },
});

if (draft.noINeedOne) {
Copy link
Contributor

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

Suggested change
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 = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let recordCopy = {
const recordCopy = {

Comment on lines 110 to 112
if "doi" not in required_schemes and not self.service.check_permission(
identity, "pid_manage"
):
Copy link
Contributor

Choose a reason for hiding this comment

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

for readability

Suggested change
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:

Copy link
Contributor

@ntarocco ntarocco left a 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 :)

@zzacharo zzacharo merged commit 834976d into inveniosoftware:master Dec 16, 2024
4 checks passed
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