Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into jauggy/fix-tests-…
Browse files Browse the repository at this point in the history
…not-clearing-db
  • Loading branch information
jauggy committed Jun 28, 2024
2 parents e5ce4c5 + 95bfe6b commit f6421ac
Show file tree
Hide file tree
Showing 142 changed files with 1,511 additions and 1,241 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# see docs/local_setup.md for usage
9bb669ea86949ceba75d95d05578f67e8ace5351
40157923b1241c63ca5be17696415a500e64dbdd
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ runtime/
/source_deploy.tar.gz
central.tar.gz
/bin
.vscode/launch.json

# I'm storing server output here, don't want to push it to git
example_output
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ repos:
# language: system
# pass_filenames: false
# files: \.exs*$
- id: mix-dialyzer
name: "elixir: mix dialyzer"
entry: mix dialyzer
language: system
pass_filenames: false
files: \.exs*$
# - id: mix-dialyzer
# name: "elixir: mix dialyzer"
# entry: mix dialyzer
# language: system
# pass_filenames: false
# files: \.exs*$

2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ config :teiserver, Teiserver,
site_title: "BAR",
site_suffix: "",
site_description: "",
site_icon: "fa-duotone fa-robot",
site_icon: "fa-solid fa-robot",
credit: "Teifion Jordan"

# Default configs
Expand Down
2 changes: 1 addition & 1 deletion documents/guides/local_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ iex -S mix phx.server
If all goes to plan you should be able to access your site locally at [http://localhost:4000/](http://localhost:4000/).

### Libraries you need to get yourself
The site makes liberal use of [FontAwesome](https://fontawesome.com/) so if you are using the site you'll need to download it and do the following
The site makes liberal use of [FontAwesome](https://fontawesome.com/) so if you are using the site you'll need to download the free version and do the following
```bash
fontawesome/css/all.css -> priv/static/css/fontawesome.css
fontawesome/webfonts -> priv/static/webfonts
Expand Down
4 changes: 2 additions & 2 deletions lib/teiserver.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ defmodule Teiserver do
alias Teiserver.Data.Types, as: T
alias Teiserver.Helpers.CacheHelper

# def icon(), do: "fa-duotone fa-robot"
# def icon(), do: "fa-solid fa-robot"
@spec icon :: String.t()
def icon(), do: "fa-duotone fa-server"
def icon(), do: "fa-solid fa-server"

@spec icon(:friend | :friend_request | :ignore | :relationship) :: String.t()
def icon(:relationship), do: "fa-solid fa-users"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Teiserver.Account do
alias Teiserver.Account.UserLib

@spec icon :: String.t()
def icon, do: "fa-duotone fa-user-alt"
def icon, do: "fa-solid fa-user-alt"

@spec list_users() :: [User]
defdelegate list_users(), to: UserLib
Expand Down
3 changes: 3 additions & 0 deletions lib/teiserver/account/error_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ defmodule Teiserver.Account.ErrorHandler do
@impl Guardian.Plug.ErrorHandler

def auth_error(conn, {:unauthenticated, _reason}, _opts) do
redirect_to = "#{conn.request_path}?#{conn.query_string}"

conn
|> put_resp_cookie("_redirect_to", redirect_to, sign: true, max_age: 60 * 5)
|> Phoenix.Controller.redirect(
to: TeiserverWeb.Router.Helpers.account_session_path(conn, :login)
)
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/exports/player_count_export.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Teiserver.Account.PlayerCountExport do
alias Teiserver.Helper.TimexHelper

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-users"
def icon(), do: "fa-solid fa-users"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/exports/retention_rate_export.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Teiserver.Account.RetentionRateExport do
@activity_types ~w(total player)

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-campground"
def icon(), do: "fa-solid fa-campground"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/libs/accolade_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Teiserver.Account.AccoladeLib do

# Functions
@spec icon :: String.t()
def icon, do: "fa-regular fa-award"
def icon, do: "fa-solid fa-award"

@spec colours :: atom
def colours, do: :info
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/libs/code_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Teiserver.Account.CodeLib do
def colours(), do: :info

@spec icon :: String.t()
def icon(), do: "fa-regular fa-octagon"
def icon(), do: "fa-regular fa-diamond"

@doc """
Returns a list of the code types we can manually use (e.g. not password_reset)
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/libs/rating_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Teiserver.Account.RatingLib do

# Functions
@spec icon :: String.t()
def icon, do: "fa-regular fa-screen-users"
def icon, do: "fa-solid fa-chart-column"

@spec colours :: atom
def colours, do: :info
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/libs/relationship_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Teiserver.Account.RelationshipLib do
def colour(), do: :success

@spec icon :: String.t()
def icon(), do: "fa-users"
def icon(), do: "fa-solid fa-users"

@spec icon_follow :: String.t()
def icon_follow(), do: "fa-eyes"
Expand Down
40 changes: 20 additions & 20 deletions lib/teiserver/account/libs/role_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,93 +42,93 @@ defmodule Teiserver.Account.RoleLib do
%{
name: "Verified",
colour: "#66AA66",
icon: "fa-duotone fa-check",
icon: "fa-solid fa-check",
contains: ~w()
},

# Community team
%{
name: "Community team",
colour: "#66AA66",
icon: "fa-duotone fa-thought-bubble",
icon: "fa-solid fa-thought-bubble",
contains: ~w(),
badge: true
},
%{
name: "Mentor",
colour: "#66AA66",
icon: "fa-duotone fa-thought-bubble",
icon: "fa-solid fa-thought-bubble",
contains: ["Community team"],
badge: true
},
%{
name: "Academy manager",
colour: "#66AA66",
icon: "fa-duotone fa-thought-bubble",
icon: "fa-solid fa-thought-bubble",
contains: ["Community team"],
badge: true
},
%{
name: "Promo team",
colour: "#66AA66",
icon: "fa-duotone fa-thought-bubble",
icon: "fa-solid fa-thought-bubble",
contains: ["Community team"],
badge: true
},

# Privileged
%{name: "VIP", colour: "#AA8833", icon: "fa-duotone fa-sparkles", contains: ["BAR+"]},
%{name: "VIP", colour: "#AA8833", icon: "fa-solid fa-sparkles", contains: ["BAR+"]},
%{name: "Streamer", colour: "#660066", icon: "fa-brands fa-twitch", contains: ~w()},
%{name: "Tournament", colour: "#0000AA", icon: "fa-duotone fa-trophy", contains: ~w()},
%{name: "Tournament", colour: "#0000AA", icon: "fa-solid fa-trophy", contains: ~w()},
%{
name: "Caster",
colour: "#660066",
icon: "fa-duotone fa-microphone-lines",
icon: "fa-solid fa-microphone-lines",
contains: ~w(Streamer Tournament),
badge: true
},
%{name: "Donor", colour: "#0066AA", icon: "fa-duotone fa-euro", contains: ~w(), badge: true},
%{name: "Donor", colour: "#0066AA", icon: "fa-solid fa-euro", contains: ~w(), badge: true},

# Contributor/Staff
%{
name: "Contributor",
colour: "#66AA66",
icon: "fa-duotone fa-code-commit",
icon: "fa-solid fa-code-commit",
contains: ["Trusted", "BAR+"],
badge: true
},
%{name: "Engine", colour: "#007700", icon: "fa-duotone fa-engine", contains: ~w(Contributor)},
%{name: "Mapping", colour: "#007700", icon: "fa-duotone fa-map", contains: ~w(Contributor)},
%{name: "Engine", colour: "#007700", icon: "fa-solid fa-engine", contains: ~w(Contributor)},
%{name: "Mapping", colour: "#007700", icon: "fa-solid fa-map", contains: ~w(Contributor)},
%{
name: "Gameplay",
colour: "#AA0000",
icon: "fa-duotone fa-pen-ruler",
icon: "fa-solid fa-pen-ruler",
contains: ~w(Contributor),
badge: true
},
%{
name: "Infrastructure",
colour: "#007700",
icon: "fa-duotone fa-server",
icon: "fa-solid fa-server",
contains: ~w(Contributor)
},
%{
name: "Data export",
colour: "#007700",
icon: "fa-duotone fa-download",
icon: "fa-solid fa-download",
contains: ~w(Contributor)
},
%{
name: "Tester",
colour: "#00AAAA",
icon: "fa-duotone fa-vial",
icon: "fa-solid fa-vial",
contains: ~w(Contributor),
badge: true
},
%{
name: "Core",
colour: "#007700",
icon: "fa-duotone fa-code-branch",
icon: "fa-solid fa-code-branch",
contains: ~w(Contributor),
badge: true
},
Expand All @@ -137,19 +137,19 @@ defmodule Teiserver.Account.RoleLib do
%{
name: "Overwatch",
colour: "#AA7733",
icon: "fa-duotone fa-clipboard-list-check",
icon: "fa-solid fa-clipboard-list-check",
contains: ["BAR+"]
},
%{
name: "Reviewer",
colour: "#AA7700",
icon: "fa-duotone fa-user-magnifying-glass",
icon: "fa-solid fa-user-magnifying-glass",
contains: ~w(Overwatch)
},
%{
name: "Moderator",
colour: "#FFAA00",
icon: "fa-duotone fa-gavel",
icon: "fa-solid fa-gavel",
contains: ~w(Reviewer),
badge: true
},
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/active_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Account.ActiveReport do
alias Teiserver.{Logging}

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-satellite-dish"
def icon(), do: "fa-solid fa-satellite-dish"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/ban_evasion_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Teiserver.Account.BanEvasionReport do
require Logger

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-user-ninja"
def icon(), do: "fa-solid fa-user-ninja"

@spec permissions() :: String.t()
def permissions(), do: "Moderator"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/growth_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Teiserver.Account.GrowthReport do
def name(), do: "Growth"

@spec icon() :: String.t()
def icon(), do: "fa-seedling"
def icon(), do: "fa-solid fa-seedling"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
3 changes: 1 addition & 2 deletions lib/teiserver/account/reports/mapping_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ defmodule Teiserver.Game.MappingReport do
search: [
started_after: start_date |> Timex.to_datetime(),
started_before: end_date |> Timex.to_datetime(),
# game_type_in: ["Duel", "Team", "FFA", "Team FFA"],
game_type_in: ["Duel", "Team"],
game_type_in: ["Duel", "Small Team", "Large Team"],
of_interest: true,
has_winning_team: true
],
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/new_smurf_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Teiserver.Account.NewSmurfReport do
require Logger

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-face-angry-horns"
def icon(), do: "fa-solid fa-face-angry"

@spec permissions() :: String.t()
def permissions(), do: "Moderator"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/new_user_funnel_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Account.NewUserFunnelReport do
alias Teiserver.{Account, Telemetry, Battle}

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-filter"
def icon(), do: "fa-solid fa-filter"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
4 changes: 2 additions & 2 deletions lib/teiserver/account/reports/open_skill_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Teiserver.Account.OpenSkillReport do
import Teiserver.Helper.NumberHelper, only: [int_parse: 1]

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-chart-line"
def icon(), do: "fa-solid fa-chart-line"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down Expand Up @@ -69,7 +69,7 @@ defmodule Teiserver.Account.OpenSkillReport do
defp apply_defaults(params) do
Map.merge(
%{
"rating_type" => "Team",
"rating_type" => "Large Team",
"metric" => "Game Rating",
"last_active" => "7 days",
"uncertainty" => "5"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/population_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Account.PopulationReport do
alias Teiserver.Repo

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-people-group"
def icon(), do: "fa-solid fa-people-group"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/relationship_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Teiserver.Account.RelationshipReport do
alias Teiserver.Account.RelationshipLib

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-arrow-down-up-across-line"
def icon(), do: "fa-solid fa-arrow-down-up-across-line"

@spec permissions() :: String.t()
def permissions(), do: "Reviewer"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/retention_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Account.RetentionReport do
alias Teiserver.{Account, Logging}

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-campground"
def icon(), do: "fa-solid fa-campground"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/review_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Account.ReviewReport do
alias Teiserver.{Logging}

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-champagne-glasses"
def icon(), do: "fa-solid fa-champagne-glasses"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/time_compare_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Teiserver.Account.TimeCompareReport do
import Teiserver.Helper.StringHelper, only: [get_hash_id: 1]

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-code-compare"
def icon(), do: "fa-solid fa-code-compare"

@spec permissions() :: String.t()
def permissions(), do: "Moderator"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/time_spent_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Teiserver.Account.TimeSpentReport do
import Teiserver.Helper.StringHelper, only: [get_hash_id: 1]

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-watch"
def icon(), do: "fa-solid fa-stopwatch"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
Loading

0 comments on commit f6421ac

Please sign in to comment.