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") error.message.includes("Network request failed")
) { ) {
window.$gz.store.commit("logItem", "Network error"); window.$gz.store.commit("logItem", "Network error");
window.$gz.eventBus.$emit( let msg = "";
"notify-error",
window.$gz.translation.get("ErrorServerUnresponsive") 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 //note: using translation key in square brackets
return reject("[ErrorServerUnresponsive]"); return reject(msg);
//throw "Error: unable to contact server"; //throw "Error: unable to contact server";
} }
} }
//Ideally this should never get called because any issue should be addressed above //Ideally this should never get called because any issue should be addressed above
devShowUnknownError(error); devShowUnknownError(error);
} }
@@ -306,6 +314,7 @@ export default {
}) })
.catch(function handleGetError(error) { .catch(function handleGetError(error) {
//fundamental error, can't proceed with this call //fundamental error, can't proceed with this call
//license/trial
handleError("GET", error, route, reject); handleError("GET", error, route, reject);
}); });
}); });

View File

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