-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated advanced filter to look similar to basic filter when not editing
- Loading branch information
Showing
10 changed files
with
155 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 53 additions & 47 deletions
100
src/EventLogExpert/Shared/Components/Filters/AdvancedFilterRow.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,72 @@ | ||
@using EventLogExpert.UI | ||
@using EventLogExpert.UI.Store.FilterPane | ||
|
||
<div class="flex-align-center"> | ||
@if (Value.IsEditing) | ||
{ | ||
<ValueSelect CssClass="@($"input color-dropdown {Value.Color.ToString().ToLower()}")" | ||
T="FilterColor" @bind-Value="Value.Color"> | ||
@foreach (FilterColor item in Enum.GetValues(typeof(FilterColor))) | ||
<div class="flex-space-between"> | ||
<div class="flex-align-center"> | ||
@if (Value.IsEditing) | ||
{ | ||
<ValueSelect CssClass="@($"input color-dropdown {Value.Color.ToString().ToLower()}")" | ||
T="FilterColor" @bind-Value="Value.Color"> | ||
@foreach (FilterColor item in Enum.GetValues(typeof(FilterColor))) | ||
{ | ||
<ValueSelectItem CssClass="@($"color-dropdown-item {item.ToString().ToLower()}")" T="FilterColor" Value="item" /> | ||
} | ||
</ValueSelect> | ||
|
||
<span> | ||
Expression: | ||
<input class="input advanced-filter" type="text" | ||
placeholder="(Id == 1000 || Id == 1001) && Description.Contains('Fault')" | ||
value="@Value.Comparison.Value" @oninput="OnInputChanged" /> | ||
</span> | ||
} | ||
else if (string.IsNullOrWhiteSpace(Value.Comparison.Value)) | ||
{ | ||
<span>No Filter Specified</span> | ||
} | ||
else | ||
{ | ||
@if (Value.Color != FilterColor.None) | ||
{ | ||
<ValueSelectItem CssClass="@($"color-dropdown-item {item.ToString().ToLower()}")" T="FilterColor" Value="item" /> | ||
<div class="mx-2 @($"color-box {Value.Color.ToString().ToLower()}")"></div> | ||
} | ||
</ValueSelect> | ||
} | ||
else if (Value.Color != FilterColor.None) | ||
{ | ||
<div class="mx-2 @($"color-box {Value.Color.ToString().ToLower()}")"></div> | ||
} | ||
|
||
<span> | ||
Expression: | ||
<input class="input advanced-filter" type="text" | ||
placeholder="(Id == 1000 || Id == 1001) && Description.Contains('Fault')" | ||
value="@Value.Comparison.Value" @oninput="OnInputChanged" disabled="@(!Value.IsEditing)" /> | ||
</span> | ||
<span>@Value.Comparison.Value</span> | ||
} | ||
</div> | ||
|
||
@if (Value.IsEditing) | ||
{ | ||
if (_isAdvancedFilterValid) | ||
<div> | ||
@if (Value.IsEditing) | ||
{ | ||
<button class="button button-green" type="button" @onclick="SaveFilter"> | ||
<i class="bi bi-check-circle"></i> Apply | ||
</button> | ||
} | ||
|
||
<button class="button button-red" type="button" @onclick="RemoveFilter"> | ||
<i class="bi bi-dash-circle"></i> Remove | ||
</button> | ||
} | ||
else | ||
{ | ||
<button class="button" type="button" @onclick="EditFilter"> | ||
<i class="bi bi-funnel"></i> Edit | ||
</button> | ||
|
||
@if (Value.IsEnabled) | ||
{ | ||
<button class="button button-red" @onclick="ToggleFilter"> | ||
<i class="bi bi-dash-circle"></i> Disable | ||
<button class="button button-red" type="button" @onclick="RemoveFilter"> | ||
<i class="bi bi-dash-circle"></i> Remove | ||
</button> | ||
} | ||
else | ||
{ | ||
<button class="button button-green" @onclick="ToggleFilter"> | ||
<i class="bi bi-plus-circle"></i> Enable | ||
<button class="button" type="button" @onclick="EditFilter"> | ||
<i class="bi bi-funnel"></i> Edit | ||
</button> | ||
|
||
@if (Value.IsEnabled) | ||
{ | ||
<button class="button button-red" @onclick="ToggleFilter"> | ||
<i class="bi bi-dash-circle"></i> Disable | ||
</button> | ||
} | ||
else | ||
{ | ||
<button class="button button-green" @onclick="ToggleFilter"> | ||
<i class="bi bi-plus-circle"></i> Enable | ||
</button> | ||
} | ||
} | ||
} | ||
</div> | ||
</div> | ||
|
||
@if (!_isAdvancedFilterValid) | ||
{ | ||
<div hidden="@(string.IsNullOrWhiteSpace(_advancedFilterErrorMessage))"> | ||
<span class="advanced-filter-error">@_advancedFilterErrorMessage</span> | ||
</div> | ||
} | ||
<div hidden="@(string.IsNullOrWhiteSpace(_errorMessage))"> | ||
<span class="advanced-filter-error">@_errorMessage</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/EventLogExpert/Shared/Components/Filters/FilterGroupModal.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 44 additions & 35 deletions
79
src/EventLogExpert/Shared/Components/Filters/FilterGroupRow.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.