This commit is contained in:
2020-06-19 21:38:32 +00:00
parent 48d062c49b
commit bfcae2a750
15 changed files with 76 additions and 58 deletions

View File

@@ -42,8 +42,8 @@ export default {
if (!window.$gz._.has(window.$gz.store.state.enums, k)) {
let that = this;
await that.fetchEnumKey(k).then(dat => {
// eslint-disable-next-line
await that.fetchEnumKey(k).then((dat) => {
//massage the data as necessary
let e = { enumKey: k, items: {} };
for (let i = 0; i < dat.length; i++) {
@@ -57,9 +57,11 @@ export default {
}
},
fetchEnumKey(enumKey) {
return window.$gz.api.get("enum-list/list/" + enumKey).then(res => {
if (res.error) {
throw res.error;
// eslint-disable-next-line
return window.$gz.api.get("enum-list/list/" + enumKey).then((res) => {
//We never expect there to be no data here
if (!res.data) {
throw res;
}
return res.data;
});

View File

@@ -130,6 +130,15 @@ export default {
msg += "\n";
}
dealWithError(msg, vm);
} else if (err instanceof Response) {
let msg =
"http error: " +
err.statusText +
" - " +
err.status +
" Url: " +
err.url;
dealWithError(msg, vm);
} else {
//last resort
let msg = JSON.stringify(err);

View File

@@ -257,8 +257,9 @@ export default {
.get("pick-list/List" + urlParams)
.then(res => {
vm.fetching = false;
if (res.error) {
throw res.error;
//We never expect there to be no data here
if (!res.data) {
throw res;
}
vm.searchResults = res.data;
window.$gz.form.addNoSelectionItem(vm.searchResults);

View File

@@ -79,10 +79,11 @@ export default {
}
vm.tagSearchUnderway = true;
window.$gz.api
.get("tag/list?query=" + val) //roles
.get("tag-list/list?query=" + val) //roles
.then(res => {
if (res.error) {
throw res.error;
//We never expect there to be no data here
if (!res.data) {
throw res;
}
//adding this to the property will automatically have it cached by the autocomplete component
//as cache-items has been set so this just needs to be set here once and all is well in future

View File

@@ -58,7 +58,7 @@ import chartBarHorizontalControl from "./components/chart-bar-horizontal-control
//DEVELOPMENT MODE
//THIS SHOULD BE FALSE IN RELEASE
//************************************************************
const DEV_MODE = false;
const DEV_MODE = true;
//************************************************************
//**************************************************************
//**************************************************************

View File

@@ -562,14 +562,16 @@ function initForm(vm) {
try {
await fetchTranslatedText(vm);
let res = await window.$gz.api.get("license");
if (res.error) {
throw res.error;
//We never expect there to be no data here
if (!res.data) {
throw res;
}
vm.currentLicenseInfo = res.data.license;
res = await window.$gz.api.get("license/database-empty");
if (res.error) {
throw res.error;
//We never expect there to be no data here
if (!res.data) {
throw res;
}
vm.dbIsEmpty = res.data;
} catch (err) {
@@ -614,18 +616,4 @@ function fetchTranslatedText(vm) {
"CopyDbId"
]);
}
// //////////////////////
// //
// //
// function populateSelectionLists(vm) {
// //http://localhost:7575/api/v8/translation/list
// return window.$gz.api.get("translation/list").then(res => {
// if (res.error) {
// window.$gz.errorHandler.handleFormError(res.error, vm);
// } else {
// vm.selectLists.translations = res.data;
// }
// });
// }
</script>

View File

@@ -302,8 +302,9 @@ function fetchTranslatedText(vm) {
//
function getServerInfo(vm) {
return window.$gz.api.get("server-info").then(res => {
if (res.error) {
throw res.error;
//We never expect there to be no data here
if (!res.data) {
throw res;
} else {
vm.serverInfo = res.data;
}

View File

@@ -163,8 +163,9 @@ export default {
try {
//Does the database need to be erased?
let res = await window.$gz.api.get("license/database-empty");
if (res.error) {
throw res.error;
//We never expect there to be no data here
if (!res.data) {
throw res;
}
if (res.data != true) {
let dialogResult = await window.$gz.dialog.confirmGeneric(

View File

@@ -221,9 +221,6 @@ export default {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
//Aya<span class="v-list-item__mask">Nov</span>
// <v-list-item-subtitle v-html="item.subtitle"></v-list-item-subtitle>
//subtitle: "<span class='text--primary'>to Alex, Scott, Jennifer</span> &mdash; Wish I could come, but I'm out of town this weekend.",
let showInfo = res.data;
let searchTerms = vm.searchPhrase
.toLocaleLowerCase()