Added creation/modification confirmation
This commit is contained in:
@@ -256,9 +256,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
return _validationErrors
|
var valid = _validationErrors
|
||||||
.Select(err => err.Value.Count)
|
.Select(err => err.Value.Count)
|
||||||
.All(c => c == 0);
|
.All(c => c == 0);
|
||||||
|
|
||||||
|
if (!valid) return false;
|
||||||
|
var dialog = await Dialogs.ShowConfirmationAsync($"Do you really want to {(_currentlyEditing ? "edit" : "create")} this entry?");
|
||||||
|
var result = await dialog.Result;
|
||||||
|
return !result.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum InputType {
|
private enum InputType {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace HopFrame.Web.Models;
|
namespace HopFrame.Web.Models;
|
||||||
|
|
||||||
public class RelationPickerDialogData(TableConfig sourceTable, object? current) {
|
public sealed class RelationPickerDialogData(TableConfig sourceTable, object? current) {
|
||||||
public object? Object { get; set; } = current;
|
public object? Object { get; set; } = current;
|
||||||
public TableConfig SourceTable { get; init; } = sourceTable;
|
public TableConfig SourceTable { get; init; } = sourceTable;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user