This commit is contained in:
@@ -17,7 +17,7 @@ function dealWithError(msg, vm) {
|
||||
lastMessageHash = newHash;
|
||||
|
||||
//localize as necessary
|
||||
msg = window.$gz.locale.translateString(msg);
|
||||
msg = window.$gz.translation.translateString(msg);
|
||||
|
||||
//In some cases the error may not be localizable, if this is not a debug run then it should show without the ?? that localizing puts in keys not found
|
||||
//so it's not as weird looking to the user
|
||||
@@ -126,6 +126,6 @@ API specific (logic) error codes are all in the range of 2000 to 3000
|
||||
CLIENT ERROR CODES:
|
||||
E16 - ErrorUserNotAuthenticated
|
||||
E17 - ErrorServerUnresponsive
|
||||
E18 - Misc error without a locale key, unexpected throws etc or api error during server call, details in the message / Any error without a locale key defined basically
|
||||
E18 - Misc error without a translation key, unexpected throws etc or api error during server call, details in the message / Any error without a translation key defined basically
|
||||
|
||||
*/
|
||||
|
||||
@@ -54,7 +54,7 @@ function handleError(action, error, route, reject) {
|
||||
window.$gz.store.commit("logItem", "Not authorized, redirecting to HOME");
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
window.$gz.locale.get("ErrorUserNotAuthorized")
|
||||
window.$gz.translation.get("ErrorUserNotAuthorized")
|
||||
);
|
||||
router.push(window.$gz.store.state.homePage);
|
||||
return reject("[ErrorUserNotAuthorized]");
|
||||
@@ -68,7 +68,7 @@ function handleError(action, error, route, reject) {
|
||||
);
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-error",
|
||||
window.$gz.locale.get("ErrorUserNotAuthenticated")
|
||||
window.$gz.translation.get("ErrorUserNotAuthenticated")
|
||||
);
|
||||
auth.logout();
|
||||
router.push("/login");
|
||||
@@ -86,9 +86,9 @@ function handleError(action, error, route, reject) {
|
||||
window.$gz.store.commit("logItem", "Network error");
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-error",
|
||||
window.$gz.locale.get("ErrorServerUnresponsive")
|
||||
window.$gz.translation.get("ErrorServerUnresponsive")
|
||||
);
|
||||
//note: using locale key in square brackets
|
||||
//note: using translation key in square brackets
|
||||
return reject("[ErrorServerUnresponsive]");
|
||||
//throw "Error: unable to contact server";
|
||||
}
|
||||
|
||||
@@ -87,9 +87,9 @@ export default {
|
||||
//
|
||||
confirmDelete() {
|
||||
return VM_LOCAL.$root.$gzconfirm({
|
||||
message: window.$gz.locale.get("DeletePrompt"),
|
||||
yesButtonText: window.$gz.locale.get("Delete"),
|
||||
noButtonText: window.$gz.locale.get("Cancel")
|
||||
message: window.$gz.translation.get("DeletePrompt"),
|
||||
yesButtonText: window.$gz.translation.get("Delete"),
|
||||
noButtonText: window.$gz.translation.get("Cancel")
|
||||
});
|
||||
},
|
||||
/////////////////////////////////////
|
||||
@@ -97,9 +97,9 @@ export default {
|
||||
//
|
||||
confirmLeaveUnsaved() {
|
||||
return VM_LOCAL.$root.$gzconfirm({
|
||||
message: window.$gz.locale.get("AreYouSureUnsavedChanges"),
|
||||
yesButtonText: window.$gz.locale.get("Leave"),
|
||||
noButtonText: window.$gz.locale.get("Cancel")
|
||||
message: window.$gz.translation.get("AreYouSureUnsavedChanges"),
|
||||
yesButtonText: window.$gz.translation.get("Leave"),
|
||||
noButtonText: window.$gz.translation.get("Cancel")
|
||||
});
|
||||
},
|
||||
/////////////////////////////////////
|
||||
@@ -107,9 +107,9 @@ export default {
|
||||
//
|
||||
displayLTErrorMessage(ltKeyText, ltKeyTitle = undefined) {
|
||||
return VM_LOCAL.$root.$gzconfirm({
|
||||
message: ltKeyText ? window.$gz.locale.get(ltKeyText) : "",
|
||||
title: ltKeyTitle ? window.$gz.locale.get(ltKeyTitle) : "",
|
||||
yesButtonText: window.$gz.locale.get("OK")
|
||||
message: ltKeyText ? window.$gz.translation.get(ltKeyText) : "",
|
||||
title: ltKeyTitle ? window.$gz.translation.get(ltKeyTitle) : "",
|
||||
yesButtonText: window.$gz.translation.get("OK")
|
||||
});
|
||||
}
|
||||
//TODO: Implement the following as it's own re-usable component instead of here
|
||||
@@ -119,9 +119,9 @@ export default {
|
||||
// async getReportChoice(vm, reports, preselected) {
|
||||
// const result = await vm.$dialog.showAndWait(reportChooser, {
|
||||
// reports: reports,
|
||||
// title: window.$gz.locale.get("Report"),
|
||||
// oktext: window.$gz.locale.get("Print"),
|
||||
// canceltext: window.$gz.locale.get("Cancel"),
|
||||
// title: window.$gz.translation.get("Report"),
|
||||
// oktext: window.$gz.translation.get("Print"),
|
||||
// canceltext: window.$gz.translation.get("Cancel"),
|
||||
// selectedvalue: preselected
|
||||
// });
|
||||
// return result;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// dirty and change tracking
|
||||
// and also general error display in forms
|
||||
//probably should be broken up more
|
||||
// All locale keys for validation *MUST* be fetched prior to this being used as it assumes all keys are fetched first
|
||||
// Add any new keys used to the block in locale.js=>commonKeysEditForm
|
||||
// All translation keys for validation *MUST* be fetched prior to this being used as it assumes all keys are fetched first
|
||||
// Add any new keys used to the block in translation.js=>commonKeysEditForm
|
||||
import Vue from "vue";
|
||||
|
||||
var triggeringChange = false;
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
}
|
||||
|
||||
// "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}",
|
||||
var err = window.$gz.locale.get("ErrorRequiredFieldEmpty");
|
||||
var err = window.$gz.translation.get("ErrorRequiredFieldEmpty");
|
||||
var fieldName = getControlLabel(ctrl);
|
||||
err = window.$gz._.replace(err, "{0}", fieldName);
|
||||
//lodash replace only replaces first instance so need to do it twice
|
||||
@@ -193,7 +193,7 @@ export default {
|
||||
if (value.length > max) {
|
||||
//get the localized rule text
|
||||
// "ErrorFieldLengthExceeded": "{0} can not exceed {1} characters.",
|
||||
var err = window.$gz.locale.get("ErrorFieldLengthExceeded");
|
||||
var err = window.$gz.translation.get("ErrorFieldLengthExceeded");
|
||||
var fieldName = getControlLabel(ctrl);
|
||||
err = window.$gz._.replace(err, "{0}", fieldName);
|
||||
err = window.$gz._.replace(err, "{1}", max);
|
||||
@@ -255,7 +255,7 @@ export default {
|
||||
|
||||
if (valueStart > valueEnd) {
|
||||
// "ErrorStartDateAfterEndDate": "Start date must be earlier than stop / end date",
|
||||
var err = window.$gz.locale.get("ErrorStartDateAfterEndDate");
|
||||
var err = window.$gz.translation.get("ErrorStartDateAfterEndDate");
|
||||
//Update the form status
|
||||
this.setFormState({
|
||||
vm: vm,
|
||||
@@ -287,7 +287,7 @@ export default {
|
||||
var valueSecond = getControlValue(ctrlSecond);
|
||||
|
||||
if (valueFirst != valueSecond) {
|
||||
var err = window.$gz.locale.get("ErrorNoMatch");
|
||||
var err = window.$gz.translation.get("ErrorNoMatch");
|
||||
//Update the form status
|
||||
this.setFormState({
|
||||
vm: vm,
|
||||
@@ -323,7 +323,7 @@ export default {
|
||||
}
|
||||
|
||||
// "ErrorFieldValueNotInteger": "Value must be an integer"
|
||||
var err = window.$gz.locale.get("ErrorFieldValueNotInteger");
|
||||
var err = window.$gz.translation.get("ErrorFieldValueNotInteger");
|
||||
//Update the form status
|
||||
this.setFormState({
|
||||
vm: vm,
|
||||
@@ -340,7 +340,7 @@ export default {
|
||||
return false;
|
||||
}
|
||||
//TODO: Handle commas and spaces in numbers
|
||||
//as per window.$gz.locale rules for numbers
|
||||
//as per window.$gz.translation rules for numbers
|
||||
|
||||
var ctrl = getControl(vm, ref);
|
||||
if (typeof ctrl == "undefined") {
|
||||
@@ -360,7 +360,7 @@ export default {
|
||||
}
|
||||
|
||||
// "ErrorFieldValueNotDecimal": "Value must be a number"
|
||||
var err = window.$gz.locale.get("ErrorFieldValueNotDecimal");
|
||||
var err = window.$gz.translation.get("ErrorFieldValueNotDecimal");
|
||||
//Update the form status
|
||||
this.setFormState({
|
||||
vm: vm,
|
||||
@@ -407,7 +407,7 @@ export default {
|
||||
}
|
||||
|
||||
// "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}",
|
||||
var err = window.$gz.locale.get("ErrorRequiredFieldEmpty");
|
||||
var err = window.$gz.translation.get("ErrorRequiredFieldEmpty");
|
||||
var fieldName = getControlLabel(ctrl);
|
||||
err = window.$gz._.replace(err, "{0}", fieldName);
|
||||
//lodash replace only replaces first instance so need to do it twice
|
||||
@@ -447,7 +447,7 @@ export default {
|
||||
//It's empty and it's required so return error
|
||||
|
||||
// "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}",
|
||||
var err = window.$gz.locale.get("ErrorRequiredFieldEmpty");
|
||||
var err = window.$gz.translation.get("ErrorRequiredFieldEmpty");
|
||||
//var fieldName = getControlLabel(ctrl);
|
||||
err = window.$gz._.replace(err, "{0}", fieldName);
|
||||
//lodash replace only replaces first instance so need to do it twice
|
||||
@@ -500,7 +500,9 @@ export default {
|
||||
//GENERAL ERROR
|
||||
if (ref == "errorbox") {
|
||||
//Add any general errors to ret
|
||||
var err = window.$gz.locale.get("ErrorAPI" + apiErrorCode.toString());
|
||||
var err = window.$gz.translation.get(
|
||||
"ErrorAPI" + apiErrorCode.toString()
|
||||
);
|
||||
if (vm.formState.serverError.message) {
|
||||
err = err + "\r\n" + vm.formState.serverError.message;
|
||||
}
|
||||
@@ -524,7 +526,7 @@ export default {
|
||||
var fldErr = "";
|
||||
var fldErrorCode = parseInt(ve.error);
|
||||
fldErr =
|
||||
window.$gz.locale.get("ErrorAPI" + fldErrorCode.toString()) +
|
||||
window.$gz.translation.get("ErrorAPI" + fldErrorCode.toString()) +
|
||||
" [" +
|
||||
ve.error +
|
||||
"]";
|
||||
|
||||
@@ -55,14 +55,14 @@ export default {
|
||||
//there will be few exceptions so they will be coded in later if needed but assume anything with an id and a type
|
||||
if (isCoreBizObject) {
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("Attachments"),
|
||||
title: window.$gz.translation.get("Attachments"),
|
||||
icon: "paperclip",
|
||||
key: "app:attachments",
|
||||
data: { ayaType: formAyaType, recordId: formRecordId }
|
||||
});
|
||||
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("WikiPage"),
|
||||
title: window.$gz.translation.get("WikiPage"),
|
||||
icon: "feather",
|
||||
key: "app:wiki",
|
||||
data: { ayaType: formAyaType, recordId: formRecordId }
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
//basically it's now a "Reminder" type of object but it's own thing with separate collection
|
||||
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("Review"),
|
||||
title: window.$gz.translation.get("Review"),
|
||||
icon: "calendar-check",
|
||||
key: "app:review",
|
||||
data: { ayaType: formAyaType, recordId: formRecordId }
|
||||
@@ -81,7 +81,7 @@ export default {
|
||||
//AFAIK right now any item with an id and a type can have a history
|
||||
//anything not would be the exception rather than the rule
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("History"),
|
||||
title: window.$gz.translation.get("History"),
|
||||
icon: "history",
|
||||
key: "app:history",
|
||||
data: { ayaType: formAyaType, recordId: formRecordId }
|
||||
@@ -89,7 +89,7 @@ export default {
|
||||
}
|
||||
|
||||
//CUSTOMIZE
|
||||
//set custom fields and link to locale text editor
|
||||
//set custom fields and link to translation text editor
|
||||
|
||||
if (
|
||||
ctx.formData &&
|
||||
@@ -106,7 +106,7 @@ export default {
|
||||
vm.appBar.menuItems.push({ divider: true, inset: false });
|
||||
//customize
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("Customize"),
|
||||
title: window.$gz.translation.get("Customize"),
|
||||
icon: "sliders-h",
|
||||
data: ctx.formData.formCustomTemplateKey,
|
||||
key: "app:customize"
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
if (isCoreBizObject && ctx.icon != "fa-search") {
|
||||
//For all forms but not on the search form itself; if this is necessary for others then make a nosearch or something flag controlled by incoming ctx but if not then this should suffice
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("Search"),
|
||||
title: window.$gz.translation.get("Search"),
|
||||
icon: "search",
|
||||
key: "app:search",
|
||||
data: formAyaType
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
|
||||
//HELP
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("MenuHelp"),
|
||||
title: window.$gz.translation.get("MenuHelp"),
|
||||
icon: "question-circle",
|
||||
key: "app:help",
|
||||
data: vm.appBar.helpUrl
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
//ABOUT
|
||||
if (ctx.helpUrl != "form-ay-about") {
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("HelpAboutAyaNova"),
|
||||
title: window.$gz.translation.get("HelpAboutAyaNova"),
|
||||
icon: "info-circle",
|
||||
key: "app:nav:abt",
|
||||
data: "ay-about"
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
|
||||
//LOGOUT
|
||||
vm.appBar.menuItems.push({
|
||||
title: window.$gz.locale.get("Logout"),
|
||||
title: window.$gz.translation.get("Logout"),
|
||||
icon: "sign-out-alt",
|
||||
key: "app:logout"
|
||||
});
|
||||
|
||||
@@ -17,8 +17,8 @@ export default function initialize() {
|
||||
var promise = new Promise(function(resolve) {
|
||||
if (window.$gz.store.state.authenticated) {
|
||||
//Fetch the core localized text keys that will always be required by user
|
||||
window.$gz.locale
|
||||
.fetch(window.$gz.locale.coreKeys)
|
||||
window.$gz.translation
|
||||
.fetch(window.$gz.translation.coreKeys)
|
||||
.then(function initializeNavPanel() {
|
||||
var key = 0;
|
||||
var sub = [];
|
||||
@@ -44,7 +44,7 @@ export default function initialize() {
|
||||
) {
|
||||
//DASHBOARD
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Dashboard"),
|
||||
title: window.$gz.translation.get("Dashboard"),
|
||||
icon: "tachometer-alt",
|
||||
route: "/home-dashboard",
|
||||
key: key++
|
||||
@@ -70,7 +70,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Search"),
|
||||
title: window.$gz.translation.get("Search"),
|
||||
icon: "search",
|
||||
route: "/home-search",
|
||||
key: key++
|
||||
@@ -79,7 +79,7 @@ export default function initialize() {
|
||||
|
||||
//SCHEDULE (personal)
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Schedule"),
|
||||
title: window.$gz.translation.get("Schedule"),
|
||||
icon: "calendar-day",
|
||||
route: "/home-schedule",
|
||||
key: key++
|
||||
@@ -87,7 +87,7 @@ export default function initialize() {
|
||||
|
||||
//MEMOS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("MemoList"),
|
||||
title: window.$gz.translation.get("MemoList"),
|
||||
icon: "inbox",
|
||||
route: "/home-memos",
|
||||
key: key++
|
||||
@@ -95,7 +95,7 @@ export default function initialize() {
|
||||
|
||||
//REMINDERS (SCHEDULE MARKERS)
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ReminderList"),
|
||||
title: window.$gz.translation.get("ReminderList"),
|
||||
icon: "sticky-note",
|
||||
route: "/home-reminders",
|
||||
key: key++
|
||||
@@ -103,7 +103,7 @@ export default function initialize() {
|
||||
|
||||
//USER SETTINGS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("UserSettings"),
|
||||
title: window.$gz.translation.get("UserSettings"),
|
||||
icon: "user-cog",
|
||||
route: "/home-user-settings",
|
||||
key: key++
|
||||
@@ -112,15 +112,15 @@ export default function initialize() {
|
||||
//Moved these two into user settings
|
||||
// //USER LOCALE
|
||||
// sub.push({
|
||||
// title: window.$gz.locale.get("Locale"),
|
||||
// title: window.$gz.translation.get("Locale"),
|
||||
// icon: "language",
|
||||
// route: "/home-locale",
|
||||
// route: "/home-translation",
|
||||
// key: key++
|
||||
// });
|
||||
|
||||
// //SET LOGIN
|
||||
// sub.push({
|
||||
// title: window.$gz.locale.get("SetLoginPassword"),
|
||||
// title: window.$gz.translation.get("SetLoginPassword"),
|
||||
// icon: "key",
|
||||
// route: "/home-password",
|
||||
// key: key++
|
||||
@@ -144,7 +144,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("NotifySubscriptionList"),
|
||||
title: window.$gz.translation.get("NotifySubscriptionList"),
|
||||
icon: "bullhorn",
|
||||
route: "/home-notify-subscriptions",
|
||||
key: key++
|
||||
@@ -153,7 +153,7 @@ export default function initialize() {
|
||||
|
||||
//HOME
|
||||
addNavItem(
|
||||
window.$gz.locale.get("Home"),
|
||||
window.$gz.translation.get("Home"),
|
||||
"home",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -180,7 +180,7 @@ export default function initialize() {
|
||||
|
||||
//CUSTOMERS subitem
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ClientList"),
|
||||
title: window.$gz.translation.get("ClientList"),
|
||||
icon: "address-card",
|
||||
route: "/cust-customers",
|
||||
key: key++
|
||||
@@ -188,7 +188,7 @@ export default function initialize() {
|
||||
|
||||
//HEAD OFFICES subitem
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("HeadOfficeList"),
|
||||
title: window.$gz.translation.get("HeadOfficeList"),
|
||||
icon: "sitemap",
|
||||
route: "/cust-headoffices",
|
||||
key: key++
|
||||
@@ -196,7 +196,7 @@ export default function initialize() {
|
||||
|
||||
// ** CUSTOMER (TOP)
|
||||
addNavItem(
|
||||
window.$gz.locale.get("ClientList"),
|
||||
window.$gz.translation.get("ClientList"),
|
||||
"address-book",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -231,7 +231,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Schedule"),
|
||||
title: window.$gz.translation.get("Schedule"),
|
||||
icon: "calendar-alt",
|
||||
route: "/svc-schedule",
|
||||
key: key++
|
||||
@@ -250,7 +250,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("WorkorderServiceList"),
|
||||
title: window.$gz.translation.get("WorkorderServiceList"),
|
||||
icon: "tools",
|
||||
route: "/svc-workorders",
|
||||
key: key++
|
||||
@@ -261,7 +261,7 @@ export default function initialize() {
|
||||
//this will be an item inside the workorders NEW menu or grid or wherever but it's not top level worthy
|
||||
//there used to be an array for 3rd level shit but that's whack yo! ;)
|
||||
// subSub.push({
|
||||
// title: window.$gz.locale.get("WorkorderServiceTemplate"),
|
||||
// title: window.$gz.translation.get("WorkorderServiceTemplate"),
|
||||
// icon: "stamp",
|
||||
// route: "/svc-workorder-templates",
|
||||
// key: key++
|
||||
@@ -271,7 +271,7 @@ export default function initialize() {
|
||||
//NOTE: this is the only item in this service level area that is visible to Sales
|
||||
//so there is no separate role check here as the service group role check supersedes this
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("WorkorderQuoteList"),
|
||||
title: window.$gz.translation.get("WorkorderQuoteList"),
|
||||
icon: "edit",
|
||||
route: "/svc-quotes",
|
||||
key: key++
|
||||
@@ -289,7 +289,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get(
|
||||
title: window.$gz.translation.get(
|
||||
"WorkorderPreventiveMaintenanceList"
|
||||
),
|
||||
icon: "business-time",
|
||||
@@ -310,7 +310,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("UnitList"),
|
||||
title: window.$gz.translation.get("UnitList"),
|
||||
icon: "fan",
|
||||
route: "/svc-units",
|
||||
key: key++
|
||||
@@ -318,7 +318,7 @@ export default function initialize() {
|
||||
|
||||
//UNIT MODELS subitem
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("UnitModels"),
|
||||
title: window.$gz.translation.get("UnitModels"),
|
||||
icon: "dice-d20",
|
||||
route: "/svc-unit-models",
|
||||
key: key++
|
||||
@@ -336,7 +336,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("LoanItemList"),
|
||||
title: window.$gz.translation.get("LoanItemList"),
|
||||
icon: "plug",
|
||||
route: "/svc-loaners",
|
||||
key: key++
|
||||
@@ -355,7 +355,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ContractList"),
|
||||
title: window.$gz.translation.get("ContractList"),
|
||||
icon: "file-contract",
|
||||
route: "/svc-contracts",
|
||||
key: key++
|
||||
@@ -374,7 +374,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ClientServiceRequestList"),
|
||||
title: window.$gz.translation.get("ClientServiceRequestList"),
|
||||
icon: "child",
|
||||
route: "/svc-csr-list",
|
||||
key: key++
|
||||
@@ -383,7 +383,7 @@ export default function initialize() {
|
||||
|
||||
//**** Service (TOP GROUP)
|
||||
addNavItem(
|
||||
window.$gz.locale.get("Service"),
|
||||
window.$gz.translation.get("Service"),
|
||||
"toolbox",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -405,7 +405,7 @@ export default function initialize() {
|
||||
|
||||
//PARTS (part list)
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("PartList"),
|
||||
title: window.$gz.translation.get("PartList"),
|
||||
icon: "boxes",
|
||||
route: "/inv-parts",
|
||||
key: key++
|
||||
@@ -413,7 +413,7 @@ export default function initialize() {
|
||||
|
||||
//INVENTORY
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("PartByWarehouseInventoryList"),
|
||||
title: window.$gz.translation.get("PartByWarehouseInventoryList"),
|
||||
icon: "pallet",
|
||||
route: "/inv-part-inventory",
|
||||
key: key++
|
||||
@@ -421,7 +421,7 @@ export default function initialize() {
|
||||
|
||||
//PART REQUESTS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("WorkorderItemPartRequestList"),
|
||||
title: window.$gz.translation.get("WorkorderItemPartRequestList"),
|
||||
icon: "paper-plane",
|
||||
route: "/inv-part-requests",
|
||||
key: key++
|
||||
@@ -429,7 +429,7 @@ export default function initialize() {
|
||||
|
||||
//PURCHASE ORDERS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("InventoryPurchaseOrders"),
|
||||
title: window.$gz.translation.get("InventoryPurchaseOrders"),
|
||||
icon: "shipping-fast",
|
||||
route: "/inv-purchase-orders",
|
||||
key: key++
|
||||
@@ -439,7 +439,9 @@ export default function initialize() {
|
||||
|
||||
//PURCHASE ORDER RECEIPTS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("InventoryPurchaseOrderReceipts"),
|
||||
title: window.$gz.translation.get(
|
||||
"InventoryPurchaseOrderReceipts"
|
||||
),
|
||||
icon: "dolly-flatbed",
|
||||
route: "/inv-purchase-order-receipts",
|
||||
key: key++
|
||||
@@ -451,7 +453,9 @@ export default function initialize() {
|
||||
|
||||
//ADJUSTMENTS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("InventoryPartInventoryAdjustments"),
|
||||
title: window.$gz.translation.get(
|
||||
"InventoryPartInventoryAdjustments"
|
||||
),
|
||||
icon: "dolly",
|
||||
route: "/inv-adjustments",
|
||||
key: key++
|
||||
@@ -459,7 +463,7 @@ export default function initialize() {
|
||||
|
||||
//**** INVENTORY (TOP GROUP)
|
||||
addNavItem(
|
||||
window.$gz.locale.get("Inventory"),
|
||||
window.$gz.translation.get("Inventory"),
|
||||
"box",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -480,7 +484,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
addNavItem(
|
||||
window.$gz.locale.get("VendorList"),
|
||||
window.$gz.translation.get("VendorList"),
|
||||
"store",
|
||||
"/vendors",
|
||||
[],
|
||||
@@ -500,7 +504,7 @@ export default function initialize() {
|
||||
|
||||
//FAKE subitem as is still TBD
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Accounting"),
|
||||
title: window.$gz.translation.get("Accounting"),
|
||||
icon: "calculator",
|
||||
route: "/acc-accounting",
|
||||
key: key++
|
||||
@@ -508,7 +512,7 @@ export default function initialize() {
|
||||
|
||||
// ** ACCOUNTING (TOP)
|
||||
addNavItem(
|
||||
window.$gz.locale.get("Accounting"),
|
||||
window.$gz.translation.get("Accounting"),
|
||||
"calculator",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -528,7 +532,7 @@ export default function initialize() {
|
||||
|
||||
// GLOBAL SETTINGS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("AdministrationGlobalSettings"),
|
||||
title: window.$gz.translation.get("AdministrationGlobalSettings"),
|
||||
icon: "cogs",
|
||||
route: "/adm-global-settings",
|
||||
key: key++
|
||||
@@ -536,7 +540,7 @@ export default function initialize() {
|
||||
|
||||
// LICENSE
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("HelpLicense"),
|
||||
title: window.$gz.translation.get("HelpLicense"),
|
||||
icon: "ticket-alt",
|
||||
route: "/adm-license",
|
||||
key: key++
|
||||
@@ -544,7 +548,7 @@ export default function initialize() {
|
||||
|
||||
// USERS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("UserList"),
|
||||
title: window.$gz.translation.get("UserList"),
|
||||
icon: "users",
|
||||
route: "/adm-users",
|
||||
key: key++
|
||||
@@ -554,7 +558,7 @@ export default function initialize() {
|
||||
|
||||
//LOCALIZED TEXT DESIGNER
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("LocalizedTextDesign"),
|
||||
title: window.$gz.translation.get("LocalizedTextDesign"),
|
||||
icon: "language",
|
||||
route: "/adm-localized-text",
|
||||
key: key++
|
||||
@@ -562,7 +566,7 @@ export default function initialize() {
|
||||
|
||||
//REPORT TEMPLATES
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ReportList"),
|
||||
title: window.$gz.translation.get("ReportList"),
|
||||
icon: "th-list",
|
||||
route: "/adm-report-templates",
|
||||
key: key++
|
||||
@@ -570,7 +574,7 @@ export default function initialize() {
|
||||
|
||||
//FILES IN DATABASE
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Attachments"),
|
||||
title: window.$gz.translation.get("Attachments"),
|
||||
icon: "folder",
|
||||
route: "/adm-attachments",
|
||||
key: key++
|
||||
@@ -578,7 +582,7 @@ export default function initialize() {
|
||||
|
||||
//EVENT LOG / HISTORY
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("History"),
|
||||
title: window.$gz.translation.get("History"),
|
||||
icon: "history",
|
||||
route: "/adm-history",
|
||||
key: key++
|
||||
@@ -586,7 +590,7 @@ export default function initialize() {
|
||||
|
||||
//KPI / METRICS / CHARTS AND STUFF
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Statistics"),
|
||||
title: window.$gz.translation.get("Statistics"),
|
||||
icon: "chart-line",
|
||||
route: "/adm-statistics",
|
||||
key: key++
|
||||
@@ -594,7 +598,7 @@ export default function initialize() {
|
||||
|
||||
// ** ADMINISTRATION (TOP)
|
||||
addNavItem(
|
||||
window.$gz.locale.get("Administration"),
|
||||
window.$gz.translation.get("Administration"),
|
||||
"user-tie",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -614,7 +618,7 @@ export default function initialize() {
|
||||
|
||||
// ARCHIVE
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("Backup"),
|
||||
title: window.$gz.translation.get("Backup"),
|
||||
icon: "file-archive",
|
||||
route: "/ops-backup",
|
||||
key: key++
|
||||
@@ -628,7 +632,7 @@ export default function initialize() {
|
||||
|
||||
// JOBS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ServerJobs"),
|
||||
title: window.$gz.translation.get("ServerJobs"),
|
||||
icon: "robot",
|
||||
route: "/ops-jobs",
|
||||
key: key++
|
||||
@@ -636,7 +640,7 @@ export default function initialize() {
|
||||
|
||||
// LOGS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ServerLog"),
|
||||
title: window.$gz.translation.get("ServerLog"),
|
||||
icon: "history",
|
||||
route: "/ops-log",
|
||||
key: key++
|
||||
@@ -644,7 +648,7 @@ export default function initialize() {
|
||||
|
||||
//METRICS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ServerMetrics"),
|
||||
title: window.$gz.translation.get("ServerMetrics"),
|
||||
icon: "file-medical-alt",
|
||||
route: "/ops-metrics",
|
||||
key: key++
|
||||
@@ -652,7 +656,7 @@ export default function initialize() {
|
||||
|
||||
//NOTIFICATION CONFIG AND HISTORY
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("NotificationSettings"),
|
||||
title: window.$gz.translation.get("NotificationSettings"),
|
||||
icon: "bullhorn",
|
||||
route: "/ops-notification-settings",
|
||||
key: key++
|
||||
@@ -660,7 +664,7 @@ export default function initialize() {
|
||||
|
||||
// ** OPERATIONS (TOP)
|
||||
addNavItem(
|
||||
window.$gz.locale.get("Operations"),
|
||||
window.$gz.translation.get("Operations"),
|
||||
"server",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -680,7 +684,7 @@ export default function initialize() {
|
||||
])
|
||||
) {
|
||||
addNavItem(
|
||||
window.$gz.locale.get("WidgetList"),
|
||||
window.$gz.translation.get("WidgetList"),
|
||||
"vial",
|
||||
"/widgets",
|
||||
[],
|
||||
@@ -705,7 +709,7 @@ export default function initialize() {
|
||||
|
||||
//CSR LIST subitem
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ClientServiceRequestList"),
|
||||
title: window.$gz.translation.get("ClientServiceRequestList"),
|
||||
icon: "child",
|
||||
route: "/customer-csr-list",
|
||||
key: key++
|
||||
@@ -713,7 +717,7 @@ export default function initialize() {
|
||||
|
||||
//WORKORDERS subitem
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("WorkorderServiceList"),
|
||||
title: window.$gz.translation.get("WorkorderServiceList"),
|
||||
icon: "tools",
|
||||
route: "/customer-workorders",
|
||||
key: key++
|
||||
@@ -722,7 +726,7 @@ export default function initialize() {
|
||||
//** CUSTOMER LOGIN HOME (TOP)
|
||||
|
||||
addNavItem(
|
||||
window.$gz.locale.get("Home"),
|
||||
window.$gz.translation.get("Home"),
|
||||
"home",
|
||||
undefined,
|
||||
sub,
|
||||
@@ -758,12 +762,12 @@ export default function initialize() {
|
||||
//get language to use, try user set override first, if empty then browser set, if empty then default to en-us
|
||||
l.languageOverride =
|
||||
res.data.languageOverride ||
|
||||
window.$gz.locale.getBrowserFirstLanguage() ||
|
||||
window.$gz.translation.getBrowserFirstLanguage() ||
|
||||
"en-US";
|
||||
|
||||
l.timeZoneOverride =
|
||||
res.data.timeZoneOverride ||
|
||||
window.$gz.locale.getBrowserTimeZoneName() ||
|
||||
window.$gz.translation.getBrowserTimeZoneName() ||
|
||||
"America/New_York";
|
||||
|
||||
//No browser setting for this so meh
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
export default {
|
||||
get(key) {
|
||||
// debugger;
|
||||
if (!window.$gz._.has(window.$gz.store.state.localeText, key)) {
|
||||
if (!window.$gz._.has(window.$gz.store.state.translationText, key)) {
|
||||
return "??" + key;
|
||||
}
|
||||
return window.$gz.store.state.localeText[key];
|
||||
return window.$gz.store.state.translationText[key];
|
||||
},
|
||||
fetch(keys) {
|
||||
return new Promise(function fetchLocaleKeysFromServer(resolve) {
|
||||
@@ -16,7 +16,9 @@ export default {
|
||||
//for example datatables have dynamic column names so they need to fetch on demand
|
||||
var needIt = [];
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (!window.$gz._.has(window.$gz.store.state.localeText, keys[i])) {
|
||||
if (
|
||||
!window.$gz._.has(window.$gz.store.state.translationText, keys[i])
|
||||
) {
|
||||
needIt.push(keys[i]);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +30,7 @@ export default {
|
||||
|
||||
//step 2: get it
|
||||
fetch(
|
||||
window.$gz.api.APIUrl("locale/subset"),
|
||||
window.$gz.api.APIUrl("translation/subset"),
|
||||
window.$gz.api.fetchPostOptions(needIt)
|
||||
)
|
||||
.then(window.$gz.api.status)
|
||||
@@ -37,7 +39,7 @@ export default {
|
||||
window.$gz._.forEach(
|
||||
response.data,
|
||||
function commitFetchedLTItemToStore(item) {
|
||||
window.$gz.store.commit("addLocaleText", item);
|
||||
window.$gz.store.commit("addTranslationText", item);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -162,7 +164,7 @@ export default {
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// Take in a string that contains one or more
|
||||
//locale keys between square brackets
|
||||
//translation keys between square brackets
|
||||
//translate each and return the string translated
|
||||
//
|
||||
translateString(s) {
|
||||
Reference in New Issue
Block a user