Merge pull request #4555 from Ocelot-Social-Community/4549-landing-page-def-route+have-internal

🍰 feat: Landing Page etc.
This commit is contained in:
Wolfgang Huß 2021-07-26 20:58:32 +02:00 committed by GitHub
commit 0154d3d4c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 242 additions and 47 deletions

View File

@ -1,9 +1,13 @@
// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding
// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/constants/
export default {
ORGANIZATION: 'https://ocelot.social',
SUPPORT: 'https://ocelot.social',
LANDING_PAGE: '/login', // examples: '/login', '/registration', '/organization', or external 'https://ocelot.social'
// on null or empty strings internal imprint is used, see 'webapp/locales/html/'
// you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/
SUPPORT: 'https://ocelot.social', // example for internal support page: 'https://staging.ocelot.social/support'. set a full URL please, because it is used in e-mails as well!
// on null or empty strings internal pages are used, see 'webapp/locales/html/'
ORGANIZATION: 'https://ocelot.social',
DONATE: 'https://ocelot-social.herokuapp.com/donations', // we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
IMPRINT: 'https://ocelot-social.herokuapp.com/imprint', // we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
TERMS_AND_CONDITIONS: null,

View File

@ -47,12 +47,8 @@ describe('PageFooter.vue', () => {
wrapper = Wrapper()
})
it('renders ORGANIZATION', () => {
expect(wrapper.find('a[data-test="organization-link"]').exists()).toBe(true)
})
it('renders version', () => {
expect(wrapper.find('a[data-test="version-link"]').exists()).toBe(true)
expect(wrapper.find('a[data-test="version-link"]').exists()).toBeTruthy()
})
})
@ -60,6 +56,7 @@ describe('PageFooter.vue', () => {
beforeEach(async () => {
const links = {
...linksDefault,
ORGANIZATION: null,
IMPRINT: null,
TERMS_AND_CONDITIONS: null,
CODE_OF_CONDUCT: null,
@ -71,24 +68,28 @@ describe('PageFooter.vue', () => {
await wrapper.vm.$nextTick()
})
it('renders ORGANIZATION as nuxt-link', () => {
expect(wrapper.find('span[data-test="organization-nuxt-link"]').exists()).toBeTruthy()
})
it('renders IMPRINT as nuxt-link', () => {
expect(wrapper.find('span[data-test="imprint-nuxt-link"]').exists()).toBe(true)
expect(wrapper.find('span[data-test="imprint-nuxt-link"]').exists()).toBeTruthy()
})
it('renders TERMS_AND_CONDITIONS as nuxt-link', () => {
expect(wrapper.find('span[data-test="terms-nuxt-link"]').exists()).toBe(true)
expect(wrapper.find('span[data-test="terms-nuxt-link"]').exists()).toBeTruthy()
})
it('renders CODE_OF_CONDUCT as nuxt-link', () => {
expect(wrapper.find('span[data-test="code-nuxt-link"]').exists()).toBe(true)
expect(wrapper.find('span[data-test="code-nuxt-link"]').exists()).toBeTruthy()
})
it('renders DATA_PRIVACY as nuxt-link', () => {
expect(wrapper.find('span[data-test="data-nuxt-link"]').exists()).toBe(true)
expect(wrapper.find('span[data-test="data-nuxt-link"]').exists()).toBeTruthy()
})
it('renders FAQ as nuxt-link', () => {
expect(wrapper.find('span[data-test="faq-nuxt-link"]').exists()).toBe(true)
expect(wrapper.find('span[data-test="faq-nuxt-link"]').exists()).toBeTruthy()
})
})
@ -96,6 +97,7 @@ describe('PageFooter.vue', () => {
beforeEach(async () => {
const links = {
...linksDefault,
ORGANIZATION: 'https://ocelot.social',
IMPRINT: 'https://ocelot.social/IMPRINT',
TERMS_AND_CONDITIONS: 'https://ocelot.social/TERMS_AND_CONDITIONS',
CODE_OF_CONDUCT: 'https://ocelot.social/CODE_OF_CONDUCT',
@ -107,26 +109,32 @@ describe('PageFooter.vue', () => {
await wrapper.vm.$nextTick()
})
it('renders ORGANIZATION as "a" tag link', () => {
expect(wrapper.find(`a[href="https://ocelot.social"]`).exists()).toBeTruthy()
})
it('renders IMPRINT as "a" tag link', () => {
expect(wrapper.find(`a[href="https://ocelot.social/IMPRINT"]`).exists()).toBe(true)
expect(wrapper.find(`a[href="https://ocelot.social/IMPRINT"]`).exists()).toBeTruthy()
})
it('renders TERMS_AND_CONDITIONS as "a" tag link', () => {
expect(wrapper.find(`a[href="https://ocelot.social/TERMS_AND_CONDITIONS"]`).exists()).toBe(
true,
)
expect(
wrapper.find(`a[href="https://ocelot.social/TERMS_AND_CONDITIONS"]`).exists(),
).toBeTruthy()
})
it('renders CODE_OF_CONDUCT as "a" tag link', () => {
expect(wrapper.find(`a[href="https://ocelot.social/CODE_OF_CONDUCT"]`).exists()).toBe(true)
expect(
wrapper.find(`a[href="https://ocelot.social/CODE_OF_CONDUCT"]`).exists(),
).toBeTruthy()
})
it('renders DATA_PRIVACY as "a" tag link', () => {
expect(wrapper.find(`a[href="https://ocelot.social/DATA_PRIVACY"]`).exists()).toBe(true)
expect(wrapper.find(`a[href="https://ocelot.social/DATA_PRIVACY"]`).exists()).toBeTruthy()
})
it('renders FAQ as "a" tag link', () => {
expect(wrapper.find(`a[href="https://ocelot.social/FAQ"]`).exists()).toBe(true)
expect(wrapper.find(`a[href="https://ocelot.social/FAQ"]`).exists()).toBeTruthy()
})
})
})

View File

@ -1,7 +1,14 @@
<template>
<div id="footer" class="ds-footer">
<!-- made with -->
<a :href="links.ORGANIZATION" target="_blank" data-test="organization-link">
<nuxt-link
v-if="noLinkDefined(links.ORGANIZATION)"
to="/organization"
data-test="organization-nuxt-link"
>
{{ $t('site.made') }}
</nuxt-link>
<a v-else :href="links.ORGANIZATION" target="_blank" data-test="organization-link">
{{ $t('site.made') }}
</a>
<span>-</span>

View File

@ -1,9 +1,13 @@
// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding
// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/constants/
export default {
ORGANIZATION: 'https://ocelot.social',
SUPPORT: 'https://ocelot.social',
LANDING_PAGE: '/login', // examples: '/login', '/registration', '/organization', or external 'https://ocelot.social'
// on null or empty strings internal imprint is used, see 'webapp/locales/html/'
// you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/
SUPPORT: 'https://ocelot.social', // example for internal support page: 'https://staging.ocelot.social/support'. set a full URL please, because it is used in e-mails as well!
// on null or empty strings internal pages are used, see 'webapp/locales/html/'
ORGANIZATION: 'https://ocelot.social',
DONATE: 'https://ocelot-social.herokuapp.com/donations', // we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
IMPRINT: 'https://ocelot-social.herokuapp.com/imprint', // we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
TERMS_AND_CONDITIONS: null,

View File

@ -788,6 +788,7 @@
"made": "Mit ❤️ gemacht",
"register": "Registernummer",
"responsible": "Verantwortlich für Inhalte dieser Seite (§ 55 Abs. 2 RStV)",
"support": "Support",
"taxident": "Umsatzsteuer-Identifikationsnummer gemäß § 27 a Umsatzsteuergesetz (Deutschland)",
"termsAndConditions": "Nutzungsbedingungen",
"thanks": "Danke!",

View File

@ -788,6 +788,7 @@
"made": "Made with ❤️",
"register": "Registry number",
"responsible": "responsible for contents of this page (§ 55 Abs. 2 RStV)",
"support": "Support",
"taxident": "USt-ID. according to §27a of the German Sales Tax Law:",
"termsAndConditions": "Terms and conditions",
"thanks": "Thanks!",

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>Ich bin der Inhalt vom Verhaltenskodex</p>
<br>
<p>Ich bin der Inhalt vom Verhaltenskodex.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>Das hier wäre der Inhalt der Datenschutzbestimmungen</p>
<br>
<p>Das hier wäre der Inhalt der Datenschutzbestimmungen.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>Hier stehen die FAQs</p>
<br>
<p>Hier stehen die FAQs.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>Ich bin das Impressum</p>
<br>
<p>Ich bin das Impressum.</p>

View File

@ -1,3 +1,5 @@
import organization from './organization.html'
import support from './support.html'
import termsAndConditions from './terms-and-conditions.html'
import codeOfConduct from './code-of-conduct.html'
import dataPrivacy from './data-privacy.html'
@ -5,6 +7,8 @@ import faq from './faq.html'
import imprint from './imprint.html'
export default {
organization,
support,
termsAndConditions,
codeOfConduct,
dataPrivacy,

View File

@ -0,0 +1,5 @@
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<br>
<p>Hier wird das Netzwerk beschrieben.</p>

View File

@ -0,0 +1,5 @@
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<br>
<p>Ich bin der Inhalt vom Support.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>Ich bin der Inhalt der Seite "Nutzungsbedingungen"</p>
<br>
<p>Ich bin der Inhalt der Seite "Nutzungsbedingungen".</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>I am the content of the code of conduct</p>
<br>
<p>I am the content of the code of conduct.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>This would be our data privacy section</p>
<br>
<p>This would be our data privacy section.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>Here are the FAQs</p>
<br>
<p>Here are the FAQs.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>I am the imprint</p>
<br>
<p>I am the imprint.</p>

View File

@ -1,3 +1,5 @@
import organization from './organization.html'
import support from './support.html'
import termsAndConditions from './terms-and-conditions.html'
import codeOfConduct from './code-of-conduct.html'
import dataPrivacy from './data-privacy.html'
@ -5,6 +7,8 @@ import faq from './faq.html'
import imprint from './imprint.html'
export default {
organization,
support,
termsAndConditions,
codeOfConduct,
dataPrivacy,

View File

@ -0,0 +1,5 @@
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<br>
<p>Here the network is described.</p>

View File

@ -0,0 +1,5 @@
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<br>
<p>I am the content of the support.</p>

View File

@ -1,3 +1,5 @@
<!-- this file is replaced on rebranding -->
<!-- this file is replaced on rebranding by https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/locales/html/ -->
<!-- you can find and store templates at https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding/tree/master/branding/templates/ -->
<p>I am the content of the page "terms and conditions"<p>
<br>
<p>I am the content of the page "Terms And Conditions".<p>

View File

@ -1,4 +1,5 @@
import isEmpty from 'lodash/isEmpty'
import links from '~/constants/links.js'
export default async ({ store, env, route, redirect }) => {
const publicPages = env.publicPages
@ -22,5 +23,5 @@ export default async ({ store, env, route, redirect }) => {
params.path = route.path
}
return redirect('/registration', params)
return redirect(links.LANDING_PAGE, params)
}

View File

@ -37,11 +37,14 @@ export default {
'password-reset-change-password',
'registration',
'pages-slug',
'organization',
'support',
'terms-and-conditions',
'code-of-conduct',
'changelog',
'imprint',
'data-privacy',
'faq',
],
// pages to keep alive
keepAlivePages: ['index'],

View File

@ -0,0 +1,38 @@
import { mount } from '@vue/test-utils'
import Organization from './organization.vue'
import VueMeta from 'vue-meta'
const localVue = global.localVue
localVue.use(VueMeta, { keyName: 'head' })
describe('organization.vue', () => {
let wrapper
let mocks
beforeEach(() => {
mocks = {
$t: (t) => t,
}
})
describe('mount', () => {
const Wrapper = () => {
return mount(Organization, {
mocks,
localVue,
})
}
beforeEach(() => {
wrapper = Wrapper()
})
it('renders', () => {
expect(wrapper.is('div')).toBe(true)
})
it('has correct <head> content', () => {
expect(wrapper.vm.$metaInfo.title).toBe('site.made')
})
})
})

View File

@ -0,0 +1,21 @@
<template>
<div>
<ds-space margin="small">
<ds-heading tag="h2">{{ $t('site.made') }}</ds-heading>
</ds-space>
<ds-container>
<div v-html="$t('html.organization')" />
</ds-container>
</div>
</template>
<script>
export default {
layout: 'basic',
head() {
return {
title: this.$t('site.made'),
}
},
}
</script>

View File

@ -0,0 +1,38 @@
import { mount } from '@vue/test-utils'
import Support from './support.vue'
import VueMeta from 'vue-meta'
const localVue = global.localVue
localVue.use(VueMeta, { keyName: 'head' })
describe('support.vue', () => {
let wrapper
let mocks
beforeEach(() => {
mocks = {
$t: (t) => t,
}
})
describe('mount', () => {
const Wrapper = () => {
return mount(Support, {
mocks,
localVue,
})
}
beforeEach(() => {
wrapper = Wrapper()
})
it('renders', () => {
expect(wrapper.is('div')).toBe(true)
})
it('has correct <head> content', () => {
expect(wrapper.vm.$metaInfo.title).toBe('site.support')
})
})
})

21
webapp/pages/support.vue Normal file
View File

@ -0,0 +1,21 @@
<template>
<div>
<ds-space margin="small">
<ds-heading tag="h2">{{ $t('site.support') }}</ds-heading>
</ds-space>
<ds-container>
<div v-html="$t('html.support')" />
</ds-container>
</div>
</template>
<script>
export default {
layout: 'basic',
head() {
return {
title: this.$t('site.support'),
}
},
}
</script>