diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-23 03:09:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-23 03:09:09 +0300 |
commit | 5df6990daccf98d24f3ac45865d0386c3a4c3eb5 (patch) | |
tree | c2d2f2d59012d1dee0fadfdf6d321e0db23cbb9e /app/helpers | |
parent | b489f0f0a1ebcea2044911b7b38837f072b7ee05 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/blob_helper.rb | 16 | ||||
-rw-r--r-- | app/helpers/ide_helper.rb | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 41bbd0fddd5..3144686bba9 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -41,20 +41,20 @@ module BlobHelper result end - def ide_fork_and_edit_path(project = @project, ref = @ref, path = @path, options = {}) - fork_path_for_current_user(project, ide_edit_path(project, ref, path)) + def ide_fork_and_edit_path(project = @project, ref = @ref, path = @path, with_notice: true) + fork_path_for_current_user(project, ide_edit_path(project, ref, path), with_notice: with_notice) end def fork_and_edit_path(project = @project, ref = @ref, path = @path, options = {}) fork_path_for_current_user(project, edit_blob_path(project, ref, path, options)) end - def fork_path_for_current_user(project, path) + def fork_path_for_current_user(project, path, with_notice: true) return unless current_user project_forks_path(project, namespace_key: current_user.namespace&.id, - continue: edit_blob_fork_params(path)) + continue: edit_blob_fork_params(path, with_notice: with_notice)) end def encode_ide_path(path) @@ -330,12 +330,12 @@ module BlobHelper blob if blob&.readable_text? end - def edit_blob_fork_params(path) + def edit_blob_fork_params(path, with_notice: true) { to: path, - notice: edit_in_new_fork_notice, - notice_now: edit_in_new_fork_notice_now - } + notice: (edit_in_new_fork_notice if with_notice), + notice_now: (edit_in_new_fork_notice_now if with_notice) + }.compact end def edit_modify_file_fork_params(action) diff --git a/app/helpers/ide_helper.rb b/app/helpers/ide_helper.rb index 5f0d513ba35..61d8d0f779d 100644 --- a/app/helpers/ide_helper.rb +++ b/app/helpers/ide_helper.rb @@ -16,7 +16,7 @@ module IdeHelper 'branch-name' => @branch, 'file-path' => @path, 'merge-request' => @merge_request, - 'forked-project' => convert_to_project_entity_json(@forked_project), + 'fork-info' => @fork_info&.to_json, 'project' => convert_to_project_entity_json(@project) } end |