Commit c549cdde authored by Stan Hu's avatar Stan Hu

Merge branch '330670-namespace-integrations-controller-concerns' into 'master'

Namespace integrations controller concerns

See merge request gitlab-org/gitlab!73430
parents aae11d62 79740505
# frozen_string_literal: true # frozen_string_literal: true
class Admin::HookLogsController < Admin::ApplicationController class Admin::HookLogsController < Admin::ApplicationController
include HooksExecution include ::Integrations::HooksExecution
before_action :hook, only: [:show, :retry] before_action :hook, only: [:show, :retry]
before_action :hook_log, only: [:show, :retry] before_action :hook_log, only: [:show, :retry]
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::HooksController < Admin::ApplicationController class Admin::HooksController < Admin::ApplicationController
include HooksExecution include ::Integrations::HooksExecution
before_action :hook_logs, only: :edit before_action :hook_logs, only: :edit
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::IntegrationsController < Admin::ApplicationController class Admin::IntegrationsController < Admin::ApplicationController
include IntegrationsActions include ::Integrations::Actions
before_action :not_found, unless: -> { instance_level_integrations? } before_action :not_found, unless: -> { instance_level_integrations? }
......
# frozen_string_literal: true # frozen_string_literal: true
module IntegrationsActions module Integrations::Actions
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
......
# frozen_string_literal: true # frozen_string_literal: true
module HooksExecution module Integrations::HooksExecution
extend ActiveSupport::Concern extend ActiveSupport::Concern
private private
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Groups module Groups
module Settings module Settings
class IntegrationsController < Groups::ApplicationController class IntegrationsController < Groups::ApplicationController
include IntegrationsActions include ::Integrations::Actions
before_action :authorize_admin_group! before_action :authorize_admin_group!
......
# frozen_string_literal: true # frozen_string_literal: true
class Projects::HookLogsController < Projects::ApplicationController class Projects::HookLogsController < Projects::ApplicationController
include HooksExecution include ::Integrations::HooksExecution
before_action :authorize_admin_project! before_action :authorize_admin_project!
......
# frozen_string_literal: true # frozen_string_literal: true
class Projects::HooksController < Projects::ApplicationController class Projects::HooksController < Projects::ApplicationController
include HooksExecution include ::Integrations::HooksExecution
# Authorize # Authorize
before_action :authorize_admin_project! before_action :authorize_admin_project!
......
# frozen_string_literal: true # frozen_string_literal: true
class Groups::HooksController < Groups::ApplicationController class Groups::HooksController < Groups::ApplicationController
include HooksExecution include ::Integrations::HooksExecution
# Authorize # Authorize
before_action :group before_action :group
......
...@@ -9,7 +9,7 @@ RSpec.describe Admin::IntegrationsController do ...@@ -9,7 +9,7 @@ RSpec.describe Admin::IntegrationsController do
sign_in(admin) sign_in(admin)
end end
it_behaves_like IntegrationsActions do it_behaves_like Integrations::Actions do
let(:integration_attributes) { { instance: true, project: nil } } let(:integration_attributes) { { instance: true, project: nil } }
let(:routing_params) do let(:routing_params) do
......
...@@ -10,7 +10,7 @@ RSpec.describe Groups::Settings::IntegrationsController do ...@@ -10,7 +10,7 @@ RSpec.describe Groups::Settings::IntegrationsController do
sign_in(user) sign_in(user)
end end
it_behaves_like IntegrationsActions do it_behaves_like Integrations::Actions do
let(:integration_attributes) { { group: group, project: nil } } let(:integration_attributes) { { group: group, project: nil } }
let(:routing_params) do let(:routing_params) do
......
...@@ -18,7 +18,7 @@ RSpec.describe Projects::ServicesController do ...@@ -18,7 +18,7 @@ RSpec.describe Projects::ServicesController do
project.add_maintainer(user) project.add_maintainer(user)
end end
it_behaves_like IntegrationsActions do it_behaves_like Integrations::Actions do
let(:integration_attributes) { { project: project } } let(:integration_attributes) { { project: project } }
let(:routing_params) do let(:routing_params) do
......
# frozen_string_literal: true # frozen_string_literal: true
RSpec.shared_examples IntegrationsActions do RSpec.shared_examples Integrations::Actions do
let(:integration) do let(:integration) do
create(:datadog_integration, create(:datadog_integration,
integration_attributes.merge( integration_attributes.merge(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment