EE-only: Open account validation modal
What does this MR do and why?
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
- User receives Account Validation email
- User clicks on "Validate your account" CTA button in the email
- User is taken to the new endpoint introduced in this MR
- 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
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":
- Update
show_cc_validation_alert?
method inee/app/helpers/ee/ci/pipelines_helper.rb
to returntrue
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
- Login with any user
- Go to a pipeline of any project
- Validate that the account validation alert is shown
- 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
- This mimics the
- Validate that the account validation modal is opened on page load
- 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.
-
I have evaluated the MR acceptance checklist for this MR.