Merge branch 'master' of gitlab.com:mythic-insight/legendary into dependabot-docker-node-16.6.0

This commit is contained in:
Robert Prehn 2021-08-04 17:06:52 -05:00
commit 01219447aa
8 changed files with 11724 additions and 11658 deletions

3
.dialyzer_ignore.exs Normal file
View file

@ -0,0 +1,3 @@
[
{"lib/i18n.ex:1:pattern_match_cov The pattern pattern <_@1, _@2, _@3> can never match the type, because it is covered by previous clauses."}
]

File diff suppressed because it is too large Load diff

View file

@ -4,10 +4,6 @@ defmodule AppWeb.LiveHelpers do
"""
import Phoenix.LiveView
alias Legendary.Auth.User
alias Pow.Store.CredentialsCache
alias AppWeb.Pow.Routes
def assign_defaults(socket, session) do
assign_new(socket, :current_user, fn -> get_user(socket, session) end)
end
@ -16,7 +12,7 @@ defmodule AppWeb.LiveHelpers do
if socket.assigns.current_user do
socket
else
redirect(socket, to: Routes.after_sign_out_path(%Plug.Conn{}))
redirect(socket, to: "/")
end
end

View file

@ -7,12 +7,11 @@ defmodule Legendary.Content.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
def start(_type, _args) do
import Supervisor.Spec
# Define workers and child supervisors to be supervised
children = [
# Start the Ecto repository
supervisor(Legendary.Content.Repo, []),
Legendary.Content.Repo,
# Start the endpoint when the application starts
# Start your own worker by calling: Legendary.Content.Worker.start_link(arg1, arg2, arg3)
# worker(Legendary.Content.Worker, [arg1, arg2, arg3]),

View file

@ -24,8 +24,14 @@ defmodule AuthWeb.Pow.ControllerCallbacks do
end
def before_respond(Pow.Phoenix.SessionController, :delete, {:ok, conn}, config) do
live_socket_id = Conn.get_session(conn, :live_socket_id)
AppWeb.Endpoint.broadcast(live_socket_id, "disconnect", %{})
case Conn.get_session(conn, :live_socket_id) do
nil ->
nil
live_socket_id ->
%{private: %{phoenix_endpoint: endpoint}} = conn
apply(endpoint, :broadcast, [live_socket_id, "disconnect", %{}])
end
conn =
conn

View file

@ -18,7 +18,11 @@ defmodule Legendary.Core.SharedDBConnectionPool do
def child_spec({mod, opts}) do
opts = Keyword.put_new(opts, :name, key(opts))
Supervisor.Spec.worker(Legendary.Core.SharedDBConnectionPool, [{mod, opts}])
%{
id: __MODULE__,
start: {Legendary.Core.SharedDBConnectionPool, :start_link, [{mod, opts}]}
}
end
defp key(opts) do

View file

@ -138,6 +138,7 @@ defmodule Legendary.Core.MixProject do
{:bamboo, "~> 1.5"},
{:bamboo_smtp, "~> 3.0"},
{:credo, "~> 1.4", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
{:ex_cldr, "~> 2.13.0"},
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
{:excoveralls, "~> 0.10", only: [:dev, :test]},

View file

@ -13,6 +13,10 @@ defmodule Legendary.Mixfile do
deps: deps(),
test_coverage: [tool: ExCoveralls],
aliases: aliases(),
dialyzer: [
plt_add_apps: [:mix],
ignore_warnings: ".dialyzer_ignore.exs"
],
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,