Skip to content

Commit 1cf7588

Browse files
committed
merged dev to local
2 parents 1ee403f + 843c2ca commit 1cf7588

625 files changed

Lines changed: 37135 additions & 14130 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: 20
26-
cache: 'yarn'
26+
cache: 'npm'
2727
- name: Install Dependencies
28-
run: yarn install --frozen-lockfile
28+
run: npm ci
2929
# We don't run tests here since we assume it's already done during PR process.
3030
# - name: Update Browser List
3131
# run: npx browserslist@latest --update-db
3232
- name: Build React App
33-
run: yarn run build && cp build/index.html build/200.html
33+
run: npm run build && cp build/index.html build/200.html
3434
env:
3535
NODE_ENV: ${{ github.ref_name == 'main' && 'production' || 'development' }}
3636
REACT_APP_APIENDPOINT: ${{ vars.REACT_APP_API_ENDPOINT }}

.github/workflows/pull_request_test.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ jobs:
4646
- uses: actions/checkout@v4
4747
with:
4848
fetch-depth: 0
49-
- uses: actions/setup-node@v4
50-
with:
51-
node-version: 20
52-
cache: 'yarn'
53-
- name: Install Dependencies
54-
run: yarn install --frozen-lockfile
55-
- name: Run Unit Tests for Changed Files Only
56-
run: yarn run test:changed
57-
- name: Run Lint
58-
run: yarn run lint
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: 20
52+
cache: 'yarn'
53+
- name: Enable Corepack
54+
run: corepack enable
55+
- name: Install Dependencies
56+
run: yarn install --frozen-lockfile
57+
- name: Run Unit Tests for Changed Files Only
58+
run: yarn test:changed
59+
- name: Run Lint
60+
run: yarn lint

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ jobs:
1212
- name: Checkout repository
1313
uses: actions/checkout@v3
1414

15-
- name: Set up Node.js & cache Yarn
15+
- name: Set up Node.js & cache npm
1616
uses: actions/setup-node@v4
1717
with:
1818
node-version: 20
1919
cache: yarn
2020

21+
- name: Enable Corepack
22+
run: corepack enable
23+
2124
- name: Install dependencies
22-
run: yarn install
25+
run: yarn install --frozen-lockfile
2326

2427
- name: Run tests
2528
run: yarn test

.husky/pre-commit

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ fi
1010
echo ""
1111
echo "🛡️ Husky pre-commit hook triggered"
1212

13+
if git rev-parse -q --verify MERGE_HEAD >/dev/null 2>&1; then
14+
echo "ℹ️ Merge commit detected. Skipping lint-staged auto-fix on the merged file set."
15+
exit 0
16+
fi
17+
1318
# Block plain .css files (except .module.css and index.css)
1419
for file in $(git diff --cached --name-only --diff-filter=ACM | grep '\.css$'); do
1520
case "$file" in
@@ -40,4 +45,4 @@ if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx|css)$'; then
4045
fi
4146
else
4247
echo "ℹ️ No JS/TS/CSS files to lint. Skipping lint-staged."
43-
fi
48+
fi

.husky/pre-push

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,52 @@
33
export NVM_DIR="$HOME/.nvm"
44
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
55
# Use Node 20 if available (or install if needed)
6-
if [ -f .nvmrc ]; then
6+
if command -v nvm >/dev/null 2>&1 && [ -f .nvmrc ]; then
77
nvm use 20 2>/dev/null || nvm install 20 && nvm use 20
88
fi
99

1010
. "$(dirname "$0")/_/husky.sh"
1111

12-
echo "🧪 Running tests before push..."
13-
npm run test -- --bail=1
14-
test_status=$?
12+
changed_files=$(git diff --name-only @{upstream}...HEAD 2>/dev/null)
13+
14+
if [ -z "$changed_files" ]; then
15+
echo "ℹ️ No outgoing changes to validate. Skipping pre-push checks."
16+
exit 0
17+
fi
18+
19+
if ! printf '%s\n' "$changed_files" | grep -qvE '^\.husky/'; then
20+
echo "ℹ️ Only Husky hook changes detected. Skipping full test and lint checks."
21+
exit 0
22+
fi
23+
24+
js_files=$(printf '%s\n' "$changed_files" | grep -E '\.(js|jsx|ts|tsx)$' || true)
25+
style_files=$(printf '%s\n' "$changed_files" | grep -E '\.(css|scss|sass)$' || true)
26+
27+
test_status=0
28+
lint_status=0
29+
style_status=0
30+
31+
if [ -n "$js_files" ]; then
32+
echo "🧪 Running related tests before push..."
33+
npx vitest related --run $js_files
34+
test_status=$?
35+
36+
echo "🧹 Running ESLint on changed files before push..."
37+
npx eslint $js_files
38+
lint_status=$?
39+
fi
40+
41+
if [ -n "$style_files" ]; then
42+
echo "🎨 Running Stylelint on changed files before push..."
43+
npx stylelint $style_files
44+
style_status=$?
45+
fi
1546

16-
echo "🧹 Running lint before push..."
17-
npm run lint
18-
lint_status=$?
1947

2048
# Block push if either fails
21-
if [ $test_status -ne 0 ] || [ $lint_status -ne 0 ]; then
22-
echo "❌ Push blocked: Lint or test failed."
49+
if [ $test_status -ne 0 ] || [ $lint_status -ne 0 ] || [ $style_status -ne 0 ]; then
50+
echo "❌ Push blocked: changed-file validation failed."
2351
exit 1
2452
fi
2553

26-
echo "✅ All checks passed. Proceeding with push..."
54+
echo "✅ All checks passed. Proceeding with push..."

.yarnrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Avoid stale persisted package tarballs in CI/Netlify.
2+
cache-folder "/tmp/hgn-yarn-cache"

fix-conflicts.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
const fs = require('fs');
2+
3+
const files = [
4+
'src/components/Announcements/SocialMediaComposer.module.css',
5+
'src/components/ApplicationAnalytics/jobAnalytics.module.css',
6+
'src/components/BMDashboard/AddMaterial/AddMaterial.module.css',
7+
'src/components/BMDashboard/Equipment/Update/UpdateEquipment.module.css',
8+
'src/components/BMDashboard/Issues/issueChart.module.css',
9+
'src/components/BMDashboard/Issues/issueCharts.module.css',
10+
'src/components/BMDashboard/ItemList/ItemListView.module.css',
11+
'src/components/BMDashboard/Lesson/LessonForm.module.css',
12+
'src/components/BMDashboard/LessonList/LessonCard.module.css',
13+
'src/components/BMDashboard/Projects/ProjectDetails/ProjectDetails.module.css',
14+
'src/components/BMDashboard/UtilizationChart/UtilizationChart.module.css',
15+
'src/components/BMDashboard/WeeklyProjectSummary/GroupedBarGraphInjurySeverity/InjuryCategoryBarChart.module.css',
16+
'src/components/BMDashboard/WeeklyProjectSummary/IssueBreakdownChart.module.css',
17+
'src/components/Collaboration/Collaboration.module.css',
18+
'src/components/CommunityPortal/Activities/ActivityAttendance.module.css',
19+
'src/components/CommunityPortal/Activities/activityId/ActivityComments.module.css',
20+
'src/components/EductionPortal/EvaluationResults/EvaluationResults.module.css',
21+
'src/components/EductionPortal/EvaluationResults/OverallPerformance.module.css',
22+
'src/components/EductionPortal/EvaluationResults/TeacherFeedback.module.css',
23+
'src/components/EductionPortal/StudentTasks/StudentTasks.module.css',
24+
'src/components/EductionPortal/StudentTasks/TaskDetails.module.css',
25+
'src/components/ExperienceDonutChart/ExperienceDonutChart.module.css',
26+
'src/components/Header/Header.module.css',
27+
'src/components/HGNForm/TopCommunityMembers/TopCommunityMembers.module.css',
28+
'src/components/HGNPRDashboard/ReviewersStackedBarChart/ReviewersStackedBarChart.module.css',
29+
'src/components/HGNSkillsDashboard/SkillsProfilePage/styles/ProfileDetails.module.css',
30+
'src/components/LandingPage/HelpModal.module.css',
31+
'src/components/LBDashboard/SentimentBreakdownDonutChart/SentimentBreakdownDonutChart.module.css',
32+
'src/components/MaterialSummary/MaterialSummary.module.css',
33+
'src/components/Projects/projects.module.css',
34+
];
35+
36+
function resolveKeepHead(content) {
37+
const lines = content.split('\n');
38+
const result = [];
39+
let state = 'normal';
40+
for (const line of lines) {
41+
if (line.startsWith('<<<<<<< ')) {
42+
state = 'head';
43+
} else if (line === '=======' && state === 'head') {
44+
state = 'other';
45+
} else if (line.startsWith('>>>>>>> ') && state === 'other') {
46+
state = 'normal';
47+
} else if (state !== 'other') {
48+
result.push(line);
49+
}
50+
}
51+
return result.join('\n');
52+
}
53+
54+
let count = 0;
55+
for (const f of files) {
56+
if (!fs.existsSync(f)) {
57+
console.log('NOT FOUND: ' + f);
58+
continue;
59+
}
60+
const content = fs.readFileSync(f, 'utf8');
61+
if (!content.includes('<<<<<<<')) {
62+
console.log('No conflict: ' + f);
63+
continue;
64+
}
65+
const resolved = resolveKeepHead(content);
66+
fs.writeFileSync(f, resolved, 'utf8');
67+
console.log('Fixed: ' + f);
68+
count++;
69+
}
70+
console.log('Total: ' + count);

jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ module.exports = {
2020
'react-leaflet': '<rootDir>/src/_tests_/__mocks__/react-leaflet.js',
2121
'marker-cluster-group': '<rootDir>/src/_tests_/__mocks__/react-leaflet-cluster.js',
2222
'\\.(css|less|scss|sass)$': 'identity-obj-proxy', // <-- Added to mock CSS/SCSS files
23+
// Fix for Node.js built-in modules in Node 20
24+
'^node:(.*)$': '$1',
2325
},
2426

2527
// The paths to modules that run some code to configure or set up the testing environment before each test

jsconfig.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": "src"
4-
}
3+
"baseUrl": "src",
4+
"paths": {
5+
"~/*": ["./*"]
6+
}
7+
},
8+
"include": ["src"]
59
}

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@
6464
"html-to-pdfmake": "^2.0.6",
6565
"html2canvas": "^1.4.1",
6666
"jest": "^30.2.0",
67+
"joi": "^18.1.2",
68+
"joi-browser": "^13.4.0",
6769
"jquery": "^3.7.1",
6870
"jspdf": "^4.2.1",
71+
"jspdf-autotable": "^5.0.7",
6972
"jwt-decode": "^2.2.0",
7073
"leaflet": "^1.9.4",
7174
"leaflet.heat": "^0.2.0",
@@ -79,6 +82,7 @@
7982
"object-hash": "^3.0.0",
8083
"path-browserify": "^1.0.1",
8184
"pdfmake": "^0.2.20",
85+
"plotly.js": "^3.3.1",
8286
"popper.js": "^1.16.1",
8387
"prop-types": "^15.7.2",
8488
"rc-slider": "^11.1.8",
@@ -96,11 +100,13 @@
96100
"react-leaflet": "4.2.1",
97101
"react-multi-select-component": "^4.0.2",
98102
"react-phone-input-2": "^2.14.0",
103+
"react-plotly.js": "^2.6.0",
99104
"react-redux": "^7.2.0",
100105
"react-router": "^5.3.4",
101106
"react-router-dom": "^5.2.0",
102107
"react-router-hash-link": "^2.3.1",
103108
"react-select": "^5.10.2",
109+
"react-simple-maps": "^3.0.0",
104110
"react-spinners": "^0.15.0",
105111
"react-sticky": "^6.0.3",
106112
"react-table": "^7.8.0",
@@ -125,6 +131,7 @@
125131
"tinymce": "^7.2.0",
126132
"util": "^0.12.5",
127133
"uuid": "^9.0.1",
134+
"validator": "^13.15.26",
128135
"webpack": "^5.104.1"
129136
},
130137
"resolutions": {
@@ -217,4 +224,3 @@
217224
"@rollup/rollup-darwin-arm64": "^4.54.0"
218225
}
219226
}
220-

0 commit comments

Comments
 (0)