summaryrefslogtreecommitdiff
path: root/app/controllers/registrations
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /app/controllers/registrations
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
downloadgitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'app/controllers/registrations')
-rw-r--r--app/controllers/registrations/welcome_controller.rb38
1 files changed, 21 insertions, 17 deletions
diff --git a/app/controllers/registrations/welcome_controller.rb b/app/controllers/registrations/welcome_controller.rb
index 4a42632a980..cfb4e939b35 100644
--- a/app/controllers/registrations/welcome_controller.rb
+++ b/app/controllers/registrations/welcome_controller.rb
@@ -21,20 +21,10 @@ module Registrations
def update
result = ::Users::SignupService.new(current_user, update_params).execute
- if result[:status] == :success
+ if result.success?
track_event('successfully_submitted_form')
- return redirect_to issues_dashboard_path(assignee_username: current_user.username) if show_tasks_to_be_done?
-
- return redirect_to update_success_path if show_signup_onboarding?
-
- members = current_user.members
-
- if registering_from_invite?(members)
- redirect_to members_activity_path(members), notice: helpers.invite_accepted_notice(members.last)
- else
- redirect_to path_for_signed_in_user(current_user)
- end
+ redirect_to update_success_path
else
render :show
end
@@ -79,21 +69,35 @@ module Registrations
end
# overridden in EE
- def show_signup_onboarding?
+ def redirect_to_signup_onboarding?
false
end
- def show_tasks_to_be_done?
+ def redirect_for_tasks_to_be_done?
MemberTask.for_members(current_user.members).exists?
end
- # overridden in EE
def update_success_path
+ return issues_dashboard_path(assignee_username: current_user.username) if redirect_for_tasks_to_be_done?
+
+ return signup_onboarding_path if redirect_to_signup_onboarding?
+
+ members = current_user.members
+
+ if registering_from_invite?(members)
+ flash[:notice] = helpers.invite_accepted_notice(members.last)
+ members_activity_path(members)
+ else
+ # subscription registrations goes through here as well
+ path_for_signed_in_user(current_user)
+ end
end
# overridden in EE
- def track_event(category)
- end
+ def signup_onboarding_path; end
+
+ # overridden in EE
+ def track_event(action); end
end
end