From 2fdde9a5397ec74e8d01106964f34bbe7f7f413c Mon Sep 17 00:00:00 2001 From: cricketthomas Date: Fri, 24 Jul 2026 08:20:58 -0400 Subject: [PATCH 1/4] Update date language translations to use Humanizer Bump minor package versions Bump Uno Version --- .../AzureKeyVaultStudio.csproj | 3 +- .../Models/KeyVaultValuesAmalgamation.cs | 43 ++----------------- .../AzureKeyVaultStudio/Package.appxmanifest | 2 +- src/uno/Directory.Packages.props | 15 ++++--- src/uno/global.json | 2 +- 5 files changed, 15 insertions(+), 50 deletions(-) diff --git a/src/uno/AzureKeyVaultStudio/AzureKeyVaultStudio.csproj b/src/uno/AzureKeyVaultStudio/AzureKeyVaultStudio.csproj index b26259a..076a004 100644 --- a/src/uno/AzureKeyVaultStudio/AzureKeyVaultStudio.csproj +++ b/src/uno/AzureKeyVaultStudio/AzureKeyVaultStudio.csproj @@ -12,7 +12,7 @@ AzureKeyVaultStudio io.github.cricketthomas.AzureKeyVaultExplorer - 2.1.1.0 + 2.2.0.0 2 cricketthomas @@ -85,6 +85,7 @@ + diff --git a/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs b/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs index 8c5cda5..f862fe5 100644 --- a/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs +++ b/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs @@ -3,6 +3,7 @@ using Azure.Security.KeyVault.Certificates; using Azure.Security.KeyVault.Keys; using Azure.Security.KeyVault.Secrets; +using Humanizer; namespace AzureKeyVaultStudio.Models; @@ -37,8 +38,8 @@ public sealed class KeyVaultItemProperties public ObservableCollection EditableTags { get; set; } = new ObservableCollection(); public DateTimeOffset? LastModifiedDate => UpdatedOn.HasValue ? UpdatedOn.Value.ToLocalTime() : CreatedOn?.ToLocalTime(); - public string? WhenLastModified => LastModifiedDate.HasValue ? FormatRelativeDate(LastModifiedDate.Value, true) : null; - public string? WhenExpires => ExpiresOn.HasValue ? FormatRelativeDate(ExpiresOn.Value) : null; + public string? WhenLastModified => LastModifiedDate.HasValue ? LastModifiedDate.Value.Humanize() : null; + public string? WhenExpires => ExpiresOn.HasValue ? ExpiresOn.Value.Humanize() : null; public static KeyVaultItemProperties FromSecretProperties(SecretProperties properties) => Create( @@ -172,44 +173,6 @@ private static KeyVaultItemProperties Create( }; } - internal static string? FormatRelativeDate(DateTimeOffset dateTimeOffset, bool isPast = false) - { - DateTimeOffset now = DateTimeOffset.Now; - - if (dateTimeOffset < now && !isPast) - { - return "Expired"; - } - - TimeSpan timeSpan = isPast ? now.Subtract(dateTimeOffset) : dateTimeOffset.Subtract(now); - int dayDifference = (int)timeSpan.TotalDays; - int secondDifference = (int)timeSpan.TotalSeconds; - var weeks = Math.Ceiling((double)dayDifference / 7); - var months = Math.Ceiling((double)dayDifference / 30); - var years = Math.Round((double)dayDifference / 365); - - if (dayDifference < 0 || dayDifference >= 5000) return null; - - return (dayDifference, secondDifference) switch - { - (0, < 60) when isPast => "just now", - (0, < 120) when isPast => "1 minute ago", - (0, < 3600) when isPast => $"{Math.Floor((double)secondDifference / 60)} minutes ago", - (0, < 7200) when isPast => "1 hour ago", - (0, < 86400) when isPast => $"{Math.Floor((double)secondDifference / 3600)} hours ago", - (0, < 86400) when !isPast => "in less than a day", - (1, _) when isPast => "yesterday", - (1, _) when !isPast => "tomorrow", - ( < 7, _) => $"{(isPast ? string.Empty : "in ")}{dayDifference} days{(isPast ? " ago" : string.Empty)}", - ( < 30, _) => $"{(isPast ? string.Empty : "in ")}{weeks} {(weeks == 1 ? "week" : "weeks")}{(isPast ? " ago" : string.Empty)}", - ( < 366, _) => $"{(isPast ? string.Empty : "in ")}{months} {(months == 1 ? "month" : "months")}{(isPast ? " ago" : string.Empty)}", - (_, _) => $"{(isPast ? string.Empty : "in ")}{years} {(years == 1 ? "year" : "years")}{(isPast ? " ago" : string.Empty)}" - }; - - - - } - public void ApplyEditableTags(IDictionary targetTags) { targetTags.Clear(); diff --git a/src/uno/AzureKeyVaultStudio/Package.appxmanifest b/src/uno/AzureKeyVaultStudio/Package.appxmanifest index b6b86bc..cb33d12 100644 --- a/src/uno/AzureKeyVaultStudio/Package.appxmanifest +++ b/src/uno/AzureKeyVaultStudio/Package.appxmanifest @@ -6,7 +6,7 @@ xmlns:uap18="http://schemas.microsoft.com/appx/manifest/uap/windows10/18" IgnorableNamespaces="uap rescap uap18"> - + Key Vault Explorer Arthur Thomas IV diff --git a/src/uno/Directory.Packages.props b/src/uno/Directory.Packages.props index 663c614..578d40b 100644 --- a/src/uno/Directory.Packages.props +++ b/src/uno/Directory.Packages.props @@ -7,20 +7,21 @@ --> + - + - + - + - - + + @@ -32,13 +33,13 @@ - + - + \ No newline at end of file diff --git a/src/uno/global.json b/src/uno/global.json index 3c7e973..5e3e959 100644 --- a/src/uno/global.json +++ b/src/uno/global.json @@ -1,7 +1,7 @@ { // To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information. "msbuild-sdks": { - "Uno.Sdk": "6.6.0-dev.232" + "Uno.Sdk": "6.6.29" }, "sdk": { "allowPrerelease": false From ad691d6bbde74ae6ed96df648b9b5ffff48540e9 Mon Sep 17 00:00:00 2001 From: cricketthomas Date: Thu, 30 Jul 2026 07:04:41 -0400 Subject: [PATCH 2/4] update uno sdk version --- src/uno/global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uno/global.json b/src/uno/global.json index 5e3e959..75da8ed 100644 --- a/src/uno/global.json +++ b/src/uno/global.json @@ -1,7 +1,7 @@ { // To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information. "msbuild-sdks": { - "Uno.Sdk": "6.6.29" + "Uno.Sdk": "6.6.33" }, "sdk": { "allowPrerelease": false From 74cf99711f252f38d2143e7b5655f728501c2056 Mon Sep 17 00:00:00 2001 From: cricketthomas Date: Thu, 30 Jul 2026 07:59:17 -0400 Subject: [PATCH 3/4] localize expired text --- .../Models/KeyVaultValuesAmalgamation.cs | 4 ++- .../Presentation/VaultTabContentPage.xaml | 25 +++++++++++++++---- .../Strings/de/Resources.resw | 5 +++- .../Strings/en/Resources.resw | 5 +++- .../Strings/es/Resources.resw | 3 +++ .../Strings/fr/Resources.resw | 5 +++- .../Strings/pt-BR/Resources.resw | 3 +++ 7 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs b/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs index f862fe5..0c62584 100644 --- a/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs +++ b/src/uno/AzureKeyVaultStudio/Models/KeyVaultValuesAmalgamation.cs @@ -35,12 +35,14 @@ public sealed class KeyVaultItemProperties public string[] TagValues => Tags is not null ? [.. Tags.Values] : []; public string[] TagKeys => Tags is not null ? [.. Tags.Keys] : []; public string TagValuesString => string.Join(", ", Tags?.Values ?? []); - public ObservableCollection EditableTags { get; set; } = new ObservableCollection(); + public ObservableCollection EditableTags { get; set; } = []; public DateTimeOffset? LastModifiedDate => UpdatedOn.HasValue ? UpdatedOn.Value.ToLocalTime() : CreatedOn?.ToLocalTime(); public string? WhenLastModified => LastModifiedDate.HasValue ? LastModifiedDate.Value.Humanize() : null; public string? WhenExpires => ExpiresOn.HasValue ? ExpiresOn.Value.Humanize() : null; + public bool IsExpired => ExpiresOn.HasValue && (ExpiresOn.Value < DateTimeOffset.Now); + public static KeyVaultItemProperties FromSecretProperties(SecretProperties properties) => Create( properties.Id, diff --git a/src/uno/AzureKeyVaultStudio/Presentation/VaultTabContentPage.xaml b/src/uno/AzureKeyVaultStudio/Presentation/VaultTabContentPage.xaml index 1c6adab..90555d3 100644 --- a/src/uno/AzureKeyVaultStudio/Presentation/VaultTabContentPage.xaml +++ b/src/uno/AzureKeyVaultStudio/Presentation/VaultTabContentPage.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:models="using:AzureKeyVaultStudio.Models" xmlns:primitives="using:CommunityToolkit.WinUI.UI.Controls.Primitives" xmlns:skia="http://uno.ui/not_win" xmlns:toolkit="using:CommunityToolkit.WinUI.Controls" @@ -254,12 +255,26 @@ CanUserSort="True" Tag="UpdatedOn" /> - + Tag="ExpiresOn"> + + + + + + + + + + + + + - + diff --git a/src/uno/AzureKeyVaultStudio/Strings/de/Resources.resw b/src/uno/AzureKeyVaultStudio/Strings/de/Resources.resw index 9c0c218..2f72856 100644 --- a/src/uno/AzureKeyVaultStudio/Strings/de/Resources.resw +++ b/src/uno/AzureKeyVaultStudio/Strings/de/Resources.resw @@ -720,4 +720,7 @@ Ablauf: - + + Abgelaufen + + \ No newline at end of file diff --git a/src/uno/AzureKeyVaultStudio/Strings/en/Resources.resw b/src/uno/AzureKeyVaultStudio/Strings/en/Resources.resw index 0ae58b8..c780416 100644 --- a/src/uno/AzureKeyVaultStudio/Strings/en/Resources.resw +++ b/src/uno/AzureKeyVaultStudio/Strings/en/Resources.resw @@ -720,4 +720,7 @@ Expiration: - + + Expired + + \ No newline at end of file diff --git a/src/uno/AzureKeyVaultStudio/Strings/es/Resources.resw b/src/uno/AzureKeyVaultStudio/Strings/es/Resources.resw index a775983..0c59b4e 100644 --- a/src/uno/AzureKeyVaultStudio/Strings/es/Resources.resw +++ b/src/uno/AzureKeyVaultStudio/Strings/es/Resources.resw @@ -720,4 +720,7 @@ Expiración: + + Expirado + \ No newline at end of file diff --git a/src/uno/AzureKeyVaultStudio/Strings/fr/Resources.resw b/src/uno/AzureKeyVaultStudio/Strings/fr/Resources.resw index 52cf2ee..bb72a9b 100644 --- a/src/uno/AzureKeyVaultStudio/Strings/fr/Resources.resw +++ b/src/uno/AzureKeyVaultStudio/Strings/fr/Resources.resw @@ -720,4 +720,7 @@ Expiration: - + + Expiré + + \ No newline at end of file diff --git a/src/uno/AzureKeyVaultStudio/Strings/pt-BR/Resources.resw b/src/uno/AzureKeyVaultStudio/Strings/pt-BR/Resources.resw index 2b7bf83..eb5febc 100644 --- a/src/uno/AzureKeyVaultStudio/Strings/pt-BR/Resources.resw +++ b/src/uno/AzureKeyVaultStudio/Strings/pt-BR/Resources.resw @@ -720,4 +720,7 @@ Expiração: + + Expirado + \ No newline at end of file From a51bd4e3305d49c9c8b0bd8fa604f7812f022bab Mon Sep 17 00:00:00 2001 From: cricketthomas Date: Fri, 31 Jul 2026 07:58:40 -0400 Subject: [PATCH 4/4] update uno version --- src/uno/Directory.Packages.props | 4 ++-- src/uno/global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uno/Directory.Packages.props b/src/uno/Directory.Packages.props index 578d40b..2cb8f0e 100644 --- a/src/uno/Directory.Packages.props +++ b/src/uno/Directory.Packages.props @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/src/uno/global.json b/src/uno/global.json index 75da8ed..5ffb90d 100644 --- a/src/uno/global.json +++ b/src/uno/global.json @@ -1,7 +1,7 @@ { // To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information. "msbuild-sdks": { - "Uno.Sdk": "6.6.33" + "Uno.Sdk": "6.6.42" }, "sdk": { "allowPrerelease": false