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

Session extension modal properly appears after 5 seconds (for develop… #469

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

GeorgeCodes19
Copy link
Contributor

@GeorgeCodes19 GeorgeCodes19 commented Feb 21, 2025

Ticket

  • Create session timeout stimulus controller
  • Create modal for extending session
  • Create API endpoint to test session extension
  • Create test for API endpoint to extend the Devise session

Resolves FFS-2377.

Screenshot 2025-02-21 at 6 03 50 PM

Changes

Context for reviewers

Acceptance testing

  • No acceptance testing needed
    • This change will not affect the user experience (bugfix, dependency updates, etc.)
  • Acceptance testing prior to merge
    • This change can be verified visually via screenshots attached below or by sending a link to a local development environment to the acceptance tester
    • Acceptance testing should be done by design for visual changes, product for behavior/logic changes, or both for changes that impact both.
  • Acceptance testing after merge
    • This change is hard to test locally, so we'll test it in the demo environment (deployed automatically after merge.)
    • Make sure to notify the team once this PR is merged so we don't inadvertently deploy the unaccepted change to production. (e.g. :alert: Deploy block! @ffs-eng I just merged PR [#123] and will be doing acceptance testing in demo - please don't deploy until I'm finished!)

Comment on lines 95 to 111
const trigger = document.createElement('a')
trigger.id = 'session-timeout-trigger'
trigger.href = '#cbv-session-timeout-content'
trigger.className = 'usa-button'
trigger.setAttribute('aria-controls', 'cbv-session-timeout-content')
trigger.dataset.openModal = true // Set to true instead of empty string
trigger.textContent = 'Open Session Timeout Modal'

// Add to DOM in a visible location
const container = document.createElement('div')
container.style.position = 'fixed'
container.style.top = '20px'
container.style.right = '20px'
container.style.zIndex = '9999'
container.appendChild(trigger)
document.body.appendChild(container)
console.log('Created modal trigger:', trigger)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to put these in the layout template instead of creating/tearing down each time. There are turbo features for selecting stuff like this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sure! This is preliminary stuff used for development, but if we opt to use a hidden button then I'll be sure to move it to the template.

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.

2 participants