Skip to content
代码片段 群组 项目
提交 b267c1b6 编辑于 作者: Aleksei Lipniagov's avatar Aleksei Lipniagov
浏览文件

Update CodeSuggestions-related settings text on SM

Update legal and UI.

Changelog: other
上级 2991ebf7
No related branches found
No related tags found
无相关合并请求
......@@ -16,12 +16,23 @@ def project_missing_pipeline_yaml?(project)
project.repository&.gitlab_ci_yml.blank?
end
def code_suggestions_description
link_start = code_suggestions_link_start(code_suggestions_docs_url)
# rubocop:disable Layout/LineLength
# rubocop:disable Style/FormatString
s_('CodeSuggestionsSM|Enable Code Suggestions for users of this instance. %{link_start}What are Code Suggestions?%{link_end}')
.html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
# rubocop:enable Style/FormatString
# rubocop:enable Layout/LineLength
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.')
s_('CodeSuggestionsSM|On GitLab.com, create a token. This token is required to use Code Suggestions on your self-managed instance. %{link_start}How do I create a token?%{link_end}')
.html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
# rubocop:enable Style/FormatString
# rubocop:enable Layout/LineLength
......@@ -33,8 +44,8 @@ def code_suggestions_agreement
# rubocop:disable Layout/LineLength
# rubocop:disable Style/FormatString
s_('CodeSuggestionsSM|&#8226; Agree to the %{terms_link_start}GitLab Testing Agreement%{link_end}.%{br} &#8226; Acknowledge that GitLab will send data from the instance, including personal data, to Google for cloud hosting.%{br} &nbsp;&nbsp;&nbsp;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 }
s_('CodeSuggestionsSM|By enabling this feature, you agree to the %{terms_link_start}GitLab Testing Agreement%{link_end} and acknowledge that GitLab will send data from the instance, including personal data, to our %{ai_docs_link_start}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 }
# rubocop:enable Style/FormatString
# rubocop:enable Layout/LineLength
end
......@@ -53,7 +64,7 @@ def code_suggestions_agreement_url
end
def code_suggestions_ai_docs_url
'https://docs.gitlab.com/ee/user/ai_features.html'
'https://docs.gitlab.com/ee/user/ai_features.html#third-party-services'
end
def code_suggestions_pat_docs_url
......
......@@ -12,8 +12,7 @@
= render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do
= expanded ? _('Collapse') : _('Expand')
%p
= s_('CodeSuggestionsSM|Enable Code Suggestion for users of this GitLab instance.')
= link_to sprite_icon('question-o'), code_suggestions_docs_url, target: '_blank', class: 'has-tooltip', title: _('More information')
= code_suggestions_description
.settings-content
= gitlab_ui_form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-ai-access-settings'), html: { class: 'fieldset-form', id: 'ai-access-settings' } do |f|
......@@ -22,7 +21,7 @@
%fieldset
.form-group
= f.gitlab_ui_checkbox_component :instance_level_code_suggestions_enabled,
s_('CodeSuggestionsSM|Turn on Code Suggestions for this instance. By turning on this feature, you:'),
s_('CodeSuggestionsSM|Enable Code Suggestions for this instance %{beta}').html_safe % { beta: gl_badge_tag(_('Beta'), variant: :neutral, size: :sm) },
help_text: code_suggestions_agreement
= f.label :ai_access_token, token_label, class: 'label-bold'
= f.password_field :ai_access_token, value: token_value, autocomplete: 'on', class: 'form-control gl-form-input', aria: { describedby: 'code_suggestions_token_explanation' }
......
......@@ -11148,25 +11148,25 @@ msgstr ""
msgid "CodeSuggestionsAlert|Get started with Code Suggestions, available for free during the beta period."
msgstr ""
 
msgid "CodeSuggestionsSM|&#8226; Agree to the %{terms_link_start}GitLab Testing Agreement%{link_end}.%{br} &#8226; Acknowledge that GitLab will send data from the instance, including personal data, to Google for cloud hosting.%{br} &nbsp;&nbsp;&nbsp;We may also send data to %{ai_docs_link_start}third-party AI providers%{link_end} to provide this feature."
msgid "CodeSuggestionsSM|By enabling this feature, you agree to the %{terms_link_start}GitLab Testing Agreement%{link_end} and acknowledge that GitLab will send data from the instance, including personal data, to our %{ai_docs_link_start}AI providers%{link_end} to provide this feature."
msgstr ""
 
msgid "CodeSuggestionsSM|Code Suggestions"
msgstr ""
 
msgid "CodeSuggestionsSM|Enable Code Suggestion for users of this GitLab instance."
msgid "CodeSuggestionsSM|Enable Code Suggestions for this instance %{beta}"
msgstr ""
 
msgid "CodeSuggestionsSM|Enter new personal access token"
msgid "CodeSuggestionsSM|Enable Code Suggestions for users of this instance. %{link_start}What are Code Suggestions?%{link_end}"
msgstr ""
 
msgid "CodeSuggestionsSM|Personal access token"
msgid "CodeSuggestionsSM|Enter new personal access token"
msgstr ""
 
msgid "CodeSuggestionsSM|Turn on Code Suggestions for this instance. By turning on this feature, you:"
msgid "CodeSuggestionsSM|On GitLab.com, create a token. This token is required to use Code Suggestions on your self-managed instance. %{link_start}How do I create a token?%{link_end}"
msgstr ""
 
msgid "CodeSuggestionsSM|Your personal access token from GitLab.com. See the %{link_start}documentation%{link_end} for information on creating a personal access token."
msgid "CodeSuggestionsSM|Personal access token"
msgstr ""
 
msgid "CodeSuggestionsThirdPartyAlert|%{code_suggestions_link_start}Code Suggestions%{link_end} now uses third-party AI services to provide higher quality suggestions. You can %{third_party_link_start}disable third-party services%{link_end} for your group, or disable Code Suggestions entirely in %{profile_settings_link_start}your user profile%{link_end}."
......@@ -33,6 +33,12 @@
end
describe 'Code Suggestions for Self-Managed instances', feature_category: :code_suggestions do
describe '#code_suggestions_description' do
subject { helper.code_suggestions_description }
it { is_expected.to include 'https://docs.gitlab.com/ee/user/project/repository/code_suggestions.html' }
end
describe '#code_suggestions_token_explanation' do
subject { helper.code_suggestions_token_explanation }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册