Skip to content

fix: Allow additional draft forms to be added to IPR disclosure edit form#4952

Merged
rjsparks merged 3 commits into
ietf-tools:mainfrom
painless-security:jennifer/ipr-edit-js
Jan 6, 2023
Merged

fix: Allow additional draft forms to be added to IPR disclosure edit form#4952
rjsparks merged 3 commits into
ietf-tools:mainfrom
painless-security:jennifer/ipr-edit-js

Conversation

@jennifer-richards

Copy link
Copy Markdown
Member

Together with #4951, fixes some major breakage on the IPR disclosure edit view.

Adding a new draft form to the formset was broken because of a missing call to setupSelect2Field() after adding the fields to the DOM. This adds that call.

In addition to the completely broken Django validation fixed by #4951, submitting the form failed because the JS was incorrectly numbering the formset entries it added when clicking the "Add more" button. This was happening because the details_edit.html template rendered a blank formset for the javascript to duplicate by tagging the "extra" formset form with the template class. This PR fixes this by getting rid of the extra form hack and using the empty_form provided by Django's formset class instead.

@codecov

codecov Bot commented Jan 6, 2023

Copy link
Copy Markdown

Codecov Report

Merging #4952 (809dda1) into main (0f35f5d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #4952   +/-   ##
=======================================
  Coverage   88.47%   88.47%           
=======================================
  Files         296      296           
  Lines       39805    39814    +9     
=======================================
+ Hits        35219    35227    +8     
- Misses       4586     4587    +1     
Impacted Files Coverage Δ
ietf/ipr/views.py 87.72% <100.00%> (ø)
ietf/doc/views_search.py 89.23% <0.00%> (-0.21%) ⬇️
ietf/meeting/views.py 90.57% <0.00%> (+<0.01%) ⬆️
ietf/meeting/models.py 86.49% <0.00%> (+0.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@rjsparks
rjsparks merged commit de62fd7 into ietf-tools:main Jan 6, 2023
@jennifer-richards
jennifer-richards deleted the jennifer/ipr-edit-js branch January 9, 2023 23:56
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants