Skip to content

Commit

Permalink
Merge pull request #21 from RatioPBC/min_version_bump
Browse files Browse the repository at this point in the history
version bump
  • Loading branch information
lei0zhou authored Aug 16, 2024
2 parents 06d1ce9 + feed5e7 commit 6c9036a
Show file tree
Hide file tree
Showing 96 changed files with 836 additions and 977 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ jobs:

env:
MIX_ENV: test

strategy:
matrix:
postgres-version: [16.4-alpine]

services:
postgres:
image: postgres:12.5-alpine
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_PASSWORD: postgres
options: >-
Expand All @@ -37,9 +41,8 @@ jobs:
fetch-depth: 0
- uses: erlef/setup-beam@v1
with:
otp-version: '25.3.1'
elixir-version: '1.14.5'

version-file: .tool-versions
version-type: strict
- name: Install dependencies
run: |
npm install --prefix assets
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ logfile
/.direnv/
.envrc.private
/.nix-mix/
/scripts/
/scripts/
/.elixir_ls/
/.erlang-history/
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
elixir 1.14.5-otp-25
erlang 25.3.1
elixir 1.17.2-otp-27
erlang 27.0.1
nodejs 18.18.2
postgres 15.2
postgres 16.4
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ config :epicenter, EpicenterWeb.Endpoint,
config :epicenter, mfa_issuer: System.fetch_env!("CANONICAL_HOST")

# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n", level: :warn
config :logger, :console, format: "[$level] $message\n", level: :warning

# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ config :epicenter,
phi_logger: Epicenter.Test.PhiLoggerMock

# Print only warnings and errors during test
config :logger, level: :warn, metadata: :all
config :logger, level: :warning, metadata: :all

config :phoenix_integration,
endpoint: EpicenterWeb.Endpoint
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# erlang = pkgs.beam.interpreters.erlang;

# use latest version of Erlang 27
erlang = final.beam.interpreters.erlang_25;
erlang = final.beam.interpreters.erlang_27;

# specify exact version of Erlang OTP
# erlang = pkgs.beam.interpreters.erlang.override {
Expand All @@ -40,7 +40,7 @@
# elixir = pkgs-beam.elixir;

# use latest version of Elixir 1.17
elixir = pkgs-beam.elixir_1_14;
elixir = pkgs-beam.elixir_1_17;

# specify exact version of Elixir
# elixir = pkgs-beam.elixir.override {
Expand All @@ -55,7 +55,7 @@
# use the Elixr/OTP versions defined above; will also install OTP, mix, hex, rebar3
elixir

postgresql_15
postgresql_16

# mix needs it for downloading dependencies
git
Expand Down
2 changes: 1 addition & 1 deletion lib/epicenter/csv.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ defmodule Epicenter.Csv do
rescue
e ->
hint = "make sure there are no spaces between the field separators (commas) and the quotes around field contents"
{:invalid_csv, "#{e.message} (#{hint})"}
{:invalid_csv, "#{Exception.message(e)} (#{hint})"}
end
end
12 changes: 8 additions & 4 deletions lib/epicenter_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ defmodule EpicenterWeb do

def live_view do
quote do
use Phoenix.HTML
use Phoenix.LiveView, layout: {EpicenterWeb.LayoutView, "live.html"}
import Phoenix.HTML
import Phoenix.HTML.Form
use PhoenixHTMLHelpers
use Phoenix.LiveView, layout: {EpicenterWeb.LayoutView, :live}
use EpicenterWeb.SearchHandling

unquote(view_helpers())
Expand Down Expand Up @@ -82,11 +84,13 @@ defmodule EpicenterWeb do
defp view_helpers do
quote do
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
import Phoenix.HTML
import Phoenix.HTML.Form
use PhoenixHTMLHelpers

# Import LiveView helpers (live_render, component, live_patch, etc)
import Phoenix.LiveView.Helpers
import EpicenterWeb.LiveComponent.Helpers
import Phoenix.Component

# Import basic rendering functionality (render, render_layout, etc)
import Phoenix.View
Expand Down
2 changes: 1 addition & 1 deletion lib/epicenter_web/format.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule EpicenterWeb.Format do
do: string |> Number.Phone.number_to_phone(area_code: true)

defp reformat_phone(string) when byte_size(string) == 11,
do: string |> String.slice(1..-1) |> Number.Phone.number_to_phone(area_code: true, country_code: String.at(string, 0))
do: string |> String.slice(1..-1//1) |> Number.Phone.number_to_phone(area_code: true, country_code: String.at(string, 0))

defp reformat_phone(string),
do: string
Expand Down
2 changes: 1 addition & 1 deletion lib/epicenter_web/live/add_visit_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:data, {:error, %Ecto.Changeset{} = form_changeset}} ->
Expand Down
5 changes: 2 additions & 3 deletions lib/epicenter_web/live/add_visit_live.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.place_search_path(EpicenterWeb.Endpoint, EpicenterWeb.PlaceSearchLive, @case_investigation), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.place_search_path(EpicenterWeb.Endpoint, EpicenterWeb.PlaceSearchLive, @case_investigation)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ defmodule EpicenterWeb.CaseInvestigationClinicalDetailsLive do
{:form, {:ok, case_investigation_attrs}} <- {:form, ClinicalDetailsForm.case_investigation_attrs(form_changeset)},
{:case_investigation, {:ok, _case_investigation}} <- {:case_investigation, update_case_investigation(socket, case_investigation_attrs)} do
socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:form, {:error, form_changeset}} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="case-investigation-clinical-details">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ defmodule EpicenterWeb.CaseInvestigationConcludeIsolationMonitoringLive do
}}
)} do
socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:form, {:error, %Ecto.Changeset{valid?: false} = form_changeset}} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="case-investigation-conclude-isolation-monitoring">
Expand Down
2 changes: 1 addition & 1 deletion lib/epicenter_web/live/case_investigation_contact_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ defmodule EpicenterWeb.CaseInvestigationContactLive do
data = data |> Map.put(:exposing_case_id, socket.assigns.case_investigation.id),
{:created, {:ok, _}} <- {:created, create_or_update_contact_investigation(contact_investigation, data, socket.assigns.current_user)} do
socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:form, {:error, changeset}} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="case-investigation-contact">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule EpicenterWeb.CaseInvestigationDiscontinueLive do
}}
) do
socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:error, changeset} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="case-investigation-discontinue">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ defmodule EpicenterWeb.CaseInvestigationIsolationMonitoringLive do
{:form, {:ok, model_attrs}} <- {:form, IsolationMonitoringForm.form_changeset_to_model_attrs(form_changeset)},
{:case_investigation, {:ok, _case_investigation}} <- {:case_investigation, update_case_investigation(socket, model_attrs)} do
socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:form, {:error, %Ecto.Changeset{valid?: false} = form_changeset}} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="case-investigation-isolation-monitoring">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defmodule EpicenterWeb.CaseInvestigationIsolationOrderLive do
{:form, {:ok, model_attrs}} <- {:form, IsolationOrderForm.form_changeset_to_model_attrs(form_changeset)},
{:case_investigation, {:ok, _case_investigation}} <- {:case_investigation, update_case_investigation(socket, model_attrs)} do
socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:form, {:error, %Ecto.Changeset{valid?: false} = form_changeset}} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="case-investigation-isolation-order">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule EpicenterWeb.CaseInvestigationStartInterviewLive do
{:form, {:ok, cast_investigation_attrs}} <- {:form, StartInterviewForm.investigation_attrs(form_changeset)},
{:case_investigation, {:ok, _case_investigation}} <- {:case_investigation, update_case_investigation(socket, cast_investigation_attrs)} do
socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.case_investigation.person)}#case-investigations")
|> noreply()
else
{:form, {:error, %Ecto.Changeset{valid?: false} = form_changeset}} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @case_investigation.person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="case-investigation-start-interview">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ defmodule EpicenterWeb.ContactInvestigationClinicalDetailsLive do
person = socket.assigns.contact_investigation.exposed_person

socket
|> push_redirect(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, person)}#contact-investigations")
|> push_navigate(to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, person)}#contact-investigations")
|> noreply()
else
{:form, {:error, form_changeset}} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="contact-investigation-clinical-details">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ defmodule EpicenterWeb.ContactInvestigationConcludeQuarantineMonitoringLive do
}}
)} do
socket
|> push_redirect(
|> push_navigate(
to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.contact_investigation.exposed_person)}#contact-investigations"
)
|> noreply()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="contact-investigation-conclude-quarantine-monitoring">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ defmodule EpicenterWeb.ContactInvestigationDiscontinueLive do
)

socket
|> push_redirect(
|> push_navigate(
to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.contact_investigation.exposed_person)}#contact-investigations"
)
|> noreply()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<div class="InvestigationDiscontinueForm">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ defmodule EpicenterWeb.ContactInvestigationQuarantineMonitoringLive do
{:form, {:ok, model_attrs}} <- {:form, QuarantineMonitoringForm.form_changeset_to_model_attrs(form_changeset)},
{:contact_investigation, {:ok, _contact_investigation}} <- {:contact_investigation, update_contact_investigation(socket, model_attrs)} do
socket
|> push_redirect(
|> push_navigate(
to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.contact_investigation.exposed_person)}#case-investigations"
)
|> noreply()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
>
<section>
<header id="subnav">
<%= live_redirect to: Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person), data: [role: "back-link"] do %>
<%= back_icon() %><span>Back</span>
<% end %>
<.link navigate={Routes.profile_path(EpicenterWeb.Endpoint, EpicenterWeb.ProfileLive, @contact_investigation.exposed_person)}
data-role="back-link"><%= back_icon() %><span>Back</span></.link>
</header>
</section>
<section id="contact-investigation-quarantine-monitoring">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defmodule EpicenterWeb.ContactInvestigationStartInterviewLive do
{:contact_investigation, {:ok, _contact_investigation}} <-
{:contact_investigation, update_contact_investigation(socket, cast_investigation_attrs)} do
socket
|> push_redirect(
|> push_navigate(
to: "#{Routes.profile_path(socket, EpicenterWeb.ProfileLive, socket.assigns.contact_investigation.exposed_person)}#contact-investigations"
)
|> noreply()
Expand Down
Loading

0 comments on commit 6c9036a

Please sign in to comment.