Base solution for your next web application
Open Closed

Feature Management by tenant #8745


User avatar
0
BobIngham created

I want my tenants to be able to select and deselect features. I have three questions.

  1. This seems a very convoluted way of adding features for a tenant:
                if (input.WantsDocumentationManagement == true)
                {
                    var updatablefeatureValues = ObjectMapper.Map<List<Abp.NameValue>>(await TenantManager.GetFeatureValuesAsync(tenant.Id));
                    foreach (var feature in updatablefeatureValues)
                    {
                        if (feature.Name == "App.DocumentationManagement")
                        {
                            feature.Value = "true";
                        }
                    }
                    await TenantManager.SetFeatureValuesAsync(tenant.Id, updatablefeatureValues.Select(fv => new NameValue(fv.Name, fv.Value)).ToArray());
                }

Is this best practise or is there a better way?

  1. I have read that features are cached. Is this change immediately available in the UI?
  2. Why is the font muted in list items?

4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bobingham,

    1. There is also SetFeatureValueAsync method on TenantManager which you can use.
    2. If you use TenantManager, yes, the cache is updatead.
    3. Could you share the screenshot where this happens ?
  • User Avatar
    0
    BobIngham created

    It's a non-standard implementation. Everyone goes on a seven day free-trial. During the free trial they are limited to three devices connected to the system. They can upgrade at any time and can choose to use the document management system or not at any time. The login process is modified to check the trial and grace periods. A message is displayed at sign in during the trial and grace periods asking the user if they want to begin a paid subscription. If they do the the system takes them to the Stripe payment page for an initial payment. After they have paid they may add more devices to the system. We have a function app in Azure which checks the database every night for expiring subscriptions. It calculates device usage and document management system usage, takes a payment from Stripe. It then updates the Zero database, connects to the Zero app and sends a notification. The tenant's subscription page will be modified to give estimated costs and to allow the user to switch on and off features we want to add such as the document management system. Which screen shot do you want to see? This a mock up of the select-editions page which will be implemented on a different web site.

  • User Avatar
    0
    ismcagdas created
    Support Team

    I mean this;

    Why is the font muted in list items?

  • User Avatar
    0
    BobIngham created