Skip to content

Add alert after Slack application is installed

What does this MR do and why?

After the integration with Slack application is successful, we want to redirect to the edit page and show a success alert. This MR uses the session to show this alert.

Changelog: changed

EE: true

Screenshots or screen recordings

global_alert_fixed_-_after

How to set up and validate locally

  1. Apply this patch to disable the logic that actually installs the app (installing the app is not possible on local development).
diff --git a/ee/app/controllers/projects/settings/slacks_controller.rb b/ee/app/controllers/projects/settings/slacks_controller.rb
index 8074c58ae3b..e7d07d125d8 100644
--- a/ee/app/controllers/projects/settings/slacks_controller.rb
+++ b/ee/app/controllers/projects/settings/slacks_controller.rb
@@ -3,8 +3,8 @@
 module Projects
   module Settings
     class SlacksController < Projects::ApplicationController
-      before_action :handle_oauth_error, only: :slack_auth
-      before_action :check_oauth_state, only: :slack_auth
+      # before_action :handle_oauth_error, only: :slack_auth
+      # before_action :check_oauth_state, only: :slack_auth
       before_action :authorize_admin_project!
       before_action :slack_integration, only: [:edit, :update]
       before_action :service, only: [:destroy, :edit, :update]
@@ -14,11 +14,11 @@ class SlacksController < Projects::ApplicationController
       feature_category :integrations
 
       def slack_auth
-        result = Projects::SlackApplicationInstallService.new(project, current_user, params).execute
+        # result = Projects::SlackApplicationInstallService.new(project, current_user, params).execute
 
-        if result[:status] == :error
-          flash[:alert] = result[:message]
-        end
+        # if result[:status] == :error
+        #   flash[:alert] = result[:message]
+        # end
 
         session[:slack_install_success] = true
         redirect_to_service_page
  1. Visit the installation page at http://127.0.0.1:3000/gitlab-org/gitlab-shell/-/settings/slack/slack_auth.

You should be redirected to the Slack application page and the success alert should be rendered.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #350566 (closed)

Merge request reports