Skip to content

Commit

Permalink
Merge pull request #1066 from bcgov/fix/EDX-1834
Browse files Browse the repository at this point in the history
EDX-1834
  • Loading branch information
trev-dev authored Sep 28, 2023
2 parents cc65301 + 05ee683 commit 35531ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 56 deletions.
66 changes: 11 additions & 55 deletions frontend/src/components/sdcCollection/StepTwoValidateData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -653,38 +653,17 @@
@update:focused="onFieldClick(sdcFieldMappings[field]?.key, $event, issue?.validationIssueSeverityCode)"
/>
<div v-else-if="sdcFieldMappings[field]?.type === 'datePicker'">
<v-menu
id="dobValidationDatePicker"
ref="dobDateFilter"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template #activator="{ on, attrs }">
<v-text-field
:id="`${sdcFieldMappings[field].key}ValidationDatePicker`"
v-model="sdcSchoolCollectionStudentDetailCopy[sdcFieldMappings[field].key]"
:rules="sdcFieldMappings[field].options.rules"
class="pt-0 mt-0"
variant="underlined"
label="Start Date"
prepend-inner-icon="mdi-calendar"
clearable
readonly
v-bind="attrs"
@click:clear="clearDobDate"
@click="openDobDatePicker"
/>
</template>
</v-menu>
<VueDatePicker
ref="dobDatePicker"
<v-text-field
:id="`${sdcFieldMappings[field].key}ValidationDatePicker`"
v-model="sdcSchoolCollectionStudentDetailCopy[sdcFieldMappings[field].key]"
:rules="sdcFieldMappings[field].options.rules"
:enable-time-picker="false"
format="yyyy-MM-dd"
@update:model-value="saveDobDate"
class="pt-0 mt-0"
variant="underlined"
:label="sdcFieldMappings[field].label"
prepend-inner-icon="mdi-calendar"
:clearable="true"
type="date"
@click:clear="clearDobDate"
/>
</div>
</div>
Expand Down Expand Up @@ -768,9 +747,7 @@ import {ApiRoutes} from '../../utils/constants';
import {SDC_VALIDATION_FIELD_MAPPINGS} from '../../utils/sdc/sdcValidationFieldMappings';
import {isEmpty, omitBy, cloneDeep, sortBy} from 'lodash';
import {formatDate} from '../../utils/format';
import moment from 'moment/moment';
import Spinner from '../common/Spinner.vue';
import VueDatePicker from '@vuepic/vue-datepicker';
import PrimaryButton from '../util/PrimaryButton.vue';
import {setSuccessAlert, setFailureAlert} from '../composable/alertComposable';
import { sdcCollectionStore } from '../../store/modules/sdcCollection';
Expand All @@ -781,8 +758,7 @@ export default {
components: {
ConfirmationDialog,
Spinner,
PrimaryButton,
VueDatePicker
PrimaryButton
},
props: {
schoolCollectionObject: {
Expand All @@ -800,7 +776,6 @@ export default {
studentListData: [],
totalStudents: 0,
sdcCollection: sdcCollectionStore(),
dobDatePicker: null,
legalUsualNameFilter: null,
penFilter: null,
from: 'uuuuMMdd',
Expand Down Expand Up @@ -1171,13 +1146,7 @@ export default {
}
},
clearDobDate(){
this.sdcSchoolCollectionStudentDetailCopy.value.dob = null;
},
openDobDatePicker(){
this.dobDatePicker.value[0].openMenu();
},
saveDobDate(){
this.sdcSchoolCollectionStudentDetailCopy.value.dob = moment(this.sdcSchoolCollectionStudentDetailCopy.value.dob).format('YYYY-MM-DD').toString();
this.sdcSchoolCollectionStudentDetailCopy.dob = null;
}
}
};
Expand Down Expand Up @@ -1242,19 +1211,6 @@ export default {
height: 100vh;
}
:deep(.dp__input_wrap){
height: 0px;
width: 0px;
}
:deep(.dp__input){
display: none;
}
:deep(.dp__icon){
display: none;
}
.form-hint{
color: rgb(56, 89, 138);
font-size: 14px;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/sdc/sdcValidationFieldMappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const SDC_VALIDATION_FIELD_MAPPINGS = Object.freeze({
USUAL_FIRST_NAME: {label: 'Usual Given', key: 'usualFirstName', type: 'input', options: {}},
USUAL_MIDDLE_NAMES: {label: 'Usual Middle', key: 'usualMiddleNames', type: 'input', options: {}},
USUAL_LAST_NAME: {label: 'Usual Surname', key: 'usualLastName', type: 'input', options: {}},
DOB: {label: 'DOB', key: 'dob', type: 'datePicker', options: {}},
DOB: {label: 'Birthdate', key: 'dob', type: 'datePicker', options: {}},
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: 'specialEducationCodes', itemValue: 'specialEducationCategoryCode'}},
Expand Down

0 comments on commit 35531ff

Please sign in to comment.