diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9b5ae6a3..b4253f6b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,4 +6,7 @@ 0.3.0-alpha [2024-10-07] [+] Exclude all entities from admin panel. -[+} Include entity properties if NetForgeProperty attribute is set. \ No newline at end of file +[+} Include entity properties if NetForgeProperty attribute is set. + +0.3.1-alpha [2024-10-08] +[*] Replaced MudAlert with Snackbar control on edit entity page \ No newline at end of file diff --git a/VERSION.txt b/VERSION.txt index 0852d432..4e8ade61 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.3.0-alpha \ No newline at end of file +0.3.1-alpha \ No newline at end of file diff --git a/src/Saritasa.NetForge.Blazor/Infrastructure/DependencyInjection/ApplicationModule.cs b/src/Saritasa.NetForge.Blazor/Infrastructure/DependencyInjection/ApplicationModule.cs index 2b7da340..4f59b3e4 100644 --- a/src/Saritasa.NetForge.Blazor/Infrastructure/DependencyInjection/ApplicationModule.cs +++ b/src/Saritasa.NetForge.Blazor/Infrastructure/DependencyInjection/ApplicationModule.cs @@ -23,7 +23,10 @@ public static void Register(IServiceCollection services) services.AddRazorPages(); services.AddServerSideBlazor(); - services.AddMudServices(); + services.AddMudServices(config => + { + config.SnackbarConfiguration.PreventDuplicates = false; + }); services.AddMemoryCache(); services.AddScoped(); services.AddScoped(); diff --git a/src/Saritasa.NetForge.Blazor/Pages/EditEntity.razor b/src/Saritasa.NetForge.Blazor/Pages/EditEntity.razor index 061bd083..b62a76c9 100644 --- a/src/Saritasa.NetForge.Blazor/Pages/EditEntity.razor +++ b/src/Saritasa.NetForge.Blazor/Pages/EditEntity.razor @@ -66,14 +66,6 @@ else if (ViewModel.IsEntityExists) - @if (ViewModel.IsUpdated) - { - - Update was completed successfully - - } - @if (ViewModel.Errors is not null && ViewModel.Errors.Count != 0) { /// Constructor. @@ -37,7 +39,8 @@ public EditEntityViewModel( string instancePrimaryKey, IEntityService entityService, IOrmDataService dataService, - IServiceProvider serviceProvider) + IServiceProvider serviceProvider, + ISnackbar snackbar) { Model = new EditEntityModel { StringId = stringId }; InstancePrimaryKey = instancePrimaryKey; @@ -45,6 +48,7 @@ public EditEntityViewModel( this.entityService = entityService; this.dataService = dataService; this.serviceProvider = serviceProvider; + this.snackbar = snackbar; } /// @@ -52,11 +56,6 @@ public EditEntityViewModel( /// public bool IsEntityExists { get; private set; } = true; - /// - /// Is entity was updated. - /// - public bool IsUpdated { get; set; } - /// /// Errors encountered while entity updating. /// @@ -165,6 +164,6 @@ public async Task UpdateEntityAsync() // We do clone because UpdateAsync method returns Model.OriginalEntityInstance // so we don't want Model.EntityInstance and Model.OriginalEntityInstance to have the same reference. Model.EntityInstance = updatedEntity.CloneJson(); - IsUpdated = true; + snackbar.Add("Update was completed successfully", Severity.Success); } }