Skip to content

Commit ec00662

Browse files
committed
Redirect dashboard to path and add path controller
1 parent 17e3478 commit ec00662

16 files changed

Lines changed: 38 additions & 33 deletions

app/controllers/auth_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def create
2929

3030
if current_user&.trial?
3131
if current_user.email != user.email
32-
redirect_to dashboard_path, alert: "This email already has an account! Please sign out and log in with HCA."
32+
redirect_to path_path, alert: "This email already has an account! Please sign out and log in with HCA."
3333
return
3434
end
3535

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
class LandingController < ApplicationController
22
allow_unauthenticated_access only: %i[index] # Public landing page
3-
allow_trial_access only: %i[index] # Trial users see landing before redirect to dashboard
3+
allow_trial_access only: %i[index] # Trial users see landing before redirect to path
44
skip_onboarding_redirect only: %i[index] # Landing page redirects signed-in users itself
55
skip_after_action :verify_authorized, only: %i[index] # No authorizable resource
66
skip_after_action :verify_policy_scoped, only: %i[index] # No scoped collection
77

88
def index
9-
return redirect_to dashboard_path if user_signed_in?
9+
return redirect_to path_path if user_signed_in?
1010
end
1111
end

app/controllers/lapse_auth_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def callback
3737
return_to = session.delete(:lapse_return_to)
3838
return_project_id = session.delete(:lapse_return_project_id)
3939
redirect_path = if return_to == "journal"
40-
dashboard_path(open: "journal", project_id: return_project_id)
40+
path_path(open: "journal", project_id: return_project_id)
4141
else
4242
root_path
4343
end

app/controllers/onboarding_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class OnboardingController < ApplicationController
77
skip_after_action :verify_policy_scoped # No index action; no policy-scoped queries
88

99
def show
10-
return redirect_to dashboard_path if current_user.onboarded?
10+
return redirect_to path_path if current_user.onboarded?
1111

1212
step = requested_step || current_step
1313
return complete_onboarding if step.nil?
@@ -27,7 +27,7 @@ def show
2727
end
2828

2929
def update
30-
return redirect_to dashboard_path if current_user.onboarded?
30+
return redirect_to path_path if current_user.onboarded?
3131

3232
step = OnboardingConfig.find_step(params[:question_key])
3333
unless step
@@ -95,6 +95,6 @@ def last_step?(key)
9595

9696
def complete_onboarding
9797
current_user.update!(onboarded: true)
98-
redirect_to dashboard_path, notice: "Welcome to the dashboard!"
98+
redirect_to path_path, notice: "Welcome to the path!"
9999
end
100100
end
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class DashboardController < ApplicationController
2-
allow_trial_access only: %i[index] # Trial users can view their dashboard
1+
class PathController < ApplicationController
2+
allow_trial_access only: %i[index] # Trial users can view their path
33
skip_after_action :verify_authorized, only: %i[index] # No authorizable resource
44
skip_after_action :verify_policy_scoped, only: %i[index] # No scoped collection
55

app/controllers/projects_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def create
5353
authorize @project
5454

5555
if @project.save
56-
# Redirect to dashboard when created from the onboarding modal so it closes and tooltips update
57-
destination = params[:return_to] == "dashboard" ? dashboard_path : @project
56+
# Redirect to path when created from the onboarding modal so it closes and tooltips update
57+
destination = params[:return_to] == "path" ? path_path : @project
5858
redirect_to destination, notice: "Project created."
5959
else
6060
redirect_back fallback_location: new_project_path, inertia: { errors: @project.errors.messages }

app/controllers/trial_sessions_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class TrialSessionsController < ApplicationController
66
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to root_path, alert: "Try again later." }
77

88
def create
9-
redirect_to dashboard_path and return if user_signed_in? && !current_user.trial? # Verified users cannot create trial sessions
9+
redirect_to path_path and return if user_signed_in? && !current_user.trial? # Verified users cannot create trial sessions
1010

1111
email = params[:email].to_s.strip.downcase
1212

@@ -35,6 +35,6 @@ def create
3535
}
3636

3737
session[:user_id] = trial_user.id
38-
redirect_to dashboard_path, notice: "Welcome!"
38+
redirect_to path_path, notice: "Welcome!"
3939
end
4040
end
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)