Skip to content

Commit 0773ec3

Browse files
Merge branch 'development' into aayush-create-line-chart-showing-total-injuries-over-time-frontend
2 parents c542414 + 1daa453 commit 0773ec3

896 files changed

Lines changed: 107509 additions & 31140 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.

.env.development

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Development environment settings
2+
REACT_APP_APIENDPOINT="http://localhost:4500/api"
3+
SKIP_PREFLIGHT_CHECK=true
4+
DISABLE_ESLINT_PLUGIN=true
5+
REACT_APP_DEF_PWD=123Welcome!

.eslintrc.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module.exports = {
2+
ignorePatterns: ['**/*.css'],
3+
env: {
4+
browser: true,
5+
es6: true,
6+
node: true,
7+
},
8+
settings: {
9+
react: {
10+
version: 'detect',
11+
},
12+
'import/resolver': {
13+
node: {
14+
paths: ['src'],
15+
extensions: ['.js', '.jsx'],
16+
},
17+
},
18+
},
19+
extends: [
20+
'airbnb',
21+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
22+
'plugin:react-hooks/recommended',
23+
'plugin:react/jsx-runtime',
24+
'plugin:import/recommended',
25+
'prettier/react',
26+
'plugin:prettier/recommended', // use prettier as a eslint rule
27+
],
28+
globals: {
29+
Atomics: 'readonly',
30+
SharedArrayBuffer: 'readonly',
31+
},
32+
parser: 'babel-eslint',
33+
parserOptions: {
34+
ecmaFeatures: {
35+
jsx: true,
36+
},
37+
ecmaVersion: 2018,
38+
sourceType: 'module',
39+
},
40+
plugins: ['react', 'testing-library', 'prettier'],
41+
rules: {
42+
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
43+
'no-underscore-dangle': 'off',
44+
'react/prop-types': 'off',
45+
'react-hooks/exhaustive-deps': 'off',
46+
'react/jsx-key': 'off',
47+
'react/jsx-uses-react': 'off',
48+
'react/display-name': 'off',
49+
'react/no-direct-mutation-state': 'off',
50+
'react/no-unknown-property': 'off',
51+
'react/destructuring-assignment': 'off',
52+
'react/react-in-jsx-scope': 'off',
53+
'import/no-duplicates': 'off',
54+
'import/no-named-as-default': 'off',
55+
'jsx-a11y/label-has-associated-control': 'off',
56+
'jsx-a11y/no-static-element-interactions': 'off',
57+
'jsx-a11y/click-events-have-key-events': 'off',
58+
'jsx-a11y/control-has-associated-label': 'off',
59+
'no-alert': 'error',
60+
'no-console': 'error',
61+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
62+
},
63+
overrides: [
64+
{
65+
files: ['**/*.test.js', '**/*.test.jsx'],
66+
env: {
67+
jest: true,
68+
},
69+
},
70+
],
71+
};

.eslintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"rules": {
3+
"no-restricted-imports": [
4+
"error",
5+
{
6+
"patterns": [
7+
"*.css",
8+
"!*.module.css",
9+
"!index.css"
10+
]
11+
}
12+
]
13+
}
14+
}

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
concurrency:
88
group: Build and Deploy / ${{ github.ref_name == 'main' && 'Production' || 'Development' }}
99
cancel-in-progress: true
10-
jobs:
10+
jobs:
1111
# Build
1212
build:
1313
name: Build
@@ -62,4 +62,4 @@ jobs:
6262
domain: ${{ vars.SURGE_DOMAIN }}
6363
project: './build'
6464
login: ${{ secrets.SURGE_LOGIN }}
65-
token: ${{ secrets.SURGE_TOKEN }}
65+
token: ${{ secrets.SURGE_TOKEN }}

.github/workflows/pull_request_test.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,41 @@ on:
55
branches:
66
- development
77
jobs:
8+
# CSS Enforcement
9+
css-check:
10+
name: Enforce CSS Modules
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Check for disallowed .css files in changed files
19+
run: |
20+
# Get list of changed CSS files in this PR
21+
changed_files=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD | grep '\.css$' || true)
22+
23+
if [ -z "$changed_files" ]; then
24+
echo "No CSS files changed in this PR"
25+
exit 0
26+
fi
27+
28+
echo "Changed CSS files:"
29+
echo "$changed_files"
30+
31+
# Check if any of the changed files are disallowed
32+
disallowed=$(echo "$changed_files" | grep -vE '(\.module\.css$|index\.css$)' || true)
33+
34+
if [ -n "$disallowed" ]; then
35+
echo "❌ Disallowed CSS file detected! Only '.module.css' (or 'index.css') files are permitted."
36+
echo "The following files violate the CSS Module policy:"
37+
echo "$disallowed"
38+
exit 1
39+
else
40+
echo "✅ CSS Module Enforcement Check passed - all changed CSS files are valid"
41+
fi
42+
843
test:
944
runs-on: ubuntu-latest
1045
steps:
@@ -20,4 +55,4 @@ jobs:
2055
- name: Run Unit Tests for Changed Files Only
2156
run: yarn run test:changed
2257
- name: Run Lint
23-
run: yarn run lint
58+
run: yarn run lint

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@
1010

1111
# misc
1212
.DS_Store
13+
14+
# Environment files
1315
.env
1416
.env.local
17+
.env.development
1518
.env.development.local
1619
.env.test.local
1720
.env.production.local
1821

22+
23+
1924
npm-debug.log*
2025
yarn-debug.log*
2126
yarn-error.log*

.husky/pre-commit

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,25 @@
33

44
echo ""
55
echo "🛡️ Husky pre-commit hook triggered"
6+
7+
# Block plain .css files (except .module.css and index.css)
8+
for file in $(git diff --cached --name-only --diff-filter=ACM | grep '\.css$'); do
9+
case "$file" in
10+
*index.css) ;; # allow index.css
11+
*.module.css) ;; # allow module.css
12+
*)
13+
echo "$file is not allowed. Use .module.css instead."
14+
exit 1
15+
;;
16+
esac
17+
done
18+
619
echo "🛠️ Attempting to auto-fix lint issues (if possible)..."
720
echo "🔍 Running ESLint via lint-staged on staged files:"
8-
git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$' || echo "No JS/TS files staged."
21+
git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx|css)$' || echo "No JS/TS/CSS files staged."
922

1023
# Run lint-staged only if relevant files are staged
11-
if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx)$'; then
24+
if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx|css)$'; then
1225
npx lint-staged
1326
lint_exit_code=$?
1427

@@ -20,5 +33,5 @@ if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx)$'; then
2033
exit $lint_exit_code
2134
fi
2235
else
23-
echo "ℹ️ No JS/TS files to lint. Skipping lint-staged."
36+
echo "ℹ️ No JS/TS/CSS files to lint. Skipping lint-staged."
2437
fi

.stylelintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"no-duplicate-selectors": true
4+
}
5+
}

config-overrides.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line import/no-extraneous-dependencies
12
const webpack = require('webpack');
23

34
module.exports = function override(config) {

current-sonarqube-issues.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"total":1,"p":1,"ps":500,"paging":{"pageIndex":1,"pageSize":500,"total":1},"effortTotal":6,"debtTotal":6,"issues":[{"key":"AZoEIilLk3K5CKHMSVKQ","rule":"javascript:S3776","severity":"CRITICAL","component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","project":"OneCommunityGlobal_HighestGoodNetworkApp","line":19,"hash":"129ed3f25f350c79b8f03e95823214ef","textRange":{"startLine":19,"endLine":19,"startOffset":9,"endOffset":17},"flows":[{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":113,"endLine":113,"startOffset":29,"endOffset":30},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":118,"endLine":118,"startOffset":46,"endOffset":47},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":119,"endLine":119,"startOffset":28,"endOffset":29},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":125,"endLine":125,"startOffset":32,"endOffset":33},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":152,"endLine":152,"startOffset":23,"endOffset":24},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":168,"endLine":168,"startOffset":36,"endOffset":37},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":168,"endLine":168,"startOffset":22,"endOffset":24},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":180,"endLine":180,"startOffset":29,"endOffset":30},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":183,"endLine":183,"startOffset":28,"endOffset":29},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":186,"endLine":186,"startOffset":53,"endOffset":54},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":193,"endLine":193,"startOffset":28,"endOffset":29},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":196,"endLine":196,"startOffset":21,"endOffset":22},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":203,"endLine":203,"startOffset":28,"endOffset":29},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":206,"endLine":206,"startOffset":74,"endOffset":75},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":213,"endLine":213,"startOffset":66,"endOffset":67},"msg":"+1"}]},{"locations":[{"component":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","textRange":{"startLine":217,"endLine":217,"startOffset":36,"endOffset":37},"msg":"+1"}]}],"status":"OPEN","message":"Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.","effort":"6min","debt":"6min","tags":["architecture","brain-overload"],"creationDate":"2025-10-21T00:18:26+0000","updateDate":"2025-10-21T00:18:26+0000","type":"CODE_SMELL","organization":"onecommunityglobal","pullRequest":"4054","cleanCodeAttribute":"FOCUSED","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"HIGH"}],"issueStatus":"OPEN","projectName":"HighestGoodNetworkApp"}],"components":[{"organization":"onecommunityglobal","key":"OneCommunityGlobal_HighestGoodNetworkApp","uuid":"AZnF4puuDsOhetXBcabH","enabled":true,"qualifier":"TRK","name":"HighestGoodNetworkApp","longName":"HighestGoodNetworkApp","pullRequest":"4054"},{"organization":"onecommunityglobal","key":"OneCommunityGlobal_HighestGoodNetworkApp:src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","uuid":"AZnRU2j4CG59FxruBTQv","enabled":true,"qualifier":"FIL","name":"WBSTasks.jsx","longName":"src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","path":"src/components/Projects/WBS/WBSDetail/WBSTasks.jsx","pullRequest":"4054"}],"organizations":[{"key":"onecommunityglobal","name":"One Community"}],"facets":[]}

0 commit comments

Comments
 (0)