Skip to content

EE-only: Open account validation modal

Eugie Limpin requested to merge open-account-validation-modal into master

What does this MR do and why?

This functionality is EE-only

This MR is part of #346233 (closed).

It adds a new endpoint (/:group_id/:project_id/-/pipelines/:pipeline_id/validate_account) that sets session[:start_account_validation] = true and redirects the user to the pipeline show page. This new endpoint will also implement event tracking (implemented in !76195 (merged)).

session[:start_account_validation] is used to set open_validate_account_modal data-attr on the view template and deleted immediately. The open_validate_account_modal data-attr in turn is used to open the validate account modal in the show pipeline page so users can start account validation process immediately when coming from the Account Validation Email.

Flow overview

  1. User receives Account Validation email
  2. User clicks on "Validate your account" CTA button in the email
  3. User is taken to the new endpoint introduced in this MR
  4. User is redirected to the show pipeline page with the validate account modal open

Steps 3 & 4 are implemented in this MR.

Screenshots or screen recordings

go_to_a_pipeline

How to set up and validate locally

Set up

Setting up local env properly to have the account validation alert appear is a very long process (see instructions in this MR) so let's "cheat":

  1. Update show_cc_validation_alert? method in ee/app/helpers/ee/ci/pipelines_helper.rb to return true
       def show_cc_validation_alert?(pipeline)
         return true
         # return false if pipeline.user.blank? || current_user != pipeline.user
    
         # pipeline.user_not_verified? && !pipeline.user.has_required_credit_card_to_run_pipelines?(pipeline.project)
       end

Validate

  1. Login with any user
  2. Go to a pipeline of any project
    Click to expand go_to_a_pipeline
  3. Validate that the account validation alert is shown
  4. Update the URL to append /validate_account then press enter to reload the page with the new URL
    • This mimics the Email CTA click -> New endpoint part of the flow mentioned above
  5. Validate that the account validation modal is opened on page load
    Click to expand go_to_a_pipeline
  6. Reload the page and validate that the account validation modal is not opened

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugie Limpin

Merge request reports

Loading