diff --git a/.eslintrc.js b/.eslintrc.js
index 2ba9ff35..4e42a29f 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -4,7 +4,9 @@ module.exports = {
'plugin:vue/vue3-strongly-recommended'
],
rules: {
- 'linebreak-style': 'off'
+ 'linebreak-style': 'off',
+ 'vue/component-definition-name-casing': ['warn', 'kebab-case'],
+ 'vue/require-default-prop': 'off'
},
settings: {
'import/resolver': {
diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue
index 69a5a39c..f7c08366 100644
--- a/src/common-components/button-question/button-question.vue
+++ b/src/common-components/button-question/button-question.vue
@@ -134,7 +134,7 @@ export default {
if (this.isOverflowScrollable) {
return "container-fluid overflow-scroll position-absolute px-5 pt-1 py-0";
}
- else if (this.buttonType == "listCard") {
+ else if (this.buttonTypeString === "listCard") {
return "w-100";
}
else {
diff --git a/src/layouts/part-questions/part-questions.vue b/src/layouts/part-questions/part-questions.vue
index 66c36158..0281b740 100644
--- a/src/layouts/part-questions/part-questions.vue
+++ b/src/layouts/part-questions/part-questions.vue
@@ -27,13 +27,14 @@ import { Form, defineRule } from "vee-validate";
import { required } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
+import BaseFormMixin from '@/mixins/base-form-mixin.js';
// DEFINE VALIDATION RULES
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
export default {
name: "part-questions",
- mixins: [vehicleQuestionsMixin],
+ mixins: [BaseFormMixin, vehicleQuestionsMixin],
async beforeRouteEnter(to, from, next) {
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue
index 4988285e..0683869b 100644
--- a/src/layouts/vehicle-damage/vehicle-damage.vue
+++ b/src/layouts/vehicle-damage/vehicle-damage.vue
@@ -68,6 +68,7 @@ import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-que
import alert from "@/ux-components/alert/alert";
// Supporting files
+import BaseFormMixin from '@/mixins/base-form-mixin.js';
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper";
import { Form, defineRule } from "vee-validate";
@@ -82,6 +83,7 @@ defineRule("replace-options-required", required(errorMessages.REPLACE_OPTIONS_RE
export default {
name: "vehicle-damage",
+ mixins: [BaseFormMixin],
async beforeRouteEnter(to, from, next) {
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
@@ -129,7 +131,7 @@ export default {
selectedRearReplaceOptions: this.getRearReplaceOptionsFromStore(),
};
},
- methods: {
+ methods: {
arePagePrerequisitesValid() {
if (this.mainStore.order.vehicle.carId) {
return true;
@@ -297,7 +299,7 @@ export default {
return this.navigateForward();
},
- navigateForward() {
+ navigateForward() {
// If vin already exists, navigate directly to vin-lookup
if (useMainStore().order.vehicle.vin) {
this.$router.navigate(
diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.vue b/src/layouts/vehicle-lookup/vehicle-lookup.vue
new file mode 100644
index 00000000..059a3c2d
--- /dev/null
+++ b/src/layouts/vehicle-lookup/vehicle-lookup.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
+
diff --git a/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue
new file mode 100644
index 00000000..ff6bd5ab
--- /dev/null
+++ b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue
index b734f58a..bd5a6be0 100644
--- a/src/layouts/vehicle-parts/vehicle-parts.vue
+++ b/src/layouts/vehicle-parts/vehicle-parts.vue
@@ -57,10 +57,11 @@ import { settleAllPromises } from "@/helpers/layout-helper";
import { issPageValues } from "@/router/router-constants/issPage-values";
import { Form } from "vee-validate";
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
+import BaseFormMixin from '@/mixins/base-form-mixin.js';
export default {
name: "vehicle-parts",
- mixins: [vehicleQuestionsMixin],
+ mixins: [BaseFormMixin, vehicleQuestionsMixin],
async beforeRouteEnter(to, from, next) {
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
diff --git a/src/mixins/base-form-mixin.js b/src/mixins/base-form-mixin.js
new file mode 100644
index 00000000..081183be
--- /dev/null
+++ b/src/mixins/base-form-mixin.js
@@ -0,0 +1,25 @@
+export default {
+ methods: {
+ onSubmit() {
+ /** DO NOT REMOVE;
+ * Needed to prevent default form submit behavior.
+ * Cannot use .prevent modifier for vee-validate Form.
+ */
+ },
+ onInvalidSubmit({ errors }) {
+ /**
+ * Identify the first error field and put focus on it
+ * get error names array
+ */
+ const errorNames = errors ? Object.keys(errors) : [];
+ const firstErrorEl = errorNames[0];
+ if (firstErrorEl) {
+ const qsString = `[data-focus-target="${firstErrorEl}"]`;
+ const el = document.querySelector(qsString);
+ if (el !== null) {
+ el.focus();
+ }
+ }
+ },
+ },
+};