diff options
Diffstat (limited to 'app/controllers/registrations')
-rw-r--r-- | app/controllers/registrations/experience_levels_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/registrations/invites_controller.rb | 9 | ||||
-rw-r--r-- | app/controllers/registrations/welcome_controller.rb | 19 |
3 files changed, 26 insertions, 4 deletions
diff --git a/app/controllers/registrations/experience_levels_controller.rb b/app/controllers/registrations/experience_levels_controller.rb index 3a721823d89..d04e8d296ed 100644 --- a/app/controllers/registrations/experience_levels_controller.rb +++ b/app/controllers/registrations/experience_levels_controller.rb @@ -38,7 +38,7 @@ module Registrations end def learn_gitlab - @learn_gitlab ||= LearnGitlab.new(current_user) + @learn_gitlab ||= LearnGitlab::Project.new(current_user) end end end diff --git a/app/controllers/registrations/invites_controller.rb b/app/controllers/registrations/invites_controller.rb new file mode 100644 index 00000000000..548714e80e9 --- /dev/null +++ b/app/controllers/registrations/invites_controller.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Registrations + class InvitesController < RegistrationsController + layout 'simple_registration' + + before_action :check_if_gl_com_or_dev + end +end diff --git a/app/controllers/registrations/welcome_controller.rb b/app/controllers/registrations/welcome_controller.rb index 62ec03206c4..87465f8714d 100644 --- a/app/controllers/registrations/welcome_controller.rb +++ b/app/controllers/registrations/welcome_controller.rb @@ -18,7 +18,13 @@ module Registrations if result[:status] == :success return redirect_to new_users_sign_up_group_path if show_signup_onboarding? - redirect_to path_for_signed_in_user(current_user) + members = current_user.members + + if members.count == 1 && members.last.source.present? + redirect_to members_activity_path(members), notice: helpers.invite_accepted_notice(members.last) + else + redirect_to path_for_signed_in_user(current_user) + end else render :show end @@ -48,7 +54,14 @@ module Registrations def path_for_signed_in_user(user) return users_almost_there_path if requires_confirmation?(user) - stored_location_for(user) || dashboard_projects_path + stored_location_for(user) || members_activity_path(user.members) + end + + def members_activity_path(members) + return dashboard_projects_path unless members.any? + return dashboard_projects_path unless members.last.source.present? + + members.last.source.activity_path end def show_signup_onboarding? @@ -57,4 +70,4 @@ module Registrations end end -Registrations::WelcomeController.prepend_if_ee('EE::Registrations::WelcomeController') +Registrations::WelcomeController.prepend_mod_with('Registrations::WelcomeController') |