From 2cdb35fef9d2d5eb76e869821bd9bcd7e779037d Mon Sep 17 00:00:00 2001 From: mightycox Date: Thu, 21 Sep 2023 16:31:05 -0700 Subject: [PATCH] EDX-1824 - Adds No Code option for school funding codes, and removes for program codes - Adds No code placeholder for program codes --- frontend/src/components/sdcCollection/StepTwoValidateData.vue | 2 ++ frontend/src/store/modules/sdcCollection.js | 2 +- frontend/src/utils/sdc/sdcValidationFieldMappings.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/sdcCollection/StepTwoValidateData.vue b/frontend/src/components/sdcCollection/StepTwoValidateData.vue index c53acab23..f0cf68968 100644 --- a/frontend/src/components/sdcCollection/StepTwoValidateData.vue +++ b/frontend/src/components/sdcCollection/StepTwoValidateData.vue @@ -616,6 +616,8 @@ item-title="dropdownText" :label="SDC_VALIDATION_FIELD_MAPPINGS[field].label" multiple + placeholder="No Program Codes" + :persistent-placeholder="true" :selectable="() => sdcSchoolCollectionStudentDetailCopy[SDC_VALIDATION_FIELD_MAPPINGS[field].key].length < 8" @update:model-value="syncWithEnrolledProgramCodeOnUserInput" @update:focused="onFieldClick(SDC_VALIDATION_FIELD_MAPPINGS[field]?.key, $event, issue?.validationIssueSeverityCode)" diff --git a/frontend/src/store/modules/sdcCollection.js b/frontend/src/store/modules/sdcCollection.js index 7f6a06ad1..90bc129fe 100644 --- a/frontend/src/store/modules/sdcCollection.js +++ b/frontend/src/store/modules/sdcCollection.js @@ -72,7 +72,6 @@ export const useSdcCollectionStore = defineStore('sdcCollection', { this.enrolledProgramCodes = enrolledProgramCodes.map(item => { return {...item, dropdownText: `${item.enrolledProgramCode} - ${item.label}`}; }); - this.enrolledProgramCodes.push({'enrolledProgramCode': '', 'dropdownText': 'No Program Code'}); this.enrolledProgramCodesMap = new Map(); enrolledProgramCodes.forEach(enrolledProgramCode => { this.enrolledProgramCodesMap.set(enrolledProgramCode.enrolledProgramCode, enrolledProgramCode); @@ -110,6 +109,7 @@ export const useSdcCollectionStore = defineStore('sdcCollection', { return {...item, dropdownText: `${item.schoolFundingCode} - ${item.label}`}; }); this.schoolFundingCodesMap = new Map(); + this.schoolFundingCodes.push({'schoolFundingCode': '', 'dropdownText': 'No Funding Code'}); schoolFundingCodes.forEach(schoolFundingCode => { this.schoolFundingCodesMap.set(schoolFundingCode.schoolFundingCode, schoolFundingCode); }); diff --git a/frontend/src/utils/sdc/sdcValidationFieldMappings.js b/frontend/src/utils/sdc/sdcValidationFieldMappings.js index 95cd98e26..c5996380b 100644 --- a/frontend/src/utils/sdc/sdcValidationFieldMappings.js +++ b/frontend/src/utils/sdc/sdcValidationFieldMappings.js @@ -25,7 +25,7 @@ export const SDC_VALIDATION_FIELD_MAPPINGS = Object.freeze({ GENDER_CODE: {label: 'Gender', key: 'gender', type: 'select', options: {items: 'genderCodes', itemValue: 'genderCode'}}, GRADE_CODE: {label: 'Grade Code', key: 'enrolledGradeCode', type: 'select', options: {items: 'enrolledGradeCodes', itemValue: 'enrolledGradeCode'}}, SPECIAL_EDUCATION_CATEGORY_CODE: {label: 'Special Education Category', key: 'specialEducationCategoryCode', type: 'select', options: {items: 'specialEducationCategoryCodes', itemValue: 'specialEducationCategoryCode'}}, - SCHOOL_FUNDING_CODE: {label: 'School Funding', key: 'schoolFundingCode', type: 'select', options: {items: 'schoolFundingCodes', itemValue: 'schoolFundingCode'}}, + SCHOOL_FUNDING_CODE: {label: 'Funding Code', key: 'schoolFundingCode', type: 'select', options: {items: 'schoolFundingCodes', itemValue: 'schoolFundingCode'}}, NATIVE_ANCESTRY_IND: {label: 'Native Ancestry', key: 'nativeAncestryInd', type: 'input', options: {}}, HOME_LANGUAGE_SPOKEN_CODE: {label: 'Home Language Spoken Code', key: 'homeLanguageSpokenCode', type: 'select', options: {items: 'homeLanguageSpokenCodes', itemValue: 'homeLanguageSpokenCode'}}, OTHER_COURSES: {label: 'Other Courses', key: 'otherCourses', type: 'input', options: {}},