From 98aed88f5e83866e64833bc60cd5b8c149678e26 Mon Sep 17 00:00:00 2001 From: Emiel Date: Mon, 11 Nov 2024 15:42:53 +0100 Subject: [PATCH] Fixed People share dialog on project --- core/config/dev.exs | 4 --- .../pixel/components/user_list_item.ex | 2 +- core/systems/account/people_view.ex | 32 +++++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/config/dev.exs b/core/config/dev.exs index e4c4bc90b..e955d082f 100644 --- a/core/config/dev.exs +++ b/core/config/dev.exs @@ -77,10 +77,6 @@ config :core, Systems.Email.Mailer, config :core, :apns_backend, Core.APNS.LoggingBackend -config :core, - :admins, - ["e.vanderveen@eyra.co", "m.j.kokernoot@eyra.co"] - # # For Minio (local S3) # config :ex_aws, # scheme: "http://", diff --git a/core/frameworks/pixel/components/user_list_item.ex b/core/frameworks/pixel/components/user_list_item.ex index bca4491d9..6dfb29f32 100644 --- a/core/frameworks/pixel/components/user_list_item.ex +++ b/core/frameworks/pixel/components/user_list_item.ex @@ -11,7 +11,7 @@ defmodule Frameworks.Pixel.UserListItem do attr(:name, :string, default: nil) attr(:email, :string, required: true) attr(:info, :string, default: nil) - attr(:action_buttons, :map, default: nil) + attr(:action_buttons, :list, default: nil) def small(assigns) do ~H""" diff --git a/core/systems/account/people_view.ex b/core/systems/account/people_view.ex index 69760269d..bd62f55dd 100644 --- a/core/systems/account/people_view.ex +++ b/core/systems/account/people_view.ex @@ -157,34 +157,38 @@ defmodule Systems.Account.PeopleView do defp map_to_item(type, %Account.User{} = user, target, count) do photo_url = ImageHelpers.get_photo_url(user.profile) - action_button = user_action_button(type, user, target, count) + action_buttons = user_action_buttons(type, user, target, count) %{ photo_url: photo_url, name: user.displayname, email: user.email, - action_button: action_button + action_buttons: action_buttons } end defp map_to_item(_, nil, _, _), do: nil - defp user_action_button(:people, _, _, count) when count <= 1 do - nil + defp user_action_buttons(:people, _, _, count) when count <= 1 do + [] end - defp user_action_button(:people, %Account.User{} = user, target, _) do - %{ - action: %{type: :send, event: "remove", item: user.id, target: target}, - face: %{type: :icon, icon: :remove} - } + defp user_action_buttons(:people, %Account.User{} = user, target, _) do + [ + %{ + action: %{type: :send, event: "remove", item: user.id, target: target}, + face: %{type: :icon, icon: :remove} + } + ] end - defp user_action_button(:search, %Account.User{} = user, target, _) do - %{ - action: %{type: :send, event: "add", item: user.id, target: target}, - face: %{type: :plain, label: "Add", icon: :add} - } + defp user_action_buttons(:search, %Account.User{} = user, target, _) do + [ + %{ + action: %{type: :send, event: "add", item: user.id, target: target}, + face: %{type: :plain, label: "Add", icon: :add} + } + ] end @impl true