🔥 Implementation of VueX, delete all emit events

This commit is contained in:
Alicia Sykes
2021-10-10 14:32:54 +01:00
parent 8d111a1623
commit fddb77dec9
12 changed files with 47 additions and 58 deletions

View File

@@ -16,9 +16,7 @@ const getAppConfig = () => {
* Support for old user structure will be removed in V 1.7.0
*/
const printWarning = () => {
const msg = 'From V 1.6.5 onwards, the structure of the users object has changed.';
// eslint-disable-next-line no-console
console.warn(msg);
ErrorHandler('From V 1.6.5 onwards, the structure of the users object has changed.');
};
/* Returns true if keycloak is enabled */

View File

@@ -11,9 +11,8 @@ import {
pageInfo as defaultPageInfo,
iconSize as defaultIconSize,
layout as defaultLayout,
// language as defaultLanguage,
} from '@/utils/defaults';
import ErrorHandler from '@/utils/ErrorHandler';
import conf from '../../public/conf.yml';
export default class ConfigAccumulator {
@@ -46,24 +45,14 @@ export default class ConfigAccumulator {
/* Page Info */
pageInfo() {
const defaults = defaultPageInfo;
let localPageInfo;
try {
localPageInfo = JSON.parse(localStorage[localStorageKeys.PAGE_INFO]);
} catch (e) {
localPageInfo = {};
let localPageInfo = {};
if (localStorage[localStorageKeys.PAGE_INFO]) {
// eslint-disable-next-line brace-style
try { localPageInfo = JSON.parse(localStorage[localStorageKeys.PAGE_INFO]); }
catch (e) { ErrorHandler('Malformed pageInfo data in local storage'); }
}
let filePageInfo = {};
if (this.conf) {
filePageInfo = this.conf.pageInfo || {};
}
const pi = filePageInfo || defaults; // The page info object to return
pi.title = localPageInfo.title || filePageInfo.title || defaults.title;
pi.logo = localPageInfo.logo || filePageInfo.logo || defaults.logo;
pi.description = localPageInfo.description || filePageInfo.description || defaults.description;
pi.navLinks = localPageInfo.navLinks || filePageInfo.navLinks || defaults.navLinks;
pi.footerText = localPageInfo.footerText || filePageInfo.footerText || defaults.footerText;
return pi;
const filePageInfo = this.conf ? this.conf.pageInfo || {} : {};
return { ...defaultPageInfo, ...filePageInfo, ...localPageInfo };
}
/* Sections */
@@ -75,13 +64,11 @@ export default class ConfigAccumulator {
const json = JSON.parse(localSections);
if (json.length >= 1) return json;
} catch (e) {
// The data in local storage has been malformed, will return conf.sections instead
ErrorHandler('Malformed section data in local storage');
}
}
// If the function hasn't yet returned, then return the config file sections
let sectionsFile = [];
if (this.conf) sectionsFile = this.conf.sections || [];
return sectionsFile;
return this.conf ? this.conf.sections || [] : [];
}
/* Complete config */