Can the Admin UI show calculations?
I have two resources; One acting as a course template and one for actualized, planned courses. Both have a price attribute with the intention that if an actualized course does not have a price it will use the default price from its template. This works fine when looking at the result of a read action in iex but the Admin UI doesn't want to show that calculation anywhere. Is this just not part of what AshAdmin is meant to do?
This is not really a breaking issue as I will have to write my own dashboard UI on top of this anyway, it would've just been nice to be able to quickly check AshAdmin to see if changes in my resources work as intended.
10 Replies
🤔 do you have
public? true
on your calculations?Huh, I didn't even know you could/had to do that.
I tried
and moving
public? true
into the calculations block but in both cases the compiler gets angry because public?
doesn't exist
it should work
Just tried that and it compiles but the calculation still does not show anywhere in the Admin UI


Solution
Huh, that page implies all calculations are included by default. I didn't explicitly overwrite that.
Thank you very much for pointing this page out in general though. I was not aware that there is this much control over how AshAdmin handles resources!
Oh,
you want
table_columns
-- nvmI just tried explicitly telling it to show the calculation and that worked. weird.
it shows up as a separate box below the resource itself
Yeah
Are you looking to edit the show page or the table?
They are done differently IIRC
I mainly just wanted to see calculations somewhere so I can quickly check if my calculations work properly
instead of having to run the app through iex
not sure which message to mark as solution, I think I'll go with the one that has the doc link?