Skip to content

Commit

Permalink
Add key entries sorting
Browse files Browse the repository at this point in the history
Update CHANGELOG.md
  • Loading branch information
Maxhy committed Oct 26, 2024
1 parent 832fc3d commit 9bbab86
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# v1.19.0 - 26/10/2024
- Add KCV variants
- Add KCV selection auto saving
- Add key entries Sort feature
- Add secret key change on File key store
- Add support for secrets encryption per machine
- Add optional Elevated/Restricted user feature
- Add Identifier to Favorite and use it instead of Name for the favorite links
- Fix DESFire reading test on SAM AV2/AV3 key store

# v1.18.1 - 09/06/2024

- Fix possible race condition on initialization cleanup when opening a key store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,10 @@
<data name="ResetEncryptionKey" xml:space="preserve">
<value>Réinitialiser la clé de chiffrement</value>
</data>
<data name="OrderById" xml:space="preserve">
<value>Trier par Id</value>
</data>
<data name="OrderByName" xml:space="preserve">
<value>Trier par nom</value>
</data>
</root>
6 changes: 6 additions & 0 deletions KeyManager.Library.KeyStore.File.UI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,10 @@
<data name="ResetEncryptionKey" xml:space="preserve">
<value>Reset Encryption Key</value>
</data>
<data name="OrderById" xml:space="preserve">
<value>Order by Id</value>
</data>
<data name="OrderByName" xml:space="preserve">
<value>Order by Name</value>
</data>
</root>
23 changes: 23 additions & 0 deletions KeyManager.Library.UI/Domain/KeyEntriesControlViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ public KeyEntriesControlViewModel(ISnackbarMessageQueue snackbarMessageQueue, Ke
}
});

OrderingCommand = new RelayCommand<string>(Ordering);

_identifiersView = CollectionViewSource.GetDefaultView(Identifiers);
_identifiersView.Filter = KeyEntryIdentifiersFilter;
}
Expand Down Expand Up @@ -511,6 +513,27 @@ private void ToggleAllSelection(bool selected)
}
}

public RelayCommand<string> OrderingCommand { get; }
private void Ordering(string? order)
{
_identifiersView.SortDescriptions.Clear();
switch (order)
{
case "ByIdAsc":
_identifiersView.SortDescriptions.Add(new SortDescription("KeyEntryId.Id", ListSortDirection.Ascending));
break;
case "ByIdDesc":
_identifiersView.SortDescriptions.Add(new SortDescription("KeyEntryId.Id", ListSortDirection.Descending));
break;
case "ByLabelAsc":
_identifiersView.SortDescriptions.Add(new SortDescription("KeyEntryId.Label", ListSortDirection.Ascending));
break;
case "ByLabelDesc":
_identifiersView.SortDescriptions.Add(new SortDescription("KeyEntryId.Label", ListSortDirection.Descending));
break;
}
}

public async Task RefreshKeyEntries()
{
lock (_identifierLock)
Expand Down
42 changes: 39 additions & 3 deletions KeyManager.Library.UI/KeyEntriesControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,45 @@
</WrapPanel>
</WrapPanel>
<DockPanel LastChildFill="True" Grid.Column="1">
<Button DockPanel.Dock="Right" x:Name="btnSearch" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Width="24" Height="24" Margin="3" ToolTip="{x:Static properties:Resources.Search}" Click="btnSearch_Click">
<materialDesign:PackIcon Kind="Search" Height="16" Width="16"/>
</Button>
<WrapPanel DockPanel.Dock="Right" Orientation="Vertical" VerticalAlignment="Center">
<Button x:Name="btnSearch" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Width="24" Height="24" Margin="3" ToolTip="{x:Static properties:Resources.Search}" Click="btnSearch_Click">
<materialDesign:PackIcon Kind="Search" Height="16" Width="16"/>
</Button>
<materialDesign:PopupBox PlacementMode="BottomAndAlignCentres"
HorizontalAlignment="Center"
ToolTip="{x:Static properties:Resources.Ordering}" Margin="3" Width="16" Height="16"
Style="{StaticResource MaterialDesignMultiFloatingActionLightPopupBox}">
<materialDesign:PopupBox.ToggleContent>
<materialDesign:PackIcon Kind="OrderBoolAscending" Height="8" Width="8" />
</materialDesign:PopupBox.ToggleContent>
<StackPanel Orientation="Vertical">
<Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
Command="{Binding OrderingCommand}"
CommandParameter="ByIdAsc"
ToolTip="{x:Static properties:Resources.OrderById}" Margin="3">
<materialDesign:PackIcon Kind="OrderNumericAscending" Height="16" Width="16" Cursor="Hand" />
</Button>
<Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
Command="{Binding OrderingCommand}"
CommandParameter="ByIdDesc"
ToolTip="{x:Static properties:Resources.OrderById}" Margin="3">
<materialDesign:PackIcon Kind="OrderNumericDescending" Height="16" Width="16" Cursor="Hand" />
</Button>
<Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
Command="{Binding OrderingCommand}"
CommandParameter="ByLabelAsc"
ToolTip="{x:Static properties:Resources.OrderByLabel}" Margin="3">
<materialDesign:PackIcon Kind="OrderAlphabeticalAscending" Height="16" Width="16" Cursor="Hand" />
</Button>
<Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
Command="{Binding OrderingCommand}"
CommandParameter="ByLabelDesc"
ToolTip="{x:Static properties:Resources.OrderByLabel}" Margin="3">
<materialDesign:PackIcon Kind="OrderAlphabeticalDescending" Height="16" Width="16" Cursor="Hand" />
</Button>
</StackPanel>
</materialDesign:PopupBox>
</WrapPanel>
<TextBox TextWrapping="Wrap" x:Name="SearchTerms" KeyDown="SearchTerms_KeyDown" Margin="3"
materialDesign:HintAssist.Hint="{x:Static properties:Resources.SearchTerms}"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
Expand Down
27 changes: 27 additions & 0 deletions KeyManager.Library.UI/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions KeyManager.Library.UI/Properties/Resources.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -579,4 +579,13 @@
<data name="WrappingKey" xml:space="preserve">
<value>Clé de Wrapping</value>
</data>
<data name="Ordering" xml:space="preserve">
<value>Tri</value>
</data>
<data name="OrderById" xml:space="preserve">
<value>Trier par Id</value>
</data>
<data name="OrderByLabel" xml:space="preserve">
<value>Trier par libellé</value>
</data>
</root>
9 changes: 9 additions & 0 deletions KeyManager.Library.UI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -579,4 +579,13 @@
<data name="WrappingKey" xml:space="preserve">
<value>Wrapping Key</value>
</data>
<data name="Ordering" xml:space="preserve">
<value>Ordering</value>
</data>
<data name="OrderById" xml:space="preserve">
<value>Order by Id</value>
</data>
<data name="OrderByLabel" xml:space="preserve">
<value>Order by Label</value>
</data>
</root>
4 changes: 2 additions & 2 deletions latestversion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"VersionString": "1.18.1",
"Uri": "https://download.leosac.com/lkm/KeyManager.Setup-1.18.1.msi"
"VersionString": "1.19.0",
"Uri": "https://download.leosac.com/lkm/KeyManager.Setup-1.19.0.msi"
}

0 comments on commit 9bbab86

Please sign in to comment.