diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 5427d3743..5b1bf60fb 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -37,6 +37,21 @@ import { CustomIconsPlugin } from '../icons'; import AsyncComputed from 'vue-async-computed'; import CKEditor from 'ckeditor4-vue'; import VuePluralize from 'vue-pluralize'; +import { configure as validationConfigure, extend as validationExtend} from 'vee-validate'; +import { min, max, regex, required } from 'vee-validate/dist/rules'; + +validationConfigure({ + classes: { + valid: 'is-valid', + invalid: 'is-invalid', + dirty: 'is-dirty' + } +}) + +validationExtend('min', min); +validationExtend('max', max); +validationExtend('regex', regex); +validationExtend('required', required); Vue.config.errorHandler = (err, vm, info) => { console.error(err); diff --git a/app/javascript/profile/person_demographics.vue b/app/javascript/profile/person_demographics.vue index 65f28fd83..9ca939db1 100644 --- a/app/javascript/profile/person_demographics.vue +++ b/app/javascript/profile/person_demographics.vue @@ -10,41 +10,59 @@ - + - + @@ -58,6 +76,7 @@ import PersonEditModal from "./person_edit_modal.vue"; import EditButton from '@/components/edit_button'; import DlPerson from './dl_person.vue'; import personSessionMixin from '@/auth/person_session.mixin'; +import { ValidationProvider } from 'vee-validate'; export default { name: "PersonDemographics", @@ -70,7 +89,8 @@ export default { components: { PersonEditModal, EditButton, - DlPerson + DlPerson, + ValidationProvider, }, data: () => ({ model, diff --git a/app/javascript/profile/person_details.vue b/app/javascript/profile/person_details.vue index e0c5fa480..10d73f9e5 100644 --- a/app/javascript/profile/person_details.vue +++ b/app/javascript/profile/person_details.vue @@ -73,26 +73,32 @@
Social Media
- + - + - +