From c590b373ab28e17532c534f5c8a241ac43234e6d Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 23 Feb 2021 16:50:48 +0100 Subject: [PATCH] Disable footer based on env variable --- client/config/prod.env.js | 1 + client/src/helpers/footer.js | 3 +++ client/src/layouts/DefaultLayout.vue | 8 ++++++-- client/src/layouts/PublicLayout.vue | 10 ++++++++-- client/src/layouts/SimpleLayout.vue | 9 ++++++++- 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 client/src/helpers/footer.js diff --git a/client/config/prod.env.js b/client/config/prod.env.js index a9b4f3ec..afc74e39 100644 --- a/client/config/prod.env.js +++ b/client/config/prod.env.js @@ -12,6 +12,7 @@ module.exports = { VUE_APP_ENABLE_PORTFOLIO: process.env.ENABLE_PORTFOLIO || "true", VUE_APP_ENABLE_SPELLCHECK: !!process.env.TASKBASE_BASEURL, VUE_APP_JS_TITLE: JSON.stringify(process.env.VUE_APP_TITLE) || '"mySkillbox"', + VUE_APP_ENABLE_FOOTER: process.env.ENABLE_FOOTER || "true", /* * Vars used in HTML templates don't need to be stringyfied, as HTML does not need them to have quotes */ diff --git a/client/src/helpers/footer.js b/client/src/helpers/footer.js new file mode 100644 index 00000000..b946d62d --- /dev/null +++ b/client/src/helpers/footer.js @@ -0,0 +1,3 @@ +const enableFooter = () => process.env.VUE_APP_ENABLE_FOOTER; + +export default enableFooter; diff --git a/client/src/layouts/DefaultLayout.vue b/client/src/layouts/DefaultLayout.vue index ce8ebdfd..5a02d3d4 100644 --- a/client/src/layouts/DefaultLayout.vue +++ b/client/src/layouts/DefaultLayout.vue @@ -10,7 +10,9 @@ :key="$route.fullPath" class="layout__content" /> - + @@ -20,6 +22,7 @@ import ProfileSidebar from '@/components/profile/ProfileSidebar'; import DefaultFooter from '@/layouts/DefaultFooter'; import NavigationSidebar from '@/components/book-navigation/NavigationSidebar'; + import enableFooter from '@/helpers/footer'; export default { components: { @@ -37,7 +40,8 @@ specialContainerClass() { let cls = this.$store.state.specialContainerClass; return [cls ? `layout--${cls}` : '', {'skillbox--show-filter': this.showFilter}]; - } + }, + enableFooter: enableFooter } }; diff --git a/client/src/layouts/PublicLayout.vue b/client/src/layouts/PublicLayout.vue index 2361deb6..2dfe4ab0 100644 --- a/client/src/layouts/PublicLayout.vue +++ b/client/src/layouts/PublicLayout.vue @@ -4,19 +4,25 @@ - + diff --git a/client/src/layouts/SimpleLayout.vue b/client/src/layouts/SimpleLayout.vue index ed12482b..1fefdb80 100644 --- a/client/src/layouts/SimpleLayout.vue +++ b/client/src/layouts/SimpleLayout.vue @@ -6,13 +6,16 @@ - +