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: Eligibility start page #1498

Merged
merged 11 commits into from Jul 10, 2023
Merged

Refactor: Eligibility start page #1498

merged 11 commits into from Jul 10, 2023

Conversation

thekaveman
Copy link
Member

@thekaveman thekaveman commented Jul 7, 2023

Supersedes #1488 -- ultimately moved away from Django template tags in favor of our trusty includes.

Stole some ideas from #1489

Part of #1442

Closes #1477

Goals

  • Move as much copy as possible away from the database (models), towards the templates
  • Reduce or eliminate the reliance on view model classes
  • Change incrementally, don't break existing pages/flows
  • Address the points in this comment: Refactor usage of view models #1442 (comment)

Overview

  1. Add field on EligibilityVerifier to reference a custom template for Start page
  2. Create 3 customized Start templates extending eligibility/start.html
    • eligibility/start__login_gov.html
    • eligibility/start__mst_courtesy_card.html
    • eligibility/start__veteran.html
  3. Move corresponding copy from model fields into customized template files
  4. Change eligibility:start view to use the verifier's template

@thekaveman thekaveman requested a review from a team as a code owner July 7, 2023 00:07
@github-actions github-actions bot added migrations [auto] Review for potential model changes/needed data migrations updates back-end Django views, sessions, middleware, models, migrations etc. i18n Copy: Language files or Django i18n framework tests Related to automated testing (unit, UI, integration, etc.) front-end HTML/CSS/JavaScript and Django templates and removed back-end Django views, sessions, middleware, models, migrations etc. labels Jul 7, 2023
@thekaveman thekaveman added this to the Veterans milestone Jul 7, 2023
@github-actions github-actions bot added the deployment-dev [auto] Changes that will trigger a deploy if merged to dev label Jul 7, 2023
Copy link
Member

@machikoyasuda machikoyasuda left a comment

Choose a reason for hiding this comment

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

LGTM!

I tried editing the start.html file (removing the whole help-text section) to see how the includes would respond and it worked perfectly + quickly (the whole section should be removed, even if the includes calls for it). Sticking with the trusty includes has led to code that's easier for me to read - no more djLint on/off switches - and more plain HTML/regular includes block overrides.

One change request: I believe the secondary_details code I wrote last Sprint can be deleted:

  • remove parameter from MediaItem view model
  • remove from media-list.html template

@thekaveman thekaveman changed the base branch from dev to refactor/verifier-radio-template July 7, 2023 17:56
machikoyasuda
machikoyasuda previously approved these changes Jul 7, 2023
Base automatically changed from refactor/verifier-radio-template to dev July 7, 2023 17:57
@angela-tran angela-tran dismissed machikoyasuda’s stale review July 7, 2023 17:57

The base branch was changed.

@thekaveman
Copy link
Member Author

thekaveman commented Jul 7, 2023

Rebased on the changes in #1489

EDIT: as y'all were merging that one and approving this one 🤣

@thekaveman
Copy link
Member Author

Let's get #1499 and #1501 in first since those are simpler, it would be more challenging to rebase/deal with conflicts in both of them against this branch.

@thekaveman thekaveman self-assigned this Jul 7, 2023
@thekaveman thekaveman marked this pull request as draft July 7, 2023 18:07
reference the template file to use for Eligibility Start

make other start fields optional
@thekaveman thekaveman changed the base branch from dev to feat/agency-variables July 7, 2023 19:05
eligibility/start template specifically for mst courtesy cards
Copy link
Member

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

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

This is looking really good so far!

Base automatically changed from feat/agency-variables to dev July 7, 2023 20:37
@thekaveman thekaveman marked this pull request as ready for review July 7, 2023 20:40
@thekaveman
Copy link
Member Author

Ready for re-review.

I couldn't fully get rid of the tag work from #1488, but I tried to squash it down to a few logical commits for the structure, and one big refactor for the includes.

Thanks for all the comments on the earlier PR, and the radio buttons PR, that all helped clarify a better way forward.

Copy link
Member

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

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

I've read through the code changes and run the app locally. This refactor looks great!! 💯

@thekaveman thekaveman merged commit 599df79 into dev Jul 10, 2023
11 checks passed
@thekaveman thekaveman deleted the refactor/eligibility-start branch July 10, 2023 18:58
@thekaveman thekaveman mentioned this pull request Jul 11, 2023
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment-dev [auto] Changes that will trigger a deploy if merged to dev front-end HTML/CSS/JavaScript and Django templates i18n Copy: Language files or Django i18n framework migrations [auto] Review for potential model changes/needed data migrations updates tests Related to automated testing (unit, UI, integration, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eligibility Start - Continue to VA.gov button style logic
3 participants