mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Refine footer links and donation link and fix their tests
This commit is contained in:
parent
9bf0e26731
commit
00c10cc1a7
@ -100,21 +100,40 @@ describe('PageFooter.vue', () => {
|
||||
const links = {
|
||||
...linksDefault,
|
||||
ORGANIZATION: linksDefault.ORGANIZATION.overwrite({
|
||||
externalLink: 'https://ocelot.social',
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social',
|
||||
target: '_blank',
|
||||
},
|
||||
}),
|
||||
IMPRINT: linksDefault.IMPRINT.overwrite({
|
||||
externalLink: 'https://ocelot.social/IMPRINT',
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social/IMPRINT',
|
||||
target: '_blank',
|
||||
},
|
||||
}),
|
||||
TERMS_AND_CONDITIONS: linksDefault.TERMS_AND_CONDITIONS.overwrite({
|
||||
externalLink: 'https://ocelot.social/TERMS_AND_CONDITIONS',
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social/TERMS_AND_CONDITIONS',
|
||||
target: '_blank',
|
||||
},
|
||||
}),
|
||||
CODE_OF_CONDUCT: linksDefault.CODE_OF_CONDUCT.overwrite({
|
||||
externalLink: 'https://ocelot.social/CODE_OF_CONDUCT',
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social/CODE_OF_CONDUCT',
|
||||
target: '_blank',
|
||||
},
|
||||
}),
|
||||
DATA_PRIVACY: linksDefault.DATA_PRIVACY.overwrite({
|
||||
externalLink: 'https://ocelot.social/DATA_PRIVACY',
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social/DATA_PRIVACY',
|
||||
target: '_blank',
|
||||
},
|
||||
}),
|
||||
FAQ: linksDefault.FAQ.overwrite({ externalLink: 'https://ocelot.social/FAQ' }),
|
||||
FAQ: linksDefault.FAQ.overwrite({
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social/FAQ',
|
||||
target: '_blank',
|
||||
} }),
|
||||
}
|
||||
wrapper = Wrapper()
|
||||
wrapper.setData({ links })
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</nuxt-link>
|
||||
<a
|
||||
v-else
|
||||
:href="pageParams.externalLink"
|
||||
:href="pageParams.externalLink.url"
|
||||
:target="pageParams.internalPage.target"
|
||||
:data-test="pageParams.name + '-link'"
|
||||
>
|
||||
|
||||
@ -4,7 +4,11 @@ export const defaultPageParamsPages = {
|
||||
ORGANIZATION: new PageParams({
|
||||
name: 'organization',
|
||||
|
||||
externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/organization', // static, don't change! internal page in case no external is defined
|
||||
@ -21,7 +25,11 @@ export const defaultPageParamsPages = {
|
||||
DONATE: new PageParams({
|
||||
name: 'donate',
|
||||
|
||||
externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/donate', // static, don't change! internal page in case no external is defined
|
||||
@ -38,7 +46,11 @@ export const defaultPageParamsPages = {
|
||||
IMPRINT: new PageParams({
|
||||
name: 'imprint',
|
||||
|
||||
externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/imprint', // static, don't change! internal page in case no external is defined
|
||||
@ -55,7 +67,11 @@ export const defaultPageParamsPages = {
|
||||
TERMS_AND_CONDITIONS: new PageParams({
|
||||
name: 'terms-and-conditions',
|
||||
|
||||
externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/terms-and-conditions', // static, don't change! internal page in case no external is defined
|
||||
@ -72,7 +88,11 @@ export const defaultPageParamsPages = {
|
||||
CODE_OF_CONDUCT: new PageParams({
|
||||
name: 'code-of-conduct',
|
||||
|
||||
externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/code-of-conduct', // static, don't change! internal page in case no external is defined
|
||||
@ -89,7 +109,11 @@ export const defaultPageParamsPages = {
|
||||
DATA_PRIVACY: new PageParams({
|
||||
name: 'data-privacy',
|
||||
|
||||
externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/data-privacy', // static, don't change! internal page in case no external is defined
|
||||
@ -106,7 +130,11 @@ export const defaultPageParamsPages = {
|
||||
FAQ: new PageParams({
|
||||
name: 'faq',
|
||||
|
||||
externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/faq', // static, don't change! internal page in case no external is defined
|
||||
@ -123,7 +151,11 @@ export const defaultPageParamsPages = {
|
||||
SUPPORT: new PageParams({
|
||||
name: 'support',
|
||||
|
||||
externalLink: null,
|
||||
// externalLink: {
|
||||
// url: 'https://ocelot.social',
|
||||
// target: '_blank',
|
||||
// },
|
||||
externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
pageRoute: '/support', // static, don't change '*/support'! internal page in case no external is defined
|
||||
|
||||
@ -24,18 +24,25 @@ export class PageParams {
|
||||
}
|
||||
|
||||
get isInternalPage() {
|
||||
return this.noStringDefined(this.externalLink)
|
||||
return !(this.externalLink && !this.noStringDefined(this.externalLink.url))
|
||||
}
|
||||
|
||||
get link() {
|
||||
return this.isInternalPage ? this.internalPage.pageRoute : this.externalLink
|
||||
return this.isInternalPage ? this.internalPage.pageRoute : this.externalLink.url
|
||||
}
|
||||
|
||||
redirectToPage(thisComponent) {
|
||||
if (this.isInternalPage) {
|
||||
thisComponent.$router.push(this.internalPage.pageRoute)
|
||||
} else if (typeof window !== 'undefined') {
|
||||
window.location.href = this.externalLink
|
||||
if (this.externalLink.target === '_blank') {
|
||||
window.open(
|
||||
this.externalLink.url,
|
||||
this.externalLink.target,
|
||||
)
|
||||
} else {
|
||||
window.location.href = this.externalLink.url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,10 +3,13 @@
|
||||
import { defaultPageParamsPages } from '~/components/utils/InternalPages.js'
|
||||
|
||||
const ORGANIZATION = defaultPageParamsPages.ORGANIZATION.overwrite({
|
||||
externalLink: 'https://ocelot.social', // if string is defined and not empty it's dominating
|
||||
// if defined it's dominating
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social',
|
||||
target: '_blank',
|
||||
},
|
||||
|
||||
internalPage: {
|
||||
target: '_blank',
|
||||
// footerIdent: 'site.made', // localized string identifier, if undefined default is used
|
||||
// headTitleIdent: 'site.made', // localized string identifier, if undefined default is used
|
||||
// headlineIdent: 'site.made', // localized string identifier, on null it's hidden, if undefined default is used
|
||||
@ -17,11 +20,14 @@ const ORGANIZATION = defaultPageParamsPages.ORGANIZATION.overwrite({
|
||||
},
|
||||
})
|
||||
const DONATE = defaultPageParamsPages.DONATE.overwrite({
|
||||
// we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
|
||||
externalLink: 'https://ocelot-social.herokuapp.com/donations', // if string is defined and not empty it's dominating
|
||||
// if defined it's dominating
|
||||
externalLink: {
|
||||
// we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
|
||||
url: 'https://ocelot-social.herokuapp.com/donations',
|
||||
target: '_blank',
|
||||
},
|
||||
|
||||
internalPage: {
|
||||
target: '_blank',
|
||||
// footerIdent: 'site.donate', // localized string identifier, if undefined default is used
|
||||
// headTitleIdent: 'site.donate', // localized string identifier, if undefined default is used
|
||||
// headlineIdent: 'site.donate', // localized string identifier, on null it's hidden, if undefined default is used
|
||||
@ -32,11 +38,13 @@ const DONATE = defaultPageParamsPages.DONATE.overwrite({
|
||||
},
|
||||
})
|
||||
const IMPRINT = defaultPageParamsPages.IMPRINT.overwrite({
|
||||
// we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
|
||||
externalLink: 'https://ocelot-social.herokuapp.com/imprint', // if string is defined and not empty it's dominating
|
||||
externalLink: {
|
||||
// we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
|
||||
url: 'https://ocelot-social.herokuapp.com/imprint',
|
||||
target: '_blank',
|
||||
},
|
||||
|
||||
internalPage: {
|
||||
target: '_blank',
|
||||
// footerIdent: 'site.imprint', // localized string identifier, if undefined default is used
|
||||
// headTitleIdent: 'site.imprint', // localized string identifier, if undefined default is used
|
||||
// headlineIdent: 'site.imprint', // localized string identifier, on null it's hidden, if undefined default is used
|
||||
@ -47,7 +55,7 @@ const IMPRINT = defaultPageParamsPages.IMPRINT.overwrite({
|
||||
},
|
||||
})
|
||||
const TERMS_AND_CONDITIONS = defaultPageParamsPages.TERMS_AND_CONDITIONS.overwrite({
|
||||
// externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
// footerIdent: 'site.termsAndConditions', // localized string identifier, if undefined default is used
|
||||
@ -60,7 +68,7 @@ const TERMS_AND_CONDITIONS = defaultPageParamsPages.TERMS_AND_CONDITIONS.overwri
|
||||
},
|
||||
})
|
||||
const CODE_OF_CONDUCT = defaultPageParamsPages.CODE_OF_CONDUCT.overwrite({
|
||||
// externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
// footerIdent: 'site.code-of-conduct', // localized string identifier, if undefined default is used
|
||||
@ -73,7 +81,7 @@ const CODE_OF_CONDUCT = defaultPageParamsPages.CODE_OF_CONDUCT.overwrite({
|
||||
},
|
||||
})
|
||||
const DATA_PRIVACY = defaultPageParamsPages.DATA_PRIVACY.overwrite({
|
||||
// externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
// footerIdent: 'site.data-privacy', // localized string identifier, if undefined default is used
|
||||
@ -86,7 +94,7 @@ const DATA_PRIVACY = defaultPageParamsPages.DATA_PRIVACY.overwrite({
|
||||
},
|
||||
})
|
||||
const FAQ = defaultPageParamsPages.FAQ.overwrite({
|
||||
// externalLink: null, // if string is defined and not empty it's dominating
|
||||
// externalLink: null, // if defined it's dominating
|
||||
|
||||
internalPage: {
|
||||
// footerIdent: 'site.faq', // localized string identifier, if undefined default is used
|
||||
@ -99,10 +107,13 @@ const FAQ = defaultPageParamsPages.FAQ.overwrite({
|
||||
},
|
||||
})
|
||||
const SUPPORT = defaultPageParamsPages.SUPPORT.overwrite({
|
||||
externalLink: 'https://ocelot.social', // if string is defined and not empty it's dominating
|
||||
// if defined it's dominating
|
||||
externalLink: {
|
||||
url: 'https://ocelot.social',
|
||||
target: '_blank',
|
||||
},
|
||||
|
||||
internalPage: {
|
||||
target: '_blank',
|
||||
// footerIdent: 'site.support', // localized string identifier, if undefined default is used
|
||||
// headTitleIdent: 'site.support', // localized string identifier, if undefined default is used
|
||||
// headlineIdent: 'site.support', // on null default is used, on empty string it's hidden
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user