Skip to content

Commit

Permalink
Merge pull request #2032 from bcgov/fix/EDX-2918
Browse files Browse the repository at this point in the history
MIN | "All Students by District" and "All Students by Independent School" Report | Issues
  • Loading branch information
SodhiA1 authored Sep 11, 2024
2 parents 1de5402 + 1edce3c commit 2cc4979
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 23 deletions.
45 changes: 30 additions & 15 deletions frontend/src/components/common/CustomTableSlice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
/>
<v-tooltip
v-else-if="column.key === 'sdcSchoolCollectionStudentStatusCode'"
:style="{ display: getSdcStudentStatusHoverText(props.item.raw['sdcSchoolCollectionStudentStatusCode'], props.item.raw['sdcSchoolCollectionStudentValidationIssues']) ? '' : 'none'}"
:style="{ display: getSdcStudentStatusHoverText(props.item.raw['sdcSchoolCollectionStudentStatusCode'], props.item.raw['sdcSchoolCollectionStudentValidationIssues']) ? '' : 'none'}"
>
<template #activator="{ props: tooltipProps }">
<v-icon
Expand All @@ -95,24 +95,34 @@
{{ getAssignedPen(props.item.raw['assignedPen']) }}
</span>
<div v-else-if="column.key === 'schoolName'">
<a
:href="schoolSafeURL(props.item.raw.schoolID, props.item.raw.sdcSchoolCollectionID)"
target="_link"
:class="{ 'disabled-link': !props.item.raw.schoolID || !props.item.raw.sdcSchoolCollectionID }"
@click="$event.stopPropagation()"
>
<span v-if="readOnly">
{{ props.item.raw['schoolName'] }}
</a>
</span>
<span v-else>
<a
:href="schoolSafeURL(props.item.raw.schoolID, props.item.raw.sdcSchoolCollectionID)"
target="_link"
:class="{ 'disabled-link': !props.item.raw.schoolID || !props.item.raw.sdcSchoolCollectionID }"
@click="$event.stopPropagation()"
>
{{ props.item.raw['schoolName'] }}
</a>
</span>
</div>
<div v-else-if="column.key === 'districtName'">
<a
:href="districtSafeURL(props.item.raw.districtID, props.item.raw.sdcDistrictCollectionID)"
target="_link"
:class="{ 'disabled-link': !props.item.raw.districtID || !props.item.raw.sdcDistrictCollectionID }"
@click="$event.stopPropagation()"
>
<span v-if="readOnly">
{{ props.item.raw['districtName'] }}
</a>
</span>
<span v-else>
<a
:href="districtSafeURL(props.item.raw.districtID, props.item.raw.sdcDistrictCollectionID)"
target="_link"
:class="{ 'disabled-link': !props.item.raw.districtID || !props.item.raw.sdcDistrictCollectionID }"
@click="$event.stopPropagation()"
>
{{ props.item.raw['districtName'] }}
</a>
</span>
</div>
<span v-else-if="column.key === 'legalName'">
{{ displayName(props.item.raw['legalFirstName'], props.item.raw['legalMiddleNames'], props.item.raw['legalLastName']) }}
Expand Down Expand Up @@ -233,6 +243,11 @@ export default {
required: true,
default: false
},
readOnly: {
type: Boolean,
required: false,
default: false
}
},
emits: ['reload', 'openStudentDetails', 'selections', 'editSelectedRow', 'loadPrevious', 'loadNext'],
data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
:reset="resetFlag"
:can-load-next="canLoadNext"
:can-load-previous="canLoadPrevious"
:read-only="readOnly"
@reload="reload"
@editSelectedRow="editStudent"
@selections="selectedStudents = $event"
Expand Down Expand Up @@ -102,7 +103,7 @@
>
<ViewStudentDetailsComponent
:selected-student-ids="studentForEdit"
:readonly="['PROVDUPES', 'DUPES_RES', 'COMPLETED'].includes(collectionObject?.collectionStatusCode) || isStudentRemoved"
:readonly="['PROVDUPES', 'DUPES_RES', 'COMPLETED'].includes(collectionObject?.collectionStatusCode) || isStudentRemoved || readOnly"
@reload-students="reloadStudentsFlag = true"
@close="closeAndLoadStudents"
/>
Expand Down Expand Up @@ -147,6 +148,12 @@ export default {
},
showExportBtn: {
type: Boolean,
required: false,
default: false
},
readOnly: {
type: Boolean,
required: false,
default: false
}
},
Expand Down Expand Up @@ -229,18 +236,22 @@ export default {
},
loadStudents() {
this.isLoading = true;
let sort = {
sdcSchoolCollectionStudentID: 'ASC'
};
if (this.indySchoolDistrictObject != null) {
const filterKey = this.indySchoolDistrictObject.type === 'indy' ? 'schoolNameNumber' : 'districtNameNumber';
this.filterSearchParams.schoolOrDistrictId = {key: filterKey, value: this.indySchoolDistrictObject.id};
if (this.indySchoolDistrictObject.type === 'district') {
sort = { sdcSchoolCollection: 'DESC' };
}
}
ApiService.apiAxios.get(`${Routes.sdc.BASE_URL}/collection/${this.collectionObject.collectionID}/students-paginated-slice?tableFormat=true`, {
params: {
pageNumber: this.pageNumber - 1,
pageSize: this.pageSize,
searchParams: omitBy(this.filterSearchParams, isEmpty),
sort: {
sdcSchoolCollectionStudentID: 'ASC'
},
sort: sort,
}
}).then(response => {
this.studentList = response.data.content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
:collection-object="collectionObject"
:indy-school-district-object="indySchoolDistrictObject"
:show-export-btn="true"
:read-only="true"
/>
</v-col>
</template>
Expand Down Expand Up @@ -114,11 +115,12 @@ export default {
let schoolItem = {
codeName: school.schoolName + ' - ' + school.mincode,
id: schoolCollection.sdcSchoolCollectionID,
mincode: school.mincode
};
this.indySchoolNames.push(schoolItem);
}
});
this.indySchoolNames = sortBy(this.indySchoolNames, ['codeName']);
this.indySchoolNames = sortBy(this.indySchoolNames, ['mincode']);
})
.catch(error => {
console.error(error);
Expand All @@ -132,11 +134,12 @@ export default {
let districtItem = {
codeName: district.name + ' - ' + district.districtNumber,
id: districtCollection.sdcDistrictCollectionID,
districtNumber: district.districtNumber
};
this.districtNames.push(districtItem);
}
});
this.districtNames = sortBy(this.districtNames, ['codeName']);
this.districtNames = sortBy(this.districtNames, ['districtNumber']);
})
.catch(error => {
console.error(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ export default {
let districtItem = {
codeName: district.name + ' - ' + district.districtNumber,
id: districtCollection.sdcDistrictCollectionID,
districtNumber: district.districtNumber
};
this.districtNames.push(districtItem);
}
});
this.districtNames = sortBy(this.districtNames, ['codeName']);
this.districtNames = sortBy(this.districtNames, ['districtNumber']);
})
.catch(error => {
console.error(error);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/sdc/collectionTableConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ export const FTE = Object.freeze(
{ title: 'Adult', key: 'isAdult', subHeader: { title: 'Grad', key: 'isGraduated' } },
{ title: 'Grade', key: 'enrolledGradeCode', subHeader: { title: 'Funding Code', key: 'mappedSchoolFunding' } },
{ title: 'Courses For Grad', key: 'mappedNoOfCourses', subHeader: { title: 'Support Blocks', key: 'supportBlocks' } },
{ title: 'Language Program', key: 'mappedLanguageEnrolledProgram', subHeader: { title: 'Years in ELL', key: 'yearsInELL' } },
{ title: 'Language Program', key: 'mappedLanguageEnrolledProgram', subHeader: { title: 'Years in ELL', key: 'yearsInEll' } },
{ title: 'Career Program', key: 'mappedCareerProgram', subHeader: { title: 'Career Code', key: 'mappedCareerProgramCode' } },
{ title: 'Indigenous Ancestry', key: 'mappedAncestryIndicator', subHeader: { title: 'Band Code', key: 'mappedBandCode' } },
{ title: 'Indigenous Support Program', key: 'mappedIndigenousEnrolledProgram', subHeader: { title: 'Inclusive Education Category', key: 'mappedSpedCode' } },
Expand Down

0 comments on commit 2cc4979

Please sign in to comment.