From c20363ceaec492b68392edf1b2d5cb3378762763 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:42:18 +0000 Subject: [PATCH] Users - remove action link --- app/views/users/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index a04aa2fa5..78f2a06d3 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -53,7 +53,7 @@ <%= summary_list.with_row do |row| row.with_key { "Telephone number" } row.with_value { user_details_html(@user, current_user, "phone") } - if UserPolicy.new(current_user, @user).edit_telephone_numbers? + if UserPolicy.new(current_user, @user).edit_telephone_numbers? && @user.phone.present? row.with_action( text: user_action_text(@user, "phone"), visually_hidden_text: "telephone number", @@ -96,7 +96,7 @@ <%= summary_list.with_row do |row| row.with_key { "Role" } row.with_value { user_details_html(@user, current_user, "role") } - if UserPolicy.new(current_user, @user).edit_roles? + if UserPolicy.new(current_user, @user).edit_roles? && @user.role row.with_action( text: user_action_text(@user, "role"), visually_hidden_text: "role",