fix(Core): Fixed map ACLs add/remove behaviour

This commit is contained in:
Dmitry Popov
2025-02-26 23:29:23 +01:00
parent b052943e34
commit aba93b342a
3 changed files with 6 additions and 16 deletions
@@ -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
+2 -12
View File
@@ -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 -2
View File
@@ -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"},