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

Reimplement timeout countdown as custom element #6023

Merged
merged 10 commits into from
Mar 15, 2022
Merged

Commits on Mar 15, 2022

  1. Configuration menu
    Copy the full SHA
    177b48d View commit details
    Browse the repository at this point in the history
  2. Reimplement timeout countdown as custom element

    **Why**:
    
    - Reduce size and scope of hot-path application pack
    - Avoid relying on window globals (LoginGov.countdownTimer), since they rely on fragile dependency order
    - Improve testability of element behavior in isolation
    - Allow reuse for common countdown behavior
    
    changelog: Internal, Optimziation, Reduce size of common JavaScript file
    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    c01cbd5 View commit details
    Browse the repository at this point in the history
  3. Initialize modal presenter with view_context

    Avoid passing from view
    
    See: #6023 (comment)
    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    d25a961 View commit details
    Browse the repository at this point in the history
  4. Move countdown tag contructor to call

    - Simplify tests to avoid accounting for newline
    - Because it's single, simple tag
    
    See: #6023 (comment)
    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    cef5cec View commit details
    Browse the repository at this point in the history
  5. Render component using view_context.render

    **Why**: Avoid errors in runtime
    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    237fcc4 View commit details
    Browse the repository at this point in the history
  6. Convert dataset to getAttribute

    Seemingly more compatible with element lifecycle, where dataset can be undefined prior to element being connected. For example, when `define`-ing the custom element, the attributeChangedCallback is triggered, but the element isn't yet mounted.
    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    94282af View commit details
    Browse the repository at this point in the history
  7. Fix lint errors

    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    2fc904e View commit details
    Browse the repository at this point in the history
  8. Use static variable syntax vs. getter

    Example snippets often use getter syntax, since it's better supported in older browsers. But since we transpile, and since reasonably new browsers support static variables, we can update to simplify.
    
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static
    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    8492b80 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4258680 View commit details
    Browse the repository at this point in the history
  10. Update countdown text via Text#nodeValue

    **Why**: To restore previous behavior of screen reader atomic announcement including time remaining.
    aduth committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    0c4c4e9 View commit details
    Browse the repository at this point in the history