Skip to content

Author interface for ROR, CRediT, and ORCiD in submission workflow #4697

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

Merged
merged 47 commits into from
Jun 5, 2025

Conversation

joemull
Copy link
Member

@joemull joemull commented Apr 7, 2025

Closes #4519.
Closes #3111.
Closes #4755.
Fixes #1485.

This follows the proposed design of #4519 as closely as possible. The ORCiD-based flow works really well, CRediT roles are easy to add, it's easy to change the correspondence author, and authors are easy to re-order.

However, there's a bit more work to do around editing co-author affiliations. We may need to move straight on to #145, which was out of scope for this PR but is a natural way to solve the problem of allowing maximum control over affiliation data, while not introducing security risks where bad actors could edit any user's affiliations.

image
image
image

@joemull joemull requested a review from ajrbyers April 7, 2025 15:54
@ajrbyers
Copy link
Member

ajrbyers commented Apr 7, 2025

@joemull can you check you've pushed everything? I think there are some missing imports on submission.logic.

@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Apr 7, 2025
@joemull
Copy link
Member Author

joemull commented Apr 8, 2025

I don't get any import errors @ajrbyers--was it on server start or on loading a page?

@joemull joemull assigned ajrbyers and unassigned joemull Apr 8, 2025
@ajrbyers
Copy link
Member

ajrbyers commented Apr 8, 2025

I don't get any import errors @ajrbyers--was it on server start or on loading a page?

Check submission.logic there are a bunch of function calls for things that are not imported:

orcid.get_orcid_record_details(cleaned_orcid)
generate_dummy_email(orcid_details)
utils_shared.generate_password()

@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Apr 8, 2025
@joemull
Copy link
Member Author

joemull commented Apr 8, 2025

Ah, right you are. I put the author search functionality in that file at the last minute. To guard against simple things like this, I should probably write quick view tests for each branch of the view's POST logic, eh?

@joemull joemull assigned mauromsl and unassigned joemull Apr 8, 2025
@joemull joemull requested a review from mauromsl April 8, 2025 10:12
@joemull
Copy link
Member Author

joemull commented Apr 14, 2025

We did a demo of this in the design meeting last week. Here are notes from that.

  • Maybe the help text for inviting a co-author to update their affiliations should explain that an account exists, and the co-author should try to log in and will be guided through the process. Something like: “This account may be inactive, and if so the user will be guided through the account activation process.”
  • For adding credit roles, use the same hide/display interaction as for correspondence authors, rather than displaying them all in a horizontal spread of buttons.
  • Avoid CSS reflow of Edit and Delete buttons on affiliation when a second author is added.
  • Consider changing the “Add affiliation manually” to “Add my affiliation” or similar to avoid the user expecting this button to appear as well for co-authors.
  • On other buttons, add the object of the action too, like “Remove author”, “Edit affiliation”, etc.

@joemull
Copy link
Member Author

joemull commented Apr 14, 2025

My other todos when this comes back from review:

  • Add translation tags?
  • Check accessibility of the “Change” dropdown - aria roles and states etc.
  • Add tests for each branch of the view logic
  • Author names should be h3s
  • Check the parsing of ORCiD data using Andy's ORCiD

@joemull joemull assigned joemull and unassigned ajrbyers and mauromsl Apr 15, 2025
@joemull joemull force-pushed the b-4519-ror-credit-submission branch from 0cefb4f to 5713e3d Compare April 18, 2025 11:54
@joemull joemull removed the request for review from mauromsl April 18, 2025 11:54
@joemull joemull assigned ajrbyers and unassigned joemull Apr 18, 2025
@joemull joemull added this to the v1.8.0 Tracker milestone Apr 18, 2025
Copy link
Member

@ajrbyers ajrbyers left a comment

Choose a reason for hiding this comment

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

Some general thoughts:

  • When attempting to update affiliations from ORCID using (https://orcid.org/0000-0003-2126-266X) I was informed that there were no affiliations. My public profile shows I have them. Are we using something else to find the user on ORCID? The email address this user has does not match one I have on ORCID.

  • When posting a CREDIT for an author can we return the user to that record so they don't need to scroll to find them?

  • Should we include a link for the submitting author to share with their co-author in this text "If this author's name, email, ORCiD, or affiliations need to be updated, please invite them to edit their profile on the Open Library of Humanities website."?

  • Lastly, could the CREDIT record items themselves be remove buttons and be on a single line? This would reduce the height of each record which was an issue we discussed.

[ Conceptualization X ] [ Formal Analysis X ] [ Investigation X ]

Some code comments in line.

def __init__(
self,
orcid_affiliation,
tzinfo=None,
Copy link
Member

Choose a reason for hiding this comment

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

Rather than set to None, why not set it to timezone.get_current_timezone() here?

@@ -710,6 +719,7 @@ def remove_credit(self, credit_role_text, article):
role=credit_role_text,
)
record.delete()
return record
Copy link
Member

Choose a reason for hiding this comment

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

Why is this being returned?

Copy link
Member Author

Choose a reason for hiding this comment

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

So the view can use it in the message that's printed for the user.

)

@patch('utils.orcid.get_orcid_record')
def test_affiliation_bulk_update_from_orcid_confirmed(self, get_orcid_record):
Copy link
Member

Choose a reason for hiding this comment

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

Test name here is a dupe of the one above.

else:
return redirect(reverse('core_edit_profile'))

orcid_details = orcid.get_orcid_record_details(cleaned_orcid)
Copy link
Member

Choose a reason for hiding this comment

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

What happens if the ORCID API request fails? We should handle that gracefully.

Copy link
Member Author

@joemull joemull Apr 23, 2025

Choose a reason for hiding this comment

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

It just gets an empty dict if there is an HTTPError in get_orcid_record, so it will be fine.

if emails:
email = emails[0]
else:
email = generate_dummy_email(orcid_details)
Copy link
Member

Choose a reason for hiding this comment

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

If this occurs there is no way to invite the author to update their record. Should we ask the submitting author for the person's email address in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's a bit wonky. If they have a valid orcid, I was anticipating they'd log in using orcid. That's the idea behind this message:

{% elif author.orcid %}
<p>
{% blocktrans %}
An account has been created using their ORCiD ID,
so they should select the ORCiD login option.
{% endblocktrans %}
</p>

Copy link
Member

@mauromsl mauromsl Apr 24, 2025

Choose a reason for hiding this comment

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

We are not flagging the account as active, so they won't be able to login with orcid.
And the email address is fake, so they won't be able to activate it either. I reckon for these authors (no email address) we should NOT create an account, only a FrozenAuthor record.

def test_submit_authors_get(self):
self.client.force_login(self.kathleen)
response = self.client.get(
f'/submit/{self.article.pk}/authors/',
Copy link
Member

@ajrbyers ajrbyers Apr 21, 2025

Choose a reason for hiding this comment

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

Why aren't we reversing the URL here? If the URL pattern changes the test will break. This is common across this module, sorry if I missed the reason for this but I found it odd.

Copy link
Member Author

Choose a reason for hiding this comment

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

The first few view tests I wrote for Janeway were based on the Django docs, which do not reverse URLs but write them out.

https://docs.djangoproject.com/en/4.2/topics/testing/tools/#overview-and-a-quick-example

Later I noticed this was different from the way they've been written in Janeway before. At this point I've added 50+ tests with literal URLs. Shall I reverse them?

@mauromsl mauromsl removed their assignment May 27, 2025
@ajrbyers ajrbyers self-requested a review May 27, 2025 16:17
@ajrbyers ajrbyers assigned ajrbyers and mauromsl and unassigned joemull May 27, 2025
@joemull joemull self-assigned this May 29, 2025
@joemull joemull removed their assignment Jun 4, 2025
@joemull joemull removed the request for review from mauromsl June 4, 2025 11:01
@joemull
Copy link
Member Author

joemull commented Jun 4, 2025

OK @ajrbyers this is ready for your review again. I tested it manually and made a few small fixes to the UI, including to the broken "Back to all authors" button.

@ajrbyers
Copy link
Member

ajrbyers commented Jun 5, 2025

I mainly tested the interface here, and am really happy with it. Going to hand this over to @mauromsl who is going to take a look over the code again.

@ajrbyers ajrbyers requested a review from mauromsl June 5, 2025 10:56
@ajrbyers ajrbyers assigned mauromsl and unassigned ajrbyers Jun 5, 2025
@mauromsl mauromsl force-pushed the b-4519-ror-credit-submission branch from a67bfa3 to 113253b Compare June 5, 2025 14:10
@mauromsl mauromsl merged commit eaabc7a into master Jun 5, 2025
@mauromsl mauromsl deleted the b-4519-ror-credit-submission branch June 5, 2025 14:13
@mauromsl mauromsl removed their assignment Jun 5, 2025
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.

Use frozen authors in submission Update the author submission screen Allow adding authors by ORCID (alone) Wiki update ORCID Information
3 participants