From 2e2fd13097bcdae4866a4359f1a8e55beaef34cd Mon Sep 17 00:00:00 2001 From: Vasily Chefonov <81791194+vasiliy-chefonov@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:11:47 +0700 Subject: [PATCH 1/2] Replace ExcludeAllEntities with IncludeAllEntities SN-782 --- README.md | 2 +- src/Saritasa.NetForge.Blazor/Domain/AdminOptionsBuilder.cs | 6 +++--- .../Domain/Entities/Options/AdminOptions.cs | 4 ++-- .../UseCases/Metadata/Services/AdminMetadataService.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5054ada9..b66f7db8 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ You can exclude all entities and include only specific ones. ```csharp services.AddNetForge(optionsBuilder => { - optionsBuilder.ExcludeAllEntities(); + optionsBuilder.SetIncludeAllEntities(false); optionsBuilder.IncludeEntities(typeof(Shop), typeof(Product)); }); ``` diff --git a/src/Saritasa.NetForge.Blazor/Domain/AdminOptionsBuilder.cs b/src/Saritasa.NetForge.Blazor/Domain/AdminOptionsBuilder.cs index 1001eccd..8f709bc0 100644 --- a/src/Saritasa.NetForge.Blazor/Domain/AdminOptionsBuilder.cs +++ b/src/Saritasa.NetForge.Blazor/Domain/AdminOptionsBuilder.cs @@ -247,13 +247,13 @@ public AdminOptionsBuilder DisableCharactersTruncation() } /// - /// Excludes all tables by default. + /// Specifies whether to include all entities in the admin panel. /// This method can be used in conjunction with /// or to include specific entities after excluding all. /// - public AdminOptionsBuilder ExcludeAllEntities() + public AdminOptionsBuilder SetIncludeAllEntities(bool includeAllEntities) { - options.ExcludeAllEntities = true; + options.IncludeAllEntities = includeAllEntities; return this; } diff --git a/src/Saritasa.NetForge.Blazor/Domain/Entities/Options/AdminOptions.cs b/src/Saritasa.NetForge.Blazor/Domain/Entities/Options/AdminOptions.cs index fd0ecdc9..3df66da8 100644 --- a/src/Saritasa.NetForge.Blazor/Domain/Entities/Options/AdminOptions.cs +++ b/src/Saritasa.NetForge.Blazor/Domain/Entities/Options/AdminOptions.cs @@ -77,9 +77,9 @@ public class AdminOptions public int TruncationMaxCharacters { get; set; } = 50; /// - /// Whether to exclude all tables from the admin panel. + /// Whether to include all tables from the admin panel. /// - public bool ExcludeAllEntities { get; set; } + public bool IncludeAllEntities { get; set; } = true; /// /// Entities to include in the admin panel. diff --git a/src/Saritasa.NetForge.Blazor/Domain/UseCases/Metadata/Services/AdminMetadataService.cs b/src/Saritasa.NetForge.Blazor/Domain/UseCases/Metadata/Services/AdminMetadataService.cs index 8692a66b..5e927d80 100644 --- a/src/Saritasa.NetForge.Blazor/Domain/UseCases/Metadata/Services/AdminMetadataService.cs +++ b/src/Saritasa.NetForge.Blazor/Domain/UseCases/Metadata/Services/AdminMetadataService.cs @@ -77,7 +77,7 @@ public IEnumerable GetMetadata() private static void ExcludeEntities(List entityMetadatas, AdminOptions adminOptions) { // Exclude entities if it was specified in the admin options. - if (!adminOptions.ExcludeAllEntities) + if (adminOptions.IncludeAllEntities) { return; } From f3ef70b0c661487c51e96ea92ec8284e2073be80 Mon Sep 17 00:00:00 2001 From: Vasily Chefonov <81791194+vasiliy-chefonov@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:38:08 +0700 Subject: [PATCH 2/2] Add the build number for the dev SN-782 --- .github/workflows/ci-dev.yml | 2 +- .github/workflows/run-tests.yml | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-dev.yml b/.github/workflows/ci-dev.yml index 1d0b333a..36ee5893 100644 --- a/.github/workflows/ci-dev.yml +++ b/.github/workflows/ci-dev.yml @@ -13,4 +13,4 @@ jobs: NetForge: uses: ./.github/workflows/pack-library.yml with: - version_postfix: dev \ No newline at end of file + version_postfix: dev-${{ github.run_number }} \ No newline at end of file diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ffa186bd..0d9e86ce 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,17 +21,10 @@ jobs: - name: Setup dotnet 8 uses: actions/setup-dotnet@v1 with: - dotnet-version: '8.0.x' - - - name: Setup dotnet 7 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '7.0.x' - - - name: Setup dotnet 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '6.0.x' + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x - name: Checkout Source uses: actions/checkout@v2