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

Fleet UI: Info banner component, uses Card as base component, tests #26276

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

RachelElysia
Copy link
Member

@RachelElysia RachelElysia commented Feb 11, 2025

Issue

Part 2 for #26231

Description

  • InfoBanner component only
  • Refactor to use Card component under the hood
  • Update test
  • Ensure storybook works as intended

Screenshots

TODO: After confirmation from Design

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
  • Added/updated automated tests
  • A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it)
  • Manual QA for all new/changed functionality

pageLevel?: boolean;
/** Add this element to the end of the banner message. Mutually exclusive with `link`. */
cta?: JSX.Element;
/** closable and link are mutually exclusive */
closable?: boolean;
/** Makes the entire banner clickable */
Copy link
Member Author

Choose a reason for hiding this comment

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

unused

Copy link
Member Author

Choose a reason for hiding this comment

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

Passing through instead since path is prop on Card

/** default 4px */
borderRadius?: "large" | "xlarge";
borderRadius?: "medium" | "xlarge";
Copy link
Member Author

Choose a reason for hiding this comment

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

corresponds to Card border radius sizes

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.66%. Comparing base (daabdb6) to head (011e301).
Report is 100 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #26276   +/-   ##
=======================================
  Coverage   63.66%   63.66%           
=======================================
  Files        1631     1633    +2     
  Lines      156545   156580   +35     
  Branches     4046     4056   +10     
=======================================
+ Hits        99657    99692   +35     
+ Misses      49038    49036    -2     
- Partials     7850     7852    +2     
Flag Coverage Δ
frontend 53.63% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RachelElysia RachelElysia marked this pull request as ready for review February 12, 2025 14:17
@RachelElysia RachelElysia requested a review from a team as a code owner February 12, 2025 14:17
@@ -57,7 +57,7 @@ const MainContent = ({
banner = <AppleBMTermsMessage />;
} else if (isVppExpired || willVppExpire) {
banner = <VppRenewalMessage expired={isVppExpired} />;
} else if (isFleetLicenseExpired) {
} else if (!isFleetLicenseExpired) {
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Change this back - used for testing

Copy link
Contributor

@ghernandez345 ghernandez345 left a comment

Choose a reason for hiding this comment

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

Just had a quick question about the info banner path behaviour

className={wrapperClasses}
color={color}
borderRadiusSize={borderRadius}
path={path}
Copy link
Contributor

@ghernandez345 ghernandez345 Feb 12, 2025

Choose a reason for hiding this comment

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

Does this mean that Info Banner itself is clickable and will go to a path? Is this the correct behaviour? seems strange as it looks like the clickable area in the design is a link,action, or x button. Im also not seeing where we are using this prop in the user of <InfoBanner />.

Copy link
Member Author

@RachelElysia RachelElysia Feb 12, 2025

Choose a reason for hiding this comment

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

@ghernandez345
link was the former prop that had been used before, but no longer is used anywhere. I think whatever used to use link was got moved to use a <Card> directly and changed to path. I replaced it with path prop since that was the corresponding prop for the basecomponent <Card> but I can see how that is confusing because we have cta which is also clickable.

Copy link
Member Author

@RachelElysia RachelElysia Feb 18, 2025

Choose a reason for hiding this comment

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

@ghernandez345 I removed the unused path prop since no instance of <InfoBanner/> requires it

@RachelElysia RachelElysia merged commit 20033a8 into main Feb 19, 2025
14 checks passed
@RachelElysia RachelElysia deleted the 26231-info-banner branch February 19, 2025 15:36
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