Skip to content

Commit

Permalink
fix: edited configuration settings move to the bottom (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnc1997 authored Oct 2, 2024
1 parent 59a17ad commit 97e803f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
</div>

@code {
private ICollection<ConfigurationSetting> ConfigurationSettings { get; } = [];
private List<ConfigurationSetting> ConfigurationSettings { get; } = [];

private IEnumerable<ConfigurationSetting> FilteredConfigurationSettings => ConfigurationSettings.Where(setting => string.IsNullOrEmpty(SearchQuery) || setting.Key.Contains(SearchQuery) || setting.Label?.Contains(SearchQuery) == true || setting.Value?.Contains(SearchQuery) == true).ToList();
private List<ConfigurationSetting> FilteredConfigurationSettings => ConfigurationSettings.Where(setting => string.IsNullOrEmpty(SearchQuery) || setting.Key.Contains(SearchQuery) || setting.Label?.Contains(SearchQuery) == true || setting.Value?.Contains(SearchQuery) == true).ToList();

private bool IsValuesHidden { get; set; } = true;

Expand Down Expand Up @@ -98,9 +98,12 @@
{
await ConfigurationSettingRepository.Update(setting);

ConfigurationSettings.Remove(SelectedConfigurationSettings.Single());
ConfigurationSettings.Add(setting);
StateHasChanged();
if (ConfigurationSettings.IndexOf(SelectedConfigurationSettings.Single()) is var index and not -1)
{
ConfigurationSettings.RemoveAt(index);
ConfigurationSettings.Insert(index, setting);
StateHasChanged();
}

SelectedConfigurationSettings.Clear();
StateHasChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
</div>

@code {
private ICollection<FeatureFlagConfigurationSetting> ConfigurationSettings { get; } = [];
private List<FeatureFlagConfigurationSetting> ConfigurationSettings { get; } = [];

private IEnumerable<FeatureFlagConfigurationSetting> FilteredConfigurationSettings => ConfigurationSettings.Where(setting => string.IsNullOrEmpty(SearchQuery) || setting.Key.Contains(SearchQuery) || setting.Description?.Contains(SearchQuery) == true || setting.Label?.Contains(SearchQuery) == true).ToList();
private List<FeatureFlagConfigurationSetting> FilteredConfigurationSettings => ConfigurationSettings.Where(setting => string.IsNullOrEmpty(SearchQuery) || setting.Key.Contains(SearchQuery) || setting.Description?.Contains(SearchQuery) == true || setting.Label?.Contains(SearchQuery) == true).ToList();

private string? SearchQuery { get; set; }

Expand Down

0 comments on commit 97e803f

Please sign in to comment.