From f5301076f8bd66ff2a0e0789146ca03696039ec3 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 8 Jan 2024 19:21:36 +0100 Subject: [PATCH] CreateWizards --- TIAMResources/TIAMResources.Designer.cs | 72 +++++ TIAMResources/TIAMResources.hu.resx | 24 ++ TIAMResources/TIAMResources.resx | 24 ++ TIAMSharedUI/Pages/ChooseDestination.razor.cs | 1 + .../Pages/Components/InputWizard.razor | 3 +- .../Pages/Components/InputWizard.razor.cs | 128 ++++++--- TIAMSharedUI/Pages/Components/Step1.razor | 4 +- .../Pages/Components/TiamDXTextBox.cs | 15 +- TIAMSharedUI/Pages/TestPage.razor | 35 ++- TIAMSharedUI/Pages/Transfer.razor | 12 +- TIAMSharedUI/Pages/User/HotelComponent.razor | 12 +- .../Pages/User/HotelComponent.razor.cs | 3 + .../Pages/User/MyServiceProviders.razor | 7 +- TIAMSharedUI/Pages/User/MyTransfers.razor | 258 ++++++++++-------- TIAMSharedUI/Pages/User/ServiceProvider.razor | 22 ++ TIAMSharedUI/Shared/AdminLayout.razor | 3 - TIAMSharedUI/Shared/SliderItemSelector.razor | 65 ++--- TIAMSharedUI/wwwroot/css/TourIAm.css | 4 + .../UI/WizardModels/MessageWizardModel.cs | 35 +++ .../UI/WizardModels/TransferWizardModel.cs | 4 +- .../Shared/Utility/TIAMRegularExpressions.cs | 1 + 21 files changed, 495 insertions(+), 237 deletions(-) create mode 100644 TIAMSharedUI/Pages/User/ServiceProvider.razor create mode 100644 TIAMWebApp/Shared/Models/ClientSide/UI/WizardModels/MessageWizardModel.cs diff --git a/TIAMResources/TIAMResources.Designer.cs b/TIAMResources/TIAMResources.Designer.cs index f96c908c..2a11c46e 100644 --- a/TIAMResources/TIAMResources.Designer.cs +++ b/TIAMResources/TIAMResources.Designer.cs @@ -123,6 +123,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Send. + /// + public static string ButtonSend { + get { + return ResourceManager.GetString("ButtonSend", resourceCulture); + } + } + /// /// Looks up a localized string similar to Confirm Email. /// @@ -240,6 +249,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Html content. + /// + public static string HtmlContent { + get { + return ResourceManager.GetString("HtmlContent", resourceCulture); + } + } + /// /// Looks up a localized string similar to Login. /// @@ -249,6 +267,24 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to New message. + /// + public static string NewMessage { + get { + return ResourceManager.GetString("NewMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Let's send them a message!. + /// + public static string NewMessageSubtitle { + get { + return ResourceManager.GetString("NewMessageSubtitle", resourceCulture); + } + } + /// /// Looks up a localized string similar to Passengers. /// @@ -303,6 +339,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Receiver Id. + /// + public static string ReceiverId { + get { + return ResourceManager.GetString("ReceiverId", resourceCulture); + } + } + /// /// Looks up a localized string similar to Register. /// @@ -357,6 +402,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Subject. + /// + public static string Subject { + get { + return ResourceManager.GetString("Subject", resourceCulture); + } + } + /// /// Looks up a localized string similar to This works!. /// @@ -375,6 +429,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Let's book a transfer!. + /// + public static string TransferSubtitle { + get { + return ResourceManager.GetString("TransferSubtitle", resourceCulture); + } + } + /// /// Looks up a localized string similar to New Transfer. /// @@ -384,6 +447,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Trip date. + /// + public static string TripDate { + get { + return ResourceManager.GetString("TripDate", resourceCulture); + } + } + /// /// Looks up a localized string similar to Wizard. /// diff --git a/TIAMResources/TIAMResources.hu.resx b/TIAMResources/TIAMResources.hu.resx index 0ecda8d9..42e71df7 100644 --- a/TIAMResources/TIAMResources.hu.resx +++ b/TIAMResources/TIAMResources.hu.resx @@ -138,6 +138,9 @@ Mentés + + Küldés + E-mail cím megerősítése @@ -177,9 +180,18 @@ Teljes név + + Html tartalom + Belépés + + Új üzenet + + + Küldjünk neki egy üzenetet! + Utasok száma @@ -198,6 +210,9 @@ Ár + + Címzett azonosítója + Regisztráció @@ -216,15 +231,24 @@ Új szolgáltató + + Tárgy + Müxik! Új uticél + + Rendeljünk egy transzfert! + Új transzfer + + Utazás napja + Varázsló diff --git a/TIAMResources/TIAMResources.resx b/TIAMResources/TIAMResources.resx index dc9d9124..0ab4d72a 100644 --- a/TIAMResources/TIAMResources.resx +++ b/TIAMResources/TIAMResources.resx @@ -138,6 +138,9 @@ Save + + Send + Confirm Email @@ -177,9 +180,18 @@ Full name + + Html content + Login + + New message + + + Let's send them a message! + Passengers @@ -198,6 +210,9 @@ Price + + Receiver Id + Register @@ -216,15 +231,24 @@ New Service provider + + Subject + This works! New destination + + Let's book a transfer! + New Transfer + + Trip date + Wizard diff --git a/TIAMSharedUI/Pages/ChooseDestination.razor.cs b/TIAMSharedUI/Pages/ChooseDestination.razor.cs index 90d3aa01..901eb688 100644 --- a/TIAMSharedUI/Pages/ChooseDestination.razor.cs +++ b/TIAMSharedUI/Pages/ChooseDestination.razor.cs @@ -1,4 +1,5 @@ using AyCode.Blazor.Components; +using DevExpress.Blazor; using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; diff --git a/TIAMSharedUI/Pages/Components/InputWizard.razor b/TIAMSharedUI/Pages/Components/InputWizard.razor index 474e2ce7..ce89e1a1 100644 --- a/TIAMSharedUI/Pages/Components/InputWizard.razor +++ b/TIAMSharedUI/Pages/Components/InputWizard.razor @@ -23,8 +23,7 @@ -

-

@localizer.GetString("DestinationName")

+

@_formSubmitResult

diff --git a/TIAMSharedUI/Pages/Components/InputWizard.razor.cs b/TIAMSharedUI/Pages/Components/InputWizard.razor.cs index cb007381..daa70db9 100644 --- a/TIAMSharedUI/Pages/Components/InputWizard.razor.cs +++ b/TIAMSharedUI/Pages/Components/InputWizard.razor.cs @@ -15,6 +15,8 @@ using TIAMWebApp.Shared.Application.Interfaces; using System.Reflection; using TIAMWebApp.Shared.Application.Models; using DevExpress.XtraPrinting; +using TIAMSharedUI.Shared; +using DevExpress.Pdf.Native.BouncyCastle.Asn1.Cms; namespace TIAMSharedUI.Pages.Components @@ -25,7 +27,7 @@ namespace TIAMSharedUI.Pages.Components public required LogToBrowserConsole LogToBrowserConsole { get; set; } [Inject] - IStringLocalizer localizer { get; set; } + IStringLocalizer localizer { get; set; } public Dictionary FormSteps { get; set; } = new Dictionary(); public int CurrentStep { get; set; } = 0; @@ -34,6 +36,8 @@ namespace TIAMSharedUI.Pages.Components [Parameter] public string TitleResourceString { get; set; } = "Wizard"; + + [Parameter] public string SubtitleResourceString { get; set; } = "Let's fill in this form"; [Parameter] @@ -45,8 +49,12 @@ namespace TIAMSharedUI.Pages.Components [Parameter] public string SubmitButtonText { get; set; } = "Submit"; + [Required] + [Parameter] + public List IgnoreReflection { get; set; } + + - string _formSubmitResult = ""; private string _spinnerClass = ""; @@ -70,7 +78,7 @@ namespace TIAMSharedUI.Pages.Components _formSubmitResult = debugString; _spinnerClass = ""; - + await OnSubmit.InvokeAsync(Data); } @@ -98,33 +106,35 @@ namespace TIAMSharedUI.Pages.Components LogToBrowserConsole.LogToBC("Hellooooo " + _type.AssemblyQualifiedName); var propertyList = _type.GetProperties(); + var _length = propertyList.Length - IgnoreReflection.Count; //var propertyList = typeof(TestUserData).GetProperties(); formLayoutBuilder.OpenComponent(0); formLayoutBuilder.AddAttribute(1, "ChildContent", (RenderFragment)((layoutItemBuilder) => { int i = 0; - int j = 0; + int k = 0; foreach (var property in propertyList) { - bool isActive = j == CurrentStep; + bool isActive = k == CurrentStep; //if (property.Name == "Id" || property.Name == "Latitude" || property.Name == "Longitude" || property.Name == "Created" || property.Name == "Modified") //if (property.Name == "Id" || property.Name == "Created" || property.Name == "Modified") - if (property.Name == "Id" || property.Name == "Price" || property.Name == "Created" || property.Name == "Modified") + if (IgnoreReflection.Contains(property.Name)) { continue; } Guid _stepID = Guid.Empty; - if (!FormSteps.ContainsKey(j)) + if (!FormSteps.ContainsKey(k)) { _stepID = Guid.NewGuid(); - FormSteps.Add(j, _stepID); + LogToBrowserConsole.LogToBC($"Adding step {k}, {_stepID}, for {property.Name}"); + FormSteps.Add(k, _stepID); } else { - _stepID = FormSteps[j]; + _stepID = FormSteps[k]; } //the following line creates an expression that accesses the property value by name @@ -138,7 +148,7 @@ namespace TIAMSharedUI.Pages.Components layoutItemBuilder.AddAttribute(i++, "id", _stepID.ToString()); layoutItemBuilder.AddAttribute(i++, "class", "disply-flex align-items-center "); layoutItemBuilder.AddAttribute(i++, "style", "width: 100%;"); - if (j != CurrentStep) + if (k != CurrentStep) { layoutItemBuilder.AddAttribute(i++, "hidden", "true"); } @@ -146,7 +156,7 @@ namespace TIAMSharedUI.Pages.Components { //this input should be focused, so we set a flag LogToBrowserConsole.LogToBC($"Setting focus to {property.Name}"); - + } DataTypeAttribute attrList = (DataTypeAttribute)property.GetCustomAttributes(typeof(DataTypeAttribute), false).First(); @@ -159,7 +169,7 @@ namespace TIAMSharedUI.Pages.Components layoutItemBuilder.AddAttribute(i++, "Template", (RenderFragment)((context) => ((editor) => { - j = 0; + var j = 0; switch (attrList.DataType) { @@ -170,8 +180,8 @@ namespace TIAMSharedUI.Pages.Components editor.AddAttribute(j++, "Text", property.GetValue(Data)); editor.AddAttribute(j++, "TextExpression", lambda); editor.AddAttribute(j++, "CssClass", "form-field"); - - if(isActive) + + if (isActive) { editor.AddAttribute(j++, "Id", "ActiveInput"); } @@ -196,18 +206,24 @@ namespace TIAMSharedUI.Pages.Components { editor.OpenComponent>(j++); editor.AddAttribute(j++, "Value", property.GetValue(Data)); + editor.AddAttribute(j++, "Mask", TIAMRegularExpressions.PhoneNumberMask); editor.AddAttribute(j++, "MaskMode", MaskMode.RegEx); - editor.AddAttribute(j++, "BindValueMode", BindValueMode.OnInput); + editor.AddAttribute(j++, "BindValueMode", BindValueMode.OnLostFocus); editor.AddAttribute(j++, "ValueExpression", lambda); editor.AddAttribute(j++, "NullText", "+11234567890"); - editor.AddAttribute(j++, "TextChanged", EventCallback.Factory.Create(this, str => SetPhoneNumber(property, Data, str))); + editor.AddAttribute(j++, "MaskAutoCompleteMode", MaskAutoCompleteMode.None); + //editor.AddAttribute(j++, "Placeholder", "#"); + //editor.AddAttribute(j++, "PlaceholdersVisible", false); + editor.AddAttribute(j++, "ValueChanged", EventCallback.Factory.Create(this, str => SetPhoneNumber(property, Data, str))); //editor.AddAttribute(j++, "TextChanged", EventCallback.Factory.Create(this, str => { property.SetValue(Data, str); })); - editor.AddAttribute(i++, "Template", (RenderFragment)((context) => ((editor2) => - { - editor2.OpenComponent(j++); - editor2.AddAttribute(j++, "PlaceholdersVisible", false); - editor2.CloseComponent(); + editor.AddAttribute(i++, "Template", (RenderFragment)((context) => ((regexProperties) => + { + var l = 0; + regexProperties.OpenComponent(l++); + regexProperties.AddAttribute(l++, "Placeholder", "#"); + regexProperties.AddAttribute(l++, "PlaceholdersVisible", false); + regexProperties.CloseComponent(); }))); editor.CloseComponent(); break; @@ -218,11 +234,25 @@ namespace TIAMSharedUI.Pages.Components editor.AddAttribute(j++, "Value", property.GetValue(Data)); editor.AddAttribute(j++, "Mask", TIAMRegularExpressions.EmailMask); editor.AddAttribute(j++, "MaskMode", MaskMode.RegEx); - editor.AddAttribute(j++, "BindValueMode", BindValueMode.OnInput); + + editor.AddAttribute(j++, "BindValueMode", BindValueMode.OnLostFocus); //MaskAutoCompleteMode="@((MaskAutoCompleteMode)AutoCompleteMode)" - editor.AddAttribute(j++, "MaskAutoCompleteMode", MaskAutoCompleteMode.Strong); - editor.AddAttribute(j++, "ValueExpression", lambda); + editor.AddAttribute(j++, "MaskAutoCompleteMode", MaskAutoCompleteMode.None); + editor.AddAttribute(j++, "NullText", "example@example.com"); + editor.AddAttribute(j++, "ValueExpression", lambda); + + editor.AddAttribute(j++, "Placeholder", "#"); + editor.AddAttribute(j++, "PlaceholdersVisible", false); + editor.AddAttribute(j++, "ValueChanged", EventCallback.Factory.Create(this, str => { property.SetValue(Data, str); })); + //editor.AddAttribute(j++, "Template", (RenderFragment)((context) => ((editor2) => + //{ + // var l = 0; + // editor2.OpenComponent(l++); + // editor2.AddAttribute(l++, "Placeholder", "#"); + // editor2.AddAttribute(l++, "PlaceholdersVisible", "false"); + // editor2.CloseComponent(); + //}))); editor.CloseComponent(); break; } @@ -281,14 +311,14 @@ namespace TIAMSharedUI.Pages.Components else if (property.PropertyType == typeof(DriverModel) && property.Name == "Driver") { //load possible drivers for this serviceprovider - + //DriverModel driver = (DriverModel)property.GetValue(Data); IEnumerable drivers = new DriverModel[] { new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "John Doe"), new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "Jane Doe"), new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe") }; - + var defaultDriver = drivers.FirstOrDefault(); //editor.OpenElement(j++, "p"); @@ -296,7 +326,7 @@ namespace TIAMSharedUI.Pages.Components //editor.CloseElement(); editor.OpenComponent>(j); editor.AddAttribute(j++, "Data", drivers); - editor.AddAttribute(j++, "TextFieldName", nameof (defaultDriver.Name)); + editor.AddAttribute(j++, "TextFieldName", nameof(defaultDriver.Name)); editor.AddAttribute(j++, "Value", drivers.FirstOrDefault()); //editor.AddAttribute(j++, "Text", defaultDriver); editor.AddAttribute(j++, "CssClass", "form-field"); @@ -306,10 +336,30 @@ namespace TIAMSharedUI.Pages.Components editor.CloseComponent(); break; } - else if (property.PropertyType == typeof(TransferDestination)) + //string.Compare(metadata.CustomDataType, "BoldRed", true) == 0 + //else if (property.PropertyType == typeof(string) && property.Name == "Destination") + + else if (property.PropertyType == typeof(string) && string.Compare(attrList.CustomDataType, "TransferDestination", true) == 0) { - editor.OpenComponent(j); + + editor.OpenComponent(j); + editor.AddAttribute(j++, "OnSliderChanged", EventCallback.Factory.Create(this, result => + { + LogToBrowserConsole.LogToBC($"Slider changed to {result}"); + property.SetValue(Data, result); + LogToBrowserConsole.LogToBC($"Data.Destination = {property.GetValue(Data)}"); + StateHasChanged(); // Add this line to refresh the UI + })); + editor.CloseComponent(); + editor.OpenComponent(j++); + editor.AddAttribute(j++, "CssClass", "form-field"); + editor.AddAttribute(j++, "NullText", "Slide or type"); + editor.AddAttribute(j++, "Text", property.GetValue(Data)); + editor.AddAttribute(j++, "TextExpression", lambda); + editor.AddAttribute(j++, "TextChanged", EventCallback.Factory.Create(this, str => { property.SetValue(Data, str); })); + editor.CloseComponent(); + } break; @@ -332,16 +382,18 @@ namespace TIAMSharedUI.Pages.Components }))); layoutItemBuilder.CloseComponent(); //close dxformlayoutitem - if (j < propertyList.Length - 1) + + if (k < _length - 1) { layoutItemBuilder.OpenComponent(i++); layoutItemBuilder.AddAttribute(i++, "Click", EventCallback.Factory.Create(this, OnNext)); layoutItemBuilder.AddAttribute(i++, "SubmitFormOnClick", false); layoutItemBuilder.AddAttribute(i++, "CssClass", "btn btn-primary mt-3"); + layoutItemBuilder.AddAttribute(i++, "style", "margin-left: auto;"); layoutItemBuilder.AddAttribute(i++, "Text", localizer.GetString(ResourceKeys.ButtonNext)); layoutItemBuilder.CloseComponent(); } - if (j > 0) + if (k > 0) { layoutItemBuilder.OpenComponent(i++); layoutItemBuilder.AddAttribute(i++, "Click", EventCallback.Factory.Create(this, OnPrevious)); @@ -361,8 +413,8 @@ namespace TIAMSharedUI.Pages.Components layoutItemBuilder.CloseElement(); - LogToBrowserConsole.LogToBC($"loop {j}, {propertyList.Length}"); - j++; + LogToBrowserConsole.LogToBC($"loop {k}, length: {_length}, formSteps: {FormSteps.Count} "); + k++; } layoutItemBuilder.OpenComponent(i++); @@ -370,21 +422,21 @@ namespace TIAMSharedUI.Pages.Components layoutItemBuilder.AddAttribute(i++, "CssClass", "full-width"); layoutItemBuilder.AddAttribute(i++, "Template", (RenderFragment)((context) => ((editor) => { - LogToBrowserConsole.LogToBC($"Submit button {CurrentStep}, {propertyList.Length}"); + LogToBrowserConsole.LogToBC($"Submit button {CurrentStep}, {FormSteps.Count}"); editor.OpenElement(i++, "button"); editor.AddAttribute(i++, "type", "submit"); editor.AddAttribute(i++, "class", "btn btn-primary mt-3"); - if (CurrentStep < propertyList.Length - 1) + if (CurrentStep < _length - 1) { editor.AddAttribute(i++, "disabled", "true"); - + } //editor.AddAttribute(i++, "disabled", "true"); editor.OpenElement(i++, "span"); editor.AddAttribute(i++, "class", _spinnerClass); - + editor.CloseElement(); editor.AddContent(i++, localizer.GetString(SubmitButtonText)); editor.CloseElement(); @@ -413,7 +465,7 @@ namespace TIAMSharedUI.Pages.Components private void SetPhoneNumber(PropertyInfo property, object Data, string str) { LogToBrowserConsole.LogToBC($"SetPhoneNumber called with {str}"); - property.SetValue(Data, str); + property.SetValue(Data, str); } } } diff --git a/TIAMSharedUI/Pages/Components/Step1.razor b/TIAMSharedUI/Pages/Components/Step1.razor index e8eb5e62..f89012db 100644 --- a/TIAMSharedUI/Pages/Components/Step1.razor +++ b/TIAMSharedUI/Pages/Components/Step1.razor @@ -41,9 +41,7 @@ public EventCallback onNext { get; set; } [Parameter] - public EventCallback RegModelChanged { get; set; } - - IEnumerable PredefinedPlaceholders { get; set; } = new List() { '_', '#' }; + public EventCallback RegModelChanged { get; set; } //string EmailMask { get; set; } = @"(\w|[.-])+@(\w|-)+\.(\w|-){2,4}"; string EmailMask { get; set; } = TIAMRegularExpressions.EmailMask; diff --git a/TIAMSharedUI/Pages/Components/TiamDXTextBox.cs b/TIAMSharedUI/Pages/Components/TiamDXTextBox.cs index 411db714..95e1face 100644 --- a/TIAMSharedUI/Pages/Components/TiamDXTextBox.cs +++ b/TIAMSharedUI/Pages/Components/TiamDXTextBox.cs @@ -11,20 +11,7 @@ namespace TIAMSharedUI.Pages.Components base.OnInitialized(); this.CssClass = "dx-textbox tiam-textbox"; - } - - //need a textexpression that works with double? and string - [Parameter] - public new Expression> TextExpression { - get - { - return Model.TextExpression; - } - set - { - Model.TextExpression = value; - } - } + } } } diff --git a/TIAMSharedUI/Pages/TestPage.razor b/TIAMSharedUI/Pages/TestPage.razor index 82780097..edd83b8b 100644 --- a/TIAMSharedUI/Pages/TestPage.razor +++ b/TIAMSharedUI/Pages/TestPage.razor @@ -13,7 +13,11 @@
+ +
+
+
- + - + + +
@@ -43,6 +45,7 @@ @code { SliderItemSelector slider; + SliderItemSelector slider2; public string message; public string message2; public List destinations = new List() {"Liszt Ferenc Airport", "Buda Castle", "Chain Bridge"}; @@ -59,12 +62,7 @@ /*protected override void OnAfterRender(bool isFirst) { message = " Target destination is " + slider.SliderElementId.ToString(); - }*/ - - void changeDest(string dest) - { - message2 = dest; - } + }*/ public void next() => navManager.NavigateTo("/transfer2"); diff --git a/TIAMSharedUI/Pages/User/HotelComponent.razor b/TIAMSharedUI/Pages/User/HotelComponent.razor index 6f1aa6a0..e390172c 100644 --- a/TIAMSharedUI/Pages/User/HotelComponent.razor +++ b/TIAMSharedUI/Pages/User/HotelComponent.razor @@ -16,14 +16,14 @@
-
Your QR code
+

Your QR code

Use this in printed material, to gain referrals

@@ -33,8 +33,10 @@
-
-

Some conclusion

+
+

Hotel name: Example hotel

+

Address: Budapest, Minta u. 46

+

Phone number: +36 1 123 4567

diff --git a/TIAMSharedUI/Pages/User/HotelComponent.razor.cs b/TIAMSharedUI/Pages/User/HotelComponent.razor.cs index 1c3ecb46..b1d9a57d 100644 --- a/TIAMSharedUI/Pages/User/HotelComponent.razor.cs +++ b/TIAMSharedUI/Pages/User/HotelComponent.razor.cs @@ -11,6 +11,9 @@ namespace TIAMSharedUI.Pages.User { public partial class HotelComponent: ComponentBase { + + [Parameter] + public string? Id { get; set; } [Inject] ISupplierService SupplierService { get; set; } diff --git a/TIAMSharedUI/Pages/User/MyServiceProviders.razor b/TIAMSharedUI/Pages/User/MyServiceProviders.razor index 1a97658e..89e3cd6b 100644 --- a/TIAMSharedUI/Pages/User/MyServiceProviders.razor +++ b/TIAMSharedUI/Pages/User/MyServiceProviders.razor @@ -62,15 +62,16 @@ CustomizeEditModel="Grid_CustomizeEditModel" EditModelSaving="Grid_EditModelSaving" DataItemDeleting="Grid_DataItemDeleting" - EditMode="GridEditMode.PopupEditForm" + EditMode="GridEditMode.EditRow" KeyboardNavigationEnabled="true"> - + - @context.Value + @context.Value + diff --git a/TIAMSharedUI/Pages/User/MyTransfers.razor b/TIAMSharedUI/Pages/User/MyTransfers.razor index 7c68b51b..3dc53bcb 100644 --- a/TIAMSharedUI/Pages/User/MyTransfers.razor +++ b/TIAMSharedUI/Pages/User/MyTransfers.razor @@ -1,148 +1,158 @@ @page "/user/transfers" +@using AyCode.Models.Messages @using TIAM.Entities.ServiceProviders @using TIAM.Resources @using TIAMSharedUI.Pages.Components @using TIAMSharedUI.Shared @using TIAMWebApp.Shared.Application.Models @using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels +@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages @using TIAMWebApp.Shared.Application.Utility @layout AdminLayout @inject LogToBrowserConsole logToBrowserConsole @inject IStringLocalizer localizer Transfers -

Properties

+
-
-
-
-
- Service providers list - -
-
- -
+

@localizer.GetString("Transfer")

+ + + + + + + + + +
+
+
+ + + -
-
-
- -
- - - - - - - - @{ - var keyField = context.Value; - @context.Value - } - - - - - - - - - - @{ - var keyField = context.Value; - string buttonText = "Contact"; - - } - - - - - @{ - DriverModel keyField = (DriverModel)context.Value; - string driverText = keyField.Name; -

@driverText

- } -
-
- -
- - + + + @{ - var transfer = (TransferWizardModel)EditFormContext.EditModel; + var keyField = context.Value; + @context.Value } - - - @EditFormContext.GetEditor("Destination") - - - @EditFormContext.GetEditor("PickupAddress") - - - @EditFormContext.GetEditor("TripDate") - - - @EditFormContext.GetEditor("NumberOfPassengers") - - - @EditFormContext.GetEditor("FullName") - - - @EditFormContext.GetEditor("PhoneNumber") - - - @EditFormContext.GetEditor("EmailAddress") - - - + + + + + + + @{ + var keyField = context.Value; + string buttonText = "Contact"; + + } + + + + + @{ + DriverModel keyField = (DriverModel)context.Value; + string driverText = keyField.Name; +

@driverText

+ } +
+
+ + + + + @{ + var transfer = (TransferWizardModel)EditFormContext.EditModel; + } + + + @EditFormContext.GetEditor("Destination") + + + @EditFormContext.GetEditor("PickupAddress") + + + @EditFormContext.GetEditor("TripDate") + + + @EditFormContext.GetEditor("NumberOfPassengers") + + + @EditFormContext.GetEditor("FullName") + + + @EditFormContext.GetEditor("PhoneNumber") + + + @EditFormContext.GetEditor("EmailAddress") + + + - - - - - +
+
-
+ + + -
- -
-

Some conclusion

-
-
+ + + +
@@ -159,8 +169,14 @@ public TransferWizardModel myModel = new TransferWizardModel(); - bool EulaAccepted { get; set; } - bool EulaVisible { get; set; } + bool PopupVisible { get; set; } + public List ignoreList = new List + { + "ReceiverId" + }; + + public MessageWizardModel messageWizardModel = new MessageWizardModel(); + //IEnumerable drivers { get; set; } @@ -185,22 +201,24 @@ void SendMail(object emailAddress) { logToBrowserConsole.LogToBC($"Sending mail to {emailAddress}"); + PopupVisible = true; } void CancelCreateClick() { - EulaVisible = false; + PopupVisible = false; } void EulaPopupClosed() { - EulaAccepted = false; + //cancel clicked } void EulaPopupClosing(PopupClosingEventArgs args) { - myModel = new TransferWizardModel(); + //myModel = new TransferWizardModel(); + messageWizardModel = new MessageWizardModel(); } //----------------------------------------------------------------------------------- diff --git a/TIAMSharedUI/Pages/User/ServiceProvider.razor b/TIAMSharedUI/Pages/User/ServiceProvider.razor new file mode 100644 index 00000000..4b0abed5 --- /dev/null +++ b/TIAMSharedUI/Pages/User/ServiceProvider.razor @@ -0,0 +1,22 @@ +@page "/user/serviceprovider/{id}" +@using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Models; +@using TIAMWebApp.Shared.Application.Interfaces; +@layout AdminLayout +@inject NavigationManager navigationManager + +
+ +
+ +@code { + [Parameter] + public string Id { get; set; } + + protected override void OnInitialized() + { + base.OnInitialized(); + if (string.IsNullOrEmpty(Id)) + navigationManager.NavigateTo("/user/properties"); + } +} diff --git a/TIAMSharedUI/Shared/AdminLayout.razor b/TIAMSharedUI/Shared/AdminLayout.razor index 0da560fd..e4384908 100644 --- a/TIAMSharedUI/Shared/AdminLayout.razor +++ b/TIAMSharedUI/Shared/AdminLayout.razor @@ -12,11 +12,8 @@
-
- - @Body
diff --git a/TIAMSharedUI/Shared/SliderItemSelector.razor b/TIAMSharedUI/Shared/SliderItemSelector.razor index 71bda048..6850e213 100644 --- a/TIAMSharedUI/Shared/SliderItemSelector.razor +++ b/TIAMSharedUI/Shared/SliderItemSelector.razor @@ -1,4 +1,7 @@ - +@using System.Linq.Expressions +@using TIAMWebApp.Shared.Application.Utility +@inject LogToBrowserConsole logToBrowserConsole + -