Skip to content

Commit 4ed1a52

Browse files
committed
Fix compiler warnings
1 parent 8b8f2ce commit 4ed1a52

File tree

7 files changed

+10
-17
lines changed

7 files changed

+10
-17
lines changed

extra/keila_cloud_web/controllers/cloud_account_controller.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Keila.if_cloud do
44
defmodule KeilaWeb.CloudAccountController do
55
use KeilaWeb, :controller
66
import Phoenix.LiveView.Controller
7-
import Ecto.Changeset
87

98
def onboarding(conn, _) do
109
live_render(conn, KeilaWeb.CloudAccountOnboardingLive,

extra/keila_cloud_web/controllers/cloud_account_onboarding_live.ex

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ require Keila
33
Keila.if_cloud do
44
defmodule KeilaWeb.CloudAccountOnboardingLive do
55
use KeilaWeb, :live_view
6-
import Ecto.Changeset
76

87
alias KeilaCloud.Accounts.Account.ContactData
98
alias KeilaCloud.Accounts.Account.OnboardingReviewData
@@ -18,8 +17,8 @@ Keila.if_cloud do
1817

1918
{:ok,
2019
socket
21-
|> assign(:current_user, session["current_user"])
22-
|> assign(:current_account, session["current_account"])
20+
|> assign(:current_user, current_user)
21+
|> assign(:current_account, current_account)
2322
|> assign(:countries, countries)
2423
|> assign(:step, :user_name)
2524
|> put_user_changeset()
@@ -53,8 +52,7 @@ Keila.if_cloud do
5352

5453
defp put_onboarding_review_data_changeset(socket, params \\ %{}) do
5554
onboarding_review_data =
56-
socket.assigns.current_account.onboarding_review_data ||
57-
%KeilaCloud.Accounts.Account.OnboardingReviewData{}
55+
socket.assigns.current_account.onboarding_review_data || %OnboardingReviewData{}
5856

5957
assign(
6058
socket,

extra/keila_cloud_web/controllers/cloud_admin_controller.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ require Keila
33
Keila.if_cloud do
44
defmodule KeilaWeb.CloudAdminController do
55
use KeilaWeb, :controller
6-
import Phoenix.LiveView.Controller
76

87
plug :authorize
98

extra/keila_cloud_web/views/cloud_account_view.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Keila.if_cloud do
77
namespace: KeilaWeb
88

99
use Phoenix.HTML
10-
import Phoenix.View
1110
import Phoenix.LiveView.Helpers
1211
import KeilaWeb.Gettext
1312
import KeilaWeb.ErrorHelpers
@@ -46,7 +45,7 @@ Keila.if_cloud do
4645

4746
defp format_to_field_groups(format, field_groups \\ [[]])
4847

49-
@known_fields ~w[given_name additional_name family_name organization_name postal_code sorting_code dependent_locality locality administrative_area country address_line_1 sorting_code address_line_2 address_line_3]
48+
@known_fields ~w[given_name additional_name family_name organization_name postal_code sorting_code dependent_locality locality administrative_area country address_line_1 address_line_2 address_line_3]
5049

5150
for field <- @known_fields do
5251
@field field

extra/keila_cloud_web/views/cloud_admin_view.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ Keila.if_cloud do
77
namespace: KeilaWeb
88

99
use Phoenix.HTML
10-
import Phoenix.View
1110
import Phoenix.LiveView.Helpers
1211

1312
import KeilaWeb.Gettext
14-
import KeilaWeb.ErrorHelpers
1513
alias KeilaWeb.Router.Helpers, as: Routes
1614
end
1715
end

lib/keila/mailings/sender_adapters.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ defmodule Keila.Mailings.SenderAdapters do
2626
"""
2727
@spec adapter_names() :: list(String.t())
2828
def adapter_names do
29-
Enum.map(adapters(), fn a -> a.name end)
29+
Enum.map(adapters(), fn adapter -> adapter.name() end)
3030
end
3131

3232
@doc """
3333
Returns the names of all configured shared sender adapters.
3434
"""
3535
@spec shared_adapter_names() :: list(String.t())
3636
def shared_adapter_names do
37-
Enum.map(shared_adapters(), fn a -> a.name end)
37+
Enum.map(shared_adapters(), fn adapter -> adapter.name() end)
3838
end
3939

4040
@doc """
4141
Returns the configured sender adapter or shared sender adapter with the given `name`
4242
"""
4343
@spec get_adapter(String.t()) :: Keila.Mailings.SenderAdapters.Adapter.t()
4444
def get_adapter(name) do
45-
Enum.find(adapters() ++ shared_adapters(), fn a -> a.name == name end)
45+
Enum.find(adapters() ++ shared_adapters(), fn adapter -> adapter.name() == name end)
4646
end
4747

4848
@doc """

lib/keila_web/live/segment_edit_live.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,13 @@ defmodule KeilaWeb.SegmentEditLive do
296296
defp filter_condition_to_form_data("string", _field, %{"$like" => value}) do
297297
cond do
298298
String.starts_with?(value, "%") && String.ends_with?(value, "%") ->
299-
%{"value" => String.slice(value, 1..-2), "widget" => "includes"}
299+
%{"value" => String.slice(value, 1..-2//-1), "widget" => "includes"}
300300

301301
String.starts_with?(value, "%") ->
302-
%{"value" => String.slice(value, 1..-1), "widget" => "ends_with"}
302+
%{"value" => String.slice(value, 1..-1//-1), "widget" => "ends_with"}
303303

304304
String.ends_with?(value, "%") ->
305-
%{"value" => String.slice(value, 0..-2), "widget" => "starts_with"}
305+
%{"value" => String.slice(value, 0..-2//-1), "widget" => "starts_with"}
306306
end
307307
end
308308

0 commit comments

Comments
 (0)