Skip to content

Commit

Permalink
Fixed People share dialog on project
Browse files Browse the repository at this point in the history
  • Loading branch information
mellelieuwes committed Nov 18, 2024
1 parent e76d946 commit 98aed88
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 0 additions & 4 deletions core/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ config :core, Systems.Email.Mailer,

config :core, :apns_backend, Core.APNS.LoggingBackend

config :core,
:admins,
["[email protected]", "[email protected]"]

# # For Minio (local S3)
# config :ex_aws,
# scheme: "http://",
Expand Down
2 changes: 1 addition & 1 deletion core/frameworks/pixel/components/user_list_item.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
32 changes: 18 additions & 14 deletions core/systems/account/people_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98aed88

Please sign in to comment.