Skip to content
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

Render tag UDFs in the Reference Tagging view #913

Merged
merged 114 commits into from
Apr 5, 2024
Merged

Conversation

munnsmunns
Copy link
Collaborator

@munnsmunns munnsmunns commented Oct 4, 2023

Lays the groundwork for using User Defined Forms that are bound to Reference Tags.

  • Adds TagUDFContent model
  • Shows matching Tag UDFs when tagging references
  • Tag forms can be collapsed by clicking on the header

TODO:

  • Consider how tag UDF deletions should be managed

Example of displayed Tag UDF:
image

@munnsmunns munnsmunns changed the title Render tag forms in the Reference Tagging view Render tag UDFs in the Reference Tagging view Oct 4, 2023
Base automatically changed from udf-render-forms to main March 12, 2024 21:26
# Conflicts:
#	hawc/apps/animal/templates/animal/endpoint_detail.html
#	hawc/apps/study/forms.py
#	hawc/apps/udf/cache.py
#	hawc/apps/udf/forms.py
#	hawc/apps/udf/migrations/0003_modeludfcontent.py
#	hawc/apps/udf/models.py
#	hawc/apps/udf/signals.py
#	hawc/apps/udf/templates/udf/udf_form.html
#	hawc/apps/udf/views.py
#	tests/hawc/apps/common/dynamic_forms/test_forms.py
Copy link
Owner

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

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

Nice work @caseyhans and @munnsmunns! This was a really complicated implementation, great job figuring out how to pass static HTML forms and dynamically inject values in/out. There are a few oddities with how it had to be done (sending data to/from as arrays of values, checking for multiple choice fields on the backend), but I couldn't figure out a better way to do it, so I put some TODOs for future thinking on other ways to improve. That said, I put it through a number of tests, and it worked great.

I did one major refactoring on the JS side to try to separate out the UDF code as much as I could. I tried to break out the individual changes as much as I could for review of my changes.

  • 2e16ca6 cleanup from code review (16 minutes ago) {Andy Shapiro}
  • 68bfe49 fix integration test (32 hours ago) {Andy Shapiro}
  • 50127cf separate udf js components (2 days ago) {Andy Shapiro}
  • 7932aa2 move udf component to separate file (2 days ago) {Andy Shapiro}
  • efe4065 restore fix for multiple choice (2 days ago) {Andy Shapiro}
  • 5a0da97 rewrite udf form save code (2 days ago) {Andy Shapiro}
  • 5c30756 move clear form code to helper method (2 days ago) {Andy Shapiro}
  • 84b08cd build css class instead of inline (2 days ago) {Andy Shapiro}
  • 7fbba2c remove cachable if it cant be unset (3 weeks ago) {Andy Shapiro}
  • a888810 more language refinement (3 weeks ago) {Andy Shapiro}
  • 57bc5a4 minor edits (3 weeks ago) {Andy Shapiro}
  • abe4509 add tag form cache (3 weeks ago) {Andy Shapiro}

@shapiromatron shapiromatron merged commit 640eadc into main Apr 5, 2024
6 checks passed
@shapiromatron shapiromatron deleted the udf-render-tag-forms branch April 5, 2024 00:02
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.

3 participants