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

Refactor HTMX Viewsets #1012

Merged
merged 23 commits into from
Jun 14, 2024
Merged

Refactor HTMX Viewsets #1012

merged 23 commits into from
Jun 14, 2024

Conversation

shapiromatron
Copy link
Owner

@shapiromatron shapiromatron commented Apr 9, 2024

Refactor our lit.workflows and assessment.attachments HTMX ViewSets to use new .show-only-child class and remove nearly-identical templates between eco and epiv2 viewsets. This uses the pattern originally used in #989.

  • show-only-child hides an element unless it is the only child of a parent element
  • hide-empty-tbody will hide an element unless it has a child <tbody> containing a <tr> element
  • Fix deletion script for eco class; cascading deletions are now properly displayed in the eco update page (i.e., deleting a Cause will immediately remove related Results from the table)

@caseyhans caseyhans changed the title refactor lit.workflow Refactor HTMX Viewsets Apr 19, 2024
@caseyhans caseyhans marked this pull request as ready for review April 19, 2024 15:29
@caseyhans caseyhans self-requested a review April 19, 2024 16:26
Copy link
Collaborator

@caseyhans caseyhans left a comment

Choose a reason for hiding this comment

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

LGTM! @shapiromatron back to you

@shapiromatron shapiromatron self-assigned this May 13, 2024
@shapiromatron
Copy link
Owner Author

Sorry it took me so long to review your changes @caseyhans, they all looked great, and I really like the generalized templates. This will make things simple, and it's really nice to have such a consistent pattern to use for future work.

I made a number of extremely minor changes, please merge if you're happy with the changes:

  • c1fcfee add a few more newline characters (20 minutes ago)
  • 4d0728d use helpers instead of manual html (52 minutes ago)
  • b19d661 add trailing newline (69 minutes ago)
  • e1dcb39 make script ID more specific (69 minutes ago)
  • e00e06c rename class for clarity (70 minutes ago)
  • ff8c1fe remove unused variable (70 minutes ago)

@caseyhans
Copy link
Collaborator

LGTM!

@caseyhans caseyhans merged commit 00c865f into main Jun 14, 2024
6 checks passed
@caseyhans caseyhans deleted the htmx-refactor branch June 14, 2024 22:11
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.

None yet

2 participants