mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-08-25 07:16:31 +00:00
fix(Core): Fixed map ACLs add/remove behaviour
This commit is contained in:
@@ -730,7 +730,7 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
)
|
||||
|
||||
~H"""
|
||||
<label
|
||||
<div
|
||||
phx-feedback-for={@field.name}
|
||||
class={[
|
||||
"form-control",
|
||||
@@ -762,7 +762,7 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
<div for="form_description" class="label">
|
||||
<.error :for={msg <- @errors}><%= msg %></.error>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
|
||||
@@ -665,6 +665,7 @@ defmodule WandererAppWeb.MapsLive do
|
||||
|
||||
form =
|
||||
form
|
||||
|> Map.put("acls", form["acls"] || [])
|
||||
|> Map.put("scope", scope)
|
||||
|> Map.put(
|
||||
"only_tracked_characters",
|
||||
@@ -675,14 +676,6 @@ defmodule WandererAppWeb.MapsLive do
|
||||
|> WandererApp.Api.Map.update(form)
|
||||
|> case do
|
||||
{:ok, updated_map} ->
|
||||
case form["acls"] do
|
||||
nil ->
|
||||
{:ok, _} = WandererApp.Api.Map.update_acls(updated_map, %{acls: []})
|
||||
|
||||
acls when is_list(acls) ->
|
||||
{:ok, _} = WandererApp.Api.Map.update_acls(updated_map, %{acls: acls})
|
||||
end
|
||||
|
||||
{added_acls, removed_acls} = map.acls |> Enum.map(& &1.id) |> _get_acls_diff(form["acls"])
|
||||
|
||||
Phoenix.PubSub.broadcast(
|
||||
@@ -720,10 +713,7 @@ defmodule WandererAppWeb.MapsLive do
|
||||
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign_async(:maps, fn ->
|
||||
_load_maps(current_user)
|
||||
end)
|
||||
|> push_patch(to: ~p"/maps")}
|
||||
|> push_navigate(to: ~p"/maps")}
|
||||
|
||||
{:error, error} ->
|
||||
{:noreply,
|
||||
|
||||
@@ -2,7 +2,7 @@ defmodule WandererApp.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
@source_url "https://github.com/wanderer-industries/wanderer"
|
||||
|
||||
|
||||
@version "1.52.7"
|
||||
|
||||
def project do
|
||||
@@ -90,7 +90,7 @@ defmodule WandererApp.MixProject do
|
||||
{:exsync, "~> 0.4", only: :dev},
|
||||
{:nimble_csv, "~> 1.2.0"},
|
||||
{:cachex, "~> 3.6"},
|
||||
{:live_select, "~> 1.4"},
|
||||
{:live_select, "~> 1.5"},
|
||||
{:nebulex, "~> 2.6"},
|
||||
{:decorator, "~> 1.4"},
|
||||
{:slugify, "~> 1.3"},
|
||||
|
||||
Reference in New Issue
Block a user