diff --git a/dev/resources/accounts/resources/user.ex b/dev/resources/accounts/resources/user.ex index a267f0c..f5d7fc4 100644 --- a/dev/resources/accounts/resources/user.ex +++ b/dev/resources/accounts/resources/user.ex @@ -25,7 +25,7 @@ defmodule Demo.Accounts.User do multitenancy do strategy :attribute attribute :org - # global? true + global? true end policies do diff --git a/dev/resources/tickets/resources/ticket/ticket.ex b/dev/resources/tickets/resources/ticket/ticket.ex index 9033d88..3ece2d4 100644 --- a/dev/resources/tickets/resources/ticket/ticket.ex +++ b/dev/resources/tickets/resources/ticket/ticket.ex @@ -80,7 +80,13 @@ defmodule Demo.Tickets.Ticket do change manage_relationship(:tickets, :source_links, on_lookup: {:relate_and_update, :create, :read, :all}) end - update :update, primary?: true + update :update do + primary? true + argument :organization_id, :uuid + require_atomic? false + + change manage_relationship(:organization_id, :organization, type: :append_and_remove) + end update :assign do accept [] diff --git a/lib/ash_admin/components/resource/form.ex b/lib/ash_admin/components/resource/form.ex index 19e96ac..bfbf8fc 100644 --- a/lib/ash_admin/components/resource/form.ex +++ b/lib/ash_admin/components/resource/form.ex @@ -177,6 +177,7 @@ defmodule AshAdmin.Components.Resource.Form do skip: skip ) + ~H""" <% {attributes, flags, bottom_attributes, relationship_args} = attributes(@resource, @action, @exactly) %> @@ -1611,7 +1612,7 @@ defmodule AshAdmin.Components.Resource.Form do end defp manages_relationship(argument, action) do - if action.changes && map_type?(argument.type) do + if action.changes do Enum.find_value(action.changes, fn %{change: {Ash.Resource.Change.ManageRelationship, opts}} -> if opts[:argument] == argument.name do diff --git a/lib/ash_admin/components/top_nav.ex b/lib/ash_admin/components/top_nav.ex index c473104..29374e1 100644 --- a/lib/ash_admin/components/top_nav.ex +++ b/lib/ash_admin/components/top_nav.ex @@ -119,11 +119,10 @@ defmodule AshAdmin.Components.TopNav do />
- <.live_component +