Skip to content

Commit

Permalink
Merge branch 'main' of github.com:wepublish/hauptstadt
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-scheurer committed Jun 6, 2024
2 parents 7818d54 + c241e36 commit 5e37c8d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
4 changes: 1 addition & 3 deletions components/blocks/TeaserGridBlockView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ import AuthorsLine from '~/components/author/AuthorsLine.vue'
import ImgLoadingSlot from '~/sdk/wep/components/img/ImgLoadingSlot.vue'
import PeerArticleTeaser from '~/sdk/wep/models/teaser/PeerArticleTeaser'
import PeeringImgOverlay from '~/components/blocks/PeeringImgOverlay.vue'
import { LoginBypass } from '~/sdk/wep/utils'
export default Vue.extend({
name: 'TeaserGridBlockView',
Expand Down Expand Up @@ -265,8 +264,7 @@ export default Vue.extend({
// article id is for paywall purposes. see WepPublication.vue
const baseUrl = `/a/${teaser?.wepPublication?.slug}`
const hasAccess = this.$store.getters['auth/hasAccess']
const loginBypass = (new LoginBypass(this.$cookies).check())
return (hasAccess || loginBypass) ? baseUrl : `${baseUrl}?articleId=${teaser.wepPublication?.id}`
return hasAccess ? baseUrl : `${baseUrl}?articleId=${teaser.wepPublication?.id}`
} else if (teaser.__typename === 'PageTeaser') {
return `/p/${teaser?.wepPublication?.slug}`
}
Expand Down
3 changes: 1 addition & 2 deletions components/navigation/header/menu/MenuRubricEntries.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export default Vue.extend({
if (activeElement) {
activeElement.blur()
}
const preparedSearchQuery = this.searchQuery.replace(' ', ' & ')
const link = `/p/search?query=${preparedSearchQuery}`
const link = `/p/search?query=${this.searchQuery}`
this.searchQuery = ''
await this.$router.push(link)
this.$store.commit('navigation/closeMenu')
Expand Down
4 changes: 3 additions & 1 deletion components/wepPublication/WepPublication.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ import PagePropertiesContent from '~/components/wepPublication/PagePropertiesCon
import CrowdfundingBlock from '~/sdk/wep/models/block/CrowdfundingBlock'
import UserInteractionOffline from '~/sdk/wep/components/helpers/UserInteractionOffline.vue'
import TextZoom from '~/components/helpers/TextZoom.vue'
import { LoginBypass } from '~/sdk/wep/utils'
export default Vue.extend({
name: 'WepPublication',
Expand Down Expand Up @@ -395,7 +396,8 @@ export default Vue.extend({
startPath = currentPath
}
const paywallKey = this.$route.query.articleId
if (startPath !== currentPath || paywallKey) {
const loginBypass = (new LoginBypass(this.$cookies).check())
if ((startPath !== currentPath || paywallKey) && !loginBypass) {
// apply paywall
blocks?.removeBlocks(3)
this.showPaywall = true
Expand Down
8 changes: 8 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ export default Vue.extend({
overlay: false
}
},
head() {
return {
script: [
{ src: `${this.$nuxt.context.$config.WEP_API_URL_CLIENT.replace('/v1', '')}/static/head.js` },
{ src: `${this.$nuxt.context.$config.WEP_API_URL_CLIENT.replace('/v1', '')}/static/body.js`, body: true },
]
}
},
computed: {
redirectUrl (): string | undefined {
return this.$nuxt.context.$config.REDIRECT_URL
Expand Down
4 changes: 3 additions & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export default {
// HAS internal
MEDIUM_SLUG: 'HAS'
},
privateRuntimeConfig: {},
privateRuntimeConfig: {
WEP_API_URL_CLIENT: process.env.WEP_API_URL_CLIENT
},

// Global CSS: https://go.nuxtjs.dev/config-css
css: [
Expand Down

0 comments on commit 5e37c8d

Please sign in to comment.