Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Proof of concept for licensing #3008

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

Closed
wants to merge 7 commits into from
Closed

Conversation

presleyp
Copy link
Contributor

@presleyp presleyp commented Jul 15, 2022

Closes #2904
Things aren't named quite right yet but here's a start! I plan to add to this but wanted to share early.

requirements as I understand them:

  • license data must be fetched on app mount (which means also on browser refresh)
  • license data must be fetched any action that could cause compliance (user suspension, upgrading, disabling a feature) or change what's enabled
  • whenever warnings are present in the license data, the LicenseBanner must be shown on all pages containing all warnings
  • all features that are enabled in the license data must be available (soft enforcement)
  • all paid features must be unavailable to OSS users - I have kind of handled this by defaulting license data to enabled: false, but we should decide how the API will handle this case
  • there will be an admin page containing toggles for enabling/disabling all paid features. This page will be available to all non-OSS admins. Defaults will not handle this case so we should sync on a way for the frontend to know if they should get this page.
  • the toggle for any paid feature for which entitled is false will show a warning, but the admin will be able to enable the feature (soft enforcement)

Solution:

  • licenseXService fetches license data on app mount, refresh, and various events and holds license data in global state
  • LicenseBanner displays any warnings
  • LicenseRequired page wrapper redirects OSS users to another page (currently 404, will later be something more informative) if they try to access a page that is entirely a paid feature
  • pages select visibility booleans from licenseXService to determine whether to show smaller features (coming next)

@presleyp presleyp requested a review from spikecurtis July 15, 2022 18:24
@presleyp
Copy link
Contributor Author

Closing because this has served its purpose.

@presleyp presleyp closed this Jul 25, 2022
@github-actions github-actions bot deleted the licensing-poc/presleyp/2904 branch February 4, 2023 20:04
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

Successfully merging this pull request may close these issues.

Proof of concept for frontend licensing
1 participant