Skip to content

som-fix/email-management/sonarcloud-followup#5338

Open
somramnani wants to merge 6 commits into
developmentfrom
som_fix/email-management/sonarcloud-followup
Open

som-fix/email-management/sonarcloud-followup#5338
somramnani wants to merge 6 commits into
developmentfrom
som_fix/email-management/sonarcloud-followup

Conversation

@somramnani

@somramnani somramnani commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

Screenshot 2026-06-05 at 12 22 13 PM

TODO:
Fix:

  • Nested ternaries in IntegratedEmailSender.jsx
  • High Cognitive Complexity WeeklyUpdateComposer.jsx
  • Error object handling in emailTemplateActions.js
  • Unused variable in sendEmails.jsx
  • Contrast ratio issues across IntegratedEmailSender.module.css and EmailManagementShared.module.css

Related PRS (if any):

Related PR: 5112

Main changes explained:

  • /components/EmailManagement/email-sender/IntegratedEmailSender.jsx: Refactored the nested JSX ternary used for rendering variable inputs into an independent variableInput assignment with if/else logic, improving readability while preserving existing behavior.
  • /components/EmailManagement/email-sender/WeeklyUpdateComposer.jsx: Refactored YouTube link validation into a separate getYouTubeValidationError helper, reducing validateForm cognitive complexity while preserving existing validation behavior.
  • src/actions/emailTemplateActions.js: Replaced thrown object literals with proper Error instances using a shared createEmailTemplateError helper, preserving structured errors and missing details while satisfying Sonar’s error-throwing rule.
  • src/components/EmailManagement/email-sender/validation.js: Refactored template variable validation into shared rule-based helpers, removing duplicated switch logic between bulk and single-variable validation while preserving existing error messages and satisfying Sonar’s Cognitive Complexity limit.
  • src/components/EmailManagement/email-sender/IntegratedEmailSender.module.css: Updated mode button primary, success, and info colors to darker accessible variants, fixing Sonar contrast warnings for outlined and hover states while keeping the existing button styling consistent.
  • src/components/EmailManagement/EmailManagementShared.module.css: Updated the dark-mode primary outline hover background to an accessible blue, fixing Sonar’s contrast warning for white text on hover.

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. go to dashboard→ Tasks→ task→…
  6. verify function “A” (feel free to include screenshot here)
  7. verify this new feature works in dark mode

Screenshots or videos of changes:

Coming Soon

@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit ff92edc
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a2c34dbf117b40008e2a649
😎 Deploy Preview https://deploy-preview-5338--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant