Merge branch 'feature/refactor-env-vars-to-es6-module' into develop

This commit is contained in:
Daniel Egger 2022-05-11 14:08:32 +02:00
commit db9ef5ef22
34 changed files with 173 additions and 104 deletions

View File

@ -0,0 +1,17 @@
'use strict'
module.exports = {
/*
* ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes
* around strings
*/
VUE_APP_ENABLE_SPELLCHECK: !!process.env.TASKBASE_BASEURL,
/*
* Vars used in HTML templates don't need to be stringyfied, as HTML does not need them to have quotes
*/
// vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv
VUE_APP_FAVICON_32: 'https://skillbox-my-kv-prod.s3-eu-west-1.amazonaws.com/mykv-fav.png',
VUE_APP_FAVICON_16: 'https://skillbox-my-kv-prod.s3-eu-west-1.amazonaws.com/mykv-fav.png',
VUE_APP_TITLE: 'My KV'
// ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^
}

View File

@ -1,25 +1,34 @@
'use strict' 'use strict'
module.exports = { const { merge } = require('webpack-merge')
const values = {
NODE_ENV: '"production"', NODE_ENV: '"production"',
HEP_URL: JSON.stringify(process.env.HEP_URL), HEP_URL: JSON.stringify(process.env.HEP_URL),
MATOMO_HOST: JSON.stringify(process.env.MATOMO_HOST), MATOMO_HOST: JSON.stringify(process.env.MATOMO_HOST),
MATOMO_SITE_ID: JSON.stringify(process.env.MATOMO_SITE_ID), MATOMO_SITE_ID: JSON.stringify(process.env.MATOMO_SITE_ID),
LOGOUT_REDIRECT_URL: JSON.stringify(process.env.LOGOUT_REDIRECT_URL), LOGOUT_REDIRECT_URL: JSON.stringify(process.env.LOGOUT_REDIRECT_URL),
VUE_APP_FLAVOR: JSON.stringify(process.env.APP_FLAVOR),
/* /*
* ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes * ENV variables used in JS code need to be stringyfied, as they will be replaced (in place) in the code,
* around strings * and JS needs quotes around strings
* see https://cli.vuejs.org/guide/mode-and-env.html#using-env-variables-in-client-side-code
*/ */
VUE_APP_LOGO: JSON.stringify(process.env.VUE_APP_LOGO) || '"/static/logo.png"',
VUE_APP_ENABLE_PORTFOLIO: process.env.ENABLE_PORTFOLIO || "true",
VUE_APP_ENABLE_SPELLCHECK: !!process.env.TASKBASE_BASEURL, 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 * Vars used in HTML templates don't need to be stringyfied, as HTML does not need them to have quotes
*/ */
// vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv // vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv
VUE_APP_FAVICON_32: process.env.VUE_APP_FAVICON_32 || '/static/favicon-32x32.png', VUE_APP_FAVICON_32: '/static/favicon-32x32.png',
VUE_APP_FAVICON_16: process.env.VUE_APP_FAVICON_16 || '/static/favicon-16x16.png', VUE_APP_FAVICON_16: '/static/favicon-16x16.png',
VUE_APP_TITLE: process.env.VUE_APP_TITLE || 'mySkillbox' VUE_APP_TITLE: 'mySkillbox'
// ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^ // ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^
} }
if (process.env.APP_FLAVOR === 'my-kv') {
module.exports = merge(values, require('./prod-my-kv.env.js'));
} else {
// we are on the skillbox APP_FLAVOR
module.exports = values;
}

View File

@ -9,7 +9,7 @@
<a <a
class="button button--primary submissions-page__back" class="button button--primary submissions-page__back"
@click="$emit('back')" @click="$emit('back')"
>Aufgabe im Modul anzeigen</a> >Aufgabe im {{ $flavor.textModule }} anzeigen</a>
</div> </div>
<div <div
@ -65,7 +65,7 @@
<script> <script>
import StudentSubmission from '@/components/StudentSubmission'; import StudentSubmission from '@/components/StudentSubmission';
import {meQuery} from '@/graphql/queries'; import { meQuery } from '@/graphql/queries';
export default { export default {
props: ['assignment'], props: ['assignment'],

View File

@ -9,9 +9,9 @@
</template> </template>
<script> <script>
import {MODULE_PAGE} from '@/router/module.names'; import { MODULE_PAGE } from '@/router/module.names';
import {ROOMS_PAGE} from '@/router/room.names'; import { ROOMS_PAGE } from '@/router/room.names';
import {PROJECTS_PAGE} from '@/router/portfolio.names'; import { PROJECTS_PAGE } from '@/router/portfolio.names';
const ChevronLeft = () => import(/* webpackChunkName: "icons" */'@/components/icons/ChevronLeft'); const ChevronLeft = () => import(/* webpackChunkName: "icons" */'@/components/icons/ChevronLeft');
@ -51,9 +51,9 @@
fullTitle() { fullTitle() {
switch (this.type) { switch (this.type) {
case 'topic': case 'topic':
return `Thema: ${this.title}`; return `${this.$flavor.textTopic}: ${this.title}`;
case 'module': case 'module':
return `Modul: ${this.title}`; return `${this.$flavor.textModule}: ${this.title}`;
default: default:
return this.title; return this.title;
} }

View File

@ -81,11 +81,12 @@
import DELETE_CONTENT_BLOCK_MUTATION from '@/graphql/gql/mutations/deleteContentBlock.gql'; import DELETE_CONTENT_BLOCK_MUTATION from '@/graphql/gql/mutations/deleteContentBlock.gql';
import me from '@/mixins/me'; import me from '@/mixins/me';
import {hidden} from '@/helpers/visibility';
import {CONTENT_TYPE} from '@/consts/types'; import { hidden } from '@/helpers/visibility';
import { CONTENT_TYPE } from '@/consts/types';
import PopoverLink from '@/components/ui/PopoverLink'; import PopoverLink from '@/components/ui/PopoverLink';
import {removeAtIndex} from '@/graphql/immutable-operations'; import { removeAtIndex } from '@/graphql/immutable-operations';
import {EDIT_CONTENT_BLOCK_PAGE} from '@/router/module.names'; import { EDIT_CONTENT_BLOCK_PAGE } from '@/router/module.names';
const ContentComponent = () => import(/* webpackChunkName: "content-components" */'@/components/content-blocks/ContentComponent'); const ContentComponent = () => import(/* webpackChunkName: "content-components" */'@/components/content-blocks/ContentComponent');
@ -137,7 +138,7 @@
return ''; return '';
} }
return `Instrument - ${instruments[contentType]}`; return `${this.$flavor.textInstrument} - ${instruments[contentType]}`;
}, },
canEditContentBlock() { canEditContentBlock() {
return this.contentBlock.mine && !this.contentBlock.indent; return this.contentBlock.mine && !this.contentBlock.indent;

View File

@ -12,7 +12,7 @@
class="content-navigation__link" class="content-navigation__link"
@click.native="close" @click.native="close"
> >
Themen {{ $flavor.textTopics }}
</router-link> </router-link>
<book-topic-navigation <book-topic-navigation
@ -27,7 +27,7 @@
class="content-navigation__link" class="content-navigation__link"
@click.native="close" @click.native="close"
> >
Instrumente {{ $flavor.textInstruments }}
</router-link> </router-link>
</div> </div>
@ -120,7 +120,7 @@
computed: { computed: {
showPortfolio() { showPortfolio() {
return process.env.VUE_APP_ENABLE_PORTFOLIO; return this.$flavor.showPortfolio;
} }
}, },

View File

@ -9,14 +9,14 @@
:to="{name: 'instrument', params: { slug: value.slug }}" :to="{name: 'instrument', params: { slug: value.slug }}"
class="instrument-widget__button button" class="instrument-widget__button button"
> >
Instrument anzeigen {{ $flavor.textInstrument }} anzeigen
</router-link> </router-link>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: ['value'] props: ['value'],
}; };
</script> </script>

View File

@ -10,7 +10,7 @@
export default { export default {
computed: { computed: {
img() { img() {
return process.env.VUE_APP_LOGO; return this.$flavor.appLogo;
} }
}, },
}; };

View File

@ -13,7 +13,7 @@
</template> </template>
<script> <script>
import {INTERDISCIPLINARY, LANGUAGE_COMMUNICATION, SOCIETY} from '@/consts/instrument.consts'; import { INTERDISCIPLINARY, LANGUAGE_COMMUNICATION, SOCIETY } from '@/consts/instrument.consts';
import instrumentType from '@/helpers/instrumentType'; import instrumentType from '@/helpers/instrumentType';
export default { export default {
@ -34,7 +34,11 @@
}; };
}, },
categoryName() { categoryName() {
return instrumentType(this.instrument); if (this.$flavor.appFlavor === 'my-kv') {
return this.$flavor.textInstruments;
} else {
return instrumentType(this.instrument);
}
}, },
}, },
}; };

View File

@ -40,7 +40,7 @@
</div> </div>
<h3 id="objectives"> <h3 id="objectives">
Lernziele <span v-show="$flavor.showObjectivesTitle">Lernziele</span>
</h3> </h3>
<div class="module__objective-groups"> <div class="module__objective-groups">
@ -74,6 +74,7 @@
default: () => ({}), default: () => ({}),
}, },
}, },
components: { components: {
BookmarkActions, BookmarkActions,
ObjectiveGroups, ObjectiveGroups,

View File

@ -25,7 +25,7 @@
<a <a
class="button" class="button"
@click="close" @click="close"
>Zurück zum Modul</a> >Zurück zum {{ $flavor.textModule }}</a>
</div> </div>
</template> </template>
</modal> </modal>
@ -33,7 +33,7 @@
<script> <script>
import Modal from '@/components/Modal'; import Modal from '@/components/Modal';
import {SNAPSHOT_LIST} from '@/router/module.names'; import { SNAPSHOT_LIST } from '@/router/module.names';
import dateformat from '@/helpers/date-format'; import dateformat from '@/helpers/date-format';
export default { export default {

View File

@ -37,7 +37,7 @@
<checkbox <checkbox
:checked="agreement" :checked="agreement"
data-cy="apply-checkbox" data-cy="apply-checkbox"
label="Ich will die Anpassungen aus diesem Snapshot in das Modul kopieren." :label="`Ich will die Anpassungen aus diesem Snapshot in das ${$flavor.textModule} kopieren.`"
@input="agreement = $event" @input="agreement = $event"
/> />
</div> </div>
@ -70,7 +70,7 @@
import me from '@/mixins/me'; import me from '@/mixins/me';
import APPLY_SNAPSHOT_MUTATION from 'gql/mutations/snapshots/applySnapshot.gql'; import APPLY_SNAPSHOT_MUTATION from 'gql/mutations/snapshots/applySnapshot.gql';
import {MODULE_PAGE} from '@/router/module.names'; import { MODULE_PAGE } from '@/router/module.names';
const _getChange = (snapshot, index) => { const _getChange = (snapshot, index) => {
try { try {

View File

@ -46,7 +46,7 @@
<template v-else> <template v-else>
Diese Person kann Diese Person kann
</template> </template>
weiterhin Module und Instrumente lesen. weiterhin {{ $flavor.textModules }} und {{ $flavor.textInstruments }} lesen.
</li> </li>
<li class="deactivate-user__text deactivate-user__list-item"> <li class="deactivate-user__text deactivate-user__list-item">
<template v-if="myself"> <template v-if="myself">

View File

@ -2,7 +2,7 @@
<toggle <toggle
:checked="module.inEditMode" :checked="module.inEditMode"
data-cy="toggle-editing" data-cy="toggle-editing"
label="Modul anpassen" :label="`${$flavor.textModule} anpassen`"
@input="toggle" @input="toggle"
/> />
</template> </template>
@ -10,8 +10,8 @@
<script> <script>
import Toggle from '@/components/ui/Toggle'; import Toggle from '@/components/ui/Toggle';
// import MODULE_DETAILS_QUERY from '@/graphql/gql/queries/modules/moduleDetailsQuery.gql'; // import MODULE_DETAILS_QUERY from '@/graphql/gql/queries/modules/moduleDetailsQuery.gql';
import {gql} from '@apollo/client/core'; import { gql } from '@apollo/client/core';
import {setModuleEditMode} from '@/graphql/cache-operations'; import { setModuleEditMode } from '@/graphql/cache-operations';
const QUERY = gql` const QUERY = gql`
query ModuleEditModeQuery ($slug: String) { query ModuleEditModeQuery ($slug: String) {

View File

@ -0,0 +1,45 @@
const defaultFlavorValues = {
appFlavor: 'skillbox',
appLogo: '/static/logo.png',
// mySkillbox texts
textAppName: 'mySkillbox',
textTopic: 'Thema',
textTopics: 'Themen',
textModule: 'Modul',
textModules: 'Module',
textInstrument: 'Instrument',
textInstruments: 'Instrumente',
// mySkillbox flags
showFooter: true,
showObjectivesTitle: true,
showInstrumentFilterSidebar: true,
showPortfolio: true,
};
let flavorValues = Object.assign({}, defaultFlavorValues);
if (process.env.VUE_APP_FLAVOR === 'my-kv') {
flavorValues = Object.assign({}, defaultFlavorValues, {
appFlavor: 'my-kv',
appLogo: 'https://skillbox-my-kv-prod.s3-eu-west-1.amazonaws.com/mykv-logo.png',
// myKV texts
textAppName: 'myKV',
textTopic: 'HKB',
textTopics: 'HKB',
textModule: 'Lernfeld',
textModules: 'Lernfelder',
textInstrument: 'Grundlagenwissen',
textInstruments: 'Grundlagenwissen',
// myKV flags
showFooter: false,
showObjectivesTitle: false,
showInstrumentFilterSidebar: false,
showPortfolio: true,
});
}
export default flavorValues;

View File

@ -1,3 +0,0 @@
const enableFooter = () => process.env.VUE_APP_ENABLE_FOOTER;
export default enableFooter;

View File

@ -1,13 +1,13 @@
import {LANGUAGE_COMMUNICATION, SOCIETY} from '@/consts/instrument.consts'; import { LANGUAGE_COMMUNICATION, SOCIETY } from '@/consts/instrument.consts';
const instrumentType = ({type: {category}}) => { const instrumentType = ({type: {category}}) => {
if (category === LANGUAGE_COMMUNICATION) { if (category === LANGUAGE_COMMUNICATION) {
return 'Sprache & Kommunikation'; return 'Sprache & Kommunikation';
} else if (category === SOCIETY) { } else if (category === SOCIETY) {
return 'Gesellschaft'; return 'Gesellschaft';
} else { } else {
return 'Überfachliches Instrument'; return 'Überfachliches Instrument';
} }
}; };
export default instrumentType; export default instrumentType;

View File

@ -26,7 +26,6 @@
import ProfileSidebar from '@/components/profile/ProfileSidebar'; import ProfileSidebar from '@/components/profile/ProfileSidebar';
import DefaultFooter from '@/layouts/DefaultFooter'; import DefaultFooter from '@/layouts/DefaultFooter';
import NavigationSidebar from '@/components/book-navigation/NavigationSidebar'; import NavigationSidebar from '@/components/book-navigation/NavigationSidebar';
import enableFooter from '@/helpers/footer';
export default { export default {
components: { components: {
@ -56,7 +55,7 @@
return classes; return classes;
}, },
enableFooter() { enableFooter() {
return enableFooter() && (!this.$route.meta || !this.$route.meta.hideFooter); return this.$flavor.showFooter && (!this.$route.meta || !this.$route.meta.hideFooter);
} }
} }
}; };

View File

@ -11,13 +11,13 @@
<router-view class="public__content layout__content" /> <router-view class="public__content layout__content" />
<default-footer <default-footer
class="skillbox__footer public__footer footer" class="skillbox__footer public__footer footer"
v-if="enableFooter" v-if="$flavor.showFooter"
/> />
</div> </div>
</template> </template>
<script> <script>
import DefaultFooter from '@/layouts/DefaultFooter'; import DefaultFooter from '@/layouts/DefaultFooter';
import enableFooter from '@/helpers/footer';
const Logo = () => import(/* webpackChunkName: "icons" */'@/components/icons/Logo'); const Logo = () => import(/* webpackChunkName: "icons" */'@/components/icons/Logo');
export default { export default {
@ -25,10 +25,6 @@
Logo, Logo,
DefaultFooter DefaultFooter
}, },
computed: {
enableFooter: enableFooter
}
}; };
</script> </script>

View File

@ -19,7 +19,7 @@
<script> <script>
import SimpleFooter from '@/layouts/SimpleFooter'; import SimpleFooter from '@/layouts/SimpleFooter';
import enableFooter from '@/helpers/footer';
const Cross = () => import(/* webpackChunkName: "icons" */'@/components/icons/CrossIcon'); const Cross = () => import(/* webpackChunkName: "icons" */'@/components/icons/CrossIcon');
export default { export default {
@ -33,7 +33,7 @@
if (this.$route.meta.hideFooter) { if (this.$route.meta.hideFooter) {
return false; return false;
} }
return enableFooter(); return this.$flavor.showFooter;
} }
}, },

View File

@ -4,7 +4,7 @@ import VueVimeoPlayer from 'vue-vimeo-player';
import apolloClientFactory from './graphql/client'; import apolloClientFactory from './graphql/client';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import App from './App.vue'; import App from './App.vue';
import {postLoginRedirectUrlKey, router} from './router'; import { postLoginRedirectUrlKey, router } from './router';
import store from '@/store/index'; import store from '@/store/index';
import VueScrollTo from 'vue-scrollto'; import VueScrollTo from 'vue-scrollto';
import autoGrow from '@/directives/auto-grow'; import autoGrow from '@/directives/auto-grow';
@ -15,7 +15,8 @@ import VueRemoveEdges from '@/plugins/edges';
import VueMatomo from 'vue-matomo'; import VueMatomo from 'vue-matomo';
import VueToast from 'vue-toast-notification'; import VueToast from 'vue-toast-notification';
import VueLogger from 'vuejs-logger'; import VueLogger from 'vuejs-logger';
import {joiningClass, loginRequired, unauthorizedAccess} from "@/router/guards"; import { joiningClass, loginRequired, unauthorizedAccess } from '@/router/guards';
import flavorPlugin from '@/plugins/flavor';
Vue.config.productionTip = false; Vue.config.productionTip = false;
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
@ -38,6 +39,8 @@ Vue.use(VueScrollTo, {
offset: -50, offset: -50,
}); });
Vue.use(flavorPlugin);
if (process.env.MATOMO_HOST) { if (process.env.MATOMO_HOST) {
Vue.use(VueMatomo, { Vue.use(VueMatomo, {
host: process.env.MATOMO_HOST, host: process.env.MATOMO_HOST,

View File

@ -1,7 +0,0 @@
export default {
data() {
return {
pageTitle: process.env.VUE_APP_JS_TITLE
};
}
};

View File

@ -19,7 +19,7 @@
</a> </a>
</div> </div>
<p class="about__text"> <p class="about__text">
mySkillbox ist ein Angebot des hep Verlags in {{ $flavor.textAppName }} ist ein Angebot des hep Verlags in
Zusammenarbeit mit der Eidgenössischen Hochschule für Berufsbildung (EHB). Zusammenarbeit mit der Eidgenössischen Hochschule für Berufsbildung (EHB).
</p> </p>
</div> </div>
@ -29,7 +29,7 @@
class="login-actions__title" class="login-actions__title"
data-cy="hello-title" data-cy="hello-title"
> >
Wollen Sie {{ pageTitle }} im Unterricht verwenden? Wollen Sie {{ $flavor.textAppName }} im Unterricht verwenden?
</h2> </h2>
<a <a
class="button button--primary button--big actions__submit" class="button button--primary button--big actions__submit"
@ -71,13 +71,11 @@
</template> </template>
<script> <script>
import pageTitleMixin from '@/mixins/page-title';
const HepLogoNoClaim = () => import(/* webpackChunkName: "icons" */'@/components/icons/HepLogoNoClaim'); const HepLogoNoClaim = () => import(/* webpackChunkName: "icons" */'@/components/icons/HepLogoNoClaim');
const EhbLogo = () => import(/* webpackChunkName: "icons" */'@/components/icons/EhbLogo'); const EhbLogo = () => import(/* webpackChunkName: "icons" */'@/components/icons/EhbLogo');
const Logo = () => import(/* webpackChunkName: "icons" */'@/components/icons/Logo'); const Logo = () => import(/* webpackChunkName: "icons" */'@/components/icons/Logo');
export default { export default {
mixins: [pageTitleMixin],
components: { components: {
HepLogoNoClaim, HepLogoNoClaim,
EhbLogo, EhbLogo,

View File

@ -14,7 +14,7 @@
</li> </li>
<li> <li>
<router-link to="/module"> <router-link to="/module">
Modul {{ $flavor.textModule }}
</router-link> </router-link>
</li> </li>
<li> <li>

View File

@ -2,8 +2,13 @@
<div class="instrument-overview"> <div class="instrument-overview">
<instrument-filter <instrument-filter
class="instrument-overview__filter" class="instrument-overview__filter"
v-if="$flavor.showInstrumentFilterSidebar"
@filter="updateFilter" @filter="updateFilter"
/> />
<div
class="instrument-overview__filter"
v-else
/>
<div class="instrument-overview__list"> <div class="instrument-overview__list">
<router-link <router-link
:to="{name: 'instrument', params: {slug: instrument.slug}}" :to="{name: 'instrument', params: {slug: instrument.slug}}"

View File

@ -50,13 +50,13 @@
<a <a
:href="teacherEditionUrl" :href="teacherEditionUrl"
class="hep-link" class="hep-link"
>{{ pageTitle }} für Lehrpersonen</a> >{{ flavorPageTitle }} für Lehrpersonen</a>
</li> </li>
<li class="license-links__item"> <li class="license-links__item">
<a <a
:href="studentEditionUrl" :href="studentEditionUrl"
class="hep-link" class="hep-link"
>{{ pageTitle }} für Lernende</a> >{{ flavorPageTitle }} für Lernende</a>
</li> </li>
</ul> </ul>
</section> </section>
@ -68,16 +68,15 @@
import REDEEM_COUPON from '@/graphql/gql/mutations/redeemCoupon.gql'; import REDEEM_COUPON from '@/graphql/gql/mutations/redeemCoupon.gql';
import ME_QUERY from '@/graphql/gql/queries/meQuery.gql'; import ME_QUERY from '@/graphql/gql/queries/meQuery.gql';
import LoadingButton from '@/components/LoadingButton'; import LoadingButton from '@/components/LoadingButton';
import {ValidationObserver} from 'vee-validate'; import { ValidationObserver } from 'vee-validate';
import me from '@/mixins/me'; import me from '@/mixins/me';
import logout from '@/mixins/logout'; import logout from '@/mixins/logout';
import pageTitleMixin from '@/mixins/page-title';
const ValidatedInput = () => import('@/components/validation/ValidatedInput'); const ValidatedInput = () => import('@/components/validation/ValidatedInput');
export default { export default {
mixins: [me, logout, pageTitleMixin], mixins: [me, logout],
components: { components: {
LoadingButton, LoadingButton,
ValidationObserver, ValidationObserver,

View File

@ -8,7 +8,7 @@
Lösungen Lösungen
</h2> </h2>
<p class="module-settings__paragraph"> <p class="module-settings__paragraph">
Wollen Sie die Lösungen in diesem Modul für die Lernenden der ausgewählten Klasse anzeigen? Wollen Sie die Lösungen in diesem {{ $flavor.textModule }} für die Lernenden der ausgewählten Klasse anzeigen?
</p> </p>
<toggle-solutions-for-module /> <toggle-solutions-for-module />
</section> </section>

View File

@ -6,19 +6,15 @@
</h1> </h1>
<p class="onboarding__claim"> <p class="onboarding__claim">
Schauen Sie sich die Einführung an und lernen Sie {{ pageTitle }} kennen. Schauen Sie sich die Einführung an und lernen Sie {{ flavorPageTitle }} kennen.
</p> </p>
</div> </div>
</template> </template>
<script> <script>
import pageTitleMixin from '@/mixins/page-title';
const Logo = () => import(/* webpackChunkName: "icons" */'@/components/icons/Logo'); const Logo = () => import(/* webpackChunkName: "icons" */'@/components/icons/Logo');
export default { export default {
mixins: [pageTitleMixin],
components: { components: {
Logo Logo
}, },

View File

@ -7,16 +7,16 @@
Ihr Lernbereich Ihr Lernbereich
</h1> </h1>
<h2 class="onboarding__heading"> <h2 class="onboarding__heading">
Themen {{ $flavor.textTopics }}
</h2> </h2>
<p class="onboarding__paragraph"> <p class="onboarding__paragraph">
In den «Themen» finden Sie aktuelle Module mit Aufträgen und Situationen. In den «{{ $flavor.textTopics }}» finden Sie aktuelle {{ $flavor.textModules }} mit Aufträgen und Situationen.
</p> </p>
<h2 class="onboarding__heading"> <h2 class="onboarding__heading">
Instrumente {{ $flavor.textInstruments }}
</h2> </h2>
<p class="onboarding__paragraph"> <p class="onboarding__paragraph">
Die «Instrumente» helfen Ihnen dabei, Aufträge und Situationen zu bearbeiten. Zudem erweitern Sie so Ihre Kompetenzen. Die «{{ $flavor.textInstruments }}» helfen Ihnen dabei, Aufträge und Situationen zu bearbeiten. Zudem erweitern Sie so Ihre Kompetenzen.
</p> </p>
<h2 class="onboarding__heading"> <h2 class="onboarding__heading">
News News

View File

@ -2,7 +2,7 @@
<div class="snapshots"> <div class="snapshots">
<h1>Snapshots</h1> <h1>Snapshots</h1>
<p class="snapshots__details"> <p class="snapshots__details">
Thema: {{ module.topic.title }} - {{ module.metaTitle }}: {{ module.title }} {{ $flavor.textTopic }}: {{ module.topic.title }} - {{ module.metaTitle }}: {{ module.title }}
</p> </p>
<snapshot-team-menu <snapshot-team-menu
:selected="selectedLink" :selected="selectedLink"
@ -24,7 +24,6 @@
<script> <script>
import SnapshotListItem from '@/components/modules/SnapshotListItem'; import SnapshotListItem from '@/components/modules/SnapshotListItem';
import MODULE_SNAPSHOTS_QUERY from '@/graphql/gql/queries/moduleSnapshots.gql'; import MODULE_SNAPSHOTS_QUERY from '@/graphql/gql/queries/moduleSnapshots.gql';
import SnapshotTeamMenu from '@/components/modules/SnapshotTeamMenu'; import SnapshotTeamMenu from '@/components/modules/SnapshotTeamMenu';

View File

@ -9,14 +9,14 @@
class="start-page__heading" class="start-page__heading"
data-cy="start-page-heading" data-cy="start-page-heading"
> >
Letzte Module Letzte {{ $flavor.textModules }}
</h2> </h2>
<h3 <h3
class="start-page__no-modules" class="start-page__no-modules"
data-cy="no-modules-yet" data-cy="no-modules-yet"
v-if="!me.recentModules.length" v-if="!me.recentModules.length"
> >
Sie haben sich noch kein Modul angeschaut. Legen Sie jetzt los! Sie haben sich noch kein {{ $flavor.textModule }} angeschaut. Legen Sie jetzt los!
</h3> </h3>
<div class="start-page__modules-list"> <div class="start-page__modules-list">
<module-teaser <module-teaser
@ -34,7 +34,7 @@
tag="div" tag="div"
class="button" class="button"
> >
Alle Module anzeigen Alle {{ $flavor.textModules }} anzeigen
</router-link> </router-link>
</div> </div>
<div <div
@ -63,10 +63,10 @@
<div class="start-page__onboarding"> <div class="start-page__onboarding">
<h2 class="start-page__heading"> <h2 class="start-page__heading">
Kennen Sie schon alle Bereiche von {{ pageTitle }}? Kennen Sie schon alle Bereiche von {{ flavorPageTitle }}?
</h2> </h2>
<p class="start-page__paragraph"> <p class="start-page__paragraph">
Schauen Sie sich jetzt die Einführung zu {{ pageTitle }} an. Schauen Sie sich jetzt die Einführung zu {{ flavorPageTitle }} an.
</p> </p>
<router-link <router-link
:to="{name: 'onboarding-start'}" :to="{name: 'onboarding-start'}"
@ -82,15 +82,12 @@
import NewsTeaser from '@/components/news/NewsTeaser.vue'; import NewsTeaser from '@/components/news/NewsTeaser.vue';
import ModuleTeaser from '@/components/modules/ModuleTeaser'; import ModuleTeaser from '@/components/modules/ModuleTeaser';
import meQuery from '@/mixins/me'; import meQuery from '@/mixins/me';
import news from '@/mixins/news'; import news from '@/mixins/news';
import pageTitleMixin from '@/mixins/page-title';
export default { export default {
mixins: [meQuery, news, pageTitleMixin], mixins: [meQuery, news],
components: { components: {
NewsTeaser, NewsTeaser,
@ -106,7 +103,7 @@
}, },
moduleText() { moduleText() {
if (this.me.lastModule && this.me.lastModule.slug) { if (this.me.lastModule && this.me.lastModule.slug) {
return 'Aktuelles Modul anzeigen'; return `Aktuelles ${this.$flavor.textModule} anzeigen`;
} }
return 'Alle Inhalte anzeigen'; return 'Alle Inhalte anzeigen';
}, },

View File

@ -30,7 +30,7 @@
v-if="me.isTeacher && topic.instructions" v-if="me.isTeacher && topic.instructions"
> >
<bulb-icon class="topic__instruction-icon topic__link-icon" /> <bulb-icon class="topic__instruction-icon topic__link-icon" />
<span class="topic__link-description">Anweisungen zum Thema anzeigen</span> <span class="topic__link-description">Anweisungen zum {{ $flavor.textTopic }} anzeigen</span>
</a> </a>
</div> </div>
<div class="topic__modules"> <div class="topic__modules">
@ -52,6 +52,7 @@
import UPDATE_LAST_TOPIC_MUTATION from '@/graphql/gql/mutations/updateLastTopic.gql'; import UPDATE_LAST_TOPIC_MUTATION from '@/graphql/gql/mutations/updateLastTopic.gql';
import ME_QUERY from '@/graphql/gql/queries/meQuery.gql'; import ME_QUERY from '@/graphql/gql/queries/meQuery.gql';
const PlayIcon = () => import(/* webpackChunkName: "icons" */'@/components/icons/Play'); const PlayIcon = () => import(/* webpackChunkName: "icons" */'@/components/icons/Play');
const BulbIcon = () => import(/* webpackChunkName: "icons" */'@/components/icons/BulbIcon'); const BulbIcon = () => import(/* webpackChunkName: "icons" */'@/components/icons/BulbIcon');

View File

@ -0,0 +1,7 @@
import flavorValues from '@/helpers/app-flavor';
export default {
install: (Vue) => {
Vue.prototype.$flavor = Object.assign({}, flavorValues);
}
};

View File

@ -1,4 +1,6 @@
import {NEW_PROJECT_PAGE, PROJECTS_PAGE} from '@/router/portfolio.names'; import { NEW_PROJECT_PAGE, PROJECTS_PAGE } from '@/router/portfolio.names';
import flavorValues from '@/helpers/app-flavor';
const portfolio = () => import(/* webpackChunkName: "portfolio" */'@/pages/portfolio/portfolio'); const portfolio = () => import(/* webpackChunkName: "portfolio" */'@/pages/portfolio/portfolio');
const project = () => import(/* webpackChunkName: "portfolio" */'@/pages/portfolio/project'); const project = () => import(/* webpackChunkName: "portfolio" */'@/pages/portfolio/project');
const newProject = () => import(/* webpackChunkName: "portfolio" */'@/pages/portfolio/newProject'); const newProject = () => import(/* webpackChunkName: "portfolio" */'@/pages/portfolio/newProject');
@ -11,6 +13,6 @@ const portfolioRoutes = [
{path: '/edit-project/:slug', name: 'edit-project', component: editProject, props: true}, {path: '/edit-project/:slug', name: 'edit-project', component: editProject, props: true},
]; ];
const routes = process.env.VUE_APP_ENABLE_PORTFOLIO ? portfolioRoutes : []; const routes = flavorValues.showPortfolio ? portfolioRoutes : [];
export default routes; export default routes;