Skip to content

Commit

Permalink
Workflow Instance Filter Improvements (#151)
Browse files Browse the repository at this point in the history
* Add 'enhancement/*' branch to Github workflow

The workflow configuration in packages.yml has been updated. The 'enhancement/*' branch pattern is now included in the action triggers. This allows the workflow to run for any enhancements in the codebase.

* Update incident filtering in WorkflowInstanceList

Changed the incident filter option in the WorkflowInstanceList from a checkbox to a dropdown list. This allows the user to select a clearer "Yes" or "No" option instead of a checkbox. In addition, updated the OnHasIncidentsChanged method to be asynchronous.

* Update label for "UpdatedAt" field in WorkflowInstanceList

The label for the "UpdatedAt" field in the WorkflowInstanceList component was changed from "Last executed" to "Updated". This better represents what the field is actually showing, as it refers to the most recent update to the workflow instance, not its last execution.

* Update time filtering in WorkflowInstanceList

The time filter input in the WorkflowInstanceList module has been updated. It is now handled as an Nullable string instead of a non-nullable one. Additionally, the UI has been improved by replacing the MudTimePicker with a clearer MudTextField with an appropriate format and icon.

* Update AnchorOrigin to BottomCenter in WorkflowInstanceList

This commit changes the AnchorOrigin in the WorkflowInstanceList component from BottomLeft to BottomCenter. This alteration should make the user interface more symmetrical and easier to interact with.

* Remove unnecessary identifiers from WorkflowInstanceList

The WorkflowInstanceList no longer checks against the workflow definition's description, ID, and definition ID. This change simplifies the search functionality and focuses on only the workflows' names, which should facilitate user experience and search efficiency.
  • Loading branch information
sfmskywalker authored Feb 21, 2024
1 parent 39613e0 commit 5f9de66
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- 'main'
- 'feature/*'
- 'enhancement/*'
- 'patch/*'
- 'fix/*'
release:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public class TimestampFilterModel
/// <summary>
/// Gets or sets the time to filter by.
/// </summary>
public string Time { get; set; }
public string? Time { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@

<MudSpacer/>

<MudCheckBox
T="bool?"
Label="Has Incidents"
ValueChanged="@OnHasIncidentsChanged"
Value="@HasIncidents"
Size="Size.Medium"
TriState="true"/>
<MudSelect T="@(bool?)" Label="Has Incidents" ValueChanged="@OnHasIncidentsChanged" Value="@HasIncidents" Variant="Variant.Outlined">
<MudSelectItem T="@(bool?)" Value="@(default(bool?))">-</MudSelectItem>
<MudSelectItem T="@(bool?)" Value="@(true)">Yes</MudSelectItem>
<MudSelectItem T="@(bool?)" Value="@(false)">No</MudSelectItem>
</MudSelect>

<MudTextField
T="string"
Expand Down Expand Up @@ -87,7 +85,7 @@
ValuePresenter="ValuePresenter.Chip"
MultiSelection="true"
Variant="Variant.Outlined"
AnchorOrigin="Origin.BottomLeft"
AnchorOrigin="Origin.BottomCenter"
Dense="true"
ChipSize="Size.Small"
ChipVariant="Variant.Filled"
Expand All @@ -106,7 +104,7 @@
ValuePresenter="ValuePresenter.Chip"
MultiSelection="true"
Variant="Variant.Outlined"
AnchorOrigin="Origin.BottomLeft"
AnchorOrigin="Origin.BottomCenter"
Dense="true"
ChipSize="Size.Small"
ChipVariant="Variant.Filled"
Expand Down Expand Up @@ -157,7 +155,16 @@
<MudDatePicker Label="Date" Variant="Variant.Outlined" Clearable="true" @bind-Text="timestampFilter.Date"/>
</td>
<td>
<MudTimePicker Label="Time" Variant="Variant.Outlined" Clearable="true" @bind-Text="timestampFilter.Time"/>
<MudTextField
T="string?"
Label="Time"
Variant="Variant.Outlined"
InputType="InputType.Time"
Format="hh:mm:ss:mm"
Clearable="true"
AdornmentIcon="@Icons.Material.Filled.Timer"
@bind-Value="timestampFilter.Time"/>
@* <MudTimePicker Label="Time" Variant="Variant.Outlined" Clearable="true" @bind-Text="timestampFilter.Time"/> *@
</td>
</tr>
}
Expand Down Expand Up @@ -204,7 +211,7 @@
<MudTableSortLabel SortLabel="CreatedAt" T="WorkflowInstanceRow" InitialDirection="SortDirection.Descending">Created</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel SortLabel="UpdatedAt" T="WorkflowInstanceRow">Last executed</MudTableSortLabel>
<MudTableSortLabel SortLabel="UpdatedAt" T="WorkflowInstanceRow">Updated</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel SortLabel="FinishedAt" T="WorkflowInstanceRow">Finished</MudTableSortLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ private bool FilterWorkflowDefinitions(WorkflowDefinitionSummary workflowDefinit
var sources = new[]
{
workflowDefinition.Name,
workflowDefinition.Description,
workflowDefinition.Id,
workflowDefinition.DefinitionId
};

return sources.Any(x => x?.Contains(trimmedTerm, StringComparison.OrdinalIgnoreCase) == true);
Expand Down Expand Up @@ -267,10 +264,10 @@ private async Task OnSearchTermChanged(string text)
await _table.ReloadServerData();
}

private Task OnHasIncidentsChanged(bool? value)
private async Task OnHasIncidentsChanged(bool? value)
{
HasIncidents = value;
return _table.ReloadServerData();
await _table.ReloadServerData();
}

private void OnAddTimestampFilterClicked()
Expand Down

0 comments on commit 5f9de66

Please sign in to comment.