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

EDX-3037: Bug fix #2136

Merged
merged 1 commit into from
Dec 3, 2024
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
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
Loading