Refactor EnvelopeTypeDto to EnvelopeTypeDefaultsDto
Renamed `EnvelopeTypeDto` to `EnvelopeTypeDefaultsDto` to better reflect its purpose as a DTO for default envelope type configurations. Updated all references to `EnvelopeTypeDto` across the application, including: - Service interfaces (`IEnvelopeTypeService`) and implementations. - AutoMapper mappings in `MappingProfile.cs`. - Query handlers (`ReadEnvelopeTypesQuery` and `ReadEnvelopeTypesQueryHandler`). - Razor components (`CreateEnvelopeWizardPopup.razor`, `SenderEditorPage.razor`, `SenderPage.razor`). - Client-side services (`EnvelopeTypeService`). - Controller (`TestEnvelopeTypeController`). These changes ensure consistency and clarity in naming conventions while maintaining functionality.
This commit is contained in:
@@ -423,7 +423,7 @@
|
||||
public EventCallback<CreateEnvelopeWizardResult> StartEditorRequested { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public IReadOnlyList<EnvelopeTypeDto> EnvelopeTypes { get; set; } = [];
|
||||
public IReadOnlyList<EnvelopeTypeDefaultsDto> EnvelopeTypes { get; set; } = [];
|
||||
|
||||
private const int TotalSteps = 4;
|
||||
private static readonly System.ComponentModel.DataAnnotations.EmailAddressAttribute EmailValidator = new();
|
||||
@@ -1002,7 +1002,7 @@
|
||||
return bool.TryParse(args.Value?.ToString(), out var parsed) && parsed;
|
||||
}
|
||||
|
||||
private void ApplyEnvelopeTypeDefaults(EnvelopeTypeDto envelopeType)
|
||||
private void ApplyEnvelopeTypeDefaults(EnvelopeTypeDefaultsDto envelopeType)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(envelopeType.Language))
|
||||
_language = envelopeType.Language;
|
||||
|
||||
@@ -698,7 +698,7 @@
|
||||
string _envelopeMessage = string.Empty;
|
||||
bool _titleTouched = false;
|
||||
|
||||
List<EnvelopeTypeDto> _envelopeTypes = [];
|
||||
List<EnvelopeTypeDefaultsDto> _envelopeTypes = [];
|
||||
int? _selectedEnvelopeTypeId;
|
||||
string _language = "de-DE";
|
||||
bool _useAccessCode;
|
||||
@@ -986,7 +986,7 @@
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
void ApplyEnvelopeTypeDefaults(EnvelopeTypeDto envelopeType)
|
||||
void ApplyEnvelopeTypeDefaults(EnvelopeTypeDefaultsDto envelopeType)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(envelopeType.Language))
|
||||
_language = envelopeType.Language;
|
||||
|
||||
@@ -626,7 +626,7 @@
|
||||
private string? _deleteErrorMessage;
|
||||
|
||||
private bool _createWizardVisible = false;
|
||||
private IReadOnlyList<EnvelopeTypeDto> _envelopeTypes = [];
|
||||
private IReadOnlyList<EnvelopeTypeDefaultsDto> _envelopeTypes = [];
|
||||
|
||||
// StableDefaults keys used to store/restore each tab's layout in UserPreferences.GridLayouts
|
||||
private const string GridKeyActive = "sender.active-envelopes";
|
||||
|
||||
@@ -8,7 +8,7 @@ public class EnvelopeTypeService(IHttpClientFactory clientFactory)
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web);
|
||||
|
||||
public async Task<IReadOnlyList<EnvelopeTypeDto>> GetAsync(CancellationToken cancel = default)
|
||||
public async Task<IReadOnlyList<EnvelopeTypeDefaultsDto>> GetAsync(CancellationToken cancel = default)
|
||||
{
|
||||
var http = clientFactory.CreateClient("EnvelopeGenerator.Server");
|
||||
var response = await http.GetAsync("/api/EnvelopeType", cancel);
|
||||
@@ -16,7 +16,7 @@ public class EnvelopeTypeService(IHttpClientFactory clientFactory)
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return [];
|
||||
|
||||
var data = await response.Content.ReadFromJsonAsync<List<EnvelopeTypeDto>>(JsonOptions, cancel);
|
||||
var data = await response.Content.ReadFromJsonAsync<List<EnvelopeTypeDefaultsDto>>(JsonOptions, cancel);
|
||||
return data ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user