Activities of "rafael.gonzales"

Configuring the suite's project name independently from the project name would be awesome. So we can have a demo project with a solution and project name exactly like our main project but without the issue to figure out in Suites which one we are creating our entities.

Why do Create and Edit Pages in MVC inherit from ModulePageModel but Index Page inherit from AbpPageModel?

ModulePageModel already inherits from AbpPageModule but helps as a base class in a module to customize.

In Summary,

Suppose you create a module named MyModule. The entities generated there will have Create, Edit, and Index pages.

Create and Edit -> Inherit from MyModulePageModel Index -> Inherit from AbpPageModule.

Expected behavior,

Credit, Edit and Index should inherit from MyModulePageModel

The same issue happened with the AppService project. If you are in a Module, all the AppService generated are still using ApplicationAppService instead of MyModuleAppService

Why do Create and Edit Pages in MVC inherit from ModulePageModel but Index Page inherit from AbpPageModel?

ModulePageModel already inherits from AbpPageModule but helps as a base class in a module to customize.

In Summary,

Suppose you create a module named MyModule. The entities generated there will have Create, Edit, and Index pages.

Create and Edit -> Inherit from MyModulePageModel Index -> Inherit from AbpPageModule.

Expected behavior,

Credit, Edit and Index should inherit from MyModulePageModel

It still happens to me even in my other projects not named "Demo". I have to fill the first page then add whatever column and save to avoid any loosing data.

Hi,

Can we add some formatting to the %%excel-method-interface%% and %%bulk-delete-methods-interface%% by default? It would be better to be in a new line by default

ABP Modules in the navigation property are not displayed when you already have an entity created. Also, please check that it is duplicated when it's shown in the first entity.

What is the sense of keeping these two fields in "decimal" type if they are not getting added in the "CreateDto" and "UpdateDto"

For decimals, there should be a validation, if the values inserted there (min and max) are integers, then we should be able to get those values added in "CreateDto" and "UpdateDto" like the following code

        [Required]
        [Range(DemoConsts.Price MinLength, DemoConsts.Price MaxLength)]
        public decimal Price { get; set; }

In the "DemoConsts.cs" file the "Min" and "Max" const should be declared as integers too

        public const int PriceMinLength = -180;
        public const int PriceMaxLength = 180;

If you add a "boolean" value in the ABP Suite column definition, their filter selection is not localized.

The generated code in Index.cshtml.cs, adds the following code.

        [SelectItems(nameof(IsUsedBoolFilterItems))]
        public string IsUsedFilter { get; set; }

        public List<SelectListItem> IsUsedBoolFilterItems { get; set; } =
            new List<SelectListItem>
            {
                new SelectListItem("", ""),
                new SelectListItem("Yes", "true"),
                new SelectListItem("No", "false"),
            };

First, the string generated should be nullable like the following public string? IsUsedFilter { get; set; }

To avoid this warning in the constructor

The filter items are not localized and the keys "Yes" and "No" are hardcoded in any language. To solve this, I propose to add this method in AbpModel

        protected List<SelectListItem> SetFilterItems()
        {
            return new List<SelectListItem>
            {
                new SelectListItem("", ""),
                new SelectListItem(_localizer["Yes"], "true"),
                new SelectListItem(_localizer["No"], "false")
            };
        }

In ABP Suite, It should generate the Filter Items using a backend field like the following.

        [SelectItems(nameof(IsUsedBoolFilterItems))]
        public string? IsUsedFilter { get; set; }

        private List<SelectListItem>? _IsUsedBoolFilterItems;
        public List<SelectListItem> IsUsedBoolFilterItems
        {
            get { return (_IsUsedBoolFilterItems == null) ? SetFilterItems() : _IsUsedBoolFilterItems; }
            set { _IsUsedBoolFilterItems = value; }
        }

But this needs to add a localizer in the constructor of Index.cshtml and also Index.Extended.cshtml.cs (if they use custom code) to pass to AbpModel to add that method I propose.

public IndexModelBase(IStringLocalizer<DemoResource> localizer, IDemosAppService demosAppService) : base(localizer)
{
    _demosAppService = demosAppService;
}

Downloadable Excel file is not localized

[AllowAnonymous]
public virtual async Task<IRemoteStreamContent> GetListAsExcelFileAsync(DemoExcelDownloadDto input)
{
    var downloadToken = await _excelDownloadTokenCache.GetAsync(input.DownloadToken);
    if (downloadToken == null || input.DownloadToken != downloadToken.Token)
    {
        throw new AbpAuthorizationException("Invalid download token: " + input.DownloadToken);
    }

    var items = await _demoRepository.GetListAsync(input.FilterText, input.Name, input.Date, input.Price);

    var memoryStream = new MemoryStream();
    await memoryStream.SaveAsAsync(ObjectMapper.Map<List<Ubigeo>, List<UbigeoExcelDto>>(items));
    memoryStream.Seek(0, SeekOrigin.Begin);

    return new RemoteStreamContent(memoryStream, "Demos .xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
}
  • The names of the columns are not localized
  • The name of the file are not localized

Proposal for change

        public override async Task<IRemoteStreamContent> GetListAsExcelFileAsync(DemoExcelDownloadDto input)
        {
            var downloadToken = await _excelDownloadTokenCache.GetAsync(input.DownloadToken);
            if (downloadToken == null || input.DownloadToken != downloadToken.Token)
            {
                throw new AbpAuthorizationException("Invalid download token: " + input.DownloadToken);
            }

            var items = await _demoRepository.GetListAsync(input.FilterText, input.Name, input.Date, input.Price);

            var config = new OpenXmlConfiguration
            {
                DynamicColumns = new MiniExcelLibs.Attributes.DynamicExcelColumn[]
                {
                    new MiniExcelLibs.Attributes.DynamicExcelColumn("Name") { Name = L["Name"]},
                    new MiniExcelLibs.Attributes.DynamicExcelColumn("Date") { Name = L["Date"]},
                    new MiniExcelLibs.Attributes.DynamicExcelColumn("Price") { Name = L["Price"]}
                }
            };

            var memoryStream = new MemoryStream();
            await memoryStream.SaveAsAsync(ObjectMapper.Map<List<Ubigeo>, List<DemoExcelDto>>(items), configuration: config);
            memoryStream.Seek(0, SeekOrigin.Begin);

            var fileName = L["Demos"] + ".xlsx";
            return new RemoteStreamContent(memoryStream, fileName, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        }

That would be a great change for ABP Suite generator to solve the localization of the Excel file process.

Sure, I created a Loom with the footage of the issue.

https://www.loom.com/share/0281cc2d84f24cc6950b803db9755ccf?sid=1661c041-1e0d-48b9-8cb4-9146716bc9c2

Dear EngincanV, I have also another issue with migrations. Sometimes the demo2 (with version 8.1.0.rc-1) doesn't apply any migrations at all, it's a weird bug because it happens (sometimes!!) when the project is created or when I create or update an already existing entity (It happens randomly). I will try to create a loom at the exact moment when It happens.

Showing 21 to 30 of 123 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11