Skip to content

Commit

Permalink
Update biography DEFAULTSORT autofill to work with paranthetical disa…
Browse files Browse the repository at this point in the history
…mbiguation (#225)

* When accepting biography, autofills name when there is a paranthetical disambiguation

* Update comment to reflect removing disambig when autofilling

* revert change to package.json because it will cause a merge conflict

* fix 3 code review suggestions

---------

Co-authored-by: kzhovn <[email protected]>
Co-authored-by: NovemLinguae <[email protected]>
  • Loading branch information
3 people authored Apr 9, 2024
1 parent 8914696 commit 41824d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1704,9 +1704,11 @@
function prefillBiographyDetails() {
var titleParts;

// Prefill `LastName, FirstName` for Biography if the page title is two words and
// Prefill `LastName, FirstName` for Biography if the page title is two words
// after removing any trailing parentheticals (likely disambiguation), and
// therefore probably safe to asssume in a `FirstName LastName` format.
titleParts = afchSubmission.shortTitle.split( ' ' );
var title = afchSubmission.shortTitle.replace( / \([\s\S]*?\)$/g, '' );
titleParts = title.split( ' ' );
if ( titleParts.length === 2 ) {
$afch.find( '#subjectName' ).val( titleParts[ 1 ] + ', ' + titleParts[ 0 ] );
}
Expand Down

0 comments on commit 41824d1

Please sign in to comment.