From dd6bfca7be6489eeb535e071e1c6a7aedaabbb62 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 24 Nov 2020 15:07:23 +0100 Subject: [PATCH 1/7] Clean up phoenix init --- src/phoenix.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/phoenix.js b/src/phoenix.js index 3b5592c6ed8..fc512ff12f5 100644 --- a/src/phoenix.js +++ b/src/phoenix.js @@ -298,11 +298,17 @@ async function registerClient(openIdConfig) { (async function () { + config = await fetch('config.json') + + if (config.status === 404) { + router.push('missing-config') + missingConfig() + return + } + try { - config = await fetch('config.json').catch(() => { - config.state = 'missing' - }) config = await config.json() + // if dynamic client registration is necessary - do this here now if (config.openIdConnect && config.openIdConnect.dynamic) { const clientData = await registerClient(config.openIdConnect) @@ -317,20 +323,15 @@ async function registerClient(openIdConfig) { // Loads apps from external servers if (config.external_apps) { - config.external_apps.forEach(app => apps.push(app.path)) + apps.push(...config.external_apps.map(app => app.path)) } - // provide global config object - // TODO: frozen object would be great ... - window.phoenixConfig = config - // requirejs.config({waitSeconds:200}) is not really working ... reason unknown // we are manipulating requirejs directly requirejs.s.contexts._.config.waitSeconds = 200 requirejs(apps, loadApps, requireError) } catch (err) { - router.push('missing-config') - missingConfig() + console.log(err) } })() From e4d47e5370f6d0c60d4c86ddf9008461316422f8 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 24 Nov 2020 16:42:51 +0100 Subject: [PATCH 2/7] Get rid of unused plugins mechanics --- src/components/Top-Bar.vue | 2 -- src/mixins/pluginHelper.js | 26 -------------------------- 2 files changed, 28 deletions(-) delete mode 100644 src/mixins/pluginHelper.js diff --git a/src/components/Top-Bar.vue b/src/components/Top-Bar.vue index b3af3ea9fc7..6174de4686e 100644 --- a/src/components/Top-Bar.vue +++ b/src/components/Top-Bar.vue @@ -32,7 +32,6 @@