Skip to content

Commit

Permalink
Merge pull request #1030 from bcgov/fix/EDX-1760
Browse files Browse the repository at this point in the history
limit grade options for schl/dist view
  • Loading branch information
mightycox authored Sep 14, 2023
2 parents 8768f4a + 7383e5b commit 02dbaa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/common/forms/SchoolDetailsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
v-if="isGradeOfferedUpdateAllowed && editing"
id="schoolGrades"
v-model="schoolDetailsCopy.grades"
:items="gradeCodes"
:items="gradeOptions"
item-title="label"
item-value="schoolGradeCode"
variant="underlined"
Expand Down Expand Up @@ -1062,6 +1062,7 @@ export default {
...mapState(instituteStore, ['provinceCodes']),
...mapState(instituteStore, ['countryCodes']),
...mapState(instituteStore, ['gradeCodes']),
...mapState(instituteStore, ['gradeOptions']),
dataReady: function () {
return this.userInfo;
},
Expand All @@ -1088,7 +1089,7 @@ export default {
},
isGradeOfferedUpdateAllowed() {
return this.school.schoolCategoryCode !== 'INDP_FNS' && this.school.schoolCategoryCode !== 'INDEPEND';
},
}
},
watch: {
schoolDetailsFormValid(value) {
Expand Down Expand Up @@ -1389,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
3 changes: 2 additions & 1 deletion frontend/src/store/modules/institute.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const instituteStore = defineStore('institute', {
activeCountryCodesGet: state => state.activeCountryCodes,
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)
regularSchoolContactTypes: state => state.schoolContactTypeCodes?.filter(type => !type.indOnly && !type.offshoreOnly),
gradeOptions: state => state.gradeCodes?.filter(grade => !['KINDHALF', 'ELEMUNGR', 'SECUNGR'].includes(grade.schoolGradeCode))
},
actions: {
async setFacilityTypeCodes(facilityTypeCodes) {
Expand Down

0 comments on commit 02dbaa5

Please sign in to comment.