diff --git a/ee/app/assets/javascripts/users/identity_verification/components/wizard.vue b/ee/app/assets/javascripts/users/identity_verification/components/wizard.vue index ce2110768dc7cf0813a835147e1f1365dbbb485a..a41f9cb2db3f9143ccb62264768bd20eaec60f70 100644 --- a/ee/app/assets/javascripts/users/identity_verification/components/wizard.vue +++ b/ee/app/assets/javascripts/users/identity_verification/components/wizard.vue @@ -23,6 +23,12 @@ export default { GlButton, }, inject: ['verificationStatePath', 'phoneExemptionPath', 'successfulVerificationPath'], + props: { + username: { + type: String, + required: true, + }, + }, data() { return { steps: [], @@ -44,6 +50,11 @@ export default { allStepsCompleted() { return !Object.entries(this.stepsVerifiedState).filter(([, completed]) => !completed).length; }, + pageDescription() { + return sprintf(this.$options.i18n.pageDescription, { + username: this.username, + }); + }, }, mounted() { this.fetchVerificationState(); @@ -115,7 +126,7 @@ export default { i18n: { pageTitle: s__('IdentityVerification|Help us keep GitLab secure'), pageDescription: s__( - "IdentityVerification|For added security, you'll need to verify your identity in a few quick steps.", + "IdentityVerification|You are signed in as %{username}. For added security, you'll need to verify your identity in a few quick steps.", ), ccStep: s__('IdentityVerification|Step %{stepNumber}: Verify a payment method'), phoneStep: s__('IdentityVerification|Step %{stepNumber}: Verify phone number'), @@ -129,7 +140,7 @@ export default { <div class="gl-flex-grow-1 gl-max-w-62"> <header class="gl-text-center"> <h2>{{ $options.i18n.pageTitle }}</h2> - <p>{{ $options.i18n.pageDescription }}</p> + <p>{{ pageDescription }}</p> </header> <gl-loading-icon v-if="loading" /> diff --git a/ee/app/assets/javascripts/users/identity_verification/index.js b/ee/app/assets/javascripts/users/identity_verification/index.js index a76e744f99b323871dda666ee22d5229a7b2c8f2..b4db2fa18345877fb7e279a10a703faaf2fad2db 100644 --- a/ee/app/assets/javascripts/users/identity_verification/index.js +++ b/ee/app/assets/javascripts/users/identity_verification/index.js @@ -9,6 +9,7 @@ export const initIdentityVerification = () => { if (!el) return false; const { + username, email, creditCard, phoneNumber, @@ -43,6 +44,9 @@ export const initIdentityVerification = () => { arkoseDataExchangePayload, successfulVerificationPath, }, - render: (createElement) => createElement(IdentityVerificationWizard), + render: (createElement) => + createElement(IdentityVerificationWizard, { + props: { username }, + }), }); }; diff --git a/ee/app/helpers/users/identity_verification_helper.rb b/ee/app/helpers/users/identity_verification_helper.rb index 84ed5daec48759ea3fbfb5f2726895e0b6d1791e..92e9af8302a2a186fa4280925bb1077e85b2918f 100644 --- a/ee/app/helpers/users/identity_verification_helper.rb +++ b/ee/app/helpers/users/identity_verification_helper.rb @@ -44,6 +44,7 @@ def restricted_country?(country_code, namespace = nil) def build_data(user, path_helper:) { data: { + username: user.username, verification_state_path: path_helper.call(:verification_state), phone_exemption_path: path_helper.call(:toggle_phone_exemption), phone_send_code_path: path_helper.call(:send_phone_verification_code), diff --git a/ee/spec/frontend/users/identity_verification/components/wizard_spec.js b/ee/spec/frontend/users/identity_verification/components/wizard_spec.js index f429a7f4a52a5ccb412dd6fc8d7c6a2602839f22..c10ebc5a1632dc248068944bb18018c160db0769 100644 --- a/ee/spec/frontend/users/identity_verification/components/wizard_spec.js +++ b/ee/spec/frontend/users/identity_verification/components/wizard_spec.js @@ -28,6 +28,7 @@ describe('IdentityVerificationWizard', () => { let wrapper; let axiosMock; + const DEFAULT_PROPS = { username: 'test_user123' }; const DEFAULT_PROVIDE = { verificationStatePath: '/users/identity_verification/verification_state', successfulVerificationPath: '/users/identity_verification/success', @@ -38,6 +39,7 @@ describe('IdentityVerificationWizard', () => { const createComponent = ({ provide } = { provide: {} }) => { wrapper = shallowMount(IdentityVerificationWizard, { + propsData: DEFAULT_PROPS, provide: { ...DEFAULT_PROVIDE, ...provide }, }); }; @@ -81,9 +83,7 @@ describe('IdentityVerificationWizard', () => { it('displays the description', () => { expect(findDescription().text()).toBe( - s__( - "IdentityVerification|For added security, you'll need to verify your identity in a few quick steps.", - ), + `You are signed in as ${DEFAULT_PROPS.username}. For added security, you'll need to verify your identity in a few quick steps.`, ); }); diff --git a/ee/spec/helpers/users/identity_verification_helper_spec.rb b/ee/spec/helpers/users/identity_verification_helper_spec.rb index 5caeaf194fe369973bd50e812f12b08c3da0bc0b..5249b56a73fa8b44967bcbff233ccd996260718f 100644 --- a/ee/spec/helpers/users/identity_verification_helper_spec.rb +++ b/ee/spec/helpers/users/identity_verification_helper_spec.rb @@ -34,6 +34,7 @@ let(:common_data) do { + username: user.username, offer_phone_number_exemption: mock_offer_phone_number_exemption, phone_number: {}, credit_card: { diff --git a/ee/spec/support/helpers/identity_verification_helpers.rb b/ee/spec/support/helpers/identity_verification_helpers.rb index 3e1bfe00dee5fad29c8e5b44bae2d70755295f96..9882f441d6f2fe93894a51df98924b3611213a34 100644 --- a/ee/spec/support/helpers/identity_verification_helpers.rb +++ b/ee/spec/support/helpers/identity_verification_helpers.rb @@ -167,9 +167,8 @@ def verify_code(code) end def expect_to_see_identity_verification_page - expect(page).to have_content( - s_("IdentityVerification|For added security, you'll need to verify your identity") - ) + expect(page).to have_current_path(/identity_verification/) + expect(page).to have_content(s_('IdentityVerification|Help us keep GitLab secure')) end def expect_verification_completed diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 90cb3fe7514dd698a51c686c9191282acb37eaf7..19a53a7da2b916a7fc1a657612ac47ee0099bf06 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -26719,9 +26719,6 @@ msgstr "" msgid "IdentityVerification|Enter a valid code." msgstr "" -msgid "IdentityVerification|For added security, you'll need to verify your identity in a few quick steps." -msgstr "" - msgid "IdentityVerification|For added security, you'll need to verify your identity." msgstr "" @@ -26854,6 +26851,9 @@ msgstr "" msgid "IdentityVerification|We've sent a verification code to +%{phoneNumber}" msgstr "" +msgid "IdentityVerification|You are signed in as %{username}. For added security, you'll need to verify your identity in a few quick steps." +msgstr "" + msgid "IdentityVerification|You will receive a text containing a code. Standard charges may apply." msgstr ""