fix dialyzer, credo and format
This commit is contained in:
@ -1,8 +1,12 @@
|
||||
defmodule CanneryWeb.Component.Topbar do
|
||||
@moduledoc """
|
||||
Component that renders a topbar with user functions/links
|
||||
"""
|
||||
|
||||
use CanneryWeb, :component
|
||||
|
||||
alias Cannery.{Accounts}
|
||||
alias CanneryWeb.{HomeLive}
|
||||
alias Cannery.Accounts
|
||||
alias CanneryWeb.HomeLive
|
||||
|
||||
def topbar(assigns) do
|
||||
assigns =
|
||||
|
@ -1,9 +1,13 @@
|
||||
defmodule CanneryWeb.UserAuth do
|
||||
@moduledoc """
|
||||
Functions for user session and authentication
|
||||
"""
|
||||
|
||||
import Plug.Conn
|
||||
import Phoenix.Controller
|
||||
|
||||
alias Cannery.Accounts
|
||||
alias CanneryWeb.{HomeLive}
|
||||
alias CanneryWeb.HomeLive
|
||||
alias CanneryWeb.Router.Helpers, as: Routes
|
||||
|
||||
# Make the remember me cookie valid for 60 days.
|
||||
@ -37,6 +41,11 @@ defmodule CanneryWeb.UserAuth do
|
||||
|> redirect(to: user_return_to || signed_in_path(conn))
|
||||
end
|
||||
|
||||
@spec maybe_write_remember_me_cookie(
|
||||
Plug.Conn.t(),
|
||||
String.t() | any(),
|
||||
%{required(String.t()) => String.t()} | any()
|
||||
) :: Plug.Conn.t()
|
||||
defp maybe_write_remember_me_cookie(conn, token, %{"remember_me" => "true"}) do
|
||||
put_resp_cookie(conn, @remember_me_cookie, token, @remember_me_options)
|
||||
end
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.AmmoGroupLive.FormComponent do
|
||||
@moduledoc """
|
||||
Livecomponent that can update or create an Cannery.Ammo.AmmoGroup
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_component
|
||||
|
||||
alias Cannery.Ammo
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.AmmoGroupLive.Index do
|
||||
@moduledoc """
|
||||
Liveview to show a Cannery.Ammo.AmmoGroup index
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.Ammo
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.AmmoGroupLive.Show do
|
||||
@moduledoc """
|
||||
Liveview for showing and editing an Cannery.Ammo.AmmoGroup
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.Ammo
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.AmmoTypeLive.FormComponent do
|
||||
@moduledoc """
|
||||
Livecomponent that can update or create an Cannery.Ammo.AmmoType
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_component
|
||||
|
||||
alias Cannery.Ammo
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.AmmoTypeLive.Index do
|
||||
@moduledoc """
|
||||
Liveview for showing a Cannery.Ammo.AmmoType index
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.Ammo
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.AmmoTypeLive.Show do
|
||||
@moduledoc """
|
||||
Liveview for showing and editing an Cannery.Ammo.AmmoType
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.Ammo
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.ContainerLive.FormComponent do
|
||||
@moduledoc """
|
||||
Livecomponent that can update or create an Cannery.Containers.Container
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_component
|
||||
|
||||
alias Cannery.Containers
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.ContainerLive.Index do
|
||||
@moduledoc """
|
||||
Liveview for showing Cannery.Containers.Container index
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.Containers
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.ContainerLive.Show do
|
||||
@moduledoc """
|
||||
Liveview for showing and editing a Cannery.Containers.Container
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.Containers
|
||||
|
@ -1,6 +1,10 @@
|
||||
defmodule CanneryWeb.HomeLive do
|
||||
@moduledoc """
|
||||
Liveview for the home page
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
alias Cannery.{Accounts}
|
||||
alias Cannery.Accounts
|
||||
|
||||
@impl true
|
||||
def mount(_params, session, socket) do
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.InviteLive.FormComponent do
|
||||
@moduledoc """
|
||||
Livecomponent that can update or create an Cannery.Invites.Invite
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_component
|
||||
|
||||
alias Cannery.Invites
|
||||
|
@ -1,8 +1,12 @@
|
||||
defmodule CanneryWeb.InviteLive.Index do
|
||||
@moduledoc """
|
||||
Liveview to show a Cannery.Invites.Invite index
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.{Invites}
|
||||
alias Cannery.Invites.{Invite}
|
||||
alias Cannery.Invites
|
||||
alias Cannery.Invites.Invite
|
||||
|
||||
@impl true
|
||||
def mount(_params, session, socket) do
|
||||
|
@ -1,7 +1,11 @@
|
||||
defmodule CanneryWeb.LiveHelpers do
|
||||
@moduledoc """
|
||||
Contains common helper functions for liveviews
|
||||
"""
|
||||
|
||||
import Phoenix.LiveView.Helpers
|
||||
import Phoenix.LiveView, only: [assign_new: 3]
|
||||
alias Cannery.{Accounts}
|
||||
alias Cannery.Accounts
|
||||
|
||||
@doc """
|
||||
Renders a component inside the `CanneryWeb.ModalComponent` component.
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.ModalComponent do
|
||||
@moduledoc """
|
||||
Livecomponent that displays a floating modal window
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_component
|
||||
|
||||
@impl true
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.TagLive.FormComponent do
|
||||
@moduledoc """
|
||||
Livecomponent that can update or create an Cannery.Tags.Tag
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_component
|
||||
|
||||
alias Cannery.Tags
|
||||
@ -103,7 +107,7 @@ defmodule CanneryWeb.TagLive.FormComponent do
|
||||
Returns a random tag color in `#ffffff` hex format
|
||||
"""
|
||||
@spec random_color() :: String.t()
|
||||
def random_color() do
|
||||
def random_color do
|
||||
["#cc0066", "#ff6699", "#6666ff", "#0066cc", "#00cc66", "#669900", "#ff9900", "#996633"]
|
||||
|> Enum.random()
|
||||
end
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.TagLive.Index do
|
||||
@moduledoc """
|
||||
Liveview to show a Cannery.Tags.Tag index
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
|
||||
alias Cannery.Tags
|
||||
|
@ -1,4 +1,8 @@
|
||||
defmodule CanneryWeb.Telemetry do
|
||||
@moduledoc """
|
||||
Collects telemetry
|
||||
"""
|
||||
|
||||
use Supervisor
|
||||
import Telemetry.Metrics
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
defmodule CanneryWeb.LayoutView do
|
||||
use CanneryWeb, :view
|
||||
alias Cannery.{Accounts}
|
||||
alias CanneryWeb.{HomeLive}
|
||||
alias Cannery.Accounts
|
||||
alias CanneryWeb.HomeLive
|
||||
|
||||
# Phoenix LiveDashboard is available only in development by default,
|
||||
# so we instruct Elixir to not warn if the dashboard route is missing.
|
||||
|
Reference in New Issue
Block a user