-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: Add fixes and new rules to tokenless banner show logic #3764
base: main
Are you sure you want to change the base?
Conversation
30298a8
to
8ccdef9
Compare
Bundle ReportChanges will decrease total bundle size by 1.9kB (-0.02%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-systemAssets Changed:
Files in
view changes for bundle: gazebo-production-esmAssets Changed:
Files in
|
Bundle ReportChanges will decrease total bundle size by 1.9kB (-0.02%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-staging-esmAssets Changed:
Files in
view changes for bundle: gazebo-staging-systemAssets Changed:
Files in
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3764 +/- ##
=======================================
Coverage 98.72% 98.72%
=======================================
Files 824 826 +2
Lines 14786 14818 +32
Branches 4242 4256 +14
=======================================
+ Hits 14597 14629 +32
Misses 182 182
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3764 +/- ##
=======================================
Coverage 98.72% 98.72%
=======================================
Files 824 826 +2
Lines 14786 14818 +32
Branches 4242 4256 +14
=======================================
+ Hits 14597 14629 +32
Misses 182 182
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3764 +/- ##
=======================================
Coverage 98.72% 98.72%
=======================================
Files 824 826 +2
Lines 14786 14818 +32
Branches 4250 4256 +6
=======================================
+ Hits 14597 14629 +32
Misses 182 182
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #3764 +/- ##
=======================================
Coverage 98.72% 98.72%
=======================================
Files 824 826 +2
Lines 14786 14818 +32
Branches 4250 4256 +6
=======================================
+ Hits 14597 14629 +32
Misses 182 182
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
const hasActiveRepos = ownerData?.hasActiveRepos | ||
const hasPublicRepos = ownerData?.hasPublicRepos | ||
|
||
if ( | ||
!tokenlessSection || | ||
!owner || | ||
!data || | ||
!currentUser?.user || | ||
cameFromOnboarding | ||
) | ||
cameFromOnboarding || | ||
!hasActiveRepos || | ||
!hasPublicRepos | ||
) { |
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.
this is the main change of bullet 1
// we want to show the banners again when this setting is changed | ||
// even if the user dismissed them in the past | ||
removeFromLocalStorage(MEMBER_TOKEN_NOT_REQUIRED_BANNER) | ||
removeFromLocalStorage(ADMIN_TOKEN_NOT_REQUIRED_BANNER) | ||
removeFromLocalStorage(MEMBER_TOKEN_REQUIRED_BANNER) | ||
removeFromLocalStorage(ADMIN_TOKEN_REQUIRED_BANNER) | ||
|
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.
main change of bullet 2
src/shared/GlobalTopBanners/TokenlessBanner/TokenlessBanner.tsx
Outdated
Show resolved
Hide resolved
const parsedData = RequestSchema.safeParse(res?.data) | ||
|
||
if (!parsedData.success) { | ||
return rejectNetworkError({ |
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.
can we get a test added for this failure case?
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.
lgtm! Just the one comment
Thanks for making the new hook
f47a7c1
to
282dd38
Compare
Description
Closes codecov/engineering-team#3074
Notable Changes
hasActiveRepos
andhasPublicRepos
to hide the tokenless banner if an organization does not have any active repos or does not have any public repos (which means only private)Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.