From b2fa1fc5de2272fb049f993b7db1ee9bc9fca898 Mon Sep 17 00:00:00 2001 From: Cristina <579522+CristinaRO@users.noreply.github.com> Date: Tue, 13 Feb 2024 20:07:15 +0000 Subject: [PATCH] Show user status as tag instead of strikethrough The strikethrough is not part of the design system, so we've decided to use the govuk-tag style instead. The design on the card showed green for active users, grey for suspended users, but there were no examples of locked or invited users. I've chosen to only use green for active users, and grey for all other statuses. --- app/helpers/users_helper.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 61e6977616..e92056b072 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -2,7 +2,13 @@ module UsersHelper include Pundit::Authorization def status(user) - user.status.humanize + css_classes = if user.status == User::USER_STATUS_ACTIVE + "govuk-tag--green" + else + "govuk-tag--grey" + end + + govuk_tag(user.status.humanize, css_classes) end def two_step_status(user) @@ -67,8 +73,7 @@ def assignable_user_roles end def user_name(user) - anchor_tag = link_to(user.name, edit_user_path(user), class: "govuk-link") - user.suspended? ? content_tag(:del, anchor_tag) : anchor_tag + link_to(user.name, edit_user_path(user), class: "govuk-link") end def options_for_role_select(selected: nil)