diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 15:08:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 15:08:54 +0300 |
commit | 473b876fe3d7e0b36eb6268cc44a4fe0d94f4422 (patch) | |
tree | 2f6d5f2ecad53015024b6b1509896f5933c5c3e6 /app/helpers/admin/application_settings/settings_helper.rb | |
parent | dca8df0c90d8727d69b3501b15b481546897f3cd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/admin/application_settings/settings_helper.rb')
-rw-r--r-- | app/helpers/admin/application_settings/settings_helper.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/app/helpers/admin/application_settings/settings_helper.rb b/app/helpers/admin/application_settings/settings_helper.rb index 1741d6a953a..0a7f20caa02 100644 --- a/app/helpers/admin/application_settings/settings_helper.rb +++ b/app/helpers/admin/application_settings/settings_helper.rb @@ -15,6 +15,55 @@ module Admin def project_missing_pipeline_yaml?(project) project.repository&.gitlab_ci_yml.blank? end + + def code_suggestions_token_explanation + link_start = code_suggestions_link_start(code_suggestions_pat_docs_url) + + # rubocop:disable Layout/LineLength + # rubocop:disable Style/FormatString + s_('CodeSuggestionsSM|Your personal access token from GitLab.com. See the %{link_start}documentation%{link_end} for information on creating a personal access token.') + .html_safe % { link_start: link_start, link_end: '</a>'.html_safe } + # rubocop:enable Style/FormatString + # rubocop:enable Layout/LineLength + end + + def code_suggestions_agreement + terms_link_start = code_suggestions_link_start(code_suggestions_agreement_url) + ai_docs_link_start = code_suggestions_link_start(code_suggestions_ai_docs_url) + + # rubocop:disable Layout/LineLength + # rubocop:disable Style/FormatString + s_('CodeSuggestionsSM|• Agree to the %{terms_link_start}GitLab Testing Agreement%{link_end}.%{br} • Acknowledge that GitLab will send data from the instance, including personal data, to Google for cloud hosting.%{br} We may also send data to %{ai_docs_link_start}third-party AI providers%{link_end} to provide this feature.') + .html_safe % { terms_link_start: terms_link_start, ai_docs_link_start: ai_docs_link_start, link_end: '</a>'.html_safe, br: '</br>'.html_safe } + # rubocop:enable Style/FormatString + # rubocop:enable Layout/LineLength + end + + private + + # rubocop:disable Gitlab/DocUrl + # We want to link SaaS docs for flexibility for every URL related to Code Suggestions on Self Managed. + # We expect to update docs often during the Beta and we want to point user to the most up to date information. + def code_suggestions_docs_url + 'https://docs.gitlab.com/ee/user/project/repository/code_suggestions.html' + end + + def code_suggestions_agreement_url + 'https://about.gitlab.com/handbook/legal/testing-agreement/' + end + + def code_suggestions_ai_docs_url + 'https://docs.gitlab.com/ee/user/ai_features.html' + end + + def code_suggestions_pat_docs_url + 'https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token' + end + # rubocop:enable Gitlab/DocUrl + + def code_suggestions_link_start(url) + "<a href=\"#{url}\" target=\"_blank\" rel=\"noopener noreferrer\">".html_safe + end end end end |