Skip to content

Commit

Permalink
EDX-3037: Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SodhiA1 committed Dec 3, 2024
1 parent cc26afa commit b48d9dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/src/components/cache-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
7 changes: 7 additions & 0 deletions backend/src/components/sdc/sdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ 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');
return errorResponse(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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
>
<v-card-item class="pb-0">
<v-card-title class="column-header">
Submitted to District
Submitted
</v-card-title>
</v-card-item>
<v-card-text>
Expand Down Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/utils/sdc/collectionTableConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down

0 comments on commit b48d9dd

Please sign in to comment.