Skip to content

feat: Add LicenseBanner #3568

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 22 commits into from
Aug 23, 2022
Merged

feat: Add LicenseBanner #3568

merged 22 commits into from
Aug 23, 2022

Conversation

presleyp
Copy link
Contributor

@presleyp presleyp commented Aug 18, 2022

Fixes #3217

Showing the color scheme (more up to date than the gif below):
Screen Shot 2022-08-18 at 6 59 17 PM

Description

  • Extracts Pill component from WorkspaceStatusBadge to reuse in LicenseBannerView
  • Extracts Expander component from ErrorSummary to reuse in LicenseBannerView
  • implements license banner design, sort of, in LicenseBannerView - see remaining issues below!
  • hooks up LicenseBanner to entitlementsXService.

Left to do:

  • improve the colors
  • see where I need more stories and tests

To try it out

The current api will always return falsey data, as if you are using the open source offering. To view the banner, use the XState inspector to send an event of type "SHOW_MOCK_BANNER". To hide the banner, send, you guessed it, "HIDE_MOCK_BANNER."

Kapture 2022-08-18 at 17 16 29

Design changes

Here is the Figma. I have deviated from it in some ways:

  • The banner is above the nav bar, like in v1. Ammar agreed this made the most sense since it's a global issue.
  • The expand/collapse control is a link with an icon rather than embedded text. This is for consistency with ErrorSummary.
  • The color scheme is orange, because people agreed it should be warning-colored.
  • The pill says "License Issue" or "n License Issues" for consistency (rather than just "License" in the singular case) and the casing is not all caps for consistency with WorkspaceStatusBadge

I also changed the color of the More/Less link from light blue to near-white, which affected the ErrorSummary. Let me know if you think it's a problem!

@presleyp presleyp changed the title License banner/presleyp/3217 feat: Add LicenseBanner Aug 18, 2022
@presleyp presleyp marked this pull request as ready for review August 19, 2022 18:16
@presleyp presleyp requested a review from a team as a code owner August 19, 2022 18:16
@presleyp presleyp requested review from BrunoQuaresma and Kira-Pilot and removed request for a team August 19, 2022 18:16
const styles = useStyles()
interface ArrowProps {
margin?: boolean
}
Copy link
Member

Choose a reason for hiding this comment

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

We could share this typing with the makeStyles block above: makeStyles<Theme, ArrowProps>

Copy link
Member

Choose a reason for hiding this comment

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

I also wonder if, instead of a margin prop, we add a style prop that we spread in the children. Makes things a bit more flexible, but just a suggestion!

Copy link
Contributor Author

@presleyp presleyp Aug 22, 2022

Choose a reason for hiding this comment

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

We may want to consider keeping link text blue for accessibility reasons.

(This comment ended up in the wrong place, sorry for the confusion!)

@Kira-Pilot Yeah, so I changed this because I thought the color combination was bad and it was also going to pose a contrast issue, but I have been wondering if it's obvious enough. I think the chevron and placement helps. But I also think I'm having trouble making it blue or underlined because it's a not a navigation link. It's really a button in functionality. What do you think is the best way to style that? I guess Zenhub styles "Show 4 more" on this page like a link (bold and blue).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to wait on a style prop here because I think this component will be revisited in future color work and it'll be easier to tell then what to do.

Copy link
Member

Choose a reason for hiding this comment

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

@presleyp That makes sense! I agree with your logic and I don't think it's something we need to change right now. Let's keep it back of mind and look out for link inspo in the future.

presleyp and others added 2 commits August 22, 2022 10:25
Co-authored-by: Kira Pilot <kira@coder.com>
Co-authored-by: Kira Pilot <kira@coder.com>
@Kira-Pilot
Copy link
Member

We may want to consider keeping link text blue for accessibility reasons. No strong opinions on this thought - I think we still have a lot of contrast.

This looks great! Really thorough and nice job.

@presleyp presleyp merged commit 49de44c into main Aug 23, 2022
@presleyp presleyp deleted the license-banner/presleyp/3217 branch August 23, 2022 15:26
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.

Show license banner when warnings are present
2 participants