Skip to content

Commit a689bcf

Browse files
Dependency updates, and one small features (#125)
* Update package versions and modify dialog title * Changed dialog title in `KeyVaultTreeList.axaml.cs` from "Open Key Vault By URI" to "Open Key Vault". * Upgrades several package references in `Desktop.csproj` and `KeyVaultExplorer.csproj` add new menu item for copying the portal URL
1 parent f8f9971 commit a689bcf

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

Desktop/Desktop.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444

4545

4646
<ItemGroup>
47-
<PackageReference Include="Avalonia.Desktop" Version="11.2.5" />
48-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.3" />
47+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.6" />
48+
<PackageReference Include="Avalonia.Desktop" Version="11.3.2" />
4949
</ItemGroup>
5050

5151

KeyVaultExplorer/KeyVaultExplorer.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@
5454

5555
<ItemGroup>
5656
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.1.5" />
57-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.5" />
58-
<PackageReference Include="Avalonia.Svg.Skia" Version="11.2.0.2" />
57+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.2" />
5958
<PackageReference Include="DeviceId" Version="6.9.0" />
6059
<PackageReference Include="FluentAvaloniaUI" Version="2.3.0" />
6160
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
62-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.3" />
63-
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.3" />
61+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
62+
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.6" />
6463
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
65-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.3" />
66-
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.70.0" />
67-
<PackageReference Include="Azure.ResourceManager.KeyVault" Version="1.3.1" />
68-
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.7.0" />
64+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.6" />
65+
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.73.0" />
66+
<PackageReference Include="Azure.ResourceManager.KeyVault" Version="1.3.2" />
67+
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.8.0" />
6968
<PackageReference Include="Azure.Security.KeyVault.Keys" Version="4.7.0" />
70-
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.7.0" />
69+
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.8.0" />
7170
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.1.11" />
71+
<PackageReference Include="Svg.Controls.Skia.Avalonia" Version="11.3.0.1" />
7272
</ItemGroup>
7373

7474

KeyVaultExplorer/ViewModels/KeyVaultTreeListViewModel.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Avalonia.Threading;
1+
using Avalonia.Input;
2+
using Avalonia.Threading;
23
using Azure.Core;
34
using Azure.ResourceManager;
45
using Azure.ResourceManager.KeyVault;
@@ -42,6 +43,7 @@ public partial class KeyVaultTreeListViewModel : ViewModelBase
4243
private readonly KvExplorerDb _dbContext;
4344
private readonly VaultService _vaultService;
4445
private readonly NotificationViewModel _notificationViewModel;
46+
private readonly ClipboardService _clipboardService;
4547
private readonly string[] WatchedNameOfProps = [nameof(KvSubscriptionModel.IsExpanded), nameof(KvSubscriptionModel.IsSelected)];
4648

4749
public KeyVaultTreeListViewModel()
@@ -50,6 +52,7 @@ public KeyVaultTreeListViewModel()
5052
_vaultService = Defaults.Locator.GetRequiredService<VaultService>();
5153
_dbContext = Defaults.Locator.GetRequiredService<KvExplorerDb>();
5254
_notificationViewModel = Defaults.Locator.GetRequiredService<NotificationViewModel>();
55+
_clipboardService = Defaults.Locator.GetRequiredService<ClipboardService>();
5356
// PropertyChanged += OnMyViewModelPropertyChanged;
5457

5558
//foreach (var item in TreeViewList)
@@ -296,14 +299,6 @@ await DelaySetIsBusy(async () =>
296299
}
297300
}
298301

299-
//private void OnMyViewModelPropertyChanged(object sender, PropertyChangedEventArgs e)
300-
//{
301-
// if (e.PropertyName == nameof(SelectedTreeItem))
302-
// {
303-
// // Handle changes to the SelectedTreeItem property here
304-
// //OnSelectedTreeItemChanged("test");
305-
// }
306-
//}
307302

308303
partial void OnSearchQueryChanged(string value)
309304
{
@@ -324,6 +319,14 @@ private void OpenInAzure(KeyVaultResource model)
324319
Process.Start(new ProcessStartInfo(uri) { UseShellExecute = true, Verb = "open" });
325320
}
326321

322+
[RelayCommand]
323+
private async Task CopyPortalURL(KeyVaultResource model)
324+
{
325+
if (model is null) return;
326+
var uri = $"https://portal.azure.com/#@{_authService.TenantName}/resource{model.Id}";
327+
await _clipboardService.SetTextAsync(uri);
328+
}
329+
327330
private void TreeViewList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
328331
{
329332
if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems is not null)

KeyVaultExplorer/Views/CustomControls/KeyVaultTreeList.axaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
CommandParameter="{Binding #SubscriptionTreeViewList.SelectedItem}"
4444
IconSource="Open"
4545
Text="Open in Azure Portal" />
46+
<ui:MenuFlyoutItem
47+
Command="{Binding CopyPortalURLCommand}"
48+
CommandParameter="{Binding #SubscriptionTreeViewList.SelectedItem}"
49+
IconSource="Copy"
50+
Text="Copy Portal URL" />
4651

4752
</ui:FAMenuFlyout>
4853
</UserControl.Resources>

KeyVaultExplorer/Views/CustomControls/KeyVaultTreeList.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private void OpenExternalVaultFromUriDialogBox_Click(object sender, RoutedEventA
108108
var dialog = new ContentDialog()
109109
{
110110
Name = "OpenExternalVaultDialog",
111-
Title = "Open Key Vault By URI",
111+
Title = "Open Key Vault",
112112
IsPrimaryButtonEnabled = true,
113113
PrimaryButtonText = "Open",
114114
DefaultButton = ContentDialogButton.Primary,

0 commit comments

Comments
 (0)