diff --git a/lib/epicenter/release.ex b/lib/epicenter/release.ex
index 7037c685..8a1aa9ca 100644
--- a/lib/epicenter/release.ex
+++ b/lib/epicenter/release.ex
@@ -1,8 +1,7 @@
defmodule Epicenter.Release do
alias Epicenter.Accounts
alias Epicenter.AuditLog
- alias EpicenterWeb.Endpoint
- alias EpicenterWeb.Router.Helpers, as: Routes
+ use Phoenix.VerifiedRoutes, endpoint: EpicenterWeb.Endpoint, router: EpicenterWeb.Router
@app :epicenter
@@ -143,7 +142,7 @@ defmodule Epicenter.Release do
defp generated_password_reset_url(user) do
{:ok, %{body: body}} =
Accounts.deliver_user_reset_password_instructions(user, fn encoded_token ->
- Routes.user_reset_password_url(Endpoint, :edit, encoded_token)
+ url(~p"/users/reset-password/#{encoded_token}")
end)
[_body, url] = Regex.run(~r|\n(https?://[^\n]+)\n|, body)
diff --git a/lib/epicenter_web.ex b/lib/epicenter_web.ex
index d1771844..262caee7 100644
--- a/lib/epicenter_web.ex
+++ b/lib/epicenter_web.ex
@@ -23,7 +23,7 @@ defmodule EpicenterWeb do
import Plug.Conn
import Epicenter.Gettext
- alias EpicenterWeb.Router.Helpers, as: Routes
+ use Phoenix.VerifiedRoutes, endpoint: EpicenterWeb.Endpoint, router: EpicenterWeb.Router
end
end
@@ -49,6 +49,7 @@ defmodule EpicenterWeb do
use PhoenixHTMLHelpers
use Phoenix.LiveView, layout: {EpicenterWeb.LayoutView, :live}
use EpicenterWeb.SearchHandling
+ use Phoenix.VerifiedRoutes, endpoint: EpicenterWeb.Endpoint, router: EpicenterWeb.Router
unquote(view_helpers())
end
@@ -81,6 +82,14 @@ defmodule EpicenterWeb do
end
end
+ def presenter do
+ quote do
+ use Phoenix.Component
+ use Phoenix.VerifiedRoutes, endpoint: EpicenterWeb.Endpoint, router: EpicenterWeb.Router
+ alias EpicenterWeb.Format
+ end
+ end
+
defp view_helpers do
quote do
# Use all HTML functionality (forms, tags, etc)
@@ -97,7 +106,7 @@ defmodule EpicenterWeb do
import Epicenter.Gettext
import EpicenterWeb.ErrorHelpers
- alias EpicenterWeb.Router.Helpers, as: Routes
+ use Phoenix.VerifiedRoutes, endpoint: EpicenterWeb.Endpoint, router: EpicenterWeb.Router
end
end
diff --git a/lib/epicenter_web/controllers/import_controller.ex b/lib/epicenter_web/controllers/import_controller.ex
index 07a9d3fa..7887d271 100644
--- a/lib/epicenter_web/controllers/import_controller.ex
+++ b/lib/epicenter_web/controllers/import_controller.ex
@@ -3,7 +3,6 @@ defmodule EpicenterWeb.ImportController do
LiveView doesn't currently support file uploads, so this is a regular controller. It could probably be enhanced
with some ajax or something.
"""
-
use EpicenterWeb, :controller
import EpicenterWeb.ControllerHelpers, only: [assign_defaults: 2]
@@ -28,17 +27,17 @@ defmodule EpicenterWeb.ImportController do
conn
|> Session.set_last_csv_import_info(popped_import_info)
- |> redirect(to: Routes.import_path(conn, :show))
+ |> redirect(to: ~p"/import/complete")
{:error, [user_readable: user_readable_message]} ->
conn
|> Session.set_import_error_message(user_readable_message)
- |> redirect(to: Routes.import_start_path(conn, EpicenterWeb.ImportLive))
+ |> redirect(to: ~p"/import/start")
{:error, %DateParsingError{user_readable: user_readable_message}} ->
conn
|> Session.set_import_error_message(user_readable_message)
- |> redirect(to: Routes.import_start_path(conn, EpicenterWeb.ImportLive))
+ |> redirect(to: ~p"/import/start")
end
end
diff --git a/lib/epicenter_web/controllers/root_controller.ex b/lib/epicenter_web/controllers/root_controller.ex
index b6398c29..af690467 100644
--- a/lib/epicenter_web/controllers/root_controller.ex
+++ b/lib/epicenter_web/controllers/root_controller.ex
@@ -2,6 +2,6 @@ defmodule EpicenterWeb.RootController do
use EpicenterWeb, :controller
def show(conn, _params) do
- conn |> redirect(to: Routes.people_path(conn, EpicenterWeb.PeopleLive))
+ conn |> redirect(to: ~p"/people")
end
end
diff --git a/lib/epicenter_web/controllers/user_auth.ex b/lib/epicenter_web/controllers/user_auth.ex
index b6c20ba3..d26c5a8e 100644
--- a/lib/epicenter_web/controllers/user_auth.ex
+++ b/lib/epicenter_web/controllers/user_auth.ex
@@ -1,10 +1,9 @@
defmodule EpicenterWeb.UserAuth do
import Plug.Conn
- import Phoenix.Controller
+ use EpicenterWeb, :controller
alias Epicenter.Accounts
alias EpicenterWeb.Session
- alias EpicenterWeb.Router.Helpers, as: Routes
@doc """
Logs the user in.
@@ -22,7 +21,7 @@ defmodule EpicenterWeb.UserAuth do
user_token = Accounts.generate_user_session_token(user)
user_return_to = get_session(conn, :user_return_to)
- mfa_path = user.mfa_secret == nil && Routes.user_multifactor_auth_setup_path(conn, :new)
+ mfa_path = user.mfa_secret == nil && ~p"/users/mfa-setup"
user_agent = get_req_header(conn, "user-agent") |> Euclid.Extra.List.first("user_agent_not_found")
{:ok, _} = Accounts.create_login(%{session_id: user_token.id, user_agent: user_agent, user_id: user.id})
@@ -125,9 +124,9 @@ defmodule EpicenterWeb.UserAuth do
they use the application at all, here would be a good place.
"""
def require_authenticated_user(conn, opts) do
- login_path = Routes.user_session_path(conn, :new)
- mfa_setup_path = Routes.user_multifactor_auth_setup_path(conn, :new)
- mfa_path = Routes.user_multifactor_auth_path(conn, :new)
+ login_path = ~p"/users/login"
+ mfa_setup_path = ~p"/users/mfa-setup"
+ mfa_path = ~p"/users/mfa"
error =
case user_authentication_status(conn, opts) do
diff --git a/lib/epicenter_web/controllers/user_multifactor_auth_setup_controller.ex b/lib/epicenter_web/controllers/user_multifactor_auth_setup_controller.ex
index 9ce5504e..1f0d18b9 100644
--- a/lib/epicenter_web/controllers/user_multifactor_auth_setup_controller.ex
+++ b/lib/epicenter_web/controllers/user_multifactor_auth_setup_controller.ex
@@ -1,6 +1,5 @@
defmodule EpicenterWeb.UserMultifactorAuthSetupController do
use EpicenterWeb, :controller
-
import EpicenterWeb.ControllerHelpers, only: [assign_defaults: 1]
alias Epicenter.Accounts
@@ -30,7 +29,7 @@ defmodule EpicenterWeb.UserMultifactorAuthSetupController do
}}
)
- conn |> Session.put_multifactor_auth_success(true) |> redirect(to: Routes.root_path(conn, :show))
+ conn |> Session.put_multifactor_auth_success(true) |> redirect(to: ~p"/")
{:error, message} ->
conn
diff --git a/lib/epicenter_web/controllers/user_reset_password_controller.ex b/lib/epicenter_web/controllers/user_reset_password_controller.ex
index 58481e8a..bbfd0d93 100644
--- a/lib/epicenter_web/controllers/user_reset_password_controller.ex
+++ b/lib/epicenter_web/controllers/user_reset_password_controller.ex
@@ -1,6 +1,5 @@
defmodule EpicenterWeb.UserResetPasswordController do
use EpicenterWeb, :controller
-
import EpicenterWeb.ControllerHelpers, only: [assign_defaults: 2]
alias Epicenter.Accounts
@@ -21,7 +20,7 @@ defmodule EpicenterWeb.UserResetPasswordController do
{:ok, _} =
Accounts.deliver_user_reset_password_instructions(
user,
- &Routes.user_reset_password_url(conn, :edit, &1)
+ &url(~p"/users/reset-password/#{&1}")
)
else
conn
@@ -50,7 +49,7 @@ defmodule EpicenterWeb.UserResetPasswordController do
{:ok, _} ->
conn
|> put_flash(:info, "Password reset successfully — please log in")
- |> redirect(to: Routes.user_session_path(conn, :new))
+ |> redirect(to: ~p"/users/login")
{:error, changeset} ->
conn |> assign_defaults(@common_assigns) |> render("edit.html", changeset: changeset)
diff --git a/lib/epicenter_web/controllers/user_session_controller.ex b/lib/epicenter_web/controllers/user_session_controller.ex
index bba614db..3db4ea04 100644
--- a/lib/epicenter_web/controllers/user_session_controller.ex
+++ b/lib/epicenter_web/controllers/user_session_controller.ex
@@ -1,6 +1,5 @@
defmodule EpicenterWeb.UserSessionController do
use EpicenterWeb, :controller
-
import EpicenterWeb.ControllerHelpers, only: [assign_defaults: 2]
alias Epicenter.Accounts
@@ -44,7 +43,7 @@ defmodule EpicenterWeb.UserSessionController do
with {:user, {:ok, user}} <- {:user, Accounts.register_user({new_user_attrs, audit_meta})},
{:token, {:ok, token}} <- {:token, Accounts.generate_user_reset_password_token(user)} do
- conn |> redirect(to: Routes.user_reset_password_path(conn, :edit, token))
+ conn |> redirect(to: ~p"/users/reset-password/#{token}")
else
{:user, {:error, %Ecto.Changeset{valid?: false} = changeset}} ->
error_message =
diff --git a/lib/epicenter_web/controllers/user_settings_controller.ex b/lib/epicenter_web/controllers/user_settings_controller.ex
index 3743bd3b..8301e6b1 100644
--- a/lib/epicenter_web/controllers/user_settings_controller.ex
+++ b/lib/epicenter_web/controllers/user_settings_controller.ex
@@ -1,6 +1,5 @@
defmodule EpicenterWeb.UserSettingsController do
use EpicenterWeb, :controller
-
import EpicenterWeb.ControllerHelpers, only: [assign_defaults: 2]
alias Epicenter.Accounts
@@ -30,7 +29,7 @@ defmodule EpicenterWeb.UserSettingsController do
{:ok, user} ->
conn
|> put_flash(:info, "Password updated successfully")
- |> put_session(:user_return_to, Routes.user_settings_path(conn, :edit))
+ |> put_session(:user_return_to, ~p"/users/settings")
|> UserAuth.log_in_user(user)
{:error, changeset} ->
diff --git a/lib/epicenter_web/live/add_visit_live.ex b/lib/epicenter_web/live/add_visit_live.ex
index 4a3232f3..3470928b 100644
--- a/lib/epicenter_web/live/add_visit_live.ex
+++ b/lib/epicenter_web/live/add_visit_live.ex
@@ -56,7 +56,7 @@ defmodule EpicenterWeb.AddVisitLive do
data = data |> Map.put(:place_id, socket.assigns.place.id),
{:save, {:ok, _visit}} <- {:save, Cases.create_visit({data, audit_meta_create_visit(socket)})} do
socket
- |> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
+ |> push_navigate(to: ~p"/people/#{socket.assigns.case_investigation.person}/#case-investigations")
|> noreply()
else
{:data, {:error, %Ecto.Changeset{} = form_changeset}} ->
diff --git a/lib/epicenter_web/live/add_visit_live.html.heex b/lib/epicenter_web/live/add_visit_live.html.heex
index 861f6a96..f84ada50 100644
--- a/lib/epicenter_web/live/add_visit_live.html.heex
+++ b/lib/epicenter_web/live/add_visit_live.html.heex
@@ -6,7 +6,7 @@
>
- <.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, person.id)}>View + <.link navigate={~p"/people/#{person.id}"}>View |
- <.link navigate={Routes.user_path(EpicenterWeb.Endpoint, EpicenterWeb.UserLive, user)}><%= user.name %> + <.link navigate={~p"/admin/user/#{user}"}><%= user.name %> | <%= user.email %> | <%= user.type %> | <%= user.active_status %> | - <.link navigate={Routes.user_logins_path(EpicenterWeb.Endpoint, EpicenterWeb.UserLoginsLive, user)} + <.link navigate={~p"/admin/user/#{user}/logins"} data-tid={"view-audit-trail-#{user.tid}"}>View |
diff --git a/lib/epicenter_web/live_component/contact_investigation.ex b/lib/epicenter_web/live_component/contact_investigation.ex
index 3d7aa789..dba878c5 100644
--- a/lib/epicenter_web/live_component/contact_investigation.ex
+++ b/lib/epicenter_web/live_component/contact_investigation.ex
@@ -79,21 +79,21 @@ defmodule EpicenterWeb.ContactInvestigation do
~H"""
<.link
:if={@label==:start_interview}
- navigate={Routes.contact_investigation_start_interview_path(EpicenterWeb.Endpoint,EpicenterWeb.ContactInvestigationStartInterviewLive,@contact_investigation)}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/start-interview"}
class="primary"
data-role="contact-investigation-start-interview"
>Start interview
<.link
:if={@label==:complete_interview}
- navigate={Routes.contact_investigation_complete_interview_path(EpicenterWeb.Endpoint,:complete_contact_investigation,@contact_investigation)}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/complete-interview"}
class="primary"
data-role="contact-investigation-complete-interview-link"
>Complete interview
<.link
:if={@label==:discontinue_interview}
- navigate={Routes.contact_investigation_discontinue_path(EpicenterWeb.Endpoint, EpicenterWeb.ContactInvestigationDiscontinueLive, @contact_investigation)}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/discontinue"}
class="discontinue-link"
data-role="contact-investigation-discontinue-interview"
>Discontinue
@@ -106,14 +106,14 @@ defmodule EpicenterWeb.ContactInvestigation do
~H"""
<.link
:if={@contact_investigation.quarantine_monitoring_status=="pending"}
- navigate={Routes.contact_investigation_quarantine_monitoring_path(EpicenterWeb.Endpoint,EpicenterWeb.ContactInvestigationQuarantineMonitoringLive,@contact_investigation)}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/quarantine-monitoring"}
class="primary"
data-role="contact-investigation-quarantine-monitoring-start-link"
>Add quarantine dates
<.link
:if={@contact_investigation.quarantine_monitoring_status=="ongoing"}
- navigate={Routes.contact_investigation_conclude_quarantine_monitoring_path(EpicenterWeb.Endpoint,EpicenterWeb.ContactInvestigationConcludeQuarantineMonitoringLive,@contact_investigation)}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/conclude-quarantine-monitoring"}
class="primary"
data-role="conclude-contact-investigation-quarantine-monitoring-link"
>Conclude monitoring
diff --git a/lib/epicenter_web/live_component/contact_investigation.html.heex b/lib/epicenter_web/live_component/contact_investigation.html.heex
index 424bb433..d23b2583 100644
--- a/lib/epicenter_web/live_component/contact_investigation.html.heex
+++ b/lib/epicenter_web/live_component/contact_investigation.html.heex
@@ -51,7 +51,7 @@
<%= if is_editable?(@contact_investigation.exposed_person) do %>
- <.link navigate={Routes.contact_investigation_clinical_details_path(EpicenterWeb.Endpoint, EpicenterWeb.ContactInvestigationClinicalDetailsLive, @contact_investigation)}
+ <.link navigate={~p"/contact-investigations/#{@contact_investigation}/clinical-details"}
data-role="edit-contact-clinical-details-link"
class="contact-investigation-clinical-details-link">Edit
diff --git a/lib/epicenter_web/live_helpers.ex b/lib/epicenter_web/live_helpers.ex
index cea949a8..137d607c 100644
--- a/lib/epicenter_web/live_helpers.ex
+++ b/lib/epicenter_web/live_helpers.ex
@@ -1,10 +1,8 @@
defmodule EpicenterWeb.LiveHelpers do
import Phoenix.LiveView
import Phoenix.Component
-
+ use Phoenix.VerifiedRoutes, endpoint: EpicenterWeb.Endpoint, router: EpicenterWeb.Router
alias Epicenter.Accounts
- alias EpicenterWeb.Endpoint
- alias EpicenterWeb.Router.Helpers, as: Routes
@default_assigns [body_class: "body-background-none", show_nav: true]
@@ -40,11 +38,11 @@ defmodule EpicenterWeb.LiveHelpers do
do: socket
defp check_user(socket),
- do: redirect(socket, to: Routes.user_session_path(Endpoint, :new))
+ do: redirect(socket, to: ~p"/users/login")
defp check_admin(%{assigns: %{current_user: %{admin: true, confirmed_at: confirmed_at}}} = socket) when not is_nil(confirmed_at),
do: socket
defp check_admin(socket),
- do: redirect(socket, to: Routes.root_path(EpicenterWeb.Endpoint, :show))
+ do: redirect(socket, to: ~p"/")
end
diff --git a/lib/epicenter_web/presenters/case_investigation_presenter.ex b/lib/epicenter_web/presenters/case_investigation_presenter.ex
index 31a4bf48..2d9764bd 100644
--- a/lib/epicenter_web/presenters/case_investigation_presenter.ex
+++ b/lib/epicenter_web/presenters/case_investigation_presenter.ex
@@ -1,13 +1,12 @@
defmodule EpicenterWeb.Presenters.CaseInvestigationPresenter do
import PhoenixHTMLHelpers.Tag
- use Phoenix.Component
+ use EpicenterWeb, :presenter
+
alias Epicenter.Cases
alias Epicenter.Cases.CaseInvestigation
alias Epicenter.ContactInvestigations.ContactInvestigation
alias Epicenter.Cases.Person
- alias EpicenterWeb.Format
alias EpicenterWeb.Presenters.PeoplePresenter
- alias EpicenterWeb.Router.Helpers, as: Routes
def contact_details_as_list(%ContactInvestigation{} = contact_investigation) do
content_tag :ul do
@@ -65,30 +64,18 @@ defmodule EpicenterWeb.Presenters.CaseInvestigationPresenter do
~H"""
<.link
:if={@label == :started_interview}
- navigate={Routes.case_investigation_start_interview_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationStartInterviewLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/start-interview"}
class="case-investigation-link"
>Edit
<.link
:if={@label == :discontinued_interview}
- navigate={Routes.case_investigation_discontinue_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationDiscontinueLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/discontinue"}
id="edit-discontinue-case-investigation-link-001"
class="discontinue-case-investigation-link"
>Edit
<.link
:if={@label == :completed_interview}
- navigate={Routes.case_investigation_complete_interview_path(
- EpicenterWeb.Endpoint,
- :complete_case_investigation,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/complete-interview"}
id="edit-complete-interview-link-001"
class="edit-complete-interview-link"
>Edit
@@ -165,31 +152,19 @@ defmodule EpicenterWeb.Presenters.CaseInvestigationPresenter do
~H"""
<.link
:if={@label == :start_interview}
- navigate={Routes.case_investigation_start_interview_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationStartInterviewLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/start-interview"}
id="start-interview-case-investigation-link-001"
class="primary"
>Start interview
<.link
:if={@label == :complete_interview}
- navigate={Routes.case_investigation_complete_interview_path(
- EpicenterWeb.Endpoint,
- :complete_case_investigation,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/complete-interview"}
id="complete-interview-case-investigation-link-001"
class="primary"
>Complete interview
<.link
:if={@label == :discontinue_interview}
- navigate={Routes.case_investigation_discontinue_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationDiscontinueLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/discontinue"}
id="discontinue-case-investigation-link-001"
class="discontinue-case-investigation-link"
>Discontinue
@@ -222,21 +197,13 @@ defmodule EpicenterWeb.Presenters.CaseInvestigationPresenter do
~H"""
<.link
:if={@case_investigation.isolation_monitoring_status == "pending"}
- navigate={Routes.case_investigation_isolation_monitoring_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationIsolationMonitoringLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/isolation-monitoring"}
id="add-isolation-dates-case-investigation-link-001"
class="primary"
>Add isolation dates
<.link
:if={@case_investigation.isolation_monitoring_status == "ongoing"}
- navigate={Routes.case_investigation_conclude_isolation_monitoring_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationConcludeIsolationMonitoringLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/conclude-isolation-monitoring"}
id="conclude-isolation-monitoring-case-investigation-link-001"
class="primary"
>Conclude isolation
@@ -270,21 +237,13 @@ defmodule EpicenterWeb.Presenters.CaseInvestigationPresenter do
~H"""
<.link
:if={@label == :edit_isolation_monitoring}
- navigate={Routes.case_investigation_isolation_monitoring_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationIsolationMonitoringLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/isolation-monitoring"}
id="edit-isolation-monitoring-link-001"
class="case-investigation-link"
>Edit
<.link
:if={@label == :edit_isolation_monitoring_conclusion}
- navigate={Routes.case_investigation_conclude_isolation_monitoring_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.CaseInvestigationConcludeIsolationMonitoringLive,
- @case_investigation
- )}
+ navigate={~p"/case-investigations/#{@case_investigation}/conclude-isolation-monitoring"}
id="edit-isolation-monitoring-conclusion-link-001"
class="case-investigation-link"
>Edit
diff --git a/lib/epicenter_web/presenters/contact_investigation_presenter.ex b/lib/epicenter_web/presenters/contact_investigation_presenter.ex
index e6d182bf..1bbc3093 100644
--- a/lib/epicenter_web/presenters/contact_investigation_presenter.ex
+++ b/lib/epicenter_web/presenters/contact_investigation_presenter.ex
@@ -1,24 +1,19 @@
defmodule EpicenterWeb.Presenters.ContactInvestigationPresenter do
import EpicenterWeb.PersonHelpers, only: [demographic_field: 2]
- use Phoenix.Component
+
+ use EpicenterWeb, :presenter
alias Epicenter.Cases
alias Epicenter.ContactInvestigations.ContactInvestigation
alias Epicenter.ContactInvestigations
- alias EpicenterWeb.Format
alias EpicenterWeb.Presenters.PeoplePresenter
- alias EpicenterWeb.Router.Helpers, as: Routes
attr :contact_investigation, :any, required: true
def exposing_case_link(assigns) do
~H"""
<.link
- navigate={Routes.profile_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.ProfileLive,
- @contact_investigation.exposing_case.person
- )}
+ navigate={~p"/people/#{@contact_investigation.exposing_case.person}"}
data-role="visit-exposing-case-link"
class="visit-exposing-case-link"
><%= "\##{exposing_case_person_id(@contact_investigation)}" %>
@@ -56,33 +51,21 @@ defmodule EpicenterWeb.Presenters.ContactInvestigationPresenter do
~H"""
<.link
:if={@label==:start_interview}
- navigate={Routes.contact_investigation_start_interview_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.ContactInvestigationStartInterviewLive,
- @contact_investigation
- )}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/start-interview"}
data-role="contact-investigation-start-interview-edit-link"
class="contact-investigation-link"
>Edit
<.link
:if={@label==:complete_interview}
- navigate={Routes.contact_investigation_complete_interview_path(
- EpicenterWeb.Endpoint,
- :complete_contact_investigation,
- @contact_investigation
- )}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/complete-interview"}
data-role="contact-investigation-complete-interview-edit-link"
class="contact-investigation-link"
>Edit
<.link
:if={@label==:discontinue_interview}
- navigate={Routes.contact_investigation_discontinue_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.ContactInvestigationDiscontinueLive,
- @contact_investigation
- )}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/discontinue"}
data-role="contact-investigation-discontinue-interview-edit-link"
class="contact-investigation-link"
>Edit
@@ -172,22 +155,14 @@ defmodule EpicenterWeb.Presenters.ContactInvestigationPresenter do
~H"""
<.link
:if={@label == :quarantine_dates_history}
- navigate={Routes.contact_investigation_quarantine_monitoring_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.ContactInvestigationQuarantineMonitoringLive,
- @contact_investigation
- )}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/quarantine-monitoring"}
data-role="edit-contact-investigation-quarantine-monitoring-link"
class="contact-investigation-link"
>Edit
<.link
:if={@label == :quarantine_conclusion}
- navigate={Routes.contact_investigation_conclude_quarantine_monitoring_path(
- EpicenterWeb.Endpoint,
- EpicenterWeb.ContactInvestigationConcludeQuarantineMonitoringLive,
- @contact_investigation
- )}
+ navigate={~p"/contact-investigations/#{@contact_investigation}/conclude-quarantine-monitoring"}
data-role="conclude-contact-investigation-quarantine-monitoring-edit-link"
class="contact-investigation-link"
>Edit
diff --git a/lib/epicenter_web/templates/layout/_search_results.html.heex b/lib/epicenter_web/templates/layout/_search_results.html.heex
index d099b040..d49657ed 100644
--- a/lib/epicenter_web/templates/layout/_search_results.html.heex
+++ b/lib/epicenter_web/templates/layout/_search_results.html.heex
@@ -29,7 +29,7 @@
<%= for person <- @search_results.visible do %>
<%= link(EpicenterWeb.Presenters.PeoplePresenter.full_name_and_external_ids(person),
- to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, person),
+ to: ~p"/people/#{person}",
data_role: "search-result-name"
) %>
diff --git a/lib/epicenter_web/templates/layout/_user_menu.html.heex b/lib/epicenter_web/templates/layout/_user_menu.html.heex
index 637f7804..64f64130 100644
--- a/lib/epicenter_web/templates/layout/_user_menu.html.heex
+++ b/lib/epicenter_web/templates/layout/_user_menu.html.heex
@@ -1,9 +1,9 @@
- <%= form_for @conn, Routes.user_multifactor_auth_path(@conn, :create), [as: :user, data: [role: "multifactor-auth-form"]], fn f -> %>
+ <%= form_for @conn, ~p"/users/mfa", [as: :user, data: [role: "multifactor-auth-form"]], fn f -> %>
Multi-factor authentication@@ -39,7 +39,7 @@ |