Skip to content

Commit

Permalink
Merge branch 'master' into feature/edx-2828
Browse files Browse the repository at this point in the history
  • Loading branch information
SodhiA1 committed Sep 13, 2024
2 parents 8014f6b + 08fafff commit 02b2576
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
5 changes: 4 additions & 1 deletion backend/src/components/ministrySDCReports.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { logApiError, errorResponse, getData } = require('./utils');
const config = require('../config/index');
const HttpStatus = require('http-status-codes');
let reportTypes = ['indy-inclusive-ed-enrollment-headcounts', 'school-enrollment-headcounts', 'indy-school-enrollment-headcounts', 'school-address-report', 'fsa-registration-report',
'offshore-enrollment-headcounts', 'offshore-languages-headcounts', 'indy-inclusive-ed-funding-headcounts', 'inclusive-education-variance-headcounts'];
'offshore-enrollment-headcounts', 'offshore-languages-headcounts', 'indy-inclusive-ed-funding-headcounts', 'indy-funding-report', 'online-indy-funding-report', 'non-graduated-adult-indy-funding-report'];

async function getMinistrySDCReport(req, res) {
try {
Expand Down Expand Up @@ -50,6 +50,9 @@ function getFileDetails(reportType) {
'offshore-enrollment-headcounts': { filename: 'OffshoreSchoolsHeadcounts.csv', contentType: 'text/csv' },
'offshore-languages-headcounts': { filename: 'OffshoreSpokenLanguageHeadcounts.csv', contentType: 'text/csv' },
'indy-inclusive-ed-funding-headcounts': { filename: 'IndependentSchoolsInclusiveEdFundingHeadcounts.csv', contentType: 'text/csv' },
'indy-funding-report': { filename: 'IndependentSchoolsFundingReportStandardStudent.csv', contentType: 'text/csv' },
'online-indy-funding-report': { filename: 'IndependentSchoolsFundingReportOnlineLearning.csv', contentType: 'text/csv' },
'non-graduated-adult-indy-funding-report': { filename: 'IndependentSchoolsFundingReportNonGraduatedAdult.csv', contentType: 'text/csv' },
'DEFAULT': { filename: 'download.pdf', contentType: 'application/pdf' }
};
return mappings[reportType] || mappings['DEFAULT'];
Expand Down
6 changes: 4 additions & 2 deletions backend/src/components/sdc/sdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ async function getSDCSchoolCollectionStudentPaginatedSlice(req, res) {
if (e?.status === 404) {
res.status(HttpStatus.OK).json(null);
} else {
await logApiError(e, 'Error getting sdc school collection student paginated list');
await logApiError(e, 'Error getting sdc school collection student paginated slice list');
return errorResponse(res);
}
}
Expand Down Expand Up @@ -310,7 +310,9 @@ function createSchoolOrDistrictCriteria(searchParams) {
function createTabFilter(searchParams) {
let searchCriteriaList = [];
let tableKey = 'sdcStudentEnrolledProgramEntities.enrolledProgramCode';

if (searchParams.label === 'NOT_DELETED') {
searchCriteriaList.push({ key: 'sdcSchoolCollectionStudentStatusCode', operation: FILTER_OPERATION.NOT_IN, value: 'DELETED', valueType: VALUE_TYPE.STRING, condition: CONDITION.AND });
}
if (searchParams.label === 'FRENCH_PR') {
searchCriteriaList.push({ key: tableKey, operation: FILTER_OPERATION.IN, value: '05,08,11,14', valueType: VALUE_TYPE.STRING, condition: CONDITION.AND });
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/data-collection/ReportSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</v-row>

<v-row
v-if="displayAllStudents || reportData !== null"
v-if="(reportData !== null || displayAllStudents) && selectedReport?.url"
no-gutters
>
<v-col>
Expand All @@ -49,7 +49,7 @@
<Spinner />
</v-col>
</v-row>
<v-row v-if="!displayAllStudents && reportData !== null">
<v-row v-if="!displayAllStudents && reportData !== null && selectedReport?.url">
<v-col>
<v-data-table
id="dataTable"
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,19 @@ export const SDC_REPORTS = Object.freeze(
{
label: 'Refugee Enroled Headcounts and FTEs',
csvDownloadURL: object.SDC_MINISTRY_REPORTS + '/download/headcount/refugee-enrolment-fte-headcounts/'
}
},
{
label: 'Independent School Funding Report - Standard Student',
csvDownloadURL: object.SDC_MINISTRY_REPORTS + '/download/headcount/indy-funding-report/'
},
{
label: 'Independent School Funding Report - Online Learning',
csvDownloadURL: object.SDC_MINISTRY_REPORTS + '/download/headcount/online-indy-funding-report/'
},
{
label: 'Independent School Funding Report - Non Graduated Adult',
csvDownloadURL: object.SDC_MINISTRY_REPORTS + '/download/headcount/non-graduated-adult-indy-funding-report/'
},
]
}
);
Expand Down
34 changes: 32 additions & 2 deletions frontend/src/utils/sdc/collectionTableConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,32 @@ export const WARNING_FILTER = Object.freeze(
}
);

export const WARNING_FILTER_REPORTS = Object.freeze(
{
heading: 'Student Status',
id: 'warnings',
multiple: true,
key: 'warnings',
filterOptions: [
{
title: 'Has Funding Warnings',
id: 'hasFundingWarning',
value: 'FUNDWARN'
},
{
title: 'Has Info Warnings',
id: 'hasInfoWarning',
value: 'INFOWARN'
},
{
title: 'Has Errors',
id: 'hasErrors',
value: 'ERROR'
}
]
}
);

export const STUDENT_TYPE_FILTER = Object.freeze(
{
heading: 'Student Type',
Expand Down Expand Up @@ -949,7 +975,9 @@ export const FTE = Object.freeze(

export const FTE_DISTRICT = Object.freeze(
{
defaultFilter: { label: 'NOT_DELETED', description: 'Student is not deleted' },
tableHeaders: [
{ key: 'sdcSchoolCollectionStudentStatusCode' },
{ title: 'District', key: 'districtName' },
{ title: 'School', key: 'schoolName' },
{ title: 'Assigned PEN', key: 'assignedPen', subHeader: { title: 'Local ID', key: 'localID' } },
Expand All @@ -968,7 +996,7 @@ export const FTE_DISTRICT = Object.freeze(
{ title: 'Grade Enrolment & FTE per School', endpoint:'grade-enrollment'}
],
allowedFilters: {
warnings: WARNING_FILTER,
warnings: WARNING_FILTER_REPORTS,
studentType: STUDENT_TYPE_FILTER,
fte: FTE_FILTER,
grade: GRADE_FILTER,
Expand Down Expand Up @@ -1046,7 +1074,9 @@ export const FTE_DISTRICT = Object.freeze(

export const FTE_SCHOOL = Object.freeze(
{
defaultFilter: { label: 'NOT_DELETED', description: 'Student is not deleted' },
tableHeaders: [
{ key: 'sdcSchoolCollectionStudentStatusCode' },
{ title: 'School', key: 'schoolName' },
{ title: 'Assigned PEN', key: 'assignedPen', subHeader: { title: 'Local ID', key: 'localID' } },
{ title: 'Legal Surname, Given (Middle)', key: 'legalName', subHeader: { title: 'Usual Surname, Given (Middle)', key: 'usualName' } },
Expand All @@ -1064,7 +1094,7 @@ export const FTE_SCHOOL = Object.freeze(
{ title: 'Grade Enrolment & FTE per School', endpoint:'grade-enrollment'}
],
allowedFilters: {
warnings: WARNING_FILTER,
warnings: WARNING_FILTER_REPORTS,
studentType: STUDENT_TYPE_FILTER,
fte: FTE_FILTER,
grade: GRADE_FILTER,
Expand Down

0 comments on commit 02b2576

Please sign in to comment.