diff options
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/broadcast_messages_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/admin/groups_controller.rb | 11 | ||||
-rw-r--r-- | app/controllers/admin/impersonation_tokens_controller.rb | 19 | ||||
-rw-r--r-- | app/controllers/admin/runners_controller.rb | 7 |
4 files changed, 12 insertions, 28 deletions
diff --git a/app/controllers/admin/broadcast_messages_controller.rb b/app/controllers/admin/broadcast_messages_controller.rb index 251ba9e29f2..edd85414696 100644 --- a/app/controllers/admin/broadcast_messages_controller.rb +++ b/app/controllers/admin/broadcast_messages_controller.rb @@ -10,6 +10,9 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController # rubocop: disable CodeReuse/ActiveRecord def index + push_frontend_feature_flag(:vue_broadcast_messages, current_user) + push_frontend_feature_flag(:role_targeted_broadcast_messages, current_user) + @broadcast_messages = BroadcastMessage.order(ends_at: :desc).page(params[:page]) @broadcast_message = BroadcastMessage.new end diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index 2ae0442c005..f3c4244269d 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -60,17 +60,6 @@ class Admin::GroupsController < Admin::ApplicationController end end - def members_update - member_params = params.permit(:user_id, :access_level, :expires_at) - result = Members::CreateService.new(current_user, member_params.merge(limit: -1, source: @group, invite_source: 'admin-group-page')).execute - - if result[:status] == :success - redirect_to [:admin, @group], notice: _('Users were successfully added.') - else - redirect_to [:admin, @group], alert: result[:message] - end - end - def destroy Groups::DestroyService.new(@group, current_user).async_execute diff --git a/app/controllers/admin/impersonation_tokens_controller.rb b/app/controllers/admin/impersonation_tokens_controller.rb index eb279298baf..9d884478e98 100644 --- a/app/controllers/admin/impersonation_tokens_controller.rb +++ b/app/controllers/admin/impersonation_tokens_controller.rb @@ -14,11 +14,10 @@ class Admin::ImpersonationTokensController < Admin::ApplicationController @impersonation_token = finder.build(impersonation_token_params) if @impersonation_token.save - PersonalAccessToken.redis_store!(current_user.id, @impersonation_token.token) - redirect_to admin_user_impersonation_tokens_path, notice: _("A new impersonation token has been created.") + render json: { new_token: @impersonation_token.token, + active_access_tokens: active_impersonation_tokens }, status: :ok else - set_index_vars - render :index + render json: { errors: @impersonation_token.errors.full_messages }, status: :unprocessable_entity end end @@ -50,19 +49,19 @@ class Admin::ImpersonationTokensController < Admin::ApplicationController PersonalAccessTokensFinder.new({ user: user, impersonation: true }.merge(options)) end + def active_impersonation_tokens + tokens = finder(state: 'active', sort: 'expires_at_asc_id_desc').execute + ::ImpersonationAccessTokenSerializer.new.represent(tokens) + end + def impersonation_token_params params.require(:personal_access_token).permit(:name, :expires_at, :impersonation, scopes: []) end - # rubocop: disable CodeReuse/ActiveRecord def set_index_vars @scopes = Gitlab::Auth.available_scopes_for(current_user) @impersonation_token ||= finder.build - @inactive_impersonation_tokens = finder(state: 'inactive').execute - @active_impersonation_tokens = finder(state: 'active').execute.order(:expires_at) - - @new_impersonation_token = PersonalAccessToken.redis_getdel(current_user.id) + @active_impersonation_tokens = active_impersonation_tokens end - # rubocop: enable CodeReuse/ActiveRecord end diff --git a/app/controllers/admin/runners_controller.rb b/app/controllers/admin/runners_controller.rb index a0f72f5e58c..96fe0c9331d 100644 --- a/app/controllers/admin/runners_controller.rb +++ b/app/controllers/admin/runners_controller.rb @@ -4,13 +4,6 @@ class Admin::RunnersController < Admin::ApplicationController include RunnerSetupScripts before_action :runner, except: [:index, :tag_list, :runner_setup_scripts] - before_action only: [:index] do - push_frontend_feature_flag(:admin_runners_bulk_delete) - end - - before_action only: [:show] do - push_frontend_feature_flag(:enforce_runner_token_expires_at) - end feature_category :runner urgency :low |