Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-09 12:12:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-09 12:12:36 +0300
commit50b7d6cec7501cf9bae39439a91c991f0de0e8eb (patch)
treeb134888f47b72c02ced12b2a214c869511856e31 /app/helpers
parent32f67dc2146e3e99bd62e11f48b95d576fa6c845 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/button_helper.rb10
-rw-r--r--app/helpers/groups_helper.rb6
-rw-r--r--app/helpers/merge_requests_helper.rb5
-rw-r--r--app/helpers/projects_helper.rb2
4 files changed, 15 insertions, 8 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb
index e6212ee7d8d..851de133a38 100644
--- a/app/helpers/button_helper.rb
+++ b/app/helpers/button_helper.rb
@@ -8,7 +8,9 @@ module ButtonHelper
# :gfm - GitLab Flavored Markdown to copy, if different from `text` (optional)
# :target - Selector for target element to copy from (optional)
# :class - CSS classes to be applied to the button (optional)
- # :title - Button's title attribute (used for the tooltip) (optional)
+ # :title - Button's title attribute (used for the tooltip) (optional, default: Copy)
+ # :aria_label - Button's aria-label attribute (optional)
+ # :aria_keyshortcuts - Button's aria-keyshortcuts attribute (optional)
# :button_text - Button's displayed label (optional)
# :hide_tooltip - Whether the tooltip should be hidden (optional, default: false)
# :hide_button_icon - Whether the icon should be hidden (optional, default: false)
@@ -31,6 +33,8 @@ module ButtonHelper
def clipboard_button(data = {})
css_class = data.delete(:class)
title = data.delete(:title) || _('Copy')
+ aria_keyshortcuts = data.delete(:aria_keyshortcuts) || nil
+ aria_label = data.delete(:aria_label) || title
button_text = data[:button_text] || nil
hide_tooltip = data[:hide_tooltip] || false
hide_button_icon = data[:hide_button_icon] || false
@@ -54,7 +58,7 @@ module ButtonHelper
data[:clipboard_target] = target if target
unless hide_tooltip
- data = { toggle: 'tooltip', placement: 'bottom', container: 'body' }.merge(data)
+ data = { toggle: 'tooltip', placement: 'bottom', container: 'body', html: 'true' }.merge(data)
end
render ::Pajamas::ButtonComponent.new(
@@ -62,7 +66,7 @@ module ButtonHelper
variant: variant,
category: category,
size: size,
- button_options: { class: css_class, title: title, aria: { label: title, live: 'polite' }, data: data, itemprop: item_prop }) do
+ button_options: { class: css_class, title: title, aria: { keyshortcuts: aria_keyshortcuts, label: aria_label, live: 'polite' }, data: data, itemprop: item_prop }) do
button_text
end
end
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index 25a2cc8a5ae..8b5d05b6408 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -57,7 +57,7 @@ module GroupsHelper
push_to_schema_breadcrumb(simple_sanitize(group.name), group_path(group))
if name
- full_title << ' &middot; '.html_safe + link_to(simple_sanitize(name), url, class: 'group-path breadcrumb-item-text js-breadcrumb-item-text')
+ full_title << ' &middot; '.html_safe + link_to(simple_sanitize(name), url, class: 'group-path js-breadcrumb-item-text')
push_to_schema_breadcrumb(simple_sanitize(name), url)
end
@@ -241,8 +241,8 @@ module GroupsHelper
private
- def group_title_link(group, hidable: false, show_avatar: false, for_dropdown: false)
- link_to(group_path(group), class: "group-path #{'breadcrumb-item-text' unless for_dropdown} js-breadcrumb-item-text #{'hidable' if hidable}") do
+ def group_title_link(group, hidable: false, show_avatar: false)
+ link_to(group_path(group), class: "group-path js-breadcrumb-item-text #{'hidable' if hidable}") do
icon = render Pajamas::AvatarComponent.new(group, alt: group.name, class: "avatar-tile", size: 16) if group.try(:avatar_url) || show_avatar
[icon, simple_sanitize(group.name)].join.html_safe
end
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb
index 100b9349df6..767838df076 100644
--- a/app/helpers/merge_requests_helper.rb
+++ b/app/helpers/merge_requests_helper.rb
@@ -275,7 +275,10 @@ module MergeRequestsHelper
def merge_request_header(project, merge_request)
link_to_author = link_to_member(project, merge_request.author, size: 24, extra_class: 'gl-font-weight-bold gl-mr-2', avatar: false)
- copy_button = clipboard_button(text: merge_request.source_branch, title: _('Copy branch name'), class: 'gl-display-none! gl-md-display-inline-block! js-source-branch-copy')
+ copy_action_description = _('Copy branch name')
+ copy_action_shortcut = 'b'
+ copy_button_title = "#{copy_action_description} <kbd class='flat ml-1'>#{copy_action_shortcut}</kbd>"
+ copy_button = clipboard_button(text: merge_request.source_branch, title: copy_button_title, aria_keyshortcuts: copy_action_shortcut, aria_label: copy_action_description, class: 'gl-display-none! gl-md-display-inline-block! js-source-branch-copy')
target_branch = link_to merge_request.target_branch, project_tree_path(merge_request.target_project, merge_request.target_branch), title: merge_request.target_branch, class: 'ref-container gl-display-inline-block gl-text-truncate gl-max-w-26 gl-mx-2'
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index cbc2db9e79f..cb8c86a7d29 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -791,7 +791,7 @@ module ProjectsHelper
link_to project_path(project) do
icon = render Pajamas::AvatarComponent.new(project, alt: project.name, size: 16, class: 'avatar-tile') if project.avatar_url && !Rails.env.test?
- [icon, content_tag("span", project_name, class: "breadcrumb-item-text js-breadcrumb-item-text")].join.html_safe
+ [icon, content_tag("span", project_name, class: "js-breadcrumb-item-text")].join.html_safe
end
end