Skip to content
This repository has been archived by the owner on Nov 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #63 from Invvard/fix/issue-62-new-configurator-url
Browse files Browse the repository at this point in the history
Fix/issue 62 new configurator url
  • Loading branch information
Invvard authored Apr 19, 2019
2 parents 4ac1a5d + bed255f commit c420738
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

14 changes: 12 additions & 2 deletions src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/AboutViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Windows.Input;
using GalaSoft.MvvmLight;
Expand Down Expand Up @@ -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";
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c420738

Please sign in to comment.