improvements, fixes...

This commit is contained in:
Loretta 2024-07-04 11:48:43 +02:00
parent 1d88ab484f
commit d7acc9fffe
4 changed files with 68 additions and 68 deletions

View File

@ -1,29 +1,29 @@
@using TIAMWebApp.Shared.Application.Models.PageModels; @using TIAMWebApp.Shared.Application.Models.PageModels;
<EditForm Model="@loginModel" OnValidSubmit="GoToNextStep"> <EditForm Model="@LoginModel" OnValidSubmit="GoToNextStep">
<DataAnnotationsValidator /> @* <DataAnnotationsValidator /> *@
<div class="form-field d-flex align-items-center"> <div class="form-field d-flex align-items-center">
<DxMaskedInput @bind-Value="@loginModel.Email" <DxMaskedInput @bind-Value="@LoginModel.Email"
Id="Email" Id="Email"
CssClass="cw-320" CssClass="cw-320"
Mask="@EmailMask" Mask="@EmailMask"
MaskMode="MaskMode.RegEx"> MaskMode="MaskMode.RegEx">
<DxRegExMaskProperties MaskAutoCompleteMode="@((MaskAutoCompleteMode)AutoCompleteMode)" <DxRegExMaskProperties MaskAutoCompleteMode="@((MaskAutoCompleteMode)AutoCompleteMode)"
Placeholder="Placeholder" Placeholder="Placeholder"
PlaceholdersVisible="PlaceholderVisible" /> PlaceholdersVisible="PlaceholderVisible" />
</DxMaskedInput> </DxMaskedInput>
</div> </div>
<ValidationMessage For="@(() => loginModel.Email)" /> <ValidationMessage For="@(() => LoginModel.Email)" />
<button class="btn btn-primary mt-3" type="submit"> <button class="btn btn-primary mt-3" type="submit">
<span class="@spinnerClass"></span> <span class="@spinnerClass"></span>
Next Next
</button> </button>
</EditForm> </EditForm>
@ -31,7 +31,7 @@
@code { @code {
[Parameter] [Parameter]
public LoginModel loginModel { get; set; } public LoginModel LoginModel { get; set; }
//[Parameter] //[Parameter]
//public string Email { get; set; } //public string Email { get; set; }
@ -56,7 +56,7 @@
spinnerClass = "spinner-border spinner-border-sm"; spinnerClass = "spinner-border spinner-border-sm";
await Task.Delay(500); await Task.Delay(500);
spinnerClass = ""; spinnerClass = "";
await LoginModelChanged.InvokeAsync(loginModel); await LoginModelChanged.InvokeAsync(LoginModel);
await onLoginNext.InvokeAsync(); await onLoginNext.InvokeAsync();
} }

View File

@ -9,58 +9,57 @@
<div class="text-center m-5"> <div class="text-center m-5">
<h1>Login</h1> <h1>Login</h1>
<h2 style="font-size:small">Good to see you again!</h2> <h2 style="font-size:small">Good to see you again!</h2>
</div> </div>
<div class="container mt-3"> <div class="container mt-3">
<div class="row d-flex justify-content-center align-items-center h-100"> <div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-12 col-sm-6 px-5"> <div class="col-12 col-sm-6 px-5">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)"> <Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card glass inputwizardwrapper my-5"> <div class="card glass inputwizardwrapper my-5">
<div class="wrapper"> <div class="wrapper">
<div class="my-logo"> <div class="my-logo">
<img src="_content/TIAMSharedUI/images/png-logo-0.png" alt=""> <img src="_content/TIAMSharedUI/images/png-logo-0.png" alt="">
</div>
<div class="text-center mt-4 name">
@localizer["LoginTitleText"]
</div>
<form class="p-3 mt-3">
<div>
@switch (currentStep)
{
case 1:
<LoginStep1 @bind-LoginModel="_loginModel" onLoginNext="GoToNextStep" />
;
break;
case 2:
<LoginStep3 @bind-LoginModel="_loginModel" onSubmit="SubmitLogin" onPrev="GoToPreviousStep" />
;
break;
}
</div> </div>
<div class="text-center mt-4 name">
@localizer["LoginTitleText"]
</form> </div>
<p>@currentStep</p> <form class="p-3 mt-3">
@{
if (!loggedIn)
{
<div> <div>
@switch (_currentStep)
{
case 1:
<LoginStep1 @bind-LoginModel="_loginModel" onLoginNext="GoToNextStep" />
;
break;
<p>@localizer["LoginEmail"]: @_loginModel.Email</p> case 2:
<LoginStep3 @bind-LoginModel="_loginModel" onSubmit="SubmitLogin" onPrev="GoToPreviousStep" />
<p>@_loginModel.Password</p> ;
break;
}
</div> </div>
</form>
<p>@_currentStep</p>
@{
if (!_loggedIn)
{
<div>
<p>@localizer["LoginEmail"]: @_loginModel.Email</p>
<p>@_loginModel.Password</p>
</div>
}
} }
} <div class="text-center fs-6">
<div class="text-center fs-6"> No account yet? <a href="register">Sign up here!</a>
No account yet? <a href="register">Sign up here!</a> </div>
</div> </div>
</div> </div>
</div>
</Animation> </Animation>
</div> </div>
<div class="col-12 col-sm-6 px-5"> <div class="col-12 col-sm-6 px-5">
@ -76,7 +75,8 @@
</div> </div>
@code { @code {
LoginModel _loginModel = new LoginModel("test@tiam.hu", "test1234"); //LoginModel _loginModel = new LoginModel("test@tiam.hu", "test1234");
LoginModel _loginModel = new LoginModel("", "");
} }

View File

@ -43,23 +43,23 @@ namespace TIAMSharedUI.Pages
//[Display(Name = "LoginTitleText", ResourceType = typeof(MyResources))] //[Display(Name = "LoginTitleText", ResourceType = typeof(MyResources))]
public string TitleText { get; set; } = "dda,mnd,amn,a"; public string TitleText { get; set; } = "dda,mnd,amn,a";
private int currentStep = 1; private int _currentStep = 1;
bool loggedIn = false; bool _loggedIn = false;
private void GoToNextStep() private void GoToNextStep()
{ {
currentStep++; _currentStep++;
} }
private void GoToPreviousStep() private void GoToPreviousStep()
{ {
currentStep--; _currentStep--;
} }
private async void SubmitLogin() private async void SubmitLogin()
{ {
currentStep = 1; _currentStep = 1;
BrowserConsoleLogWriter.Info("Login started: " + "Email: " + _loginModel.Email + ", Password: " + _loginModel.Password); BrowserConsoleLogWriter.Info("Login started: " + "Email: " + _loginModel.Email + ", Password: " + _loginModel.Password);
var response = await userDataService.AuthenticateUser(_loginModel); var response = await userDataService.AuthenticateUser(_loginModel);
//var response = await UserDataservice.TestUserApi(30); //var response = await UserDataservice.TestUserApi(30);

View File

@ -66,11 +66,11 @@
private MessageGrid _messageGrid = null!; private MessageGrid _messageGrid = null!;
private LoggerClient<MessageGridComponent> _logger = null!; private LoggerClient<MessageDetailGridComponent> _logger = null!;
protected override void OnInitialized() protected override void OnInitialized()
{ {
_logger = new LoggerClient<MessageGridComponent>(LogWriters.ToArray()); _logger = new LoggerClient<MessageDetailGridComponent>(LogWriters.ToArray());
} }
private void CustomizeElement(GridCustomizeElementEventArgs e) private void CustomizeElement(GridCustomizeElementEventArgs e)