feat: Implement Theme feature flags #279
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description - Theme Feature Flags
Theme features are created to be able to control some of the features per theme. They take precedence over the API Organization Features (look here: ngui/ui/src/hooks/useIsFeatureEnabled.ts)
All the flags are kept in ngui/ui/src/theme.feature.ts file to keep this configuration as close as possible to theme. We keep snake_case naming convention to follow naming conventions used by feature flags API.
Flag can have tree values:
true - permanently enable
false - permanently disabled
undefined - respect API organization flag
Examples
Example 1. paid_organization
We do not want to have any feaures to be demo features or disabled if someone does not pay for the platform. We control access to the platform so all features are enabled by default.
This is why we set the flag paid_organization in ngui/ui/src/theme.feature.ts to permanently enable it in the whole platform where useIsPaidOrganization hook is used.
Example 2. Hide product tour
We want to hide product tour for all users
Next steps
We can introduce another level of Feature Flags (environment variable, runtime controled flags)
Notes
This feature is important for themification.
Related issue number
MPT-14733 MPT-14638
Checklist