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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/learn_gitlab_helper.rb')
-rw-r--r--app/helpers/learn_gitlab_helper.rb38
1 files changed, 14 insertions, 24 deletions
diff --git a/app/helpers/learn_gitlab_helper.rb b/app/helpers/learn_gitlab_helper.rb
index 7dfd9ed47e3..60f3b12d736 100644
--- a/app/helpers/learn_gitlab_helper.rb
+++ b/app/helpers/learn_gitlab_helper.rb
@@ -1,6 +1,10 @@
# frozen_string_literal: true
module LearnGitlabHelper
+ IMAGE_PATH_PLAN = "learn_gitlab/section_plan.svg"
+ IMAGE_PATH_DEPLOY = "learn_gitlab/section_deploy.svg"
+ IMAGE_PATH_WORKSPACE = "learn_gitlab/section_workspace.svg"
+
def learn_gitlab_enabled?(project)
return false unless current_user
@@ -25,19 +29,7 @@ module LearnGitlabHelper
def onboarding_actions_data(project)
attributes = onboarding_progress(project).attributes.symbolize_keys
- urls_to_use = nil
-
- experiment(
- :change_continuous_onboarding_link_urls,
- namespace: project.namespace,
- actor: current_user,
- sticky_to: project.namespace
- ) do |e|
- e.control { urls_to_use = action_urls }
- e.candidate { urls_to_use = new_action_urls(project) }
- end
-
- urls_to_use.to_h do |action, url|
+ action_urls(project).to_h do |action, url|
[
action,
url: url,
@@ -50,13 +42,13 @@ module LearnGitlabHelper
def onboarding_sections_data
{
workspace: {
- svg: image_path("learn_gitlab/section_workspace.svg")
+ svg: image_path(IMAGE_PATH_WORKSPACE)
},
plan: {
- svg: image_path("learn_gitlab/section_plan.svg")
+ svg: image_path(IMAGE_PATH_PLAN)
},
deploy: {
- svg: image_path("learn_gitlab/section_deploy.svg")
+ svg: image_path(IMAGE_PATH_DEPLOY)
}
}
end
@@ -65,22 +57,20 @@ module LearnGitlabHelper
{ name: project.name }
end
- def action_urls
- LearnGitlab::Onboarding::ACTION_ISSUE_IDS.transform_values { |id| project_issue_url(learn_gitlab_project, id) }
- .merge(LearnGitlab::Onboarding::ACTION_DOC_URLS)
- end
-
- def new_action_urls(project)
- action_urls.merge(
+ def action_urls(project)
+ action_issue_urls.merge(
issue_created: project_issues_path(project),
git_write: project_path(project),
- pipeline_created: project_pipelines_path(project),
merge_request_created: project_merge_requests_path(project),
user_added: project_members_url(project),
security_scan_enabled: project_security_configuration_path(project)
)
end
+ def action_issue_urls
+ LearnGitlab::Onboarding::ACTION_ISSUE_IDS.transform_values { |id| project_issue_url(learn_gitlab_project, id) }
+ end
+
def learn_gitlab_project
@learn_gitlab_project ||= LearnGitlab::Project.new(current_user).project
end