-
Notifications
You must be signed in to change notification settings - Fork 9
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 usage of view models #1442
Comments
We could move most of what view models are doing to using Django template tags. This seems like a good approach because:
Django makes two types available OOTB:
Django also has a way to write more advanced custom tags, probably more than we need for now. |
Putting these notes here: There are 3 places in the new Veteran flow app that requires logic in the
|
We have a pretty solid plan:
And some different pieces of this implementation: |
Blocked: #1563 (comment) |
As shown in #1436, adding or moving around copy driven by translations requires changes in multiple places:
We need to look into how to simplify this, ideally cutting out extraneous view models that already have a corresponding model, and sending that directly to the template instead.
Plan
After some different iterations, this is the approach we landed on:
Acceptance Criteria
The following
viewmodels
and helpers are removed:viewmodels.Button
Refactor: buttons #1562viewmodels.Button.agency_contact_links
Refactor: agency links #1521viewmodels.Button.home
Refactor: home button #1522viewmodels.Button.link
Refactor: agency links #1521viewmodels.Button.login
Refactor: Eligibility start page #1498viewmodels.Button.logout
Refactor: sign out button #1534viewmodels.Button.primary
Refactor: buttons #1562viewmodels.Button.outline_primary
Refactor: buttons #1562viewmodels.Button.previous_page
Refactor: buttons #1562viewmodels.Icon
Refactor: remove icon/media item view models #1542viewmodels.MediaItem
Refactor: remove icon/media item view models #1542viewmodels.Modal
Refactor: remove Modal viewmodel #1504viewmodels.AgencySelector
Refactor: remove Modal viewmodel #1504viewmodels.Page
Refactor: remove Page viewmodel #1563viewmodels.ErrorPage
Refactor: error pages #1536viewmodels.ErrorPage.user_error
Refactor: error pages #1536viewmodels.ErrorPage.server_error
Refactor: error pages #1536viewmodels.ErrorPage.not_found
Refactor: error pages #1536viewmodels.PaymentProcessor
Refactor: Enrollment index #1502viewmodels.TransitAgency
Refactor: remove Transit Agency viewmodel #1541The text was updated successfully, but these errors were encountered: