Skip to content

Commit

Permalink
move grade options creation to institute module
Browse files Browse the repository at this point in the history
  • Loading branch information
Eckerman authored and Eckerman committed Sep 14, 2023
1 parent 36e41b8 commit 7383e5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 1 addition & 12 deletions frontend/src/components/common/forms/SchoolDetailsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1089,17 +1089,6 @@ export default {
},
isGradeOfferedUpdateAllowed() {
return this.school.schoolCategoryCode !== 'INDP_FNS' && this.school.schoolCategoryCode !== 'INDEPEND';
},
gradeOptions(){
const gradeOptionList = [];
for (let i=0; i < this.gradeCodes.length; i++){
if((this.school.schoolCategoryCode !== 'INDP_FNS' && this.school.schoolCategoryCode !== 'INDEPEND' && this.gradeCodes[i].schoolGradeCode === 'KINDHALF') ||
(this.gradeCodes[i].schoolGradeCode === 'ELEMUNGR' || this.gradeCodes[i].schoolGradeCode === 'SECUNGR')){
continue;
}
gradeOptionList.push(this.gradeCodes[i]);
}
return gradeOptionList;
}
},
watch: {
Expand Down Expand Up @@ -1401,7 +1390,7 @@ export default {
sortGrades() {
const gradeList = [];
for (const grade of this.schoolGradeTypes) {
if (this.schoolDetailsCopy.grades.find((rawGrade) => rawGrade.schoolGradeCode === grade.schoolGradeCode)) {
if (this.schoolDetailsCopy.grades.find((rawGrade) => rawGrade.schoolGradeCode === grade.schoolGradeCode )) {
gradeList.push(grade);
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/modules/institute.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const instituteStore = defineStore('institute', {
independentAuthoritySchoolContacts: state => state.schoolContactTypeCodes?.filter(type => !type.offshoreOnly),
offshoreSchoolContacts: state => state.schoolContactTypeCodes?.filter(type => !type.indOnly),
regularSchoolContactTypes: state => state.schoolContactTypeCodes?.filter(type => !type.indOnly && !type.offshoreOnly),
gradeOptions: state => state.gradeCodes.filter(grade => !['KINDHALF', 'ELEMENUNGR', 'SECUNGR'].includes(grade) )
gradeOptions: state => state.gradeCodes?.filter(grade => !['KINDHALF', 'ELEMUNGR', 'SECUNGR'].includes(grade.schoolGradeCode))
},
actions: {
async setFacilityTypeCodes(facilityTypeCodes) {
Expand Down

0 comments on commit 7383e5b

Please sign in to comment.