Add OrderBy LastExecuted
This commit is contained in:
parent
218bd5a851
commit
5e7fed05d2
|
|
@ -3,6 +3,7 @@
|
|||
public enum OrderBy
|
||||
{
|
||||
Started,
|
||||
LastExecuted,
|
||||
Finished
|
||||
}
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ namespace ElsaDashboard.Application.Pages.WorkflowInstances
|
|||
}.Select(x => new ButtonDropdownItem(x?.ToString() ?? "All", x.ToString(), BuildFilterUrl(SelectedWorkflowId, x, SelectedOrderBy), x == SelectedWorkflowStatus));
|
||||
|
||||
private IEnumerable<ButtonDropdownItem> OrderByItems =>
|
||||
new[] { OrderBy.Finished, OrderBy.Started }.Select(x => new ButtonDropdownItem(x.ToString(), x.ToString(), BuildFilterUrl(SelectedWorkflowId, SelectedWorkflowStatus, x), x == SelectedOrderBy));
|
||||
new[] { OrderBy.Finished, OrderBy.LastExecuted, OrderBy.Started }.Select(x => new ButtonDropdownItem(x.ToString(), x.ToString(), BuildFilterUrl(SelectedWorkflowId, SelectedWorkflowStatus, x), x == SelectedOrderBy));
|
||||
|
||||
private string SelectedWorkflowText => SelectedWorkflowId == null ? "Workflow" : LatestWorkflowBlueprints.FirstOrDefault(x => x.Id == SelectedWorkflowId)?.DisplayName ?? "Workflow";
|
||||
private string SelectedWorkflowStatusText => SelectedWorkflowStatus?.ToString() ?? "Status";
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ namespace Elsa.Server.Api.Endpoints.WorkflowInstances
|
|||
orderBySpecification = orderBy switch
|
||||
{
|
||||
OrderBy.Started => OrderBySpecification.OrderByDescending<WorkflowInstance>(x => x.CreatedAt),
|
||||
OrderBy.LastExecuted => OrderBySpecification.OrderByDescending<WorkflowInstance>(x => x.LastExecutedAt!),
|
||||
OrderBy.Finished => OrderBySpecification.OrderByDescending<WorkflowInstance>(x => x.FinishedAt!),
|
||||
_ => OrderBySpecification.OrderByDescending<WorkflowInstance>(x => x.FinishedAt!)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
public enum OrderBy
|
||||
{
|
||||
Started,
|
||||
LastExecuted,
|
||||
Finished
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue