feat: check for empty url
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2021-10-31 22:00:53 +01:00
parent acc315b581
commit a7a7c75dc5
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 15 additions and 3 deletions

View File

@ -5,7 +5,10 @@
<section v-else-if="error !== ''"> <section v-else-if="error !== ''">
<no-auth-wrapper> <no-auth-wrapper>
<card> <card>
<div class="notification is-danger"> <p v-if="error === errorNoApiUrl">
{{ $t('ready.noApiUrlConfigured') }}
</p>
<div class="notification is-danger" v-else>
<p> <p>
{{ $t('ready.errorOccured') }}<br/> {{ $t('ready.errorOccured') }}<br/>
{{ error }} {{ error }}
@ -34,6 +37,8 @@ import logoUrl from '@/assets/logo.svg'
import ApiConfig from '@/components/misc/api-config' import ApiConfig from '@/components/misc/api-config'
import NoAuthWrapper from '@/components/misc/no-auth-wrapper' import NoAuthWrapper from '@/components/misc/no-auth-wrapper'
const ERROR_NO_API_URL = 'noApiUrlProvided'
export default { export default {
name: 'ready', name: 'ready',
components: { components: {
@ -44,6 +49,7 @@ export default {
return { return {
logoUrl, logoUrl,
error: '', error: '',
errorNoApiUrl: ERROR_NO_API_URL,
} }
}, },
mounted() { mounted() {
@ -54,11 +60,16 @@ export default {
return this.$store.state.vikunjaReady return this.$store.state.vikunjaReady
}, },
showLoading() { showLoading() {
return !this.ready || this.error !== '' return !this.ready && this.error === ''
}, },
}, },
methods: { methods: {
load() { load() {
if (window.API_URL === '') {
this.error = ERROR_NO_API_URL
return
}
this.$store.dispatch('loadApp') this.$store.dispatch('loadApp')
.catch(e => { .catch(e => {
this.error = e this.error = e

View File

@ -19,7 +19,8 @@
"ready": { "ready": {
"loading": "Vikunja is loading…", "loading": "Vikunja is loading…",
"errorOccured": "An error occured:", "errorOccured": "An error occured:",
"checkApiUrl": "Please check if the api url is correct below." "checkApiUrl": "Please check if the api url is correct.",
"noApiUrlConfigured": "No API url was configured. Please set one below:"
}, },
"user": { "user": {
"auth": { "auth": {