diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-18 18:09:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-18 18:09:22 +0300 |
commit | 80d252c8e25dc88023e750cf2a22be6186cfd6aa (patch) | |
tree | ad932c5973af9081cbafb0dcbbd24a3a100105a6 /app/helpers/tree_helper.rb | |
parent | dc86d5615e92ad4dfad4e5b452e8623a552b308b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/tree_helper.rb')
-rw-r--r-- | app/helpers/tree_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index 7644ed783eb..1d8d9ddc1ec 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -199,14 +199,14 @@ module TreeHelper } end - def ide_base_path(project) + def web_ide_url_data(project) can_push_code = current_user&.can?(:push_code, project) fork_path = current_user&.fork_of(project)&.full_path - if can_push_code - project.full_path + if fork_path && !can_push_code + { path: fork_path, is_fork: true } else - fork_path || project.full_path + { path: project.full_path, is_fork: false } end end @@ -216,7 +216,7 @@ module TreeHelper show_web_ide_button = (can_collaborate || current_user&.already_forked?(project) || can_create_mr_from_fork) { - ide_base_path: ide_base_path(project), + web_ide_url_data: web_ide_url_data(project), needs_to_fork: !can_collaborate && !current_user&.already_forked?(project), show_web_ide_button: show_web_ide_button, show_gitpod_button: show_web_ide_button && Gitlab::Gitpod.feature_and_settings_enabled?(project), |