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:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/profiles/two_factor_auths_controller.rb18
-rw-r--r--app/controllers/profiles_controller.rb3
-rw-r--r--app/controllers/projects/blame_controller.rb26
3 files changed, 11 insertions, 36 deletions
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb
index 8f482cf6e2f..bc6e67a3a7d 100644
--- a/app/controllers/profiles/two_factor_auths_controller.rb
+++ b/app/controllers/profiles/two_factor_auths_controller.rb
@@ -169,18 +169,6 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
gon.push(webauthn: { options: options, app_id: u2f_app_id })
end
- # Adds delete path to u2f registrations
- # to reduce logic in view template
- def u2f_registrations
- current_user.u2f_registrations.map do |u2f_registration|
- {
- name: u2f_registration.name,
- created_at: u2f_registration.created_at,
- delete_path: profile_u2f_registration_path(u2f_registration)
- }
- end
- end
-
def webauthn_registrations
current_user.webauthn_registrations.map do |webauthn_registration|
{
@@ -235,10 +223,6 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
@qr_code = build_qr_code
@account_string = account_string
- if Feature.enabled?(:webauthn)
- setup_webauthn_registration
- else
- setup_u2f_registration
- end
+ setup_webauthn_registration
end
end
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index 44c8c8f8f44..da15b393e6c 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -10,9 +10,6 @@ class ProfilesController < Profiles::ApplicationController
check_rate_limit!(:profile_update_username, scope: current_user)
end
skip_before_action :require_email, only: [:show, :update]
- before_action do
- push_frontend_feature_flag(:webauthn)
- end
feature_category :user_profile, [:show, :update, :reset_incoming_email_token, :reset_feed_token,
:reset_static_object_token, :update_username]
diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb
index bd5701a3557..cc0d3818e33 100644
--- a/app/controllers/projects/blame_controller.rb
+++ b/app/controllers/projects/blame_controller.rb
@@ -20,28 +20,14 @@ class Projects::BlameController < Projects::ApplicationController
end
load_environment
-
- @blame_mode = Gitlab::Git::BlameMode.new(@commit.project, blame_params)
- blame_service = Projects::BlameService.new(@blob, @commit, @blame_mode, blame_params)
-
- @blame = Gitlab::View::Presenter::Factory.new(blame_service.blame, project: @project, path: @path, page: blame_service.page).fabricate!
-
- @blame_pagination = blame_service.pagination
-
- @blame_per_page = blame_service.per_page
-
- render locals: { total_extra_pages: blame_service.total_extra_pages }
+ load_blame
end
def page
@blob = @repository.blob_at(@commit.id, @path)
load_environment
-
- @blame_mode = Gitlab::Git::BlameMode.new(@commit.project, blame_params)
- blame_service = Projects::BlameService.new(@blob, @commit, @blame_mode, blame_params)
-
- @blame = Gitlab::View::Presenter::Factory.new(blame_service.blame, project: @project, path: @path, page: blame_service.page).fabricate!
+ load_blame
render partial: 'page'
end
@@ -54,6 +40,14 @@ class Projects::BlameController < Projects::ApplicationController
@environment = ::Environments::EnvironmentsByDeploymentsFinder.new(@project, current_user, environment_params).execute.last
end
+ def load_blame
+ @blame_mode = Gitlab::Git::BlameMode.new(@commit.project, blame_params)
+ @blame_pagination = Gitlab::Git::BlamePagination.new(@blob, @blame_mode, blame_params)
+
+ blame = Gitlab::Blame.new(@blob, @commit, range: @blame_pagination.blame_range)
+ @blame = Gitlab::View::Presenter::Factory.new(blame, project: @project, path: @path, page: @blame_pagination.page).fabricate!
+ end
+
def blame_params
params.permit(:page, :no_pagination, :streaming)
end