Commit fbf13a66 authored by Doug Stull's avatar Doug Stull Committed by Markus Koller

Fix terms wording to match submit button text

- on trials, this didn't match 'Continue' wording
  and now it will.
parent 994d1ad6
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
= recaptcha_tags = recaptcha_tags
.submit-container .submit-container
= f.submit button_text, class: 'btn gl-button btn-confirm', data: { qa_selector: 'new_user_register_button' } = f.submit button_text, class: 'btn gl-button btn-confirm', data: { qa_selector: 'new_user_register_button' }
= render 'devise/shared/terms_of_service_notice' = render 'devise/shared/terms_of_service_notice', button_text: button_text
- if show_omniauth_providers && omniauth_providers_placement == :bottom - if show_omniauth_providers && omniauth_providers_placement == :bottom
= render 'devise/shared/signup_omniauth_providers' = render 'devise/shared/signup_omniauth_providers'
- company_name = Gitlab.com? ? 'GitLab' : '' - return unless Gitlab::CurrentSettings.current_application_settings.enforce_terms?
- if Gitlab::CurrentSettings.current_application_settings.enforce_terms? %p.gl-text-gray-500.gl-mt-5.gl-mb-0
%p.gl-text-gray-500.gl-mt-5.gl-mb-0 - if Gitlab.dev_env_or_com?
= html_escape(_("By clicking Register, I agree that I have read and accepted the %{company_name} %{linkStart}Terms of Use and Privacy Policy%{linkEnd}")) % { linkStart: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, linkEnd: '</a>'.html_safe, company_name: company_name } = html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the GitLab %{link_start}Terms of Use and Privacy Policy%{link_end}")) % { button_text: button_text,
link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe }
- else
= html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the %{link_start}Terms of Use and Privacy Policy%{link_end}")) % { button_text: button_text,
link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe }
---
title: Fix trial registration terms message
merge_request: 61162
author:
type: fixed
...@@ -5556,9 +5556,6 @@ msgstr "" ...@@ -5556,9 +5556,6 @@ msgstr ""
msgid "By authenticating with an account tied to an Enterprise e-mail address, it is understood that this account is an Enterprise User. " msgid "By authenticating with an account tied to an Enterprise e-mail address, it is understood that this account is an Enterprise User. "
msgstr "" msgstr ""
msgid "By clicking Register, I agree that I have read and accepted the %{company_name} %{linkStart}Terms of Use and Privacy Policy%{linkEnd}"
msgstr ""
msgid "By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format." msgid "By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format."
msgstr "" msgstr ""
...@@ -29834,6 +29831,12 @@ msgstr "" ...@@ -29834,6 +29831,12 @@ msgstr ""
msgid "Sign-up restrictions" msgid "Sign-up restrictions"
msgstr "" msgstr ""
msgid "SignUp|By clicking %{button_text}, I agree that I have read and accepted the %{link_start}Terms of Use and Privacy Policy%{link_end}"
msgstr ""
msgid "SignUp|By clicking %{button_text}, I agree that I have read and accepted the GitLab %{link_start}Terms of Use and Privacy Policy%{link_end}"
msgstr ""
msgid "SignUp|First name is too long (maximum is %{max_length} characters)." msgid "SignUp|First name is too long (maximum is %{max_length} characters)."
msgstr "" msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'devise/shared/_signup_box' do
before do
stub_devise
allow(view).to receive(:show_omniauth_providers).and_return(false)
allow(view).to receive(:url).and_return('_url_')
allow(view).to receive(:terms_path).and_return('_terms_path_')
allow(view).to receive(:button_text).and_return('_button_text_')
allow(view).to receive(:suggestion_path).and_return('_suggestion_path_')
stub_template 'devise/shared/_error_messages.html.haml' => ''
end
context 'when terms are enforced' do
before do
allow(Gitlab::CurrentSettings.current_application_settings).to receive(:enforce_terms?).and_return(true)
end
it 'shows expected text with placeholders' do
render
expect(rendered).to have_content('By clicking _button_text_')
expect(rendered).to have_link('Terms of Use and Privacy Policy')
end
context 'when on .com' do
before do
allow(Gitlab).to receive(:dev_env_or_com?).and_return(true)
end
it 'shows expected GitLab text' do
render
expect(rendered).to have_content('I have read and accepted the GitLab Terms')
end
end
context 'when not on .com' do
before do
allow(Gitlab).to receive(:dev_env_or_com?).and_return(false)
end
it 'shows expected text without GitLab' do
render
expect(rendered).to have_content('I have read and accepted the Terms')
end
end
end
context 'when terms are not enforced' do
before do
allow(Gitlab::CurrentSettings.current_application_settings).to receive(:enforce_terms?).and_return(false)
allow(Gitlab).to receive(:dev_env_or_com?).and_return(true)
end
it 'shows expected text with placeholders' do
render
expect(rendered).not_to have_content('By clicking')
end
end
def stub_devise
allow(view).to receive(:devise_mapping).and_return(Devise.mappings[:user])
allow(view).to receive(:resource).and_return(spy)
allow(view).to receive(:resource_name).and_return(:user)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment