View Source Lightning.DashboardStats (Lightning v2.12.2)
Dashboard stats for a project and its workflows.
Summary
Functions
Sorts a list of workflow statistics based on the specified field and direction.
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]}, ...}, ...]