HUGE REFACTOR / CLEANUP

if there is a issue it's probably something in here that was changed
This commit is contained in:
2021-09-28 20:19:44 +00:00
parent 51eddfede9
commit d0afdd9855
238 changed files with 3127 additions and 8614 deletions

View File

@@ -1,11 +1,9 @@
/* Xeslint-disable */
function addNavItem(title, icon, route, navItems, key, testid, color = null) {
if (!testid) {
testid = route;
}
let o = {
const o = {
title,
icon,
route,
@@ -23,11 +21,8 @@ function addNavItem(title, icon, route, navItems, key, testid, color = null) {
function initNavPanel() {
let key = 0;
let sub = [];
// let t = window.$gz.translation.get;
// let role = window.$gz.role.AUTHORIZATION_ROLES;
let licenseState = window.$gz.store.state.globalSettings.licenseStatus;
let useInventory = window.$gz.store.state.globalSettings.useInventory;
const licenseState = window.$gz.store.state.globalSettings.licenseStatus;
const useInventory = window.$gz.store.state.globalSettings.useInventory;
/*Service = 1,
NotService = 2,
Customer = 3,
@@ -109,7 +104,6 @@ function initNavPanel() {
}
//###### SUBCONTRACTORS ######
//console.log(window.$gz.store.getters.isSubContractorUser);
if (window.$gz.store.getters.isSubContractorUser == true) {
//clear sublevel array
sub = [];
@@ -748,14 +742,14 @@ function initNavPanel() {
async function getUserOptions() {
try {
let res = await window.$gz.api.get(
const res = await window.$gz.api.get(
"user-option/" + window.$gz.store.state.userId
);
if (res.error) {
//In a form this would trigger a bunch of validation or error display code but for here and now:
//convert error to human readable string for display and popup a notification to user
let msg = window.$gz.api.apiErrorToHumanString(res.error);
const msg = window.$gz.api.apiErrorToHumanString(res.error);
window.$gz.store.commit(
"logItem",
"Initialize::() fetch useroptions -> error" + msg
@@ -765,7 +759,7 @@ async function getUserOptions() {
//Check if overrides and use them here
//or else use browser defaults
let l = {
const l = {
languageOverride: null,
timeZoneOverride: null,
currencyName: null,
@@ -775,16 +769,6 @@ async function getUserOptions() {
mapUrlTemplate: null
};
//removed this block, locale already attempts this fully and this should really only set the user persisted value, not guess it here
//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.navigator.languages[0] || "en-US";
// l.timeZoneOverride =
// res.data.timeZoneOverride ||
// window.$gz.locale.getResolvedTimeZoneName() ||
// "America/New_York";
l.languageOverride = res.data.languageOverride;
l.timeZoneOverride = res.data.timeZoneOverride;