summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-29 15:07:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-29 15:07:02 +0000
commita466e9450d5949aa762913729918db02b5d27761 (patch)
tree8edfaac5434413a7fe160a6e50dfaee8ecf0f151 /app
parentd1d4dfb74a55a1b56b9451b2a844c57e05c9557f (diff)
downloadgitlab-ce-a466e9450d5949aa762913729918db02b5d27761.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/helpers/sorting_helper.rb7
-rw-r--r--app/helpers/ssh_keys_helper.rb4
-rw-r--r--app/models/ci/build.rb4
-rw-r--r--app/presenters/search_service_presenter.rb2
-rw-r--r--app/views/profiles/keys/_key.html.haml2
-rw-r--r--app/views/profiles/keys/_key_details.html.haml2
-rw-r--r--app/views/projects/triggers/_form.html.haml4
-rw-r--r--app/views/shared/ssh_keys/_key_delete.html.haml14
8 files changed, 19 insertions, 20 deletions
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb
index a711f36fe05..37aaea50a43 100644
--- a/app/helpers/sorting_helper.rb
+++ b/app/helpers/sorting_helper.rb
@@ -188,13 +188,6 @@ module SortingHelper
}
end
- def runners_sort_options_hash
- {
- sort_value_created_date => sort_title_created_date,
- sort_value_contacted_date => sort_title_contacted_date
- }
- end
-
def starrers_sort_options_hash
{
sort_value_name => sort_title_name,
diff --git a/app/helpers/ssh_keys_helper.rb b/app/helpers/ssh_keys_helper.rb
index 17a9fd6146d..4cd40836335 100644
--- a/app/helpers/ssh_keys_helper.rb
+++ b/app/helpers/ssh_keys_helper.rb
@@ -2,10 +2,14 @@
module SshKeysHelper
def ssh_key_delete_modal_data(key, path)
+ title = _('Delete Key')
+
{
path: path,
method: 'delete',
qa_selector: 'delete_ssh_key_button',
+ title: title,
+ aria_label: title,
modal_attributes: {
'data-qa-selector': 'ssh_key_delete_modal',
title: _('Are you sure you want to delete this SSH key?'),
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 12c9f45e4c4..a60813a36a7 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -865,6 +865,10 @@ module Ci
Gitlab::Ci::Build::Step.from_after_script(self)].compact
end
+ def runtime_hooks
+ Gitlab::Ci::Build::Hook.from_hooks(self)
+ end
+
def image
Gitlab::Ci::Build::Image.from_image(self)
end
diff --git a/app/presenters/search_service_presenter.rb b/app/presenters/search_service_presenter.rb
index 4755b88cbea..7994957d50c 100644
--- a/app/presenters/search_service_presenter.rb
+++ b/app/presenters/search_service_presenter.rb
@@ -25,7 +25,7 @@ class SearchServicePresenter < Gitlab::View::Presenter::Delegated
case scope
when 'users'
- objects.eager_load(:status) if objects.respond_to?(:eager_load) # rubocop:disable CodeReuse/ActiveRecord
+ objects.respond_to?(:eager_load) ? objects.eager_load(:status) : objects # rubocop:disable CodeReuse/ActiveRecord
when 'commits'
prepare_commits_for_rendering(objects)
else
diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml
index f0e4b143d0d..b2d7a46e6ea 100644
--- a/app/views/profiles/keys/_key.html.haml
+++ b/app/views/profiles/keys/_key.html.haml
@@ -32,4 +32,4 @@
%span.key-created-at.gl-display-flex.gl-align-items-center
- if key.can_delete?
.gl-ml-3
- = render 'shared/ssh_keys/key_delete', html_class: "btn gl-button btn-icon btn-default js-confirm-modal-button", button_data: ssh_key_delete_modal_data(key, path_to_key(key, is_admin))
+ = render 'shared/ssh_keys/key_delete', icon: true, button_data: ssh_key_delete_modal_data(key, path_to_key(key, is_admin))
diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml
index 1a8de16471f..48f66f79200 100644
--- a/app/views/profiles/keys/_key_details.html.haml
+++ b/app/views/profiles/keys/_key_details.html.haml
@@ -43,4 +43,4 @@
.col-md-12
.float-right
- if @key.can_delete?
- = render 'shared/ssh_keys/key_delete', text: _('Delete'), html_class: "btn btn-danger gl-button delete-key js-confirm-modal-button", button_data: ssh_key_delete_modal_data(@key, path_to_key(@key, is_admin))
+ = render 'shared/ssh_keys/key_delete', button_data: ssh_key_delete_modal_data(@key, path_to_key(@key, is_admin))
diff --git a/app/views/projects/triggers/_form.html.haml b/app/views/projects/triggers/_form.html.haml
index b6b24a0c26a..b621f1ab3ed 100644
--- a/app/views/projects/triggers/_form.html.haml
+++ b/app/views/projects/triggers/_form.html.haml
@@ -6,6 +6,6 @@
%label.label-bold Token
%p.form-control-plaintext= @trigger.token
.form-group
- = f.label :key, "Description", class: "label-bold"
- = f.text_field :description, class: 'form-control gl-form-input', required: true, title: 'Trigger description is required.', placeholder: "Trigger description"
+ = f.label :key, s_("Trigger|Description"), class: "label-bold"
+ = f.text_field :description, class: 'form-control gl-form-input', required: true, title: 'Trigger description is required.', placeholder: s_("Trigger|Trigger description")
= f.submit btn_text, pajamas_button: true
diff --git a/app/views/shared/ssh_keys/_key_delete.html.haml b/app/views/shared/ssh_keys/_key_delete.html.haml
index f8bb0e21f67..4b89b2a0cbf 100644
--- a/app/views/shared/ssh_keys/_key_delete.html.haml
+++ b/app/views/shared/ssh_keys/_key_delete.html.haml
@@ -1,9 +1,7 @@
-- title = _('Delete Key')
-- aria = { label: title }
+- icon = local_assigns[:icon]
+- category = local_assigns[:category] || :primary
-- if defined?(text)
- = button_to text, '#', class: html_class, data: button_data, title: title, aria: aria
-- else
- = button_to '#', class: html_class, data: button_data, title: title, aria: aria do
- %span.sr-only= _('Delete')
- = sprite_icon('remove')
+.gl-p-2
+ = render Pajamas::ButtonComponent.new(variant: :danger, category: category, icon: ('remove' if icon), button_options: { class: 'js-confirm-modal-button', data: button_data }) do
+ - unless icon
+ = _('Delete')