diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-04 21:09:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-04 21:09:57 +0300 |
commit | f5a72705e46f835812ffcc51658eecb08fbdf050 (patch) | |
tree | 9b322ce9c0454759d5b669be56e603a481791388 /app/controllers/jira_connect | |
parent | 23c4d0c3e1ea30be08b597a961fc91773f60309f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/jira_connect')
-rw-r--r-- | app/controllers/jira_connect/branches_controller.rb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/app/controllers/jira_connect/branches_controller.rb b/app/controllers/jira_connect/branches_controller.rb index 7d7faae62a5..97d0b75639e 100644 --- a/app/controllers/jira_connect/branches_controller.rb +++ b/app/controllers/jira_connect/branches_controller.rb @@ -8,20 +8,31 @@ class JiraConnect::BranchesController < ApplicationController feature_category :integrations def new + @new_branch_data = new_branch_data + end + + def self.feature_enabled?(user) + Feature.enabled?(:jira_connect_create_branch, user, default_enabled: :yaml) + end + + private + + def initial_branch_name return unless params[:issue_key].present? - @branch_name = Issue.to_branch_name( + Issue.to_branch_name( params[:issue_key], params[:issue_summary] ) end - def self.feature_enabled?(user) - Feature.enabled?(:jira_connect_create_branch, user, default_enabled: :yaml) + def new_branch_data + { + initial_branch_name: initial_branch_name, + success_state_svg_path: ActionController::Base.helpers.image_path('illustrations/merge_requests.svg') + } end - private - def feature_enabled! render_404 unless self.class.feature_enabled?(current_user) end |