diff --git a/CHANGELOG.md b/CHANGELOG.md index 590fcd929a..faf63564f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/backend/lib/excel_import/community_progress_report.ts b/app/backend/lib/excel_import/community_progress_report.ts index 6915684e12..dc64837051 100644 --- a/app/backend/lib/excel_import/community_progress_report.ts +++ b/app/backend/lib/excel_import/community_progress_report.ts @@ -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'; @@ -101,6 +102,23 @@ 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], @@ -108,7 +126,7 @@ const readSummary = async (wb, sheet_name, applicationId, reportId) => { 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, diff --git a/db/sqitch.plan b/db/sqitch.plan index 2bcefb6453..f7576e83d9 100644 --- a/db/sqitch.plan +++ b/db/sqitch.plan @@ -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 # release v1.218.0 computed_columns/application_history [computed_columns/application_history@1.213.0] 2024-11-27T23:55:47Z Rafael Solorzano <61289255+rafasdc@users.noreply.github.com> # fix username in announcement history @1.218.1 2024-12-18T17:53:16Z CCBC Service Account # release v1.218.1 +@1.218.2 2024-12-19T16:29:04Z CCBC Service Account # release v1.218.2 diff --git a/package.json b/package.json index 0e0fdb69b7..9e8d01eda1 100644 --- a/package.json +++ b/package.json @@ -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 ",