Skip to content

Commit

Permalink
improvement: support any sensitive value
Browse files Browse the repository at this point in the history
soon, calculations will have a `sensitive?` flag as well as attributes
  • Loading branch information
zachdaniel committed Jan 10, 2024
1 parent 92f9997 commit af6d855
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ash_admin/components/resource/table.ex
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ defmodule AshAdmin.Components.Resource.Table do
|> Map.get(attribute.name)
|> (&apply(mod, func, [&1] ++ args)).()

if struct == Ash.Resource.Attribute && attribute.sensitive? &&
if Map.get(attribute, :sensitive?) &&
not Enum.member?(show_sensitive_fields, attribute.name) do
format_sensitive_value(data, attribute, record)
else
Expand Down
2 changes: 1 addition & 1 deletion lib/ash_admin/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule AshAdmin.Helpers do
|> Enum.map_join(" ", &String.capitalize/1)
end

def sensitive?(%Ash.Resource.Attribute{sensitive?: true}) do
def sensitive?(%{sensitive?: true}) do
true
end

Expand Down

0 comments on commit af6d855

Please sign in to comment.