PhoenixKitStaff.ActivityLabels (PhoenixKitStaff v0.6.0)

Copy Markdown View Source

Maps staff activity action strings (e.g. "staff.person_employment_added") to a {heroicon, human_label} pair for the person profile's Events tab. Domain labels go through PhoenixKitStaff.Gettext. Unknown actions fall back to a humanized form of the action string so a newly-added action still renders sensibly without a code change here.

The file/image "added" actions log a "count" in their metadata, so describe/2 accepts the entry's metadata and pluralizes those labels.

Summary

Functions

Returns {icon_name, label} for an action string + its metadata.

An optional secondary detail string for an event, pulled from its metadata (employment type, file/image count, person status, skill-level count), or nil when there's nothing extra worth showing. Lets the Events feed say what happened, not just the action category.

Functions

describe(action, metadata \\ %{})

@spec describe(String.t(), map()) :: {String.t(), String.t()}

Returns {icon_name, label} for an action string + its metadata.

detail(action, arg2)

@spec detail(String.t(), map()) :: String.t() | nil

An optional secondary detail string for an event, pulled from its metadata (employment type, file/image count, person status, skill-level count), or nil when there's nothing extra worth showing. Lets the Events feed say what happened, not just the action category.