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..0c62584 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;
@@ -34,11 +35,13 @@ 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 ? 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 bool IsExpired => ExpiresOn.HasValue && (ExpiresOn.Value < DateTimeOffset.Now);
public static KeyVaultItemProperties FromSecretProperties(SecretProperties properties)
=> Create(
@@ -172,44 +175,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/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
diff --git a/src/uno/Directory.Packages.props b/src/uno/Directory.Packages.props
index 663c614..2cb8f0e 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..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.0-dev.232"
+ "Uno.Sdk": "6.6.42"
},
"sdk": {
"allowPrerelease": false