Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/registrations/welcome_controller.rb')
-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