Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "alexanderpilhar"

@aaron here are the cultures specified in ProjectNameExtended folder:

  • ProjectName.xml: culture="en"
  • ProjectName-de.xml: culture="de"

@geertveenstra I see. I did as you described but now my resource extension files cannot be found at all ... Note: I did make sure to set build-process to embedded resource for the files. I also checked namespace for errors.

@maliming thanks for your comment! I think I'm falling in love with the json resource files :D They seem to be much more readable!

@aaron as far as I understand linked documentation, the culture specified in the files should be okay - I'm trying to extend CompanyName.ProjectName.Localization.ProjectName.ProjectName.xml (which is culture="en") with CompanyName.ProjectName.Localization.ProjectNameExtended.ProjectName.xml (which is culture="en" as well).

@geertveenstra did you mean to move all default localization files from CompanyName.ProjectName.Localization.ProjectName to CompanyName.ProjectName.Localization? And the rootNamespace: "CompanyName.ProjectName.Localization.ProjectName" for XmlEmbeddedFileLocalizationDictionaryProvider still works?

@ismcagdas yes, that gave me the right hints on what to do!

In case somebody else wants to implement sorting or ASPNETZERO team decides to implement it:

  1. Add the following property to FeatureMetadata.cs and FlatFeatureSelectDto.cs: public int? SortIndex { get; set; }
  2. Edit CustomDtoMapper.cs:
    1. Add class (see: Before and After Map Action):
    public class MapFeatureSortIndexAction : IMappingAction<Feature, FlatFeatureSelectDto>
    {
        public void Process(Feature source, FlatFeatureSelectDto destination)
        {
            destination.SortIndex = (source[FeatureMetadata.CustomFeatureKey] as FeatureMetadata)?.SortIndex;
        }
    }
    
    1. Change configuration.CreateMap<FlatFeatureSelectDto, Feature>().ReverseMap(); to configuration.CreateMap<FlatFeatureSelectDto, Feature>().ReverseMap().AfterMap<MapFeatureSortIndexAction>();
  3. Edit TenantRegistrationAppService.cs:
public async Task<EditionsSelectOutput> GetEditionsForSelect()
{
    ...
    var flatFeatures = ObjectMapper
        .Map<List<FlatFeatureSelectDto>>(features)
        .OrderByDescending(f => f.SortIndex.HasValue)
        .ThenBy(f => f.SortIndex)
        .ThenBy(f => f.DisplayName)
        .ToList();
   ...
}

Cheers!

I just found a question by @vladsd asking for something similar: [Extending feature properties #4618](https://support.aspnetzero.com/QA/Questions/4618)

Thanks a lot @ryancyq!

Okay then! Thank your for clarification @aaron!

@aaron I get that. But when removing a feature from an edition or a tenant, permissions that have a dependency on removed feature remain granted for users. To me, this doesn't seem to be correct.

Answer

I also make ASPNETZERO classes partial when I need to extend them somehow. But when merging I still have to check the ASPNETZERO classes because they are marked to be different since I added partial to them. If they would be partial from begin with, merging process would be a little easier/faster (less checks to do).

Although I have not tried with with ASP MVC + jQuery, this should be what you want:

context.Create(
    AppFeatures.SampleSelectionFeature,
    defaultValue: "B",
    displayName: L("Sample selection feature"),
    inputType: new ComboboxInputType(
        new StaticLocalizableComboboxItemSource(
            new LocalizableComboboxItem("A", L("Selection A")),
            new LocalizableComboboxItem("B", L("Selection B")),
            new LocalizableComboboxItem("C", L("Selection C"))
        )
    )
)[FeatureMetadata.CustomFeatureKey] = new FeatureMetadata
{
    IsVisibleOnPricingTable = true
};

Thank you @ismcagdas!

Created Issue: [FeatureChecker should make use of Localization when throwing AbpAuthorizationException #4365](https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4365)

Showing 91 to 100 of 173 entries