Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Premium Limitations #12

Open
StefanEnsmann opened this issue Oct 23, 2024 · 0 comments
Open

[RFC] Premium Limitations #12

StefanEnsmann opened this issue Oct 23, 2024 · 0 comments

Comments

@StefanEnsmann
Copy link
Contributor

Info

We have four entities that can be restricted to a premium feature:

  • Tabs
  • Groups (Accordion, Group)
  • Input Fields
  • Input Field options (Checkbox, Chips, Dropdown, Select)

Please take note, that Accordion and Group are currently not used, since they have been replaced by the new Tabs field (while theoretically they could be used inside of a tab). Additionally, Chips and Dropdown will probably be replaced by the generic Select field in the future.

Suggestion

I suggest a requires entry, which supports several types of requirements that can be fulfilled, e.g.

{
  "requires": {
    "pro-subscription": true,
    "sku-id": "<sku-id>"
  }
}

This entry will be supported by every input field and every option of an input field with multiple options (except the Platforms field). If multiple requirements are given, only one of them suffices to unlock the feature. This avoids locking features behind multiple conditions, but allows unlocking a feature by different means.

Tabs

[
  {
    "id": "tabs",
    "type": "tabs",
    "tabs": [
      {
        "label": "Font Settings",
        "requires": {
          "pro-subscription": true
        },
        "fields": [
          {
            "id": "font-settings",
            "type": "font-settings"
          }
        ]
      }
    ]
  }
]

Groups

{
    "id": "accordion",
    "type": "accordion",
    "requires": {
        "pro-subscription": true
    },
    "fields": []
}

Input Fields

{
    "id": "font-settings",
    "type": "font-settings",
    "requires": {
        "pro-subscription": true
    },
    "attributes": {
        "value": {}
    }
}

Input Field Options

{
    "id": "select",
    "type": "select",
    "options": [
        {
            "label": "Free Option",
            "value": "free-option"
        },
        {
            "label": "Paid Option",
            "value": "paid-option",
            "requires": {
                "pro-subscription": true
            }
        }
    ]
}

Restricting the scene

To enable a smooth transition between paid and non-paid states, no validation is done when saving the scene. When retrieving the scene, the backend will check all extensions for premium values that deviate from their default state. If there are values that can not be satisfied by any of the requires entries, an additional restriction will be put on the scene and displayed in presenting mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant