Welcome to mirror list, hosted at ThFree Co, Russian Federation.

jira_controller.rb « import « projects « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 976ac7df97643722eb875e1a7c66976aa694e31c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

module Projects
  module Import
    class JiraController < Projects::ApplicationController
      before_action :authenticate_user!
      before_action :authorize_read_project!
      before_action :validate_jira_import_settings!

      def show
      end

      private

      def validate_jira_import_settings!
        Gitlab::JiraImport.validate_project_settings!(@project, user: current_user, configuration_check: false)

        true
      rescue Projects::ImportService::Error => e
        flash[:notice] = e.message
        redirect_to project_issues_path(@project)

        false
      end

      def jira_service
        strong_memoize(:jira_service) do
          @project.jira_service
        end
      end

      def jira_import_params
        params.permit(:jira_project_key)
      end
    end
  end
end