som-fix/email-management/sonarcloud-followup#5338
Open
somramnani wants to merge 6 commits into
Open
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…Cognitive Complexity
|
…le.css and EmailManagementShared.module.css
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Description
TODO:
Fix:
IntegratedEmailSender.jsxWeeklyUpdateComposer.jsxemailTemplateActions.jssendEmails.jsxIntegratedEmailSender.module.cssandEmailManagementShared.module.cssRelated 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 duplicatedswitchlogic 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:
npm installand...to run this PR locallyScreenshots or videos of changes:
Coming Soon