From 0a6cafc37f801c05ca10cc488cbb6144556aebfc Mon Sep 17 00:00:00 2001 From: Invvard <7305493+Invvard@users.noreply.github.com> Date: Thu, 18 Apr 2019 23:26:55 -0400 Subject: [PATCH 1/5] Update hash ID regex pattern --- .../ViewModel/SettingsViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/SettingsViewModel.cs b/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/SettingsViewModel.cs index 0bf24f9d..dcb1a43d 100644 --- a/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/SettingsViewModel.cs +++ b/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/SettingsViewModel.cs @@ -294,7 +294,7 @@ private string ExtractLayoutHashId(string layoutUrl) Logger.TraceMethod(); var layoutHashIdGroupName = "layoutHashId"; - var pattern = $"https://configure.ergodox-ez.com/layouts/(?<{layoutHashIdGroupName}>default|[a-zA-Z0-9]{{4,}})(?:/latest/[0-9])?"; + var pattern = $"https://configure.ergodox-ez.com/ergodox-ez/layouts/(?<{layoutHashIdGroupName}>default|[a-zA-Z0-9]{{4,}})(?:/latest/[0-9])?"; var layoutHashId = "default"; var regex = new Regex(pattern); From 559545ceae6764927468a14215e15bf5fe626229 Mon Sep 17 00:00:00 2001 From: Invvard <7305493+Invvard@users.noreply.github.com> Date: Thu, 18 Apr 2019 23:27:37 -0400 Subject: [PATCH 2/5] Update unit tests --- .../ViewModel/SettingsViewModelTest.cs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/SettingsViewModelTest.cs b/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/SettingsViewModelTest.cs index 832cd646..8e005cef 100644 --- a/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/SettingsViewModelTest.cs +++ b/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/SettingsViewModelTest.cs @@ -165,17 +165,18 @@ public void CloseCommand_Execute(bool mustSave) } [ Theory ] - [ InlineData("https://configure.ergodox-ez.com/layouts/abcd/latest/0", "abcd") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/1234/latest/0", "1234") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/a2Vt/latest/0", "a2Vt") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/default/latest/0", "default") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/j3o4", "j3o4") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/r2d2/lat/9", "r2d2") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/def/latest/0", "default") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/_t3s/latest/0", "default") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/t3s/latest/0", "default") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/adbcd/latest/0", "adbcd") ] - [ InlineData("https://configure.ergodox-ez.com/layouts/asdfasdfasdfasdfgfasdffgasf/latest/0", "asdfasdfasdfasdfgfasdffgasf") ] + [ InlineData("https://configure.ergodox-ez.com/layouts/abcd/latest/0", "default") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/abcd/latest/0", "abcd") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/1234/latest/0", "1234") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/a2Vt/latest/0", "a2Vt") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/default/latest/0", "default") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/j3o4", "j3o4") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/r2d2/lat/9", "r2d2") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/def/latest/0", "default") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/_t3s/latest/0", "default") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/t3s/latest/0", "default") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/adbcd/latest/0", "adbcd") ] + [ InlineData("https://configure.ergodox-ez.com/ergodox-ez/layouts/asdfasdfasdfasdfgfasdffgasf/latest/0", "asdfasdfasdfasdfgfasdffgasf") ] public void UpdateLayoutCommand_Execute(string layoutUrl, string expectedHashId) { //Arrange From a2a759df5e32393253edbec9d65b1ff9fbbfe615 Mon Sep 17 00:00:00 2001 From: Invvard <7305493+Invvard@users.noreply.github.com> Date: Thu, 18 Apr 2019 23:53:47 -0400 Subject: [PATCH 3/5] Update assembly file version --- .../Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InvvardDev.EZLayoutDisplay.Desktop/Properties/AssemblyInfo.cs b/src/InvvardDev.EZLayoutDisplay.Desktop/Properties/AssemblyInfo.cs index 5764cd14..a01c2bf7 100644 --- a/src/InvvardDev.EZLayoutDisplay.Desktop/Properties/AssemblyInfo.cs +++ b/src/InvvardDev.EZLayoutDisplay.Desktop/Properties/AssemblyInfo.cs @@ -51,6 +51,6 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.1.0")] -[assembly: AssemblyFileVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.2.0")] [assembly: NeutralResourcesLanguage("en-US")] From 512de75575aaba107e1428beb2f74ca9a6d421e0 Mon Sep 17 00:00:00 2001 From: Invvard <7305493+Invvard@users.noreply.github.com> Date: Fri, 19 Apr 2019 00:06:56 -0400 Subject: [PATCH 4/5] Change the version source --- .../ViewModel/AboutViewModel.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/AboutViewModel.cs b/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/AboutViewModel.cs index a0f84e5d..95666e7f 100644 --- a/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/AboutViewModel.cs +++ b/src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/AboutViewModel.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System.Diagnostics; +using System.Linq; using System.Reflection; using System.Windows.Input; using GalaSoft.MvvmLight; @@ -177,9 +178,10 @@ public AboutViewModel(IWindowService windowService, IProcessService processServi private void SetLabelUi() { var appTitle = GetAppTitle(); + var appVersion = GetAppVersion(); WindowTitle = $"About {appTitle}"; AppTitleLabel = appTitle; - AppVersionLabel = $"v.{Assembly.GetExecutingAssembly().GetName().Version}"; + AppVersionLabel = $"v.{appVersion}"; CreatedTitleLabel = "Created by"; BasedOnTitleLabel = "Based on"; ProjectHomeTitleLabel = "Project home"; @@ -191,6 +193,14 @@ private void SetLabelUi() CloseButtonLabel = "OK"; } + private string GetAppVersion() + { + var assembly = Assembly.GetExecutingAssembly(); + string version = FileVersionInfo.GetVersionInfo(assembly.Location).FileVersion; + + return version; + } + private static string GetAppTitle() { Logger.TraceMethod(); From bed255f0dff2f4d80695b5f76dc48ee8214d7a62 Mon Sep 17 00:00:00 2001 From: Invvard <7305493+Invvard@users.noreply.github.com> Date: Fri, 19 Apr 2019 00:07:18 -0400 Subject: [PATCH 5/5] Update unit test --- .../ViewModel/AboutViewModelTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/AboutViewModelTest.cs b/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/AboutViewModelTest.cs index b3351923..f7de365f 100644 --- a/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/AboutViewModelTest.cs +++ b/src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/AboutViewModelTest.cs @@ -21,7 +21,7 @@ public void AboutViewModelConstructor() // Assert Assert.Equal("About EZ Layout Display", aboutViewModel.WindowTitle); Assert.Equal("EZ Layout Display", aboutViewModel.AppTitleLabel); - Assert.Equal("v.1.0.1.0", aboutViewModel.AppVersionLabel); + Assert.Equal("v.1.0.2.0", aboutViewModel.AppVersionLabel); Assert.Equal("Created by", aboutViewModel.CreatedTitleLabel); Assert.Equal("Based on", aboutViewModel.BasedOnTitleLabel); Assert.Equal("Project home", aboutViewModel.ProjectHomeTitleLabel);