Skip to content

Commit

Permalink
ER-988: Remove timeout modal functionality (#1151)
Browse files Browse the repository at this point in the history
* Remove timeout modal functionality

Retire these locales:

timeout.title
timeout.heading
timeout.body
timeout.noscript

* Configure using env vars and hide flash message
  • Loading branch information
peterdavidhamilton authored May 20, 2024
1 parent 6dc8dd7 commit 7c1879e
Show file tree
Hide file tree
Showing 30 changed files with 43 additions and 928 deletions.
7 changes: 3 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ POSTGRES_PASSWORD=
# user research
FEEDBACK_URL=

# logout
TIMEOUT_MINUTES=360
TIMEOUT_WARNING_MINUTES=5

# Time interval, in minutes, to unlock the account if :time is enabled as unlock_strategy
# Account unlock wait duration if :time is enabled
UNLOCK_IN_MINUTES=
# Account session expiration aligned to GovOne by default
TIMEOUT_IN_MINUTES=

# user acceptance tests
BASE_URL=
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,6 @@ User [service accounts](https://cloud.google.com/iam/docs/service-accounts) can
- `gsutil -m cp -r "gs://eyfs-data-dashboard-live/eventsdata" "gs://eyfs-data-dashboard-live/useranswers" .` (export folders recursively)


---

## User experience

Session timeout functionality:

- default timeout period is 25 minutes
- default timeout warning appears after 5 minutes
- screen readers announce every time the timeout refreshes every 15 secs

---

## Hotjar
Expand Down
7 changes: 0 additions & 7 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ $light-blue: tint($department-for-education-websafe, 90%);
@import 'interruption';
@import 'quote';
@import 'icons';
@import 'modal';
@import 'autocomplete';
@import 'assets-page';

Expand Down Expand Up @@ -192,12 +191,6 @@ ul>li>ul>li {
background: #f3f2f1;
}

#js-timeout-warning:focus {
outline: 3px solid #ffdd00;
outline-offset: 0;
box-shadow: inset 0 0 0 2px;
}

.govuk-footer__copyright-logo {
display: none;
}
Expand Down
66 changes: 0 additions & 66 deletions app/assets/stylesheets/modal.scss

This file was deleted.

8 changes: 0 additions & 8 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class ApplicationController < ActionController::Base
:prepare_cms

helper_method :current_user,
:timeout_timer,
:debug?

default_form_builder ::FormBuilder
Expand Down Expand Up @@ -58,13 +57,6 @@ def debug?
Rails.application.debug? && !bot?
end

def timeout_timer
timeout_controller = TimeoutController.new
timeout_controller.request = request
timeout_controller.response = response
timeout_controller.send(:ttl_to_timeout)
end

private

# @return [Boolean]
Expand Down
39 changes: 0 additions & 39 deletions app/controllers/timeout_controller.rb

This file was deleted.

26 changes: 0 additions & 26 deletions app/helpers/timeout_helper.rb

This file was deleted.

23 changes: 5 additions & 18 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import "@hotwired/turbo-rails";
import "@fortawesome/fontawesome-free/js/all";
import '@hotwired/turbo-rails';
import '@fortawesome/fontawesome-free/js/all';

import TimeoutWarning from "./timeout-warning";

import "./controllers";
import './controllers';

import { initAll } from "govuk-frontend";

Expand All @@ -16,19 +14,8 @@ function nodeListForEach (nodes, callback) {
}
}


/*
Govuk Accordion component suffers from lag without the turbo listener
*/
document.addEventListener("turbo:load", function() {
document.addEventListener('turbo:load', function() {
initAll();

/*
timeout functionality
*/
var $timeoutWarnings = document.querySelectorAll('[data-module="govuk-timeout-warning"]')

nodeListForEach($timeoutWarnings, function ($timeoutWarning) {
new TimeoutWarning($timeoutWarning).init()
});
})
*/
4 changes: 2 additions & 2 deletions app/javascript/controllers/application.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application } from "@hotwired/stimulus"
import { Application } from '@hotwired/stimulus'
import Reveal from 'stimulus-reveal-controller'

const application = Application.start()
Expand All @@ -7,4 +7,4 @@ application.register('reveal', Reveal)

application.debug = true
window.Stimulus = application
export { application }
export { application }
2 changes: 1 addition & 1 deletion app/javascript/controllers/autocomplete_controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller } from "@hotwired/stimulus"
import { Controller } from '@hotwired/stimulus'
import accessibleAutocomplete from 'accessible-autocomplete'

// Connects to data-controller="autocomplete"
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Run that command whenever you add a new controller or create them with
// ./bin/rails generate stimulus controllerName

import { application } from "./application"
import { application } from './application'

import AutocompleteController from "./autocomplete_controller"
application.register("autocomplete", AutocompleteController)
import AutocompleteController from './autocomplete_controller'
application.register('autocomplete', AutocompleteController)
Loading

0 comments on commit 7c1879e

Please sign in to comment.