Skip to content

Commit ea7c860

Browse files
Merge pull request #2033 from OneCommunityGlobal/development
Backend Release to Main [2.84]
2 parents 85fc742 + 95df6c7 commit ea7c860

140 files changed

Lines changed: 9617 additions & 3126 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.

.babelrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": [
4+
"@babel/plugin-transform-async-to-generator",
5+
[
6+
"@babel/plugin-transform-runtime",
7+
{
8+
"corejs": false,
9+
"helpers": true,
10+
"regenerator": true,
11+
"useESModules": false
12+
}
13+
],
14+
[
15+
"module-resolver",
16+
{
17+
"root": "./src"
18+
}
19+
]
20+
],
21+
"ignore": ["**/*.test.js", "**/*.spec.js", "src/test/**"]
22+
}

.eslintrc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"extends": ["eslint:recommended", "airbnb-base", "prettier"],
3+
"parser": "@babel/eslint-parser",
4+
"parserOptions": {
5+
"ecmaVersion": 8,
6+
"sourceType": "module",
7+
"requireConfigFile": false,
8+
"babelOptions": {
9+
"plugins": [
10+
[
11+
"module-resolver",
12+
{
13+
"root": ["./src"]
14+
}
15+
]
16+
]
17+
}
18+
},
19+
"env": { "es6": true, "node": true, "commonjs": true },
20+
"rules": {
21+
"global-require": "off",
22+
"func-names": "off",
23+
"no-underscore-dangle": "off",
24+
"no-param-reassign": "off",
25+
"max-len": "off",
26+
"no-continue": "warn",
27+
"no-await-in-loop": "warn",
28+
"template-curly-spacing": "off",
29+
"indent": "off",
30+
"linebreak-style": 0,
31+
"no-console": "off",
32+
"consistent-return": "off"
33+
},
34+
"settings": {
35+
"import/resolver": {
36+
"babel-module": {
37+
"root": ["./src"]
38+
},
39+
"node": {
40+
"paths": ["src"],
41+
"extensions": [".js", ".jsx"]
42+
}
43+
}
44+
},
45+
"overrides": [
46+
{
47+
"files": ["**/*.test.js", "**/*.spec.js", "src/test/*.js"],
48+
"env": {
49+
"jest": true
50+
}
51+
}
52+
]
53+
}

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ jobs:
7878
uses: actions/upload-artifact@v4
7979
with:
8080
name: backend-coverage-report
81-
path: coverage/
81+
path: coverage/

PR_DESCRIPTION.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Description
2+
Fixes issue where the "Longest Open Issues" chart was limiting results to only 7 issues when multiple projects were selected, causing some issues to be hidden. Also fixes issue numbering consistency when multiple projects are selected.
3+
4+
Fixes #4301 (Phase 2 Bugs - Priority Medium)
5+
6+
## Related PRs (if any):
7+
Related to Frontend PR: #4653
8+
To test this backend PR, you need to checkout the corresponding frontend PR branch.
9+
10+
## Main changes explained:
11+
- **Updated `bmIssueController.js`** - `getLongestOpenIssues` function:
12+
- Removed `.slice(0, 7)` limit to return all issues from selected projects instead of just top 7
13+
- Added `issueId` to response (MongoDB `_id` as string) for consistent issue identification
14+
- Added `projectId` to response to enable per-project issue numbering
15+
- Added `projectName` to response to distinguish issues across projects
16+
- Updated query to select `_id` field along with `issueTitle` and `issueDate`
17+
- Handle empty `issueTitle` arrays by returning `null` instead of `undefined`
18+
19+
## How to test:
20+
1. Checkout branch `vamsidhar-fix/issue-chart-all-issues-visible`
21+
2. Run `npm run build` to compile the changes
22+
3. Restart the backend server
23+
4. Ensure the frontend is running with the corresponding frontend PR branch
24+
5. Navigate to BMDashboard → Issues → Longest Open Issues chart
25+
6. **Test Scenario 1: Select only "Building 3"**
26+
- Should show all Building 3 issues (e.g., "Paint Peeling in Conference Room", "Issue #1", "Issue #2", "Issue #3", "Issue #4")
27+
- Verify all issues are displayed, not limited to 7
28+
7. **Test Scenario 2: Select "Building 3" and "Building 1" together**
29+
- Should show ALL issues from both projects (not limited to 7)
30+
- Should include all Building 3 issues (Issue #1, #2, #3, #4) AND all Building 1 issues
31+
- Verify no issues are missing compared to when selecting projects individually
32+
- Check backend console logs - should see: `[getLongestOpenIssues] Total issues found: X, Returning: X issues` where X is the total count (should be more than 7 for multiple projects)
33+
8. **Test Scenario 3: Select multiple projects with many issues**
34+
- Verify all issues are displayed, sorted by duration (longest first)
35+
- Check backend console logs to verify the count of issues being returned
36+
- Verify the response includes `issueId`, `projectId`, and `projectName` fields for each issue
37+
38+
## Expected behavior:
39+
- When selecting multiple projects, ALL issues from all selected projects should be visible
40+
- Issues should be sorted by duration (longest open first)
41+
- No limit on the number of issues displayed
42+
- Each issue should have a unique `issueId` for consistent identification
43+
- Response should include `projectId` and `projectName` for frontend processing
44+
45+
## Technical details:
46+
- The API endpoint `/bm/issues/longest-open` now returns all matching issues instead of limiting to 7
47+
- Response includes `issueId`, `projectId`, and `projectName` fields for frontend processing
48+
- Issues with empty `issueTitle` arrays return `null` for `issueName` (frontend will generate names)
49+
- Debug logging added to verify issue counts in console
50+
51+
## Note:
52+
This PR only includes backend changes. The frontend PR (#4653) will handle:
53+
- Using `issueId` for consistent issue numbering
54+
- Per-project issue numbering to avoid conflicts
55+
- Prefixing unnamed issues with project name when multiple projects are selected

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
useESModules: false,
1111
},
1212
],
13+
['@babel/plugin-transform-logical-assignment-operators'], // <-- needed for ||= and ??=
1314
['module-resolver', { root: './src' }],
1415
],
1516
ignore: ['**/*.test.js', '**/*.spec.js', 'src/test/**'],

git

Whitespace-only changes.

0 commit comments

Comments
 (0)