Add default footer to new dynamic footer component
This commit is contained in:
parent
f53b7791d1
commit
1428634440
|
|
@ -42,7 +42,7 @@ export const myKvValues: FlavorValues = {
|
||||||
textInstrumentFilterShowAll: 'Alles anzeigen',
|
textInstrumentFilterShowAll: 'Alles anzeigen',
|
||||||
|
|
||||||
// myKV flags
|
// myKV flags
|
||||||
showFooter: false,
|
showFooter: true,
|
||||||
showObjectivesTitle: false,
|
showObjectivesTitle: false,
|
||||||
showInstrumentFilterSidebar: true,
|
showInstrumentFilterSidebar: true,
|
||||||
showPortfolio: true,
|
showPortfolio: true,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@
|
||||||
class="layout__content"
|
class="layout__content"
|
||||||
:key="$route.fullPath"
|
:key="$route.fullPath"
|
||||||
/>
|
/>
|
||||||
<default-footer
|
<dynamic-footer
|
||||||
|
:simple="false"
|
||||||
class="layout__footer"
|
class="layout__footer"
|
||||||
v-if="enableFooter"
|
v-if="enableFooter"
|
||||||
/>
|
/>
|
||||||
|
|
@ -24,7 +25,7 @@
|
||||||
<script>
|
<script>
|
||||||
import HeaderBar from '@/components/HeaderBar.vue';
|
import HeaderBar from '@/components/HeaderBar.vue';
|
||||||
import ProfileSidebar from '@/components/profile/ProfileSidebar.vue';
|
import ProfileSidebar from '@/components/profile/ProfileSidebar.vue';
|
||||||
import DefaultFooter from '@/layouts/DefaultFooter.vue';
|
import DynamicFooter from '@/layouts/DynamicFooter.vue';
|
||||||
import NavigationSidebar from '@/components/book-navigation/NavigationSidebar.vue';
|
import NavigationSidebar from '@/components/book-navigation/NavigationSidebar.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -32,7 +33,7 @@ export default {
|
||||||
HeaderBar,
|
HeaderBar,
|
||||||
ProfileSidebar,
|
ProfileSidebar,
|
||||||
NavigationSidebar,
|
NavigationSidebar,
|
||||||
DefaultFooter,
|
DynamicFooter,
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import MyKvFooter from '@/layouts/MyKVFooter.vue';
|
import MyKvFooter from '@/layouts/MyKVFooter.vue';
|
||||||
import SkillboxSimpleFooter from '@/layouts/SkillboxSimpleFooter.vue';
|
import SkillboxSimpleFooter from '@/layouts/SkillboxSimpleFooter.vue';
|
||||||
|
import SkillboxDefaultFooter from '@/layouts/SkillboxDefaultFooter.vue';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { Flavor } from '@/helpers/flavor.stubabble';
|
import { Flavor } from '@/helpers/flavor.stubabble';
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<{ simple: boolean }>(), {
|
||||||
|
simple: true,
|
||||||
|
});
|
||||||
|
|
||||||
const flavor = Flavor.getFlavor();
|
const flavor = Flavor.getFlavor();
|
||||||
console.log(flavor);
|
|
||||||
console.log(flavor.appFlavor);
|
|
||||||
const Footer = computed(() => {
|
const Footer = computed(() => {
|
||||||
switch (flavor.appFlavor) {
|
switch (flavor.appFlavor) {
|
||||||
case 'my-kv':
|
case 'my-kv':
|
||||||
|
|
@ -18,7 +21,7 @@ const Footer = computed(() => {
|
||||||
case 'my-dhf':
|
case 'my-dhf':
|
||||||
return MyKvFooter;
|
return MyKvFooter;
|
||||||
default:
|
default:
|
||||||
return SkillboxSimpleFooter;
|
return props.simple ? SkillboxSimpleFooter : SkillboxDefaultFooter;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -9,7 +9,8 @@
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<router-view class="public__content layout__content" />
|
<router-view class="public__content layout__content" />
|
||||||
<default-footer
|
<dynamic-footer
|
||||||
|
:simple="false"
|
||||||
class="skillbox__footer public__footer footer"
|
class="skillbox__footer public__footer footer"
|
||||||
v-if="$flavor.showFooter"
|
v-if="$flavor.showFooter"
|
||||||
/>
|
/>
|
||||||
|
|
@ -18,13 +19,13 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { defineAsyncComponent } from 'vue';
|
import { defineAsyncComponent } from 'vue';
|
||||||
import DefaultFooter from '@/layouts/DefaultFooter.vue';
|
import DynamicFooter from '@/layouts/DynamicFooter.vue';
|
||||||
const Logo = defineAsyncComponent(() => import('@/components/icons/Logo.vue'));
|
const Logo = defineAsyncComponent(() => import('@/components/icons/Logo.vue'));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Logo,
|
Logo,
|
||||||
DefaultFooter,
|
DynamicFooter,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
import SimpleFooter from './SimpleFooter.vue';
|
import DynamicFooter from './DynamicFooter.vue';
|
||||||
import { Flavor } from '@/helpers/flavor.stubabble';
|
import { Flavor } from '@/helpers/flavor.stubabble';
|
||||||
import { defaultFlavorValues, dhaValues, dhfValues, myKvValues } from '@/helpers/app-flavor.constants';
|
import { defaultFlavorValues, dhaValues, dhfValues, myKvValues } from '@/helpers/app-flavor.constants';
|
||||||
|
|
||||||
const checkLinks = (baseUrl) => {
|
const checkLinks = (baseUrl, simple = true) => {
|
||||||
cy.mount(SimpleFooter);
|
|
||||||
cy.viewport('macbook-15');
|
cy.viewport('macbook-15');
|
||||||
|
cy.mount(DynamicFooter, {
|
||||||
|
props: {
|
||||||
|
simple,
|
||||||
|
},
|
||||||
|
});
|
||||||
cy.get('a')
|
cy.get('a')
|
||||||
.eq(0)
|
.eq(0)
|
||||||
.should('contain', 'Datenschutz')
|
.should('contain', 'Datenschutz')
|
||||||
|
|
@ -21,25 +25,44 @@ const checkLinks = (baseUrl) => {
|
||||||
|
|
||||||
describe('<SimpleFooter />', () => {
|
describe('<SimpleFooter />', () => {
|
||||||
it('renders for MySkillbox', () => {
|
it('renders for MySkillbox', () => {
|
||||||
|
cy.viewport('macbook-15');
|
||||||
// see: https://on.cypress.io/mounting-vue
|
// see: https://on.cypress.io/mounting-vue
|
||||||
cy.stub(Flavor, 'getFlavor').returns(defaultFlavorValues);
|
cy.stub(Flavor, 'getFlavor').returns(defaultFlavorValues);
|
||||||
cy.mount(SimpleFooter);
|
cy.mount(DynamicFooter, { props: { simple: true } });
|
||||||
cy.viewport('macbook-15');
|
|
||||||
cy.get('p').eq(0).should('contain', 'Copyright');
|
cy.get('p').eq(0).should('contain', 'Copyright');
|
||||||
});
|
});
|
||||||
it('renders for MyKV', () => {
|
it('renders for MyKV', () => {
|
||||||
// see: https://on.cypress.io/mounting-vue
|
|
||||||
cy.stub(Flavor, 'getFlavor').returns(myKvValues);
|
cy.stub(Flavor, 'getFlavor').returns(myKvValues);
|
||||||
checkLinks('mykv.ch');
|
checkLinks('mykv.ch');
|
||||||
});
|
});
|
||||||
it('renders for MyDHA', () => {
|
it('renders for MyDHA', () => {
|
||||||
// see: https://on.cypress.io/mounting-vue
|
|
||||||
cy.stub(Flavor, 'getFlavor').returns(dhaValues);
|
cy.stub(Flavor, 'getFlavor').returns(dhaValues);
|
||||||
checkLinks('mydetailhandel.ch');
|
checkLinks('mydetailhandel.ch');
|
||||||
});
|
});
|
||||||
it('renders for MyDHF', () => {
|
it('renders for MyDHF', () => {
|
||||||
// see: https://on.cypress.io/mounting-vue
|
|
||||||
cy.stub(Flavor, 'getFlavor').returns(dhfValues);
|
cy.stub(Flavor, 'getFlavor').returns(dhfValues);
|
||||||
checkLinks('mydetailhandel.ch');
|
checkLinks('mydetailhandel.ch');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('<DefaultFooter />', () => {
|
||||||
|
it('renders for MySkillbox', () => {
|
||||||
|
cy.viewport('macbook-15');
|
||||||
|
// see: https://on.cypress.io/mounting-vue
|
||||||
|
cy.stub(Flavor, 'getFlavor').returns(defaultFlavorValues);
|
||||||
|
cy.mount(DynamicFooter, { props: { simple: false } });
|
||||||
|
cy.get('h5').should('contain', 'Wer sind wir');
|
||||||
|
});
|
||||||
|
it('renders for MyKV', () => {
|
||||||
|
cy.stub(Flavor, 'getFlavor').returns(myKvValues);
|
||||||
|
checkLinks('mykv.ch', false);
|
||||||
|
});
|
||||||
|
it('renders for MyDHA', () => {
|
||||||
|
cy.stub(Flavor, 'getFlavor').returns(dhaValues);
|
||||||
|
checkLinks('mydetailhandel.ch', false);
|
||||||
|
});
|
||||||
|
it('renders for MyDHF', () => {
|
||||||
|
cy.stub(Flavor, 'getFlavor').returns(dhfValues);
|
||||||
|
checkLinks('mydetailhandel.ch', false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@
|
||||||
<cross class="close-button__icon" />
|
<cross class="close-button__icon" />
|
||||||
</div>
|
</div>
|
||||||
<router-view class="layout__content" />
|
<router-view class="layout__content" />
|
||||||
<footer
|
<dynamic-footer
|
||||||
|
:simple="true"
|
||||||
class="layout__footer"
|
class="layout__footer"
|
||||||
v-if="enableFooter"
|
v-if="enableFooter"
|
||||||
/>
|
/>
|
||||||
|
|
@ -18,7 +19,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import SimpleFooter from '@/layouts/SimpleFooter.vue';
|
import DynamicFooter from '@/layouts/DynamicFooter.vue';
|
||||||
import MyKvFooter from '@/layouts/MyKVFooter.vue';
|
import MyKvFooter from '@/layouts/MyKVFooter.vue';
|
||||||
import { defineAsyncComponent, computed } from 'vue';
|
import { defineAsyncComponent, computed } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
@ -27,15 +28,6 @@ const Cross = defineAsyncComponent(() => import('@/components/icons/CrossIcon.vu
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const Footer = computed(() => {
|
|
||||||
switch (flavor.appFlavor) {
|
|
||||||
case 'my-kv':
|
|
||||||
return MyKvFooter;
|
|
||||||
default:
|
|
||||||
return SimpleFooter;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const enableFooter = computed(() => {
|
const enableFooter = computed(() => {
|
||||||
if (route.meta.hideFooter) {
|
if (route.meta.hideFooter) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
>AGB</a
|
>AGB</a
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
:href="$flavor.supportLink"
|
href="https://myskillbox.ch/support"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="default-footer__link"
|
class="default-footer__link"
|
||||||
>Support</a
|
>Support</a
|
||||||
Loading…
Reference in New Issue