Skip to content

897 add relateditem field to UI#906

Merged
jsjiang merged 24 commits intodevelopfrom
897_add_relateditem_field_to_ui
Jul 28, 2025
Merged

897 add relateditem field to UI#906
jsjiang merged 24 commits intodevelopfrom
897_add_relateditem_field_to_ui

Conversation

@jsjiang
Copy link
Copy Markdown
Contributor

@jsjiang jsjiang commented Jul 21, 2025

Here are the major changes:

Changes to datacite_xml.py:

  • added relatedItem to _repeatableElementContainers and form colleciton formColl
  • defined _elementList_relatedItem to handle embedded elements with different topological order than what they appear at the element level.
  • moved test datasets and test code to tests/test_datacite.py

Changes to form_object.py:

  • defined RelatedItemForm class
  • initialized formset RelatedItemSet
  • added validation functions for the relatedItem form
  • added relatedItem to the form data processing function getIdForm_datacite_xml()
  • changed a few select options lists from local variable to global so they can be shared by different functions

Changes to jquery.formset.twobutton.js:

  • refactored the clearField function
  • replaced duplicated code with the clearField function
  • provided a bug fix to the addButton.click(function() by clearing fields after clone the sub-form; otherwise the selected value of the last sub-form will stay

Other changes:

  • added form template _datacite_relatedItem.html
  • added test cases to test_datacite.py to test form and Datacite XML data conversions:
    • formElementsToDataciteXml()
    • dataciteXmlToFormElements(mockxml_datacite)
  • added test_relateditem_form.py to test the related item form
  • defined a function get_field to access form field names with hyphens

@jsjiang jsjiang requested a review from sfisher July 21, 2025 14:58
@jsjiang
Copy link
Copy Markdown
Contributor Author

jsjiang commented Jul 21, 2025

@sfisher Hi Scott, can you take a look at the pull request when you have time.
Thank you!

Jing

@jsjiang jsjiang changed the base branch from main to develop July 28, 2025 21:20
@jsjiang jsjiang merged commit 1887766 into develop Jul 28, 2025
1 check 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.

1 participant