summaryrefslogtreecommitdiff
path: root/app/controllers/projects/issues_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/issues_controller.rb')
-rw-r--r--app/controllers/projects/issues_controller.rb35
1 files changed, 12 insertions, 23 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index cae5cc411bc..01a6de76ba5 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -56,8 +56,6 @@ class Projects::IssuesController < Projects::ApplicationController
push_frontend_feature_flag(:confidential_notes, @project, default_enabled: :yaml)
push_frontend_feature_flag(:issue_assignees_widget, @project, default_enabled: :yaml)
- record_experiment_user(:invite_members_version_b)
-
experiment(:invite_members_in_comment, namespace: @project.root_ancestor) do |experiment_instance|
experiment_instance.exclude! unless helpers.can_import_members?
@@ -110,12 +108,12 @@ class Projects::IssuesController < Projects::ApplicationController
params[:issue] ||= ActionController::Parameters.new(
assignee_ids: ""
)
- build_params = issue_create_params.merge(
+ build_params = issue_params.merge(
merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of],
discussion_to_resolve: params[:discussion_to_resolve],
- confidential: !!Gitlab::Utils.to_boolean(issue_create_params[:confidential])
+ confidential: !!Gitlab::Utils.to_boolean(issue_params[:confidential])
)
- service = ::Issues::BuildService.new(project, current_user, build_params)
+ service = ::Issues::BuildService.new(project: project, current_user: current_user, params: build_params)
@issue = @noteable = service.execute
@@ -130,12 +128,12 @@ class Projects::IssuesController < Projects::ApplicationController
end
def create
- create_params = issue_create_params.merge(spammable_params).merge(
+ create_params = issue_params.merge(spammable_params).merge(
merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of],
discussion_to_resolve: params[:discussion_to_resolve]
)
- service = ::Issues::CreateService.new(project, current_user, create_params)
+ service = ::Issues::CreateService.new(project: project, current_user: current_user, params: create_params)
@issue = service.execute
create_vulnerability_issue_feedback(issue)
@@ -162,7 +160,7 @@ class Projects::IssuesController < Projects::ApplicationController
new_project = Project.find(params[:move_to_project_id])
return render_404 unless issue.can_move?(current_user, new_project)
- @issue = ::Issues::UpdateService.new(project, current_user, target_project: new_project).execute(issue)
+ @issue = ::Issues::UpdateService.new(project: project, current_user: current_user, params: { target_project: new_project }).execute(issue)
end
respond_to do |format|
@@ -176,7 +174,7 @@ class Projects::IssuesController < Projects::ApplicationController
end
def reorder
- service = ::Issues::ReorderService.new(project, current_user, reorder_params)
+ service = ::Issues::ReorderService.new(project: project, current_user: current_user, params: reorder_params)
if service.execute(issue)
head :ok
@@ -187,7 +185,7 @@ class Projects::IssuesController < Projects::ApplicationController
def related_branches
@related_branches = ::Issues::RelatedBranchesService
- .new(project, current_user)
+ .new(project: project, current_user: current_user)
.execute(issue)
.map { |branch| branch.merge(link: branch_link(branch)) }
@@ -215,7 +213,7 @@ class Projects::IssuesController < Projects::ApplicationController
def create_merge_request
create_params = params.slice(:branch_name, :ref).merge(issue_iid: issue.iid)
create_params[:target_project_id] = params[:target_project_id]
- result = ::MergeRequests::CreateFromIssueService.new(project, current_user, create_params).execute
+ result = ::MergeRequests::CreateFromIssueService.new(project: project, current_user: current_user, mr_params: create_params).execute
if result[:status] == :success
render json: MergeRequestCreateSerializer.new.represent(result[:merge_request])
@@ -316,17 +314,8 @@ class Projects::IssuesController < Projects::ApplicationController
task_num
lock_version
discussion_locked
- ] + [{ label_ids: [], assignee_ids: [], update_task: [:index, :checked, :line_number, :line_source] }]
- end
-
- def issue_create_params
- create_params = %i[
issue_type
- ]
-
- params.require(:issue).permit(
- *create_params
- ).merge(issue_params)
+ ] + [{ label_ids: [], assignee_ids: [], update_task: [:index, :checked, :line_number, :line_source] }]
end
def reorder_params
@@ -345,7 +334,7 @@ class Projects::IssuesController < Projects::ApplicationController
def update_service
update_params = issue_params.merge(spammable_params)
- ::Issues::UpdateService.new(project, current_user, update_params)
+ ::Issues::UpdateService.new(project: project, current_user: current_user, params: update_params)
end
def finder_type
@@ -402,4 +391,4 @@ class Projects::IssuesController < Projects::ApplicationController
def create_vulnerability_issue_feedback(issue); end
end
-Projects::IssuesController.prepend_if_ee('EE::Projects::IssuesController')
+Projects::IssuesController.prepend_mod_with('Projects::IssuesController')