Add variables for myDHF and myDHA

This commit is contained in:
Ramon Wenger 2022-11-29 16:59:32 +01:00
parent 7b4efca096
commit e0c70d3aaa
8 changed files with 146 additions and 13 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: 'myDHA'
// ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^
}

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: 'myDHF'
// ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^
}

View File

@ -25,10 +25,18 @@ const values = {
// ^^^^ 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;
switch (process.env.APP_FLAVOR) {
case 'my-kv':
module.exports = merge(values, require('./prod-my-kv.env.js'));
break;
case 'dhf':
module.exports = merge(values, require('./prod-dhf.env.js'));
break;
case 'dha':
module.exports = merge(values, require('./prod-dha.env.js'));
break;
default:
// we are on the skillbox APP_FLAVOR
module.exports = values;
}

View File

@ -1,4 +1,6 @@
const defaultFlavorValues = {
import type {FlavorValues} from "@/helpers/types";
export const defaultFlavorValues: FlavorValues = {
appFlavor: 'skillbox',
appLogo: '/static/logo.png',
supportLink: 'https://myskillbox.ch/support',
@ -20,10 +22,7 @@ const defaultFlavorValues = {
showEHB: true,
};
let flavorValues = Object.assign({}, defaultFlavorValues);
if (process.env.VUE_APP_FLAVOR === 'my-kv') {
flavorValues = Object.assign({}, defaultFlavorValues, {
export const myKvValues: FlavorValues = {
appFlavor: 'my-kv',
appLogo: 'https://skillbox-my-kv-prod.s3-eu-west-1.amazonaws.com/mykv-logo.png',
supportLink: 'https://www.mykv.ch/support',
@ -43,7 +42,13 @@ if (process.env.VUE_APP_FLAVOR === 'my-kv') {
showInstrumentFilterSidebar: true,
showPortfolio: true,
showEHB: false,
});
}
};
export default flavorValues;
export const dhfValues: FlavorValues = Object.assign({}, myKvValues, {
appFlavor: 'dhf',
textAppName: 'myDHF'
});
export const dhaValues: FlavorValues = Object.assign({}, myKvValues, {
appFlavor: 'dha',
textAppName: 'myDHA'
});

View File

@ -0,0 +1,25 @@
import log from 'loglevel';
import type {FlavorValues} from "@/helpers/types";
import {defaultFlavorValues, dhaValues, dhfValues, myKvValues} from "@/helpers/app-flavor.constants";
let flavorValues: FlavorValues;
switch (process.env.VUE_APP_FLAVOR) {
case 'my-kv':
flavorValues = myKvValues;
break;
case 'dha':
flavorValues = dhaValues;
break;
case 'dhf':
flavorValues = dhfValues;
break;
default:
flavorValues = defaultFlavorValues;
}
log.debug('flavorValues', flavorValues);
export default flavorValues;

View File

@ -0,0 +1,17 @@
export interface FlavorValues {
appFlavor: string;
appLogo: string;
supportLink: string;
textAppName: string;
textTopic: string;
textTopics: string;
textModule: string;
textModules: string;
textInstrument: string;
textInstruments: string;
showFooter: boolean;
showObjectivesTitle: boolean;
showInstrumentFilterSidebar: boolean;
showPortfolio: boolean;
showEHB: boolean;
}

View File

@ -0,0 +1,22 @@
/* --- DHA --- */
/* accent */
$color-accent-1-dark: #CB2A79;
$color-accent-1: #E54292;
$color-accent-1-light: #FDEDF5;
$color-accent-2-dark: #C8A804;
$color-accent-2: #FEE531;
$color-accent-2-light: #FFF9D1;
$color-accent-3-dark: #29A386;
$color-accent-3: #47D0AF;
$color-accent-3-light: #DEF6F7;
$color-accent-4-dark: #0F7EB3;
$color-accent-4: #139EE0;
$color-accent-4-light: #D0EDFB;
$color-accent-5-dark: #0F2552;
$color-accent-5: #17387D;
$color-accent-5: #E2EEF8;
/* brand */
$color-brand-dark: #15893E;
$color-brand: #1BAB4E;
$color-brand-light: #D8F3E2;

View File

@ -0,0 +1,22 @@
/* --- DHF --- */
/* accent */
$color-accent-1-dark: #CB2A79;
$color-accent-1: #E54292;
$color-accent-1-light: #FDEDF5;
$color-accent-2-dark: #C8A804;
$color-accent-2: #FEE531;
$color-accent-2-light: #FFF9D1;
$color-accent-3-dark: #29A386;
$color-accent-3: #47D0AF;
$color-accent-3-light: #DEF6F7;
$color-accent-4-dark: #15893E;
$color-accent-4: #1BAB4E;
$color-accent-4-light: #D8F3E2;
$color-accent-5-dark: #0F2552;
$color-accent-5: #17387D;
$color-accent-5: #E2EEF8;
/* brand */
$color-brand-dark: #0F7EB3;
$color-brand: #139EE0;
$color-brand-light: #D0EDFB;