-
-
Notifications
You must be signed in to change notification settings - Fork 656
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: making banner more composable #6540
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 0 findings(s) 🚩
- Improving Code Health: 0 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 0 findings(s) 🚩
- Improving Code Health: 0 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 0 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method BannerModal.tsx: BannerModal
frontend/src/component/banners/OutdatedSdksBanner/OutdatedSdksBanner.tsx
Outdated
Show resolved
Hide resolved
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 0 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method BannerModal.tsx: BannerModal
frontend/src/component/admin/banners/BannerModal/BannerModal.tsx
Outdated
Show resolved
Hide resolved
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.
Pretty cool 🙌
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 0 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method BannerModal.tsx: BannerModal
@@ -61,7 +61,7 @@ export const BannerModal = ({ banner, open, setOpen }: IBannerModalProps) => { | |||
setLink(banner?.link || ''); | |||
setLinkText(banner?.linkText || ''); | |||
setDialogTitle(banner?.dialogTitle || ''); | |||
setDialog(banner?.dialog || ''); | |||
setDialog(typeof banner?.dialog === 'string' ? banner?.dialog : ''); |
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.
❌ Getting worse: Complex Method
BannerModal increases in cyclomatic complexity from 19 to 20, threshold = 10
Why does this problem occur?
This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.
To ignore this warning click here.
About the changes
Allowing ReactNode children in banner dialog so that we can style not just from the UI markdown but also from the application code. My current use case is listing all outdated sdks with applications using those SDKs. So I will be building double nested list with links to applications. I want to use regular styled React nodes for those.
Important files
Discussion points