Lightning.DashboardStats (Lightning v2.19.0-pre)
View SourceDashboard stats for a project and its workflows.
Summary
Functions
Sorts a list of workflow statistics based on the specified field and direction.
Start of the window every dashboard figure is bound to.
Functions
Sorts a list of workflow statistics based on the specified field and direction.
Parameters
workflow_stats- A list of WorkflowStats structs to be sortedsort_field- Atom representing the field to sort by, options include::last_workorder_updated_at- Sort by timestamp of the latest work order:workorders_count- Sort by total count of work orders:failed_workorders_count- Sort by count of failed work orders
sort_direction- Atom representing sort direction, either :asc or :desc
Returns
Sorted list of WorkflowStats structs
Examples
iex> sort_workflow_stats(workflow_stats, :workorders_count, :desc)
[%WorkflowStats{workorders_count: 100, ...}, %WorkflowStats{workorders_count: 50, ...}]
iex> sort_workflow_stats(workflow_stats, :last_workorder_updated_at, :asc)
[%WorkflowStats{last_workorder: %{updated_at: ~U[2023-01-01 00:00:00Z]}, ...}, ...]
Start of the window every dashboard figure is bound to.
The history links in LightningWeb.WorkflowLive.DashboardComponents use it
too, so a link opens the same window its count was taken from.