From 417e79bbbc98af989bfafa70e826e2f21cc1d014 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 17 Jul 2018 16:27:08 +0100 Subject: [PATCH 01/10] set has_tooltip to false for commit author_avatar --- app/views/projects/commits/_commit.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 90e55fd0fb0..4f0d8211a01 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -19,7 +19,7 @@ %li.commit.flex-row.js-toggle-container{ id: "commit-#{commit.short_id}" } .avatar-cell.d-none.d-sm-block - = author_avatar(commit, size: 36) + = author_avatar(commit, size: 36, has_tooltip: false) .commit-detail.flex-list .commit-content.qa-commit-content @@ -38,7 +38,7 @@ = sprite_icon('ellipsis_h', size: 12) .commiter - - commit_author_link = commit_author_link(commit, avatar: false, size: 24) + - commit_author_link = commit_author_link(commit, avatar: false, size: 24, has_tooltip: false) - commit_timeago = time_ago_with_tooltip(commit.authored_date, placement: 'bottom') - commit_text = _('%{commit_author_link} authored %{commit_timeago}') % { commit_author_link: commit_author_link, commit_timeago: commit_timeago } #{ commit_text.html_safe } From 58803cd8e0939a57df48547fa770434d9ea1f9e1 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 17 Jul 2018 16:27:46 +0100 Subject: [PATCH 02/10] Dont add title attr to user_avatar_without_link if has_tooltip is false --- app/helpers/avatars_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index 43d92bde064..dd122bf9bda 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -117,9 +117,9 @@ module AvatarsHelper alt: "#{user_name}'s avatar", src: avatar_url, data: data_attributes, - class: css_class, - title: user_name + class: css_class } + image_options[:title] = user_name if has_tooltip tag(:img, image_options) end From 14f31eb9963efbaa823845d8c5b77bf5d818fa9a Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 17 Jul 2018 16:28:20 +0100 Subject: [PATCH 03/10] Add has_tooltip bool handling for commit_person_link --- app/helpers/commits_helper.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index e5c3be47801..2b06b99021d 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -145,15 +145,18 @@ module CommitsHelper person_name end - options = { - class: "commit-#{options[:source]}-link has-tooltip", - title: source_email + link_options = { + class: "commit-#{options[:source]}-link", } + unless options[:has_tooltip] == false + link_options[:class] << ' has-tooltip' + link_options[:title] = source_email + end if user.nil? - mail_to(source_email, text, options) + mail_to(source_email, text, link_options) else - link_to(text, user_path(user), options) + link_to(text, user_path(user), link_options) end end From 228a64b8f76beff4a47631723b127b91b3178cd5 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 17 Jul 2018 17:01:19 +0100 Subject: [PATCH 04/10] Added changelog entry --- changelogs/unreleased/29278-commits-page-tooltips.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/29278-commits-page-tooltips.yml diff --git a/changelogs/unreleased/29278-commits-page-tooltips.yml b/changelogs/unreleased/29278-commits-page-tooltips.yml new file mode 100644 index 00000000000..d54301a1cf0 --- /dev/null +++ b/changelogs/unreleased/29278-commits-page-tooltips.yml @@ -0,0 +1,5 @@ +--- +title: Remove tooltips from commit author avatar and name in commit lists +merge_request: 20674 +author: +type: other From 6feb6d908e965aff3fc610983dc9895cdffdf8fc Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 20 Jul 2018 12:04:54 +0100 Subject: [PATCH 05/10] fix lint --- app/helpers/commits_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 2b06b99021d..ea0dfe4ba18 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -146,8 +146,9 @@ module CommitsHelper end link_options = { - class: "commit-#{options[:source]}-link", + class: "commit-#{options[:source]}-link" } + unless options[:has_tooltip] == false link_options[:class] << ' has-tooltip' link_options[:title] = source_email From 94c5bac97bb6902672fffab7cbb7b747023d38c9 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 20 Jul 2018 12:07:06 +0100 Subject: [PATCH 06/10] Keep img title attr --- app/helpers/avatars_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index dd122bf9bda..43d92bde064 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -117,9 +117,9 @@ module AvatarsHelper alt: "#{user_name}'s avatar", src: avatar_url, data: data_attributes, - class: css_class + class: css_class, + title: user_name } - image_options[:title] = user_name if has_tooltip tag(:img, image_options) end From 5636eb030f0ea9c4aeaa51aa347edcb2e7344c2d Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 20 Jul 2018 12:29:30 +0100 Subject: [PATCH 07/10] Remove all tooltip use from commit_person_link --- app/helpers/commits_helper.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index ea0dfe4ba18..89fe90fd801 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -149,11 +149,6 @@ module CommitsHelper class: "commit-#{options[:source]}-link" } - unless options[:has_tooltip] == false - link_options[:class] << ' has-tooltip' - link_options[:title] = source_email - end - if user.nil? mail_to(source_email, text, link_options) else From e194cf089ec633990a46c7c9bc143776b13492dc Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 20 Jul 2018 12:29:58 +0100 Subject: [PATCH 08/10] Remove unneeded has_tooltip from commit_author_link use --- app/views/projects/commits/_commit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 4f0d8211a01..feaf44e8c0a 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -38,7 +38,7 @@ = sprite_icon('ellipsis_h', size: 12) .commiter - - commit_author_link = commit_author_link(commit, avatar: false, size: 24, has_tooltip: false) + - commit_author_link = commit_author_link(commit, avatar: false, size: 24) - commit_timeago = time_ago_with_tooltip(commit.authored_date, placement: 'bottom') - commit_text = _('%{commit_author_link} authored %{commit_timeago}') % { commit_author_link: commit_author_link, commit_timeago: commit_timeago } #{ commit_text.html_safe } From 992d034ac3ab7bdbab114eb29afc0fa17b7b7e30 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 20 Jul 2018 12:30:15 +0100 Subject: [PATCH 09/10] Add has_tooltip false to remaining commit realted uses --- app/views/projects/blame/show.html.haml | 2 +- app/views/projects/commit/_commit_box.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index e90916e340d..ef6f5c76de6 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -18,7 +18,7 @@ - commit = blame_group[:commit] %td.blame-commit{ class: age_map_class(commit.committed_date, project_duration) } .commit - = author_avatar(commit, size: 36) + = author_avatar(commit, size: 36, has_tooltip: false) .commit-row-title %span.item-title.str-truncated-100 = link_to_markdown commit.title, project_commit_path(@project, commit.id), class: "cdark", title: commit.title diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index 886dd73c33b..78522393d4b 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -10,7 +10,7 @@ %span.d-none.d-sm-inline authored #{time_ago_with_tooltip(@commit.authored_date)} %span= s_('ByAuthor|by') - = author_avatar(@commit, size: 24) + = author_avatar(@commit, size: 24, has_tooltip: false) %strong = commit_author_link(@commit, avatar: true, size: 24) - if @commit.different_committer? From 362e9e40b131c896e2c3545248752ae84e9635d5 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 20 Jul 2018 13:25:31 +0100 Subject: [PATCH 10/10] fix user_browses_commits_spec --- spec/features/projects/commits/user_browses_commits_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb index 23d8d606790..534cfe1eb12 100644 --- a/spec/features/projects/commits/user_browses_commits_spec.rb +++ b/spec/features/projects/commits/user_browses_commits_spec.rb @@ -238,6 +238,5 @@ def check_author_link(email, author) author_link = find('.commit-author-link') expect(author_link['href']).to eq(user_path(author)) - expect(author_link['title']).to eq(email) expect(find('.commit-author-name').text).to eq(author.name) end