From b48d9dd4d0bd5663a2f75ab45292196f2e2a607c Mon Sep 17 00:00:00 2001 From: Avisha Sodhi <38086281+SodhiA1@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:56:23 -0800 Subject: [PATCH] EDX-3037: Bug fix --- backend/src/components/cache-service.js | 2 +- backend/src/components/sdc/sdc.js | 7 +++++++ .../components/data-collection/IndySchoolMonitoring.vue | 6 +++--- frontend/src/utils/sdc/collectionTableConfiguration.js | 6 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/src/components/cache-service.js b/backend/src/components/cache-service.js index 36b303af..e48e1717 100644 --- a/backend/src/components/cache-service.js +++ b/backend/src/components/cache-service.js @@ -384,7 +384,7 @@ const cacheService = { return {...item, dropdownText:`${item.label}`}; }); schoolCollectionStatusCodes.forEach((statusCode => { - schoolCollectionStatusCodesMap.set(statusCode, statusCode.label); + schoolCollectionStatusCodesMap.set(statusCode.sdcSchoolCollectionStatusCode, statusCode); })); return schoolCollectionStatusCodesMap; }, diff --git a/backend/src/components/sdc/sdc.js b/backend/src/components/sdc/sdc.js index fae02c4c..64ef6ec2 100644 --- a/backend/src/components/sdc/sdc.js +++ b/backend/src/components/sdc/sdc.js @@ -66,6 +66,8 @@ async function getSdcDistrictCollectionMonitoringByCollectionId(req, res) { async function getIndySdcSchoolCollectionMonitoringByCollectionId(req, res) { try { const data = await getData(`${config.get('sdc:collectionURL')}/${req.params.collectionID}/monitorIndySdcSchoolCollections`); + let statusCodeMap = cacheService.getActiveSchoolCollectionStatusCodesMap(); + data.monitorSdcSchoolCollections = data?.monitorSdcSchoolCollections.map(school => getSchoolStatusDescription(school, statusCodeMap)); return res.status(HttpStatus.OK).json(data); } catch (e) { await logApiError(e, 'Error retrieving the indy school collection monitoring stats'); @@ -73,6 +75,11 @@ async function getIndySdcSchoolCollectionMonitoringByCollectionId(req, res) { } } +function getSchoolStatusDescription(school, statusCodeMap) { + school.schoolStatusDesc = school.schoolStatus !== null && school.schoolStatus !== '' && school.schoolStatus === 'SUBMITTED' ? 'Submitted' : statusCodeMap.get(school?.schoolStatus).label; + return school; +} + async function unsubmitSdcDistrictCollection(req, res) { try { const userInfo = utils.getUser(req); diff --git a/frontend/src/components/data-collection/IndySchoolMonitoring.vue b/frontend/src/components/data-collection/IndySchoolMonitoring.vue index 802f7963..10c41cc0 100644 --- a/frontend/src/components/data-collection/IndySchoolMonitoring.vue +++ b/frontend/src/components/data-collection/IndySchoolMonitoring.vue @@ -111,7 +111,7 @@ > - Submitted to District + Submitted @@ -353,8 +353,8 @@ export default defineComponent({ { title: 'School Status', align: 'center', - key: 'schoolStatus', - value: item => this.schoolCollectionStatusCodes.get(item.schoolStatus).label + key: 'schoolStatusDesc', + value: item => item.schoolStatusDesc }, { title: 'Unsubmit', diff --git a/frontend/src/utils/sdc/collectionTableConfiguration.js b/frontend/src/utils/sdc/collectionTableConfiguration.js index 5c4af829..b3701c9d 100644 --- a/frontend/src/utils/sdc/collectionTableConfiguration.js +++ b/frontend/src/utils/sdc/collectionTableConfiguration.js @@ -778,18 +778,18 @@ export const MONITORING = Object.freeze( ] }, submittedFilter: { - heading: 'Submitted to District', + heading: 'Submitted', id: 'submittedFilter', multiple: false, key: 'submittedFilter', filterOptions: [ { - title: 'Submitted to District', + title: 'Submitted', id: 'submittedToDistrict', value: 'submittedToDistrict' }, { - title: 'Not Submitted to District', + title: 'Not Submitted', id: 'notSubmittedToDistrict', value: 'notSubmittedToDistrict' }