Remove custom error page

I find the custom error page out of scope of this PR so I will create
another tracking PR to get this feature merged as soon as possible.

See: https://github.com/Human-Connection/Nitro-Web/pull/216
This commit is contained in:
Robert Schäfer 2019-03-04 15:51:07 +01:00
parent 1672db0dfb
commit 6f116b6963
3 changed files with 4 additions and 59 deletions

View File

@ -22,5 +22,5 @@ Feature: Hide Posts
Given I am logged in with a "user" role
Then the page "/post/this-post-is-disabled" returns a 404 error with a message:
"""
Sorry, the page you're looking for cannot be found.
This post could not be found
"""

View File

@ -1,57 +0,0 @@
<template>
<div class="layout-blank">
<ds-container>
<div class="error">
<h1>
{{ header }}
</h1>
<h3>
{{ subHeader }}
</h3>
<p>
{{ message }}
</p>
</div>
</ds-container>
<div id="overlay" />
</div>
</template>
<script>
import seo from '~/components/mixins/seo'
export default {
mixins: [seo],
props: {
error: {
type: Object,
default: () => {}
}
},
computed: {
statusCode() {
const mapping = {
'500': '500',
'404': '404'
}
return mapping[this.error.statusCode] || '500'
},
header() {
return this.$t(`error.header.${this.statusCode}`)
},
subHeader() {
return this.$t(`error.subHeader.${this.statusCode}`)
},
message() {
return this.$t(`error.message.${this.statusCode}`)
},
suggestion() {
console.log(this.$t(`error.suggestion.${this.statusCode}`))
return this.$t(`error.suggestion.${this.statusCode}`)
}
},
mounted() {
console.log(this.error)
}
}
</script>

View File

@ -236,7 +236,9 @@ export default {
data: { Post }
} = await client.query({ query, variables })
if (Post.length <= 0) {
return error({ statusCode: 404 })
// TODO: custom 404 error page with translations
const message = 'This post could not be found'
return error({ statusCode: 404, message })
}
const [post] = Post
return {