diff options
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 |