Small fixes and improvements:

- StayExport - SpainParteViajerosProvider - Fixed validation for codigoPostal/codMunicipio.
- AddressQueryDialog - Add loading indication and "debounce" input to reduce API queries.
This commit is contained in:
Daniel-Garmig committed 2026-09-10 18:27:56 +02:00
1 parent dc85319da5
commit a1a55aa396
2 files changed
+22 -6

No files matched your search

@@ -17,13 +17,22 @@
<MudStack row>
<MudTextField @bind-Value="SearchText" Label="@LanguageLocale.control_AddressQueryDialog_searchText"
Required />
<MudIconButton Icon="@Icons.Material.Filled.Search" OnClick="btnSearchAddress" />
<MudIconButton Icon="@Icons.Material.Filled.Search" OnClick="btnSearchAddress" Disabled="@_isDataLoading" />
</MudStack>
<MudPaper Class="mt-4 pa-2">
@if (addressResults.Count == 0)
@if (addressResults.Count == 0 && !_isDataLoading)
{
<MudText Typo="Typo.body1">@LanguageLocale.general_noResults</MudText>
<MudElement Style="width: 100%; height: 100px;" HtmlTag="div">
<MudText Typo="Typo.body1" Align="Align.Center">
@LanguageLocale.general_noResults
</MudText>
</MudElement>
}
@if (_isDataLoading)
{
<MudSkeleton Width="100%" Height="100px" />
}
<MudList T="AddressResultDTO" @bind-SelectedValue="SelectedAddressResult"
@@ -81,6 +90,9 @@
private List<AddressResultDTO> addressResults = [];
private AddressResultDTO? SelectedAddressResult { get; set; }
private bool _isDataLoading = false;
private string _lastSearchText = "";
private void Cancel()
{
@@ -99,16 +111,20 @@
private async Task btnSearchAddress()
{
if (SearchText.Length == 0)
if (SearchText.Length == 0 || SearchText == _lastSearchText)
{
return;
}
try
{
var queryService = addressQueryFactory.GetService();
_isDataLoading = true;
var queryService = addressQueryFactory.GetService();
addressResults = await queryService.SearchAddressAsync(SearchText);
_lastSearchText = SearchText;
_isDataLoading = false;
}
catch (Exception ex)
{