-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Paid plans activation required banner (#2832)
* feat: Add activation banner for trial eligible owners * pull out interface + spec stuff * Update to reflect paid plan activation banner * Refactor CircleCI repo onboarding into one file (#2806) * Refactor Other CI repo onboarding into one file (#2807) * Update repo onboarding title position and page alignment (#2818) * sec: 390 - Add validation for potential XSS vuln (#2797) * add tests, and validation for provider * add back supportServiceless param * ref: 1548 Part 1: Convert all Header files to TS (#2821) * ref all header files to TS * remove prop types and rebase * fix: Remove repository from GUT settings page header (#2823) Small tweak removing `repository` from the GUT settings page. * Install radix-ui react radio group (#2825) * Update repo onboarding steps with new Card component (#2819) GH codecov/engineering-team#1665 * feat: Add hasSeatsLeft to plan query * Update to reflect SeatsLimitReachedBanner * feat: paid plan activation banner * update with from FreePlanSeatsLimitBanner * value duplicate * feat: Activation required banner * clean up previous commit * match design * fix style * Resolve conflicts --------- Co-authored-by: Spencer Murray <[email protected]> Co-authored-by: ajay-sentry <[email protected]> Co-authored-by: nicholas-codecov <[email protected]>
- Loading branch information
1 parent
0247fbe
commit ce7fe0e
Showing
5 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...ageOnboarding/ActivationBanner/ActivationRequiredBanner/ActivationRequiredBanner.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import ActivationRequiredBanner from './ActivationRequiredBanner' | ||
|
||
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<MemoryRouter initialEntries={['/gh/codecov/gazebo/new']}> | ||
<Route path="/:provider/:owner/:repo/new">{children}</Route> | ||
</MemoryRouter> | ||
) | ||
|
||
describe('ActivationRequiredBanner', () => { | ||
it('renders the banner with correct content', () => { | ||
render(<ActivationRequiredBanner />, { wrapper }) | ||
|
||
const bannerHeading = screen.getByRole('heading', { | ||
name: /Activation Required/, | ||
}) | ||
expect(bannerHeading).toBeInTheDocument() | ||
|
||
const description = screen.getByText( | ||
/You have available seats, but activation is needed./ | ||
) | ||
expect(description).toBeInTheDocument() | ||
}) | ||
|
||
it('renders correct links', () => { | ||
render(<ActivationRequiredBanner />, { wrapper }) | ||
|
||
const manageMembersLink = screen.getByRole('link', { | ||
name: /Manage Members/, | ||
}) | ||
expect(manageMembersLink).toBeInTheDocument() | ||
expect(manageMembersLink).toHaveAttribute('href', '/members/gh/codecov') | ||
}) | ||
}) |
31 changes: 31 additions & 0 deletions
31
...CoverageOnboarding/ActivationBanner/ActivationRequiredBanner/ActivationRequiredBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Banner from 'ui/Banner' | ||
import BannerContent from 'ui/Banner/BannerContent' | ||
import BannerHeading from 'ui/Banner/BannerHeading' | ||
import Button from 'ui/Button' | ||
|
||
function ActivationRequiredBanner() { | ||
return ( | ||
<Banner variant="plain"> | ||
<BannerContent> | ||
<BannerHeading> | ||
<h2 className="font-semibold">ℹ Activation Required</h2> | ||
<div className="left-[100px] md:relative"> | ||
<Button | ||
hook="trial-eligible-banner-start-trial" | ||
to={{ | ||
pageName: 'membersTab', | ||
}} | ||
disabled={false} | ||
variant="primary" | ||
> | ||
Manage Members | ||
</Button> | ||
</div> | ||
</BannerHeading> | ||
<p>You have available seats, but activation is needed.</p> | ||
</BannerContent> | ||
</Banner> | ||
) | ||
} | ||
|
||
export default ActivationRequiredBanner |
1 change: 1 addition & 0 deletions
1
src/pages/RepoPage/CoverageOnboarding/ActivationBanner/ActivationRequiredBanner/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './ActivationRequiredBanner' |