This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
item-disabled="!active"
|
||||
:error-messages="errors"
|
||||
:error-messages="errorMessages"
|
||||
:loading="fetching"
|
||||
:placeholder="$ay.t('Search')"
|
||||
:search-input.sync="searchEntry"
|
||||
@@ -25,7 +25,7 @@
|
||||
>
|
||||
<template v-slot:prepend-item v-if="hasError()">
|
||||
<div class="pl-2">
|
||||
<span class="error--text"> {{ errors[0] }}</span>
|
||||
<span class="error--text"> {{ entryError }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
searchResults: [],
|
||||
errors: [],
|
||||
entryError: null,
|
||||
searchEntry: null,
|
||||
lastSelection: null,
|
||||
fetching: false,
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
|
||||
errorMessages: { type: Array, default: null },
|
||||
readonly: { type: Boolean, default: false },
|
||||
disabled: { type: Boolean, default: false },
|
||||
ayaType: {
|
||||
@@ -102,7 +102,7 @@ export default {
|
||||
},
|
||||
searchEntry(val, oldVal) {
|
||||
let vm = this;
|
||||
//clear any local errors
|
||||
//clear any local entryError
|
||||
vm.clearErrors();
|
||||
//if the search entry is in the results list then it's a drop down selection not a typed search so bail
|
||||
for (let i = 0; i < vm.searchResults.length; i++) {
|
||||
@@ -121,7 +121,7 @@ export default {
|
||||
|
||||
this.doSearch(val);
|
||||
},
|
||||
errors(val) {
|
||||
entryError(val) {
|
||||
if (this.hasError()) {
|
||||
this.errorIcon = "$ayiQuestionCircle";
|
||||
} else {
|
||||
@@ -134,10 +134,10 @@ export default {
|
||||
return this.lastSelection;
|
||||
},
|
||||
hasError: function() {
|
||||
return this.errors.length > 0;
|
||||
return this.entryError != null;
|
||||
},
|
||||
clearErrors: function() {
|
||||
this.errors = [];
|
||||
this.entryError = null;
|
||||
},
|
||||
handleErrorClick: function() {
|
||||
//open help nav for picklist
|
||||
@@ -319,7 +319,7 @@ export default {
|
||||
if (searchFor.includes(" ")) {
|
||||
queryTerms = searchFor.split(" ");
|
||||
if (queryTerms.length > 2) {
|
||||
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
|
||||
vm.entryError = vm.$ay.t("ErrorPickListQueryInvalid");
|
||||
return;
|
||||
}
|
||||
isATwoTermQuery = true;
|
||||
@@ -355,7 +355,7 @@ export default {
|
||||
queryTerms[0].startsWith("..") &&
|
||||
queryTerms[1].startsWith("..")
|
||||
) {
|
||||
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
|
||||
vm.entryError = vm.$ay.t("ErrorPickListQueryInvalid");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ export default {
|
||||
!queryTerms[0].startsWith("..") &&
|
||||
!queryTerms[1].startsWith("..")
|
||||
) {
|
||||
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
|
||||
vm.entryError = vm.$ay.t("ErrorPickListQueryInvalid");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user