aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-11-09 23:34:01 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-11-09 23:34:01 +0200
commite7cbb2ad47498bb072ee293baaf7fc9e2999fbec (patch)
tree073fe0b1fee57246dd639c2f21dc6b175e197a23 /Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels
parentf42acf4a2513bfb156f3323d2cd9dadf67809220 (diff)
parent313970208cf06fe7925e41a9479e619fa1aca7f6 (diff)
downloadTango-e7cbb2ad47498bb072ee293baaf7fc9e2999fbec.tar.gz
Tango-e7cbb2ad47498bb072ee293baaf7fc9e2999fbec.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
index 27c490c80..70a68918a 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
@@ -66,7 +66,7 @@ namespace Tango.FSE.UI.ViewModels
public String Email
{
get { return _email; }
- set { _email = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
+ set { _email = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(DisplayEnvironment)); InvalidateRelayCommands(); }
}
private String _password;
@@ -153,6 +153,14 @@ namespace Tango.FSE.UI.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets a value indicating whether to display the environment selection.
+ /// </summary>
+ public bool DisplayEnvironment
+ {
+ get { return Email.IsNotNullOrEmpty() && Email.ToLower().EndsWith("@twine-s.com"); }
+ }
+
#endregion
#region Commands
@@ -288,6 +296,12 @@ namespace Tango.FSE.UI.ViewModels
}
IsFree = false;
+
+ if (!DisplayEnvironment) //Force production environment if not a twine user.
+ {
+ SelectedEnvironment = Services.GatewayService.Environments.SingleOrDefault(x => x.Name == "PROD");
+ }
+
SelectedView = LoginViews.Logging;
var result = await AuthenticationProvider.Login(Email, Password, SelectedEnvironment, (status) => Status = status);