diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 00:09:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 00:09:58 +0300 |
commit | 919e3e3cd83e76dba137ef9bcc4746214c2085ff (patch) | |
tree | 4e9799b9c6193583896ea1f05137815ff9782796 /app/controllers | |
parent | 6cae2159b8ce1e84fad48f3dbd5368995cbd87b1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/concerns/preferred_language_switcher.rb | 2 | ||||
-rw-r--r-- | app/controllers/import/github_controller.rb | 17 |
3 files changed, 17 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 865cde1b641..353f9098b95 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -510,8 +510,6 @@ class ApplicationController < ActionController::Base end def set_locale(&block) - return Gitlab::I18n.with_user_locale(current_user, &block) unless Feature.enabled?(:preferred_language_switcher) - if current_user Gitlab::I18n.with_user_locale(current_user, &block) else diff --git a/app/controllers/concerns/preferred_language_switcher.rb b/app/controllers/concerns/preferred_language_switcher.rb index 00cd0f9d1d5..872652100c9 100644 --- a/app/controllers/concerns/preferred_language_switcher.rb +++ b/app/controllers/concerns/preferred_language_switcher.rb @@ -6,8 +6,6 @@ module PreferredLanguageSwitcher private def init_preferred_language - return unless Feature.enabled?(:preferred_language_switcher) - cookies[:preferred_language] = preferred_language end diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb index 76772a72865..0bee1faccf5 100644 --- a/app/controllers/import/github_controller.rb +++ b/app/controllers/import/github_controller.rb @@ -93,6 +93,23 @@ class Import::GithubController < Import::BaseController end end + def cancel_all + projects_to_cancel = Project.imported_from(provider_name).created_by(current_user).is_importing + + canceled = projects_to_cancel.map do |project| + # #reset is called to make sure project was not finished/canceled brefore calling service + result = Import::Github::CancelProjectImportService.new(project.reset, current_user).execute + + { + id: project.id, + status: result[:status], + error: result[:message] + }.compact + end + + render json: canceled + end + protected override :importable_repos |