This commit is contained in:
2020-04-06 21:48:55 +00:00
parent 70a2a717ac
commit e2b9f0b7a0
2 changed files with 42 additions and 49 deletions

View File

@@ -84,15 +84,23 @@ function handleError(action, error, route, reject) {
error.message.includes("Network request failed")
) {
window.$gz.store.commit("logItem", "Network error");
window.$gz.eventBus.$emit(
"notify-error",
window.$gz.translation.get("ErrorServerUnresponsive")
);
let msg = "";
if (window.$gz.store.state.authenticated) {
msg = window.$gz.translation.get("ErrorServerUnresponsive");
} else {
msg = "Could not connect to AyaNova server ";
}
msg += window.$gz.api.APIUrl("") + "\r\nError: " + error.message;
window.$gz.eventBus.$emit("notify-error", msg);
//note: using translation key in square brackets
return reject("[ErrorServerUnresponsive]");
return reject(msg);
//throw "Error: unable to contact server";
}
}
//Ideally this should never get called because any issue should be addressed above
devShowUnknownError(error);
}
@@ -306,6 +314,7 @@ export default {
})
.catch(function handleGetError(error) {
//fundamental error, can't proceed with this call
//license/trial
handleError("GET", error, route, reject);
});
});

View File

@@ -26,7 +26,7 @@
v-model="selectedTrialUserId"
:items="selectLists.trialUsers"
item-text="name"
item-value="id"
item-value="l"
label="Trial mode example users"
prepend-icon="fa-question-circle"
@click:prepend="trialHelpClick"
@@ -88,7 +88,7 @@
<script>
/* xeslint-disable */
import auth from "../api/auth";
let TRIAL_MODE = false;
export default {
data() {
return {
@@ -105,128 +105,112 @@ export default {
selectLists: {
trialUsers: [
{
name: "AyaNova administrator - all rights",
id: 1,
name: "AyaNova administrator - all",
l: "manager",
p: "l3tm3in"
},
{
name: "Business admin - full rights",
id: 2,
name: "Accounting",
l: "Accounting",
p: "Accounting"
},
{
name: "Business admin",
l: "BizAdminFull",
p: "BizAdminFull"
},
{
name: "Business admin - limited rights",
id: 3,
name: "Business admin - limited",
l: "BizAdminLimited",
p: "BizAdminLimited"
},
{
name: "Customer - full rights",
id: 4,
name: "Customer",
l: "CustomerFull",
p: "CustomerFull"
},
{
name: "Customer - limited rights",
id: 5,
name: "Customer - limited",
l: "CustomerLimited",
p: "CustomerLimited"
},
{
name: "Dispatcher - full rights",
id: 6,
name: "Dispatcher",
l: "DispatchFull",
p: "DispatchFull"
},
{
name: "Dispatcher - limited rights",
id: 7,
name: "Dispatcher - limited",
l: "DispatchLimited",
p: "DispatchLimited"
},
{
name: "Head office (customer) - full rights",
id: 8,
name: "Head office",
l: "HeadOffice",
p: "HeadOffice"
},
{
name: "InventoryFull - full rights",
id: 4,
name: "Inventory",
l: "InventoryFull",
p: "InventoryFull"
},
{
name: "InventoryLimited - limited rights",
id: 5,
name: "Inventory - limited",
l: "InventoryLimited",
p: "InventoryLimited"
},
{
name: "OpsAdminFull - full rights",
id: 4,
name: "Operations",
l: "OpsAdminFull",
p: "OpsAdminFull"
},
{
name: "OpsAdminLimited - limited rights",
id: 5,
name: "Operations - limited",
l: "OpsAdminLimited",
p: "OpsAdminLimited"
},
{
name: "SalesFull - full rights",
id: 4,
name: "Sales",
l: "SalesFull",
p: "SalesFull"
},
{
name: "SalesLimited - limited rights",
id: 5,
name: "Sales - limited",
l: "SalesLimited",
p: "SalesLimited"
},
{
name: "SubContractorFull - full rights",
id: 4,
name: "Subcontractor",
l: "SubContractorFull",
p: "SubContractorFull"
},
{
name: "SubContractorLimited - limited rights",
id: 5,
name: "Subcontractor - limited",
l: "SubContractorLimited",
p: "SubContractorLimited"
},
{
name: "TechFull - full rights",
id: 4,
name: "Technician",
l: "TechFull",
p: "TechFull"
},
{
name: "TechLimited - limited rights",
id: 5,
name: "Technician - limited",
l: "TechLimited",
p: "TechLimited"
},
{
name: "Translation - Deutshe / German",
id: 4,
name: "Translation - Deutsch / German",
l: "de",
p: "de"
},
{
name: "Translation - Espanol / Spanish",
id: 5,
name: "Translation - Español / Spanish",
l: "es",
p: "es"
},
{
name: "Translation - Francais / French",
id: 5,
name: "Translation - Français / French",
l: "fr",
p: "fr"
}