Activities of "rafael.gonzales"

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.

In the end, it's a bug from Asp.net Core. Can we have this info in the documentation? This can help other developers to know that it's not an ABP Bug but instead Microsoft and follow ms suggestion instead.

Can I get my ticket refund, please?

Please, don't ignore us!

Hello,

Can someone create the "Bugs & Issues v8.1.x"?

Thanks!

It seems that it still requires a PFX. If I delete the openiddict.pfx or comment this line in my WebModule.cs, the application doesn't work

         PreConfigure&lt;OpenIddictServerBuilder&gt;(serverBuilder =>
         {
             serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "1234");
        });

salih.ozkara@volosoft.com

Sure, I will send you my demo project but one hint. Change you're region to South America (for example Peru) and set your timezone too to GMT-5.

Hello!!! It's me again. I found 2 bugs related to datepickers.

One of them, is related to ABP Framework and I created an issue here https://github.com/abpframework/abp/issues/18985

The other one is related to ABP Commercial. If you see the Loom video, you can see that I create an entity with a date value on day 17 but when I try to edit, It will display on day 16 in the date picker. https://www.loom.com/share/77c5c42318af4ff8b16f16e8729a7a66?sid=4c20182b-6621-4e39-9dd0-1f721967b51c

I was able to fix it by modifying the generated index.js in this line

(new Date(date)).toLocaleDateString(abp.localization.currentCulture.name);

with this

(new Date(date)).toLocaleDateString(abp.localization.currentCulture.name, {timeZone: 'UTC'});

This seems to happen in my timezone (GMT-5).

Showing 41 to 50 of 125 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 08:30