Skip to content

feat: add premium license banner for custom roles page #14595

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

Merged
merged 11 commits into from
Sep 11, 2024

Conversation

jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented Sep 6, 2024

resolves #14318

  • Theme the premium license in a purple color palette
  • Paywall should always be displayed if license isn't valid
  • Display roles table with any existing custom roles exist even if license is no longer valid
  • Display empty table state even if license is no longer valid
  • Add storybooks for new states

@jaaydenh jaaydenh changed the title feat: premium license banner for custom roles page feat: add premium license banner for custom roles page Sep 6, 2024
@jaaydenh jaaydenh force-pushed the jaaydenh/premium-banners branch from 8d21b76 to a8f6d9c Compare September 6, 2024 21:38
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

LGTM! I did some QA and it works as expected 👍 good job

Copy link
Member

@Parkreiner Parkreiner left a comment

Choose a reason for hiding this comment

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

Tentatively approving so that you're not blocked, but I think there's a few changes that can be made to make the component logic more reusable and foolproof

<div>
<Stack direction="row" alignItems="center" css={{ marginBottom: 24 }}>
<h5 css={styles.title}>{message}</h5>
<EnterpriseBadge />
{type === "enterprise" ? <EnterpriseBadge /> : <PremiumBadge />}
Copy link
Member

Choose a reason for hiding this comment

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

My main worry with this setup is that because the conditional "flip" for displaying the text is getting repeated so much, there's a higher risk of someone making a typo and accidentally mixing text and bullet points between paywall types

I know it isn't DRY, but just to keep things firmly grouped together, my preference would be to have two variants of the component (that can be kept un-exported as private implementation details) – one for premium and one for enterprise

Copy link
Member

Choose a reason for hiding this comment

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

Basically, I don't think there's a great way to fully DRY up the code, so we have to choose between DRYing up the content or the markup/styling. But because this potentially involves a lot of money, I'd always choose content and making sure customers can't ever get incorrect information. A single missed !== instead of a === breaks that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was meant to be a temporary solution as I originally thought the enterprise license would only remain for a short time longer. But now I am going to update this to completely remove the enterprise license and leave only the premium

maxWidth: 920,
margin: "auto",
minHeight: 280,
marginBottom: 32,
Copy link
Member

Choose a reason for hiding this comment

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

I really disagree with having any kind of external margin value on a general-purpose component

Again, maybe not DRY, but since the external spacing is strictly something the parent component would need to be worried about, I'd move that logic here. The margin isn't inherently tied to the content of the component, and now we can't use it for other purposes without having a hard-coded margin value be enforced

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it, removed the marginBottom

Comment on lines 3 to 7
/** Colors for enterprise are temporary and will be removed when the enterprise license is removed */
enterprise: {
background: string;
border: string;
};
Copy link
Member

Choose a reason for hiding this comment

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

Is there any context for what the plan is for our license types going forward? Like, is there a Notion doc page or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but I believe the plan going forward is to only have the premium license.

color: theme.palette.text.secondary,
fontSize: 16,
maxWidth: 460,
fontSize: 14,
}),
separator: (theme) => ({
Copy link
Member

Choose a reason for hiding this comment

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

Making a note for myself: we should update our color theme so that it works better on colored backgrounds. The gray divider color looks really washed out on a saturated colored background

Copy link
Member

@Parkreiner Parkreiner Sep 9, 2024

Choose a reason for hiding this comment

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

Before:
Screenshot 2024-09-09 at 10 20 08 AM

After:
Screenshot 2024-09-09 at 10 20 14 AM

Same thing applies to the border around the button, but I don't want to pop open an MUI library component

Copy link
Member

Choose a reason for hiding this comment

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

ooooh, purple divider looks rad

Copy link
Member

@Parkreiner Parkreiner left a comment

Choose a reason for hiding this comment

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

I think the content updates look good, but I'm going to defer to Kayla's opinion on the color usage

Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

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

thank you! much happier with this 😄

@jaaydenh jaaydenh merged commit 7de576b into main Sep 11, 2024
27 checks passed
@jaaydenh jaaydenh deleted the jaaydenh/premium-banners branch September 11, 2024 18:02
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⭐ Custom roles no premium license behavior
4 participants