Activities of "enisn"

Hi @trina.thompson

The problem occurs because abp CLI tries to install LeptonX Beta.1 version, but beta.1 is only compatible with ABP 5.2

We're working on this issue. You can add the following dependency into your Web.csproj file manually for now.

    <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX" Version="1.0.0-beta.2" />```

Hi @lalitChougule

appsettings is not a part of ABP Framework. It's part of Microsoft.Extensions.Configuration namespace. So I'm not sure what is the best way to move configurations to database but there is an example about what you exactly want: https://stackoverflow.com/questions/60330342/can-i-move-configuration-from-appsettings-json-to-database-in-an-asp-net-core-mv

Hi @deepak

We designed permissions to be kept in a Dictionary. Unfortunately dictionaries in C# aren't designed for being able to be sorted. https://stackoverflow.com/a/7521383/7200126

We can consider adding an order to permissions but currently, there is no order in permission groups.

I can show you a workaround until we'll add that feature.

  • Go to your YourProjectNamePermissionDefinitionProvider in .Application.Contracts project and make a manual ordering like below.
public override void Define(IPermissionDefinitionContext context)
{
    // some other permission additions of your app
    // ...
    
    if (context is PermissionDefinitionContext definitionContext)
    {
        var ordered = definitionContext.Groups.OrderByDescending(...).ToList();

        definitionContext.Groups.Clear();

        foreach (var item in ordered)
        {
            definitionContext.Groups.Add(item.Key, item.Value);
        }
    }
}
Answer

Hi again.

For earlier version such as yours, you can add following class into your Domain project and replace & override the QuestionManager with the fixed code block.

I personally don't recommend to set protected or private properties via using reflection but in that case, it can be patched like this.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Forms;
using Volo.Forms.Forms;
using Volo.Forms.Questions;
using Volo.Forms.Questions.ChoosableItems;

namespace YourProjectName;

[ExposeServices(typeof(QuestionManager))]
[Dependency(ReplaceServices = true)]
public class MyQuestionManager : QuestionManager
{
    protected IQuestionRepository questionRepository;
    public MyQuestionManager(
        IQuestionRepository questionRepository,
        IFormRepository formRepository,
        IGuidGenerator guidGenerator) : base(questionRepository, formRepository, guidGenerator)
    {
        this.questionRepository = questionRepository;
    }

    public override async Task<QuestionBase> UpdateAsync(Guid id, string title, int index, bool isRequired, string description, QuestionTypes questionType, bool hasOtherOption, List<(Guid Id, string value, bool isCorrect)> choiceList)
    {        
        var question = await questionRepository.GetAsync(id);
        var questionId = question.Id;
        var formId = question.FormId;
        var creationDate = question.CreationTime;
        // This will be removed when EfCore bug is resolved: https://github.com/dotnet/efcore/issues/22016
        // Since item with choice collection can't return single object; we can't remove choices over item.
        await ClearItemChoicesAsync(question);
        question = await questionRepository.GetAsync(id);
        await questionRepository.HardDeleteAsync(question, autoSave: true);
        var createdQuestion = CreateItemBasedOnType(questionType, questionId);
        createdQuestion
            .SetFormId(formId)
            .SetTitle(title)
            .SetIndex(index)
            .SetDescription(description);
        createdQuestion.SetRequired(isRequired);
        createdQuestion.SetOtherOption(hasOtherOption);
        if (createdQuestion is IChoosable choosableItem)
        {
            if (!(question is IChoosable))
            {
                for (var i = 0; i < choiceList.Count; i++)
                {
                    choosableItem.AddChoice(id: GuidGenerator.Create(), index: i + 1, value: choiceList[i].value, isCorrect: choiceList[i].isCorrect);
                }
            }
            else
            {
                UpdateIndexesOfChoiceList(choiceList);
                choosableItem.AddChoices(choiceList);
            }
        }

        createdQuestion.CreationTime = creationDate;
        createdQuestion.LastModificationTime = DateTime.Now;
        FixChoicesTenants(createdQuestion);
        await UpdateFormLastModificationDateAsync(createdQuestion.FormId);
        return await questionRepository.InsertAsync(createdQuestion, true);
    }

    private void FixChoicesTenants(QuestionBase createdQuestion)
    {
        if(createdQuestion is Checkbox checkbox)
        {
            foreach(var choice in checkbox.Choices)
            {
                SetProperty(choice, nameof(IMultiTenant.TenantId), CurrentTenant.Id);
            }
        }

        if (createdQuestion is ChoiceMultiple choiceMultiple)
        {
              foreach(var choice in choiceMultiple.Choices)
            {
                SetProperty(choice, nameof(IMultiTenant.TenantId), CurrentTenant.Id);
            }
        }

        if (createdQuestion is DropdownList dropdownList)
        {
              foreach(var choice in dropdownList.Choices)
            {
                SetProperty(choice, nameof(IMultiTenant.TenantId), CurrentTenant.Id);
            }
        }
    }

    private void SetProperty<T>(T obj, string propertyName, object value)
    {
        typeof(T).GetProperty(propertyName)?.SetValue(obj, value);
    }
}

In the v5.2.2, you can use -u parameter but somehow -u became a required parameter. We'll fix this in 5.2.3.

But short answer is yes you can use URL parameter in 5.2.2

Answer

This problem has been already solved in v5.2.2.

Since It's an entity related problem and can't override or replace entity class. So I can't suggest to you a workaround now, you can update to 5.2.2


Also your credit is refunded

Answer

We have validated the problem. We'll be working on the next patch version. I'll share with you a workaround as soon as possible.

Hi @sukhdeep.dhillon

You can access it via installing Volo.CmsKit.Pro.Public.* nuget packages to your project.

In that case, you have a single application, So you should install the following packages:

  • Volo.CmsKit.Pro.Public.Application to your Cao.AbpPoc.Application
  • Volo.CmsKit.Pro.Public.Application.Contracts to your Cao.AbpPoc.Application.Contracts
  • Volo.CmsKit.Pro.Public.Domain to your Cao.AbpPoc.Domain
  • Volo.CmsKit.Pro.Public.Domain.Shared to your Cao.AbpPoc.Domain.Shared
  • Volo.CmsKit.Pro.Public.EntityFrameworkCore to your Cao.AbpPoc.EntityFrameworkCore
  • Volo.CmsKit.Pro.Public.HttpApi to your Cao.AbpPoc.HttpApi
  • Volo.CmsKit.Pro.Public.HttpApi.Client to your Cao.AbpPoc.HttpApi.Client
  • Volo.CmsKit.Pro.Public.Web to your Cao.AbpPoc.Web

And don't forget to add [DependsOn] attributes for each project.


Also, instead of installing both Admin and Public packages, you can convert Admin package references to unified one.

In example, Convert Volo.CmsKit.Pro.Admin.Application to Volo.CmsKit.Pro.Application

and

Convert [DependsOn(typeof(CmsKitProAdminApplicationModule )] to [DependsOn(typeof(CmsKitProApplicationModule )]

Make sure each layer has been converted.

Answer

I've tried with v5.2.1 as you said but couldn't reproduce that exception. Can you please share the steps to reproduce?

Can you check /api/abp/api-definition URL and make sure your module name is included in the JSON from response. Maybe your module name is configured differently than productService.

By the way, if you're using CLI version 5.2, -u parameter won't work. In that version it still uses environment to define URL to get api-configuration.

You can try again after updating your CLI to 5.3.0-rc.1

dotnet tool update -g Volo.Abp.Cli --version 5.3.0-rc.1

Also Upgrage your @abp/ng.schematics package version to 5.3.0-rc.1

//package.json
 "@abp/ng.schematics": "5.3.0-rc.1"
Showing 271 to 280 of 489 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 08:30