diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /app/controllers/admin | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/abuse_reports_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/admin/background_migrations_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/admin/broadcast_messages_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/admin/groups_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/admin/hooks_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/admin/topics/avatars_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/admin/topics_controller.rb | 8 | ||||
-rw-r--r-- | app/controllers/admin/users_controller.rb | 14 |
9 files changed, 25 insertions, 14 deletions
diff --git a/app/controllers/admin/abuse_reports_controller.rb b/app/controllers/admin/abuse_reports_controller.rb index 84e5cc430ef..6b998c3d494 100644 --- a/app/controllers/admin/abuse_reports_controller.rb +++ b/app/controllers/admin/abuse_reports_controller.rb @@ -13,7 +13,12 @@ class Admin::AbuseReportsController < Admin::ApplicationController def show; end def update - Admin::AbuseReportUpdateService.new(@abuse_report, current_user, permitted_params).execute + response = Admin::AbuseReportUpdateService.new(@abuse_report, current_user, permitted_params).execute + if response.success? + render json: { message: response.message } + else + render json: { message: response.message }, status: :unprocessable_entity + end end def destroy diff --git a/app/controllers/admin/background_migrations_controller.rb b/app/controllers/admin/background_migrations_controller.rb index a5211961d81..d1b87e67800 100644 --- a/app/controllers/admin/background_migrations_controller.rb +++ b/app/controllers/admin/background_migrations_controller.rb @@ -18,7 +18,7 @@ module Admin @current_tab = @relations_by_tab.key?(params[:tab]) ? params[:tab] : 'queued' @migrations = @relations_by_tab[@current_tab].page(params[:page]) @successful_rows_counts = batched_migration_class.successful_rows_counts(@migrations.map(&:id)) - @databases = Gitlab::Database.db_config_names + @databases = Gitlab::Database.db_config_names(with_schema: :gitlab_shared) end def show diff --git a/app/controllers/admin/broadcast_messages_controller.rb b/app/controllers/admin/broadcast_messages_controller.rb index 821c3cc1635..7f85103816e 100644 --- a/app/controllers/admin/broadcast_messages_controller.rb +++ b/app/controllers/admin/broadcast_messages_controller.rb @@ -93,6 +93,7 @@ module Admin target_path broadcast_type dismissable + show_in_cli ], target_access_levels: []).reverse_merge!(target_access_levels: []) end end diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index 0f9ecc60648..001f5242138 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -5,7 +5,7 @@ class Admin::GroupsController < Admin::ApplicationController before_action :group, only: [:edit, :update, :destroy, :project_update, :members_update] - feature_category :subgroups, [:create, :destroy, :edit, :index, :members_update, :new, :show, :update] + feature_category :groups_and_projects, [:create, :destroy, :edit, :index, :members_update, :new, :show, :update] def index @groups = groups.sort_by_attribute(@sort = params[:sort]) diff --git a/app/controllers/admin/hooks_controller.rb b/app/controllers/admin/hooks_controller.rb index 57ef75f12e9..c6c0e7eac90 100644 --- a/app/controllers/admin/hooks_controller.rb +++ b/app/controllers/admin/hooks_controller.rb @@ -3,7 +3,6 @@ class Admin::HooksController < Admin::ApplicationController include ::WebHooks::HookActions - feature_category :integrations urgency :low, [:test] def test diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 84eb90ce334..e79a899cee7 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -6,7 +6,7 @@ class Admin::ProjectsController < Admin::ApplicationController before_action :project, only: [:show, :transfer, :repository_check, :destroy, :edit, :update] before_action :group, only: [:show, :transfer] - feature_category :projects, [:index, :show, :transfer, :destroy, :edit, :update] + feature_category :groups_and_projects, [:index, :show, :transfer, :destroy, :edit, :update] feature_category :source_code_management, [:repository_check] def index diff --git a/app/controllers/admin/topics/avatars_controller.rb b/app/controllers/admin/topics/avatars_controller.rb index 7acdec424b4..ee0a7e68bb3 100644 --- a/app/controllers/admin/topics/avatars_controller.rb +++ b/app/controllers/admin/topics/avatars_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Admin::Topics::AvatarsController < Admin::ApplicationController - feature_category :projects + feature_category :groups_and_projects def destroy @topic = Projects::Topic.find(params[:topic_id]) diff --git a/app/controllers/admin/topics_controller.rb b/app/controllers/admin/topics_controller.rb index 94d084932ad..c4de600dd1d 100644 --- a/app/controllers/admin/topics_controller.rb +++ b/app/controllers/admin/topics_controller.rb @@ -6,7 +6,11 @@ class Admin::TopicsController < Admin::ApplicationController before_action :topic, only: [:edit, :update, :destroy] - feature_category :projects + feature_category :groups_and_projects + + before_action do + push_frontend_feature_flag(:content_editor_on_issues, current_user) + end def index @topics = Projects::TopicsFinder.new(params: params.permit(:search)).execute.page(params[:page]).without_count @@ -23,7 +27,7 @@ class Admin::TopicsController < Admin::ApplicationController @topic = Projects::Topic.new(topic_params) if @topic.save - redirect_to edit_admin_topic_path(@topic), notice: format(_('Topic %{topic_name} was successfully created.'), topic_name: @topic.name) + redirect_to admin_topics_path, notice: format(_('Topic %{topic_name} was successfully created.'), topic_name: @topic.name) else render "new" end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 45a7901b2c4..3c96e49499f 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -56,7 +56,7 @@ class Admin::UsersController < Admin::ApplicationController log_impersonation_event - flash[:alert] = format(_("You are now impersonating %{username}"), username: user.username) + flash[:notice] = format(_("You are now impersonating %{username}"), username: user.username) redirect_to root_path else @@ -87,12 +87,14 @@ class Admin::UsersController < Admin::ApplicationController end def activate - if user.blocked? - return redirect_back_or_admin_user(notice: _("Error occurred. A blocked user must be unblocked to be activated")) - end + activate_service = Users::ActivateService.new(current_user) + result = activate_service.execute(user) - user.activate - redirect_back_or_admin_user(notice: _("Successfully activated")) + if result.success? + redirect_back_or_admin_user(notice: _("Successfully activated")) + else + redirect_back_or_admin_user(alert: result.message) + end end def deactivate |