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

feat(insights): add pay gate for data color themes #27644

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Jan 17, 2025

Problem

We want data color themes to be part of the teams plan, like other white-labelling stuff.

Changes

Adds a pay gate to the settings section:

Screenshot 2025-01-17 at 15 05 40

How did you test this code?

👀 - waiting for some guidance on how to actually set the feature availability up

Copy link
Contributor

github-actions bot commented Jan 17, 2025

Size Change: 0 B

Total Size: 1.13 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.13 MB

compressed-size-action

@thmsobrmlr thmsobrmlr marked this pull request as ready for review January 17, 2025 16:12
Copy link
Contributor

@zlwaterfield zlwaterfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, once we add to billing this should work. I'll wait to test it all before approving.

Replied to you in Slack about billing.

@@ -78,6 +78,7 @@ class License(models.Model):
AvailableFeature.SAML,
AvailableFeature.SSO_ENFORCEMENT,
AvailableFeature.ROLE_BASED_ACCESS,
AvailableFeature.DATA_COLOR_THEMES,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't used so you don't need to add here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. This brings up another question though: Are we ok with soft-gating features like this? You could still use the API to create custom themes and then use them, we just don't show the UI for it.

Also, should I add special handling for users who downgrade? They could have a custom theme in place and then there's no way to go back to the default theme.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also add these on the server, available features is stored on the organization so no paygate but if you search the API you'll see some examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll:
(a) shadow the default theme id field on the team serializer to always return the default theme if the feature isn't available and
(b) add a feature check on the create/update endpoints for themes

@thmsobrmlr
Copy link
Contributor Author

Looks good, once we add to billing this should work. I'll wait to test it all before approving.

Replied to you in Slack about billing.

Amazing, thank you. I've updated this PR https://github.com/PostHog/billing/pull/1075 based on feedback from you and Raquel.

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.

2 participants