MESH-Research / knowledge-commons-works

The next-generation research repository for the Knowledge Commons (formerly Humanities Commons)
https://hcommons.org
MIT License
4 stars 0 forks source link

User should be able to add self as contributor to new work #584

Closed mikethicke closed 2 weeks ago

mikethicke commented 1 month ago

Describe the bug

When a user tries to add themselves as a contributor to a Work, sometimes their name(s) go into incorrect fields, and sometimes they fail to be added at all.

To Reproduce

  1. Log in to HCommons (as Rand Test user, if possible)
  2. Click on "Add a Work"
  3. Click on "Contributors and Funding"
  4. Click on "Add myself"
  5. Possible failure states: a. Nothing happens b. User's full name is added to the surname(s) field and nothing appears in the first name(s) field
  6. In case of 4b, save the contributor
  7. Click on "Files" and upload a sample file
  8. Click on "Save & Publish" and click the "Preview" button
  9. Notice that the user's name is presented as undefined FULL_NAME

Expected behavior

User's surname, first name, affiliation (if present) and username should be correctly prefilled into the surname(s) and first name(s) fields.

The name should not contain "undefined" by default when presented on the preview page.

Additional context

See Issues #2 and #9 on the spreadsheet.

Screenshot Screenshot of the preview page where the name is prefixed with 'undefined'

mikethicke commented 1 month ago

Rand Test is an example user whose full name is added to the surname field.