Skip to content
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

fix: correct summary rows for community progress report #3712

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.218.2](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.218.1...v1.218.2) (2024-12-19)

### Bug Fixes

- community progress report row buffer ([39cde7a](https://github.com/bcgov/CONN-CCBC-portal/commit/39cde7a39eabce52f8fcaa4340c21f2a8d92c903))
- correct summary rows ([e0c3ed1](https://github.com/bcgov/CONN-CCBC-portal/commit/e0c3ed11d1708580f9328b873a1ab2ec06202851))

## [1.218.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.218.0...v1.218.1) (2024-12-18)

### Bug Fixes
Expand Down
30 changes: 24 additions & 6 deletions app/backend/lib/excel_import/community_progress_report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ query getCcbcNumber($_rowId: Int!) {

// For the summary table
const TOTALS_COLUMN = 'G';
const COMMUNITIES_IN_PLANNING_ROW = 27;
const COMMUNITIES_IN_CONSTRUCTION_ROW = 28;
const COMMUNITIES_OPERATIONAL_ROW = 29;
const OVERAL_PROJECT_STAGE_ROW = 30;
const TOTAL_NUMBER_OF_COMMUNITIES_ROW = 31;
let COMMUNITIES_IN_PLANNING_ROW = 25;
let COMMUNITIES_IN_CONSTRUCTION_ROW = 27;
let COMMUNITIES_OPERATIONAL_ROW = 28;
let OVERALL_PROJECT_STAGE_ROW = 29;
let TOTAL_NUMBER_OF_COMMUNITIES_ROW = 30;
const COMMUNITIES_IN_PLANNING_TEXT = 'Number of Communities in Planning';

// For the community detail table
const COMMUNITY_NAME_COLUMN = 'B';
Expand Down Expand Up @@ -101,14 +102,31 @@ const readSummary = async (wb, sheet_name, applicationId, reportId) => {
}
}

// find number of communities in planning
for (
let row = COMMUNITIES_IN_PLANNING_ROW - 5;
row <= COMMUNITIES_IN_PLANNING_ROW + 5;
row++
) {
const cellValue = sheet[row]['C'];
if (cellValue === COMMUNITIES_IN_PLANNING_TEXT) {
COMMUNITIES_IN_PLANNING_ROW = row;
COMMUNITIES_IN_CONSTRUCTION_ROW = row + 1;
COMMUNITIES_OPERATIONAL_ROW = row + 2;
OVERALL_PROJECT_STAGE_ROW = row + 3;
TOTAL_NUMBER_OF_COMMUNITIES_ROW = row + 4;
break;
}
}

const jsonData = {
numberOfCommunitiesInPlanning:
sheet[COMMUNITIES_IN_PLANNING_ROW][TOTALS_COLUMN],
numberOfCommunitiesInConstruction:
sheet[COMMUNITIES_IN_CONSTRUCTION_ROW][TOTALS_COLUMN],
numberOfCommunitiesOperational:
sheet[COMMUNITIES_OPERATIONAL_ROW][TOTALS_COLUMN],
overallProjectStage: sheet[OVERAL_PROJECT_STAGE_ROW][TOTALS_COLUMN],
overallProjectStage: sheet[OVERALL_PROJECT_STAGE_ROW][TOTALS_COLUMN],
totalNumberOfCommunities:
sheet[TOTAL_NUMBER_OF_COMMUNITIES_ROW][TOTALS_COLUMN],
communityData: result,
Expand Down
1 change: 1 addition & 0 deletions db/sqitch.plan
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,4 @@ tables/application_dependencies_001_add_applicant_insert 2024-12-09T22:35:13Z Ra
@1.218.0 2024-12-10T21:09:25Z CCBC Service Account <[email protected]> # release v1.218.0
computed_columns/application_history [computed_columns/[email protected]] 2024-11-27T23:55:47Z Rafael Solorzano <[email protected]> # fix username in announcement history
@1.218.1 2024-12-18T17:53:16Z CCBC Service Account <[email protected]> # release v1.218.1
@1.218.2 2024-12-19T16:29:04Z CCBC Service Account <[email protected]> # release v1.218.2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CONN-CCBC-portal",
"version": "1.218.1",
"version": "1.218.2",
"main": "index.js",
"repository": "https://github.com/bcgov/CONN-CCBC-portal.git",
"author": "Romer, Meherzad CITZ:EX <[email protected]>",
Expand Down
Loading