Ash calculation that exposes :tone (atom or nil) on a resource carrying an action name — the
content-change colour the activity timeline tints a create/update/destroy row by, parallel to
MishkaCmsCore.Activity.Calculations.Severity. Delegates to
MishkaCmsCore.Activity.Helpers.tone_for/1, so a create reads :created, an update :updated, a
destroy :destroyed, and anything else nil — a row the timeline then falls back to colouring by
:severity.
Wire it beside the :severity calculation, :field naming the attribute holding the action:
calculate :tone, :atom,
{MishkaCmsCore.Activity.Calculations.Tone, field: :action}
Summary
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.load/3.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.load/3.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.