Separate critical editor load and save errors
This commit is contained in:
@@ -204,7 +204,8 @@
|
||||
Model="editorModel"
|
||||
IsLoading="isEditorLoading"
|
||||
IsSaving="isEditorSaving"
|
||||
ErrorMessage="editorError"
|
||||
LoadErrorMessage="editorLoadError"
|
||||
SaveErrorMessage="editorSaveError"
|
||||
OnClose="CloseCellEditorAsync"
|
||||
OnSave="SaveCellEditorAsync" />
|
||||
}
|
||||
@@ -223,7 +224,8 @@
|
||||
private bool isEditorOpen;
|
||||
private bool isEditorLoading;
|
||||
private bool isEditorSaving;
|
||||
private string? editorError;
|
||||
private string? editorLoadError;
|
||||
private string? editorSaveError;
|
||||
private int? editingResultId;
|
||||
private CriticalCellEditorModel? editorModel;
|
||||
|
||||
@@ -321,7 +323,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
editorError = null;
|
||||
editorLoadError = null;
|
||||
editorSaveError = null;
|
||||
editorModel = null;
|
||||
editingResultId = resultId;
|
||||
isEditorSaving = false;
|
||||
@@ -333,7 +336,7 @@
|
||||
var response = await LookupService.GetCriticalCellEditorAsync(selectedTableSlug, resultId);
|
||||
if (response is null)
|
||||
{
|
||||
editorError = "The selected cell could not be loaded for editing.";
|
||||
editorLoadError = "The selected cell could not be loaded for editing.";
|
||||
editorModel = null;
|
||||
return;
|
||||
}
|
||||
@@ -342,7 +345,7 @@
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
editorError = exception.Message;
|
||||
editorLoadError = exception.Message;
|
||||
editorModel = null;
|
||||
}
|
||||
finally
|
||||
@@ -356,7 +359,8 @@
|
||||
isEditorOpen = false;
|
||||
isEditorLoading = false;
|
||||
isEditorSaving = false;
|
||||
editorError = null;
|
||||
editorLoadError = null;
|
||||
editorSaveError = null;
|
||||
editingResultId = null;
|
||||
editorModel = null;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
@@ -370,14 +374,14 @@
|
||||
}
|
||||
|
||||
isEditorSaving = true;
|
||||
editorError = null;
|
||||
editorSaveError = null;
|
||||
|
||||
try
|
||||
{
|
||||
var response = await LookupService.UpdateCriticalCellAsync(selectedTableSlug, editingResultId.Value, editorModel.ToRequest());
|
||||
if (response is null)
|
||||
{
|
||||
editorError = "The selected cell could not be saved.";
|
||||
editorSaveError = "The selected cell could not be saved.";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -386,7 +390,7 @@
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
editorError = exception.Message;
|
||||
editorSaveError = exception.Message;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user