From e0c3ed11d1708580f9328b873a1ab2ec06202851 Mon Sep 17 00:00:00 2001 From: Rafael Solorzano <61289255+rafasdc@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:02:49 -0800 Subject: [PATCH 1/4] fix: correct summary rows --- .../lib/excel_import/community_progress_report.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/backend/lib/excel_import/community_progress_report.ts b/app/backend/lib/excel_import/community_progress_report.ts index 6915684e12..dc8c9ab1ca 100644 --- a/app/backend/lib/excel_import/community_progress_report.ts +++ b/app/backend/lib/excel_import/community_progress_report.ts @@ -24,11 +24,11 @@ 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; +const COMMUNITIES_IN_PLANNING_ROW = 26; +const COMMUNITIES_IN_CONSTRUCTION_ROW = 27; +const COMMUNITIES_OPERATIONAL_ROW = 28; +const OVERAL_PROJECT_STAGE_ROW = 29; +const TOTAL_NUMBER_OF_COMMUNITIES_ROW = 30; // For the community detail table const COMMUNITY_NAME_COLUMN = 'B'; From 39cde7a39eabce52f8fcaa4340c21f2a8d92c903 Mon Sep 17 00:00:00 2001 From: Rafael Solorzano <61289255+rafasdc@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:08:39 -0800 Subject: [PATCH 2/4] fix: community progress report row buffer --- .../excel_import/community_progress_report.ts | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/app/backend/lib/excel_import/community_progress_report.ts b/app/backend/lib/excel_import/community_progress_report.ts index dc8c9ab1ca..896db6c494 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 = 26; -const COMMUNITIES_IN_CONSTRUCTION_ROW = 27; -const COMMUNITIES_OPERATIONAL_ROW = 28; -const OVERAL_PROJECT_STAGE_ROW = 29; -const TOTAL_NUMBER_OF_COMMUNITIES_ROW = 30; +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,24 @@ 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']; + console.log('row', row, 'cellValue', cellValue); + 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 +127,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, @@ -273,7 +292,7 @@ const LoadCommunityReportData = async (wb, sheet_name, req) => { const validate = req.query?.validate === 'true'; const data = await readSummary(wb, sheet_name, applicationId, reportId); - + console.log('data', data); const errorList = await ValidateData(data._jsonData, applicationId, req); if (errorList.length > 0) { From 748a346f029fee8b9265b2fb4df7ad4858bf51dc Mon Sep 17 00:00:00 2001 From: Rafael Solorzano <61289255+rafasdc@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:14:50 -0800 Subject: [PATCH 3/4] chore: cleanup --- app/backend/lib/excel_import/community_progress_report.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/backend/lib/excel_import/community_progress_report.ts b/app/backend/lib/excel_import/community_progress_report.ts index 896db6c494..dc64837051 100644 --- a/app/backend/lib/excel_import/community_progress_report.ts +++ b/app/backend/lib/excel_import/community_progress_report.ts @@ -109,7 +109,6 @@ const readSummary = async (wb, sheet_name, applicationId, reportId) => { row++ ) { const cellValue = sheet[row]['C']; - console.log('row', row, 'cellValue', cellValue); if (cellValue === COMMUNITIES_IN_PLANNING_TEXT) { COMMUNITIES_IN_PLANNING_ROW = row; COMMUNITIES_IN_CONSTRUCTION_ROW = row + 1; @@ -292,7 +291,7 @@ const LoadCommunityReportData = async (wb, sheet_name, req) => { const validate = req.query?.validate === 'true'; const data = await readSummary(wb, sheet_name, applicationId, reportId); - console.log('data', data); + const errorList = await ValidateData(data._jsonData, applicationId, req); if (errorList.length > 0) { From cc8f8a1c9903cd37fe72fd48e13842148de934a8 Mon Sep 17 00:00:00 2001 From: CCBC Service Account <116113628+ccbc-service-account@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:29:05 +0000 Subject: [PATCH 4/4] chore: release v1.218.2 --- CHANGELOG.md | 7 +++++++ db/sqitch.plan | 1 + package.json | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) 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/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 ",