From 7f92cc9afce21d74f688a5bcf3fcae638808d3e9 Mon Sep 17 00:00:00 2001 From: KentoHyono Date: Tue, 21 Jan 2025 11:39:26 -0800 Subject: [PATCH 1/5] Working on 3240 --- .../src/components/Batch/Forms/FormInputs/SchoolInput.vue | 2 +- frontend/src/components/Common/SchoolDetailsDialog.vue | 7 +++---- frontend/src/store/modules/app.js | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue b/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue index 96997989..207835b5 100644 --- a/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue +++ b/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue @@ -67,7 +67,7 @@
School Category: - {{ item.info.schoolCategoryCode }} + {{ item.info.schoolCategoryCode }}
{{ item }}
diff --git a/frontend/src/components/Common/SchoolDetailsDialog.vue b/frontend/src/components/Common/SchoolDetailsDialog.vue index fb08db8a..989be01d 100644 --- a/frontend/src/components/Common/SchoolDetailsDialog.vue +++ b/frontend/src/components/Common/SchoolDetailsDialog.vue @@ -31,9 +31,8 @@
School Category {{ - getInstituteCategoryByCode(school.schoolCategoryCode)?.legacyCode - }} {{ school.schoolCategoryCode }} + > + {{ getCategoryNameByCode(school.schoolCategoryCode) }}
Issue Transcripts code === categoryCode.schoolCategoryCode ); }, + getCategoryNameByCode: (state) => { + return (code) => this.getInstituteAddressTypeCode(state) + " - " + code + }, getInstituteFacilityCodes: (state) => state.instituteFacilityCodes, getInstituteFacilityCode: (state) => { return (code) => From b519d41e4375f0438825ba2c945ff71faf269e55 Mon Sep 17 00:00:00 2001 From: KentoHyono Date: Tue, 21 Jan 2025 12:13:20 -0800 Subject: [PATCH 2/5] Working on 3240 --- frontend/src/components/Common/SchoolDetailsDialog.vue | 9 ++++++--- frontend/src/store/modules/app.js | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/Common/SchoolDetailsDialog.vue b/frontend/src/components/Common/SchoolDetailsDialog.vue index 989be01d..8e65bf6e 100644 --- a/frontend/src/components/Common/SchoolDetailsDialog.vue +++ b/frontend/src/components/Common/SchoolDetailsDialog.vue @@ -31,8 +31,10 @@
School Category - {{ getCategoryNameByCode(school.schoolCategoryCode) }} + >{{ + getInstituteCategoryByCode(school.schoolCategoryCode)?.legacyCode + }} {{ school.schoolCategoryCode }} + {{ console.log(getSchoolCategoryDisplayByCode(school.schoolCategoryCode)) }}
Issue Transcripts code === categoryCode.schoolCategoryCode ); }, - getCategoryNameByCode: (state) => { - return (code) => this.getInstituteAddressTypeCode(state) + " - " + code + getSchoolCategoryDisplayByCode: (state) => { + return (code) => + state.instituteCategoryCodes.find( + (categoryCode) => code === categoryCode.schoolCategoryCode + ); }, getInstituteFacilityCodes: (state) => state.instituteFacilityCodes, getInstituteFacilityCode: (state) => { From 472a86038c51e4c6660bd8d9d601f3921667991c Mon Sep 17 00:00:00 2001 From: KentoHyono Date: Tue, 21 Jan 2025 12:27:02 -0800 Subject: [PATCH 3/5] Added school category legacy code to the display for batch jobs to make them consistent --- .../src/components/Batch/Forms/FormInputs/SchoolInput.vue | 4 ++-- frontend/src/components/Common/SchoolDetailsDialog.vue | 8 ++------ frontend/src/store/modules/app.js | 6 ++++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue b/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue index 207835b5..16d6ca84 100644 --- a/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue +++ b/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue @@ -67,7 +67,7 @@
School Category: - {{ item.info.schoolCategoryCode }}
{{ item }}
+ {{ getInstituteCategoryDisplayByCode(item.info.schoolCategoryCode) }}
@@ -216,7 +216,7 @@ export default { }, computed: { - ...mapState(useAppStore, ["getSchoolsList", "getSchoolById"]), + ...mapState(useAppStore, ["getSchoolsList", "getSchoolById", "getInstituteCategoryDisplayByCode"]), isEmpty() { return this.students.length > 0; }, diff --git a/frontend/src/components/Common/SchoolDetailsDialog.vue b/frontend/src/components/Common/SchoolDetailsDialog.vue index 8e65bf6e..3ce0838f 100644 --- a/frontend/src/components/Common/SchoolDetailsDialog.vue +++ b/frontend/src/components/Common/SchoolDetailsDialog.vue @@ -31,10 +31,7 @@
School Category {{ - getInstituteCategoryByCode(school.schoolCategoryCode)?.legacyCode - }} {{ school.schoolCategoryCode }} - {{ console.log(getSchoolCategoryDisplayByCode(school.schoolCategoryCode)) }} + >{{ getInstituteCategoryDisplayByCode(school.schoolCategoryCode) }}
Issue Transcripts code === categoryCode.schoolCategoryCode ); }, - getSchoolCategoryDisplayByCode: (state) => { + getInstituteCategoryDisplayByCode: (state) => { return (code) => state.instituteCategoryCodes.find( (categoryCode) => code === categoryCode.schoolCategoryCode - ); + )?.legacyCode + + " - " + + code; }, getInstituteFacilityCodes: (state) => state.instituteFacilityCodes, getInstituteFacilityCode: (state) => { From 6fb2a338a0760f37a1b6df20b24d0c50962f5a71 Mon Sep 17 00:00:00 2001 From: KentoHyono Date: Tue, 21 Jan 2025 16:02:12 -0800 Subject: [PATCH 4/5] Made it legacyCode - label instead of legacyCode - code --- .../src/components/Batch/Forms/FormInputs/SchoolInput.vue | 4 ++-- frontend/src/components/Common/SchoolDetailsDialog.vue | 4 ++-- frontend/src/store/modules/app.js | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue b/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue index 16d6ca84..5d76b8b8 100644 --- a/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue +++ b/frontend/src/components/Batch/Forms/FormInputs/SchoolInput.vue @@ -67,7 +67,7 @@
School Category: - {{ getInstituteCategoryDisplayByCode(item.info.schoolCategoryCode) }} + {{ displaySchoolCategoryCode(item.info.schoolCategoryCode) }}
@@ -216,7 +216,7 @@ export default { }, computed: { - ...mapState(useAppStore, ["getSchoolsList", "getSchoolById", "getInstituteCategoryDisplayByCode"]), + ...mapState(useAppStore, ["getSchoolsList", "getSchoolById", "displaySchoolCategoryCode"]), isEmpty() { return this.students.length > 0; }, diff --git a/frontend/src/components/Common/SchoolDetailsDialog.vue b/frontend/src/components/Common/SchoolDetailsDialog.vue index 3ce0838f..01b1980c 100644 --- a/frontend/src/components/Common/SchoolDetailsDialog.vue +++ b/frontend/src/components/Common/SchoolDetailsDialog.vue @@ -31,7 +31,7 @@
School Category {{ getInstituteCategoryDisplayByCode(school.schoolCategoryCode) }} + >{{ displaySchoolCategoryCode(school.schoolCategoryCode) }}
Issue Transcripts code === categoryCode.schoolCategoryCode ); }, - getInstituteCategoryDisplayByCode: (state) => { + displaySchoolCategoryCode: (state) => { return (code) => state.instituteCategoryCodes.find( (categoryCode) => code === categoryCode.schoolCategoryCode )?.legacyCode + " - " + - code; + state.instituteCategoryCodes.find( + (categoryCode) => code === categoryCode.schoolCategoryCode + )?.label }, getInstituteFacilityCodes: (state) => state.instituteFacilityCodes, getInstituteFacilityCode: (state) => { From f1ec3f325defc2ecc216fb33473e0d906c5a9b55 Mon Sep 17 00:00:00 2001 From: KentoHyono Date: Tue, 21 Jan 2025 16:11:57 -0800 Subject: [PATCH 5/5] Simplified function --- frontend/src/store/modules/app.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/frontend/src/store/modules/app.js b/frontend/src/store/modules/app.js index f784e370..29edfc15 100644 --- a/frontend/src/store/modules/app.js +++ b/frontend/src/store/modules/app.js @@ -44,15 +44,12 @@ export const useAppStore = defineStore("app", { (categoryCode) => code === categoryCode.schoolCategoryCode ); }, - displaySchoolCategoryCode: (state) => { - return (code) => - state.instituteCategoryCodes.find( - (categoryCode) => code === categoryCode.schoolCategoryCode - )?.legacyCode - + " - " + - state.instituteCategoryCodes.find( - (categoryCode) => code === categoryCode.schoolCategoryCode - )?.label + displaySchoolCategoryCode: (state) => (code) => { + const categoryCode = state.instituteCategoryCodes.find( + (categoryCode) => code === categoryCode.schoolCategoryCode + ) + + return categoryCode?.legacyCode + " - " + categoryCode?.label }, getInstituteFacilityCodes: (state) => state.instituteFacilityCodes, getInstituteFacilityCode: (state) => {