-
-
Notifications
You must be signed in to change notification settings - Fork 40
Sohail and Anthony - BLUE SQUARE EMAIL AUTOMATION #1788
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
Merged
one-community
merged 13 commits into
development
from
Anthony-BlueSquare-Email-Automation
Jan 9, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
cc7092c
refactor: Email case automation with lots of fixes and adjustments
AnthonyWeathers c35c0de
feat: implement robust email threading
sohailuddinsyed 8b4764f
refactor: finalize email threading logic and enforce safe testing par…
sohailuddinsyed 6d0bd8c
Update test email configuration values
sohailuddinsyed 5d8664b
Merge branch 'development' into Anthony-BlueSquare-Email-Automation
sohailuddinsyed 3bed1f2
fix: Remove duplicate code block in userHelper.js
sohailuddinsyed 667e108
test: add coverage for timeUtils, objectUtils, emailModels, and email…
sohailuddinsyed 449c9b5
test: add Pacific timezone coverage for time utilities
sohailuddinsyed c7b7be3
fix: Resolve potential vulnerabilities suggested by copilot
sohailuddinsyed 1587c09
Merge pull request #1978 from OneCommunityGlobal/development
one-community 12ddadb
Merge pull request #1985 from OneCommunityGlobal/development
one-community ce6e823
fix: resolve merge conflicts in userHelper.js and connection error in…
sohailuddinsyed f996313
Merge branch 'development' into Anthony-BlueSquare-Email-Automation
sohailuddinsyed 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| echo "✅ Husky pre-commit is running..." | ||
| npx lint-staged --allow-empty | ||
|
|
||
|
|
||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| const userHelperFactory = require('../userHelper'); | ||
|
|
||
| const { getInfringementEmailBody } = userHelperFactory(); | ||
|
|
||
| describe('getInfringementEmailBody', () => { | ||
| const baseAdministrativeContent = { | ||
| startDate: '1-1-2023', | ||
| role: 'Core Team', | ||
| userTitle: 'Volunteer', | ||
| historyInfringements: 'History snapshot', | ||
| }; | ||
|
|
||
| it('returns default messaging when timeRemaining is undefined', () => { | ||
| const infringement = { | ||
| date: '2025-01-05', | ||
| description: 'Should not be used because the time off body is provided', | ||
| }; | ||
|
|
||
| const result = getInfringementEmailBody( | ||
| 'Jane', | ||
| 'Doe', | ||
| infringement, | ||
| 3, | ||
| undefined, | ||
| null, | ||
| '<span>Approved time off</span>', | ||
| baseAdministrativeContent, | ||
| ); | ||
|
|
||
| expect(result).toContain('This action usually includes removal from our team though'); | ||
| expect(result).toContain('This is your <b>3rd</b> blue square of 5.'); | ||
| expect(result).toContain('<span>Approved time off</span>'); | ||
| }); | ||
|
|
||
| it('highlights critical phrases and calculates owed hours when time remaining exists', () => { | ||
| const infringement = { | ||
| date: '2025-02-09', | ||
| description: | ||
| 'System auto-assigned infringement for two reasons: not meeting weekly volunteer time commitment as well as not submitting a weekly summary. In the week starting Sunday details. You logged 4 hours.', | ||
| }; | ||
|
|
||
| const result = getInfringementEmailBody( | ||
| 'John', | ||
| 'Smith', | ||
| infringement, | ||
| 6, | ||
| 4, | ||
| 1, | ||
| undefined, | ||
| baseAdministrativeContent, | ||
| 10, | ||
| ); | ||
|
|
||
| expect(result).toContain( | ||
| '<p><b>Total Infringements:</b> This is your <b>6th</b> blue square of 5 and that means you have 1 hour(s) added', | ||
| ); | ||
| expect(result).toContain( | ||
| '<b>not meeting weekly volunteer time commitment as well as not submitting a weekly summary</b>', | ||
| ); | ||
| expect(result).toContain('logged <b>4 hours</b>'); | ||
| expect(result).toContain('Please complete ALL owed time this week (15 hours)'); | ||
| }); | ||
|
|
||
| it('wraps plain descriptions in bold tags when no keywords match', () => { | ||
| const infringement = { | ||
| date: '2025-03-01', | ||
| description: 'Missed posting weekly update', | ||
| }; | ||
|
|
||
| const result = getInfringementEmailBody( | ||
| 'Alex', | ||
| 'Lee', | ||
| infringement, | ||
| 2, | ||
| 1, | ||
| 0, | ||
| undefined, | ||
| baseAdministrativeContent, | ||
| 5, | ||
| ); | ||
|
|
||
| expect(result).toContain('<b>Missed posting weekly update<b>'); | ||
| }); | ||
|
|
||
| it('formats editing infringement details to emphasize the edit count', () => { | ||
| const infringement = { | ||
| date: '2025-04-07', | ||
| description: | ||
| 'System auto-assigned infringement for editing your time entries <3> times. Additional supporting details.', | ||
| }; | ||
|
|
||
| const result = getInfringementEmailBody( | ||
| 'Evan', | ||
| 'Taylor', | ||
| infringement, | ||
| 6, | ||
| 2, | ||
| 0, | ||
| undefined, | ||
| baseAdministrativeContent, | ||
| 8, | ||
| ); | ||
|
|
||
| expect(result).toContain('time entries <b>3 times</b>'); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.