summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-02 18:08:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-02 18:08:28 +0000
commit888bb81daaf346356c1fdd84a60108417fe2e774 (patch)
tree72c8ebcd8362185afdc91ed1c16b5f300b2fdc7b /app
parente61f798b74e8e18fca7239fd01802182479bfcfc (diff)
downloadgitlab-ce-888bb81daaf346356c1fdd84a60108417fe2e774.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/merge_requests_controller.rb2
-rw-r--r--app/helpers/users_helper.rb28
-rw-r--r--app/models/award_emoji.rb2
-rw-r--r--app/validators/json_schemas/build_metadata_secrets.json3
-rw-r--r--app/views/admin/users/_head.html.haml9
-rw-r--r--app/views/admin/users/show.html.haml11
6 files changed, 40 insertions, 15 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 3cf0fee2536..a18ba5f30bc 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -220,7 +220,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
end
def codequality_mr_diff_reports
- reports_response(@merge_request.find_codequality_mr_diff_reports)
+ reports_response(@merge_request.find_codequality_mr_diff_reports, head_pipeline)
end
def codequality_reports
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 7154d498d77..2af932f8e8c 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -231,6 +231,34 @@ module UsersHelper
}
end
+ def confirm_user_data(user)
+ message = if user.unconfirmed_email.present?
+ _('This user has an unconfirmed email address (%{email}). You may force a confirmation.') % { email: user.unconfirmed_email }
+ else
+ _('This user has an unconfirmed email address. You may force a confirmation.')
+ end
+
+ modal_attributes = Gitlab::Json.dump({
+ title: s_('AdminUsers|Confirm user %{username}?') % { username: sanitize_name(user.name) },
+ messageHtml: message,
+ actionPrimary: {
+ text: s_('AdminUsers|Confirm user'),
+ attributes: [{ variant: 'info', 'data-qa-selector': 'confirm_user_confirm_button' }]
+ },
+ actionSecondary: {
+ text: _('Cancel'),
+ attributes: [{ variant: 'default' }]
+ }
+ })
+
+ {
+ path: confirm_admin_user_path(user),
+ method: 'put',
+ modal_attributes: modal_attributes,
+ qa_selector: 'confirm_user_button'
+ }
+ end
+
def user_deactivation_effects
header = tag.p s_('AdminUsers|Deactivating a user has the following effects:')
diff --git a/app/models/award_emoji.rb b/app/models/award_emoji.rb
index 5ba6100f169..41687febcf2 100644
--- a/app/models/award_emoji.rb
+++ b/app/models/award_emoji.rb
@@ -64,3 +64,5 @@ class AwardEmoji < ApplicationRecord
awardable.try(:expire_etag_cache)
end
end
+
+AwardEmoji.prepend_mod_with('AwardEmoji')
diff --git a/app/validators/json_schemas/build_metadata_secrets.json b/app/validators/json_schemas/build_metadata_secrets.json
index 799e7ab1642..3c8035d0dcf 100644
--- a/app/validators/json_schemas/build_metadata_secrets.json
+++ b/app/validators/json_schemas/build_metadata_secrets.json
@@ -23,7 +23,8 @@
}
},
"additionalProperties": false
- }
+ },
+ "^file$": { "type": "boolean" }
},
"additionalProperties": false
}
diff --git a/app/views/admin/users/_head.html.haml b/app/views/admin/users/_head.html.haml
index be04e87f8b9..9ef2d7b2f22 100644
--- a/app/views/admin/users/_head.html.haml
+++ b/app/views/admin/users/_head.html.haml
@@ -22,11 +22,16 @@
= render_if_exists 'admin/users/gma_user_badge'
.float-right
- - if impersonation_enabled? && @user != current_user && @user.can?(:log_in)
- = link_to _('Impersonate'), impersonate_admin_user_path(@user), method: :post, class: "btn btn-info gl-button btn-grouped", data: { qa_selector: 'impersonate_user_link' }
= link_to edit_admin_user_path(@user), class: "btn btn-default gl-button btn-grouped" do
= sprite_icon('pencil-square', css_class: 'gl-icon gl-button-icon')
= _('Edit')
+ - if @user != current_user
+ - if impersonation_enabled? && @user.can?(:log_in)
+ = link_to _('Impersonate'), impersonate_admin_user_path(@user), method: :post, class: "btn btn-default gl-button btn-grouped", data: { qa_selector: 'impersonate_user_link' }
+ - if can_force_email_confirmation?(@user)
+ %button.btn.gl-button.btn-info.btn-grouped.js-confirm-modal-button{ data: confirm_user_data(@user) }
+ = _('Confirm user')
+
%hr
%ul.nav-links.nav.nav-tabs
= nav_link(path: 'users#show') do
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml
index 08c1e089f21..5477ece7439 100644
--- a/app/views/admin/users/show.html.haml
+++ b/app/views/admin/users/show.html.haml
@@ -141,17 +141,6 @@
.col-md-6
- unless @user == current_user
- - if can_force_email_confirmation?(@user)
- .gl-card.border-info.gl-mb-5
- .gl-card-header.bg-info.text-white
- = _('Confirm user')
- .gl-card-body
- - if @user.unconfirmed_email.present?
- - email = " (#{@user.unconfirmed_email})"
- %p= _('This user has an unconfirmed email address %{email}. You may force a confirmation.') % { email: email }
- %br
- = link_to _('Confirm user'), confirm_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: _('Are you sure?'), qa_selector: 'confirm_user_button' }
-
= render 'admin/users/user_detail_note'
- unless @user.internal?