From af6d8555c08eb3d299a903b71d805c84060121e1 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Tue, 9 Jan 2024 19:29:53 -0500 Subject: [PATCH] improvement: support any sensitive value soon, calculations will have a `sensitive?` flag as well as attributes --- lib/ash_admin/components/resource/table.ex | 2 +- lib/ash_admin/helpers.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ash_admin/components/resource/table.ex b/lib/ash_admin/components/resource/table.ex index 56c34351..c47e5768 100644 --- a/lib/ash_admin/components/resource/table.ex +++ b/lib/ash_admin/components/resource/table.ex @@ -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 diff --git a/lib/ash_admin/helpers.ex b/lib/ash_admin/helpers.ex index bbc25601..fa6c41d7 100644 --- a/lib/ash_admin/helpers.ex +++ b/lib/ash_admin/helpers.ex @@ -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