This commit is contained in:
2021-01-07 19:13:13 +00:00
parent e8f94c3c71
commit b3d2accf1c
3 changed files with 15 additions and 13 deletions

View File

@@ -84,6 +84,8 @@ function getControlLabel(ctrl) {
// from server error collection
//
function getErrorsForField(vm, ref) {
//Note: to debug this on forms just put {{ formState.serverError }}
//on the form to see what is actually stored there and should be showing
let ret = [];
if (ref == "generalerror") {
ret = vm.formState.serverError.details.filter(

View File

@@ -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;
}
}

View File

@@ -1,5 +1,6 @@
<template>
<div>
{{ formState.serverError }}
<gz-report-selector ref="reportSelector"></gz-report-selector>
<div v-if="formState.ready">
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
@@ -73,7 +74,6 @@
>
<gz-pick-list
:ayaType="ayaTypes().Unit"
:variant="'customerid:' + obj.customerId"
:showEditIcon="true"
v-model="obj.unitId"
:readonly="formState.readOnly"
@@ -85,7 +85,7 @@
></gz-pick-list>
</v-col>
<!-- --------------------------------- -->
<!-- :variant="'customerid:' + obj.customerId" --------------------------------- -->
<v-col
v-if="form().showMe(this, 'CustomerServiceRequestDetails')"
cols="12"