-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Create alert for paid plans #2841
Merged
Merged
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5dcfbbe
feat: Add free plan seats alert
RulaKhaled ec14c36
feat: Create alerts for paid plan
RulaKhaled 052a665
fix: Remove repositoryDeprecated from path contents hooks (#2845)
nicholas-codecov a50e79d
Update useBranchCoverageMeasurements to use repository instead of rep…
spalmurray-codecov b1a3527
feat: Paid/Free plan seats limit banner (#2830)
RulaKhaled 6c79478
feat: Paid plans activation required banner (#2832)
RulaKhaled 9d5c1c9
Unlink PR author on pulls table (#2846)
spalmurray-codecov 8a27276
ref: Use Repository instead of RepositoryDeprecated in useCommitYaml …
spalmurray-codecov e0b313b
ref: Convert useCommitErrors to TS and remove repositoryDeprecated (#…
ajay-sentry b9982dd
feat: Route to plan if user session + to param == plan (#2837)
ajay-sentry e0b7c48
fix: Show banner for private repos only (#2853)
RulaKhaled a66c98f
fix: Footer Codecov icon displaying incorrect color (#2858)
ajay-sentry 4654184
Update useRepoSettings to move to new repository type (#2851)
rohitvinnakota-codecov f7ec56d
dep: Update to Sentry RC-1 (#2849)
nicholas-codecov 88b2e94
fix: Flaky tests around file explorer tables (#2856)
spalmurray-codecov 1e2da9f
ref: Convert SessionsTable to tanstack table (#2842)
spalmurray-codecov 87d01b7
style: Use Card component in bundle onboarding (#2861)
spalmurray-codecov 5622e04
chore: Update codecov.yml so that PR comment isn't sent until 9 uploa…
spalmurray-codecov 832a683
ref: Convert useComparisonForCommitAndParent to TS and remove reposit…
ajay-sentry 7f0acc2
feat: Add radio button navigation to repo onboarding (#2839)
spalmurray-codecov 7102eae
fix: A potential fix for the flaky test (#2854)
RulaKhaled 0c38e9c
ref: Clean up pull file explorer tests (#2852)
spalmurray-codecov 1d7f14d
components over time display name instead of id (#2868)
JerrySentry 3f7c930
style: Fix radio tile group indicator shifting on certain screen size…
spalmurray-codecov 1f10bec
ref: Remove repositoryDeprecated from usePrefetchSingleFileComp (#2870)
nicholas-codecov 235d38a
Capitlize view in free alert
RulaKhaled 35eaa12
Merge branch 'main' into alert-for-paid-plans
RulaKhaled 2707208
Merge branch 'main' into alert-for-paid-plans
RulaKhaled c2ff8d1
oops conflict stuff
RulaKhaled File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
48 changes: 48 additions & 0 deletions
48
src/pages/RepoPage/ActivationAlert/ActivationRequiredAlert/ActivationRequiredAlert.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,48 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import ActivationRequiredAlert from './ActivationRequiredAlert' | ||
|
||
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<MemoryRouter initialEntries={['/gh/codecov/gazebo/new']}> | ||
<Route path="/:provider/:owner/:repo/new">{children}</Route> | ||
</MemoryRouter> | ||
) | ||
|
||
describe('ActivationRequiredAlert', () => { | ||
it('renders the banner with correct heading', () => { | ||
render(<ActivationRequiredAlert />, { wrapper }) | ||
|
||
const bannerHeading = screen.getByRole('heading', { | ||
name: /Activation Required/, | ||
}) | ||
expect(bannerHeading).toBeInTheDocument() | ||
}) | ||
|
||
it('renders the banner with correct description', () => { | ||
render(<ActivationRequiredAlert />, { wrapper }) | ||
|
||
const description = screen.getByText( | ||
/You have available seats, but activation is needed./ | ||
) | ||
expect(description).toBeInTheDocument() | ||
}) | ||
|
||
it('renders the banner with correct link', () => { | ||
render(<ActivationRequiredAlert />, { wrapper }) | ||
|
||
const link = screen.getByRole('link', { | ||
name: /Manage members/, | ||
}) | ||
expect(link).toBeInTheDocument() | ||
expect(link).toHaveAttribute('href', '/members/gh/codecov') | ||
}) | ||
|
||
it('renders the correct img', () => { | ||
render(<ActivationRequiredAlert />, { wrapper }) | ||
|
||
const img = screen.getByAltText('Forbidden') | ||
expect(img).toBeInTheDocument() | ||
expect(img).toHaveAttribute('src', 'error-403.svg') | ||
}) | ||
}) |
24 changes: 24 additions & 0 deletions
24
src/pages/RepoPage/ActivationAlert/ActivationRequiredAlert/ActivationRequiredAlert.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,24 @@ | ||
import img403 from 'layouts/shared/NetworkErrorBoundary/assets/error-403.svg' | ||
import Button from 'ui/Button' | ||
|
||
const ActivationRequiredAlert = () => { | ||
return ( | ||
<div className="flex flex-col items-center justify-center gap-8 bg-ds-gray-primary pb-28 pt-12 text-center"> | ||
<img src={img403} alt="Forbidden" className="w-36" /> | ||
<div className="flex w-2/5 flex-col gap-1"> | ||
<h1 className="text-2xl">Activation Required</h1> | ||
<p>You have available seats, but activation is needed.</p> | ||
</div> | ||
<Button | ||
to={{ pageName: 'membersTab' }} | ||
disabled={undefined} | ||
hook={undefined} | ||
variant="primary" | ||
> | ||
Manage members | ||
</Button> | ||
</div> | ||
) | ||
} | ||
|
||
export default ActivationRequiredAlert |
1 change: 1 addition & 0 deletions
1
src/pages/RepoPage/ActivationAlert/ActivationRequiredAlert/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 './ActivationRequiredAlert' |
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
48 changes: 48 additions & 0 deletions
48
src/pages/RepoPage/ActivationAlert/PaidPlanSeatsTakenAlert/PaidPlanSeatsTakenAlert.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,48 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import PaidPlanSeatsTakenAlert from './PaidPlanSeatsTakenAlert' | ||
|
||
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<MemoryRouter initialEntries={['/gh/codecov/gazebo/new']}> | ||
<Route path="/:provider/:owner/:repo/new">{children}</Route> | ||
</MemoryRouter> | ||
) | ||
|
||
describe('PaidPlanSeatsTakenAlert', () => { | ||
it('renders the banner with correct heading', () => { | ||
render(<PaidPlanSeatsTakenAlert />, { wrapper }) | ||
|
||
const bannerHeading = screen.getByRole('heading', { | ||
name: /Seats Limit Reached/, | ||
}) | ||
expect(bannerHeading).toBeInTheDocument() | ||
}) | ||
|
||
it('renders the banner with correct description', () => { | ||
render(<PaidPlanSeatsTakenAlert />, { wrapper }) | ||
|
||
const description = screen.getByText( | ||
/Your organization has utilized all available seats on this plan/ | ||
) | ||
expect(description).toBeInTheDocument() | ||
}) | ||
|
||
it('renders the banner with correct link', () => { | ||
render(<PaidPlanSeatsTakenAlert />, { wrapper }) | ||
|
||
const link = screen.getByRole('link', { | ||
name: /Increase seat count/, | ||
}) | ||
expect(link).toBeInTheDocument() | ||
expect(link).toHaveAttribute('href', '/plan/gh/codecov/upgrade') | ||
}) | ||
|
||
it('renders the correct img', () => { | ||
render(<PaidPlanSeatsTakenAlert />, { wrapper }) | ||
|
||
const img = screen.getByAltText('Forbidden') | ||
expect(img).toBeInTheDocument() | ||
expect(img).toHaveAttribute('src', 'error-403.svg') | ||
}) | ||
}) |
36 changes: 36 additions & 0 deletions
36
src/pages/RepoPage/ActivationAlert/PaidPlanSeatsTakenAlert/PaidPlanSeatsTakenAlert.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 img403 from 'layouts/shared/NetworkErrorBoundary/assets/error-403.svg' | ||
import A from 'ui/A' | ||
import Button from 'ui/Button' | ||
|
||
const PaidPlanSeatsTakenAlert = () => { | ||
return ( | ||
<div className="flex flex-col items-center justify-center gap-8 bg-ds-gray-primary pb-28 pt-12 text-center"> | ||
<img src={img403} alt="Forbidden" className="w-36" /> | ||
<div className="flex w-2/5 flex-col gap-1"> | ||
<h1 className="text-2xl">Seats Limit Reached</h1> | ||
<p> | ||
Your organization has utilized all available seats on this plan. To | ||
add more members, please increase your seat count.{' '} | ||
<A | ||
to={{ pageName: 'membersTab' }} | ||
isExternal={false} | ||
hook="repo-page-to-members-tab" | ||
variant="semibold" | ||
> | ||
manage members | ||
</A> | ||
</p> | ||
</div> | ||
<Button | ||
to={{ pageName: 'upgradeOrgPlan' }} | ||
disabled={undefined} | ||
hook={undefined} | ||
variant="primary" | ||
> | ||
Increase seat count | ||
</Button> | ||
</div> | ||
) | ||
} | ||
|
||
export default PaidPlanSeatsTakenAlert |
1 change: 1 addition & 0 deletions
1
src/pages/RepoPage/ActivationAlert/PaidPlanSeatsTakenAlert/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 './PaidPlanSeatsTakenAlert' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be a leftover from a merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yah my bad 🏃♀️