From d53f12a586ef63a3219fa6c914d1f9d8e7a72e2b Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Mon, 27 Apr 2026 11:09:50 +0100 Subject: [PATCH 1/6] CLDC-4365: Allow for two thirds notifications --- app/helpers/application_helper.rb | 14 ++++++++++++++ app/views/layouts/application.html.erb | 20 +++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5a9203da8..13edeb1f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -32,6 +32,20 @@ module ApplicationHelper !request.path.match?(/\/notifications\/\d+$/) && (authenticated_user_has_notifications? || unauthenticated_user_has_notifications?) end + def notification_banner + govuk_notification_banner( + title_text: "Success", + success: true, title_heading_level: 3, + title_id: "flash-notice", + role: "alert" + ) do |notification_banner| + notification_banner.with_heading(text: flash.notice.html_safe) + if flash[:notification_banner_body] + tag.p flash[:notification_banner_body]&.html_safe + end + end + end + private def paginated_title(title, pagy) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c7d5e2230..2903d0dc6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -120,17 +120,15 @@
<% if flash.notice && !flash.notice.include?("translation missing") %> - <%= govuk_notification_banner( - title_text: "Success", - success: true, title_heading_level: 3, - title_id: "flash-notice", - role: "alert" - ) do |notification_banner| - notification_banner.with_heading(text: flash.notice.html_safe) - if flash[:notification_banner_body] - tag.p flash[:notification_banner_body]&.html_safe - end - end %> + <% if flash[:notification_banner_two_thirds] %> +
+
+ <%= notification_banner %> +
+
+ <% else %> + <%= notification_banner %> + <% end %> <% end %> <%= content_for?(:content) ? yield(:content) : yield %>
From 8128dae473b2442b665c7e7b8dc50a71e148d6ba Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Mon, 27 Apr 2026 11:10:19 +0100 Subject: [PATCH 2/6] CLDC-4365: Make the interruptuon screen notice two thirds --- app/controllers/form_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index 808edca91..6dba53a8a 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -25,6 +25,7 @@ class FormController < ApplicationController updated_question = @page.questions.reject { |question| question.check_answer_label.blank? }.first updated_question_string = [updated_question&.question_number_string, updated_question&.check_answer_label.to_s.downcase].compact.join(": ") flash[:notice] = "You have successfully updated #{updated_question_string}" + flash[:notification_banner_two_thirds] = true end update_duplication_tracking From 25cb48980d9b599eb9ecc1109f43845205d847e2 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Thu, 30 Apr 2026 17:25:29 +0100 Subject: [PATCH 3/6] CLDC-4365: Use a ternary class for two thirds conditional --- app/views/layouts/application.html.erb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2903d0dc6..c56d3b031 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -120,15 +120,11 @@
<% if flash.notice && !flash.notice.include?("translation missing") %> - <% if flash[:notification_banner_two_thirds] %> -
-
- <%= notification_banner %> -
+
+
+ <%= notification_banner %>
- <% else %> - <%= notification_banner %> - <% end %> +
<% end %> <%= content_for?(:content) ? yield(:content) : yield %>
From 136d0f2e563e520f8426b61641a155da21290497 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Thu, 30 Apr 2026 17:25:41 +0100 Subject: [PATCH 4/6] CLDC-4365: Fix notification banner call --- app/helpers/application_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 13edeb1f3..d379ef847 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -35,7 +35,8 @@ module ApplicationHelper def notification_banner govuk_notification_banner( title_text: "Success", - success: true, title_heading_level: 3, + success: true, + title_heading_level: 3, title_id: "flash-notice", role: "alert" ) do |notification_banner| From ae2114fb234cb4c9787d292a0523bbf09df6e906 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Thu, 30 Apr 2026 17:48:47 +0100 Subject: [PATCH 5/6] fixup! CLDC-4365: Fix notification banner call --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d379ef847..b0fe65593 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -38,7 +38,7 @@ module ApplicationHelper success: true, title_heading_level: 3, title_id: "flash-notice", - role: "alert" + role: "alert", ) do |notification_banner| notification_banner.with_heading(text: flash.notice.html_safe) if flash[:notification_banner_body] From ac5063bced4ae563ec0f6937d403b08e429fe2cd Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Fri, 1 May 2026 11:28:21 +0100 Subject: [PATCH 6/6] fixup! CLDC-4365: Use a ternary class for two thirds conditional --- app/views/layouts/application.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c56d3b031..fc7c1471d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -121,7 +121,7 @@
<% if flash.notice && !flash.notice.include?("translation missing") %>
-
+
"> <%= notification_banner %>