-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Paid/Free plan seats limit banner (#2830)
* 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: paid plan seats limit banner * just one more small tweak * update name to FreePlanSeatsLimitBanner * remove queryclient call * update tests * fix padding * Update to have a const for plan value --------- 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
a50e79d
commit b1a3527
Showing
8 changed files
with
213 additions
and
10 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
40 changes: 40 additions & 0 deletions
40
...ageOnboarding/ActivationBanner/FreePlanSeatsLimitBanner/FreePlanSeatsLimitBanner.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,40 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import FreePlanSeatsLimitBanner from './FreePlanSeatsLimitBanner' | ||
|
||
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<MemoryRouter initialEntries={['/gh/codecov/gazebo/new']}> | ||
<Route path="/:provider/:owner/:repo/new">{children}</Route> | ||
</MemoryRouter> | ||
) | ||
|
||
describe('FreePlanSeatsLimitBanner', () => { | ||
it('renders the banner with correct content', () => { | ||
render(<FreePlanSeatsLimitBanner />, { wrapper }) | ||
|
||
const bannerHeading = screen.getByRole('heading', { | ||
name: /All Seats Taken/, | ||
}) | ||
expect(bannerHeading).toBeInTheDocument() | ||
|
||
const description = screen.getByText( | ||
/Your organization is on the Developer free plan/i | ||
) | ||
expect(description).toBeInTheDocument() | ||
}) | ||
|
||
it('renders correct links', () => { | ||
render(<FreePlanSeatsLimitBanner />, { wrapper }) | ||
|
||
const upgradeLink = screen.getByRole('link', { name: /Upgrade/ }) | ||
expect(upgradeLink).toBeInTheDocument() | ||
expect(upgradeLink).toHaveAttribute('href', '/plan/gh/codecov/upgrade') | ||
|
||
const manageMembersLink = screen.getByRole('link', { | ||
name: /manage members/, | ||
}) | ||
expect(manageMembersLink).toBeInTheDocument() | ||
expect(manageMembersLink).toHaveAttribute('href', '/members/gh/codecov') | ||
}) | ||
}) |
45 changes: 45 additions & 0 deletions
45
...CoverageOnboarding/ActivationBanner/FreePlanSeatsLimitBanner/FreePlanSeatsLimitBanner.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,45 @@ | ||
import A from 'ui/A' | ||
import Banner from 'ui/Banner' | ||
import BannerContent from 'ui/Banner/BannerContent' | ||
import BannerHeading from 'ui/Banner/BannerHeading' | ||
import Button from 'ui/Button' | ||
|
||
function FreePlanSeatsLimitBanner() { | ||
return ( | ||
<Banner variant="plain"> | ||
<BannerContent> | ||
<BannerHeading> | ||
<h2 className="font-semibold">ℹ All Seats Taken</h2> | ||
</BannerHeading> | ||
<div className="flex justify-between"> | ||
<p className="pr-2"> | ||
Your organization is on the Developer free plan, limited to one | ||
seat, which is currently occupied. You can add any amount of seats | ||
by upgrading for more flexibility.{' '} | ||
<A | ||
to={{ pageName: 'membersTab' }} | ||
hook="manage-members-paid-plan" | ||
isExternal={false} | ||
> | ||
manage members | ||
</A> | ||
</p> | ||
<div className="flex items-start justify-end"> | ||
<Button | ||
hook="trial-eligible-banner-start-trial" | ||
to={{ | ||
pageName: 'upgradeOrgPlan', | ||
}} | ||
disabled={false} | ||
variant="primary" | ||
> | ||
Upgrade | ||
</Button> | ||
</div> | ||
</div> | ||
</BannerContent> | ||
</Banner> | ||
) | ||
} | ||
|
||
export default FreePlanSeatsLimitBanner |
1 change: 1 addition & 0 deletions
1
src/pages/RepoPage/CoverageOnboarding/ActivationBanner/FreePlanSeatsLimitBanner/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 './FreePlanSeatsLimitBanner' |
40 changes: 40 additions & 0 deletions
40
...ageOnboarding/ActivationBanner/PaidPlanSeatsLimitBanner/PaidPlanSeatsLimitBanner.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,40 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import PaidPlanSeatsLimitBanner from './PaidPlanSeatsLimitBanner' | ||
|
||
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<MemoryRouter initialEntries={['/gh/codecov/gazebo/new']}> | ||
<Route path="/:provider/:owner/:repo/new">{children}</Route> | ||
</MemoryRouter> | ||
) | ||
|
||
describe('PaidPlanSeatsLimitBanner', () => { | ||
it('renders the banner with correct content', () => { | ||
render(<PaidPlanSeatsLimitBanner />, { wrapper }) | ||
|
||
const bannerHeading = screen.getByRole('heading', { | ||
name: /Seats Limit Reached/, | ||
}) | ||
expect(bannerHeading).toBeInTheDocument() | ||
|
||
const description = screen.getByText( | ||
/Your organization has utilized all available seats on this plan./i | ||
) | ||
expect(description).toBeInTheDocument() | ||
}) | ||
|
||
it('renders correct links', () => { | ||
render(<PaidPlanSeatsLimitBanner />, { wrapper }) | ||
|
||
const upgradeLink = screen.getByRole('link', { name: /Upgrade/ }) | ||
expect(upgradeLink).toBeInTheDocument() | ||
expect(upgradeLink).toHaveAttribute('href', '/plan/gh/codecov/upgrade') | ||
|
||
const manageMembersLink = screen.getByRole('link', { | ||
name: /manage members/, | ||
}) | ||
expect(manageMembersLink).toBeInTheDocument() | ||
expect(manageMembersLink).toHaveAttribute('href', '/members/gh/codecov') | ||
}) | ||
}) |
44 changes: 44 additions & 0 deletions
44
...CoverageOnboarding/ActivationBanner/PaidPlanSeatsLimitBanner/PaidPlanSeatsLimitBanner.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,44 @@ | ||
import A from 'ui/A' | ||
import Banner from 'ui/Banner' | ||
import BannerContent from 'ui/Banner/BannerContent' | ||
import BannerHeading from 'ui/Banner/BannerHeading' | ||
import Button from 'ui/Button' | ||
|
||
function PaidPlanSeatsLimitBanner() { | ||
return ( | ||
<Banner variant="plain"> | ||
<BannerContent> | ||
<BannerHeading> | ||
<h2 className="font-semibold">ℹ Seats Limit Reached</h2> | ||
</BannerHeading> | ||
<div className="flex justify-between"> | ||
<p className="pr-2"> | ||
Your organization has utilized all available seats on this plan. To | ||
add more members, please increase your seat count.{' '} | ||
<A | ||
to={{ pageName: 'membersTab' }} | ||
hook="manage-members-paid-plan" | ||
isExternal={false} | ||
> | ||
manage members | ||
</A> | ||
</p> | ||
<div className="flex items-start justify-end"> | ||
<Button | ||
hook="trial-eligible-banner-start-trial" | ||
to={{ | ||
pageName: 'upgradeOrgPlan', | ||
}} | ||
disabled={false} | ||
variant="primary" | ||
> | ||
Upgrade | ||
</Button> | ||
</div> | ||
</div> | ||
</BannerContent> | ||
</Banner> | ||
) | ||
} | ||
|
||
export default PaidPlanSeatsLimitBanner |
1 change: 1 addition & 0 deletions
1
src/pages/RepoPage/CoverageOnboarding/ActivationBanner/PaidPlanSeatsLimitBanner/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 './PaidPlanSeatsLimitBanner' |