Refactor ReceiverPage and update AGENTS.md TODOs
Updated AGENTS.md to add a technical debt TODO for modularizing server pages by splitting large components, reducing duplication, and centralizing shared logic. Enhanced ReceiverPage.razor with new state variables and logic to support a "Reject" popup feature, including state management for visibility, submission, and validation. Improved sharing functionality in ReceiverPage.razor by adding error handling, user feedback, and proper state updates during asynchronous operations to enhance maintainability and UX.
This commit is contained in:
@@ -404,6 +404,12 @@
|
||||
string? _shareMessage;
|
||||
bool _shareMessageIsError = false;
|
||||
|
||||
// ----- Reject popup state -----
|
||||
bool _rejectPopupVisible = false;
|
||||
bool _isRejectSubmitting = false;
|
||||
string _rejectReason = string.Empty;
|
||||
string? _rejectValidationMessage;
|
||||
|
||||
async Task LogoutAsync()
|
||||
{
|
||||
if (_isLoggingOut || string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||
@@ -469,6 +475,29 @@
|
||||
return;
|
||||
}
|
||||
|
||||
_isSharing = true;
|
||||
_shareMessage = null;
|
||||
_shareMessageIsError = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
try
|
||||
{
|
||||
_shareMessage = "Freigabe ist in dieser Ansicht derzeit nicht verfugbar.";
|
||||
_shareMessageIsError = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "Failed to share envelope {EnvelopeKey}", EnvelopeKey);
|
||||
_shareMessage = "Freigabe fehlgeschlagen. Bitte versuchen Sie es erneut.";
|
||||
_shareMessageIsError = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isSharing = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
// ----- Lifecycle -----
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user