diff --git a/Directory.Packages.props b/Directory.Packages.props index e2ea3dc099..26dfca3862 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -115,11 +115,11 @@ - - - - - + + + + + diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index ab5e61a31f..6027658d6d 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -617,6 +617,9 @@ "Permission:Testimonials": "Testimonials", "SelectCompanySizePlaceholder": "Company Size", "SelectExperienceYearPlaceholder": "Experience year", - "SelectCountryPlaceholder": "Country" + "SelectCountryPlaceholder": "Country", + "DeleteImageConfirmationMessage": "Are you sure you want to delete the image for \"{0}\"?", + "DeleteImageSuccessMessage": "Image successfully deleted", + "DeleteImage": "Delete Image" } } \ No newline at end of file diff --git a/docs/en/UI/Blazor/Data-Table-Column-Extensions.md b/docs/en/UI/Blazor/Data-Table-Column-Extensions.md index ebb2f27cbf..f61ba49457 100644 --- a/docs/en/UI/Blazor/Data-Table-Column-Extensions.md +++ b/docs/en/UI/Blazor/Data-Table-Column-Extensions.md @@ -73,6 +73,7 @@ This section explains how to customize data table columns using the properties i * `Sortable`: A boolean field indicating whether the column is sortable or not. * `DisplayFormat`: You can specify a custom format for the column. * `DisplayFormatProvider` : You can provide a custom `IFormatProvider` for the column. Default value is `CultureInfo.CurrentCulture`. +* `Visible`: A boolean field indicating whether the column is visible or not. ## Rendering Custom Components In The Data Table Columns diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs index efd1d9320b..89cdb33729 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs @@ -24,6 +24,8 @@ public class TableColumn public Func? ValueConverter { get; set; } public bool Sortable { get; set; } + + public bool Visible { get; set; } = true; public TableColumn() { diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor index b38f4afaa9..ed9c532e49 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor @@ -74,7 +74,7 @@ { @if (column.ValueConverter == null) { - + @RenderCustomTableColumnComponent(column.Component, context) @@ -82,7 +82,7 @@ } else { - + @RenderCustomTableColumnComponent(column.Component, context) @@ -100,14 +100,16 @@ Caption="@column.Title" Sortable="@column.Sortable" DisplayFormat="@column.DisplayFormat" - DisplayFormatProvider="@column.DisplayFormatProvider"/> + DisplayFormatProvider="@column.DisplayFormatProvider" + Displayable="column.Visible"/> } else { + Sortable="@column.Sortable" + Displayable="column.Visible"> @(GetConvertedFieldValue(context, column)) @@ -116,7 +118,7 @@ } else { - + @{ var entity = context as IHasExtraProperties; diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor index 9951e616e2..629317aea6 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor @@ -15,7 +15,7 @@ } - + @Message diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index 9745d3c23f..a8c9994340 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -111,6 +111,8 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien await RunGraphBuildForMicroserviceServiceTemplate(projectArgs); await CreateInitialMigrationsAsync(projectArgs); + await ConfigureAngularAfterMicroserviceServiceCreatedAsync(projectArgs, template); + var skipInstallLibs = commandLineArgs.Options.ContainsKey(Options.SkipInstallingLibs.Long) || commandLineArgs.Options.ContainsKey(Options.SkipInstallingLibs.Short); if (!skipInstallLibs) { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index f64ffee7e3..e056810592 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -1,13 +1,12 @@ using System; using System.IO; +using System.Text; using System.Linq; using System.Threading.Tasks; using ICSharpCode.SharpZipLib.Core; using ICSharpCode.SharpZipLib.Zip; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using NuGet.Versioning; -using NUglify.Helpers; using Volo.Abp.Cli.ProjectModification; using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Bundling; @@ -436,6 +435,7 @@ public abstract class ProjectCreationCommandBase var isModuleTemplate = ModuleTemplateBase.IsModuleTemplate(projectArgs.TemplateName); var isWebassembly = projectArgs.UiFramework == UiFramework.Blazor; + var message = isWebassembly || isModuleTemplate ? "Generating bundles for Blazor Wasm" : "Generating bundles for MAUI Blazor"; @@ -453,6 +453,7 @@ public abstract class ProjectCreationCommandBase var searchPattern = isWebassembly ? "*.Blazor.csproj" : "*.MauiBlazor.csproj"; var path = projectArgs.OutputFolder; + if (isWebassembly && Directory.GetFiles(path, "*.Blazor.Client.csproj", SearchOption.AllDirectories).Any()) { searchPattern = "*.Blazor.Client.csproj"; @@ -720,7 +721,7 @@ public abstract class ProjectCreationCommandBase protected virtual ThemeStyle? GetThemeStyleOrNull(CommandLineArgs commandLineArgs, Theme theme) { - if(theme != Theme.LeptonX) + if (theme != Theme.LeptonX) { return null; } @@ -758,6 +759,59 @@ public abstract class ProjectCreationCommandBase } } + protected virtual async Task ConfigureAngularAfterMicroserviceServiceCreatedAsync(ProjectBuildArgs projectArgs, string template) + { + if (!MicroserviceServiceTemplateBase.IsMicroserviceServiceTemplate(projectArgs.TemplateName)) + { + return; + } + + var rootPath = Directory.GetCurrentDirectory(); + var uiFramework = FindMicroserviceSolutionUiFramework(rootPath); + + if (uiFramework != UiFramework.Angular) + { + return; + } + + Logger.LogInformation("Setting up the angular library..."); + + var libraryName = projectArgs.SolutionName.ProjectName.ToKebabCase(); + var angularAppPath = Path.Combine(rootPath, "apps", "angular"); + + var result = await CreateAngularLibraryAsync(libraryName, angularAppPath); + + Logger.LogInformation(result); + } + + protected virtual async Task CreateAngularLibraryAsync( + string libraryName, + string workingDirectory, + bool isSecondaryEndpoint = false, + bool isModuleTemplate = true, + bool isOverride = true) + { + //TODO: Can we improve this validations ? + if (string.IsNullOrWhiteSpace(libraryName)) + { + throw new CliUsageException("Angular library name can not be empty"); + } + + if (string.IsNullOrWhiteSpace(workingDirectory)) + { + throw new CliUsageException("Angular project path can not be empty"); + } + + var commandBuilder = new StringBuilder($"npx ng g @abp/ng.schematics:create-lib --package-name {libraryName}"); + + commandBuilder.Append($" --is-secondary-entrypoint {isSecondaryEndpoint.ToString().ToLower()}"); + commandBuilder.Append($" --is-module-template {isModuleTemplate.ToString().ToLower()}"); + commandBuilder.Append($" --override {isOverride.ToString().ToLower()}"); + + var result = CmdHelper.RunCmdAndGetOutput(commandBuilder.ToString(), workingDirectory); + return await Task.FromResult(result); + } + public static class Options { public static class Template diff --git a/npm/ng-packs/packages/schematics/src/commands/create-lib/files-package/__libraryName@kebab__/src/lib/__libraryName@kebab__-routing.module.ts.template b/npm/ng-packs/packages/schematics/src/commands/create-lib/files-package/__libraryName@kebab__/src/lib/__libraryName@kebab__-routing.module.ts.template index 4b9517b211..8c9afe6aa2 100644 --- a/npm/ng-packs/packages/schematics/src/commands/create-lib/files-package/__libraryName@kebab__/src/lib/__libraryName@kebab__-routing.module.ts.template +++ b/npm/ng-packs/packages/schematics/src/commands/create-lib/files-package/__libraryName@kebab__/src/lib/__libraryName@kebab__-routing.module.ts.template @@ -1,12 +1,12 @@ import { NgModule } from '@angular/core'; -import { DynamicLayoutComponent } from '@abp/ng.core'; +import { RouterOutletComponent } from '@abp/ng.core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: '', pathMatch: 'full', - component: DynamicLayoutComponent, + component: RouterOutletComponent, children: [], }, ];