Commit 8d19b31e authored by pestov's avatar pestov
Browse files

Merge branch 'feature/#339-image-error-message' into 'develop'

feat: add new error strings for images

Closes #339

See merge request !224
parents ee821524 d28a51f4
Pipeline #231545 passed with stages
in 3 minutes and 49 seconds
......@@ -26,6 +26,7 @@
:contenttypes="contentTypes"
:contenturls="contentUrls"
:errormessage="errormessage"
:error-image="errorImage"
:fontsize="fontsize"
:imageurl="imageurl"
:isloading="isLoading"
......@@ -67,6 +68,7 @@ export default {
contentTypes: [],
contentUrls: [],
errormessage: false,
errorImage: null,
fontsize: 16,
imageurl: '',
isCollection: false,
......@@ -272,18 +274,30 @@ export default {
}
if (data.image) {
this.imageurl = data.image.id || '';
this.imageurl = data.image.id;
fetch(this.imageurl).then((response) => {
if (response.status === 200 || response.status === 201) {
this.errormessage = false;
this.errorImage = null;
} else {
// for vpn error.
this.errormessage = true;
this.errorImage = {
messageKey: 'imageErrorMessageVPN',
};
}
}).catch(() => {
// for CORS error.
this.errormessage = true;
this.errorImage = {
messageKey: 'imageErrorMessageVPN',
};
});
} else {
this.errormessage = true;
this.errorImage = {
messageKey: 'imageErrorMessageNotExists',
};
}
});
},
......
<template>
<div
v-if="errormessage"
v-if="errorImage"
class="q-pa-sm"
>
<Notification
:message="$t(messages.none)"
:message="$t(errorImage.messageKey)"
:notification-colors="config.notificationColors"
title-key="imageErrorTitle"
type="warning"
......@@ -63,6 +63,10 @@ export default {
type: Boolean,
default: () => false,
},
errorImage: {
type: Object,
default: () => null,
},
imageurl: {
type: String,
default: () => '',
......@@ -88,13 +92,10 @@ export default {
homeButton: 'default',
fullPageButton: 'fullscreen',
},
messages: {
none: 'imageErrorMessage',
},
};
},
mounted() {
if (this.errormessage) {
if (this.errorImage !== null) {
return;
}
......
......@@ -16,14 +16,16 @@ export default {
Editor: 'Herausgeber',
Editorial: 'Editorisch',
Editors: 'Herausgeber',
defaultError: 'Es ist ein Fehler aufgetreten. Bitte laden sie die App/Seite erneut und/oder versuchen Sie es später zu einem späteren Zeitpunkt noch mal.',
hide: 'Verstecke',
Image: 'Digitalisat',
imageErrorMessage: 'Einige Bilder stehen Ihnen außerhalb des Netzwerks der'
+ ' Georg-August-Universität Göttingen nicht ohne VPN-Zugang zur Verfügung. '
imageErrorMessageVPN: 'Einige Bilder stehen Ihnen außerhalb des Netzwerks der'
+ ' Georg-August-Universität Göttingen ohne VPN-Zugang nicht zur Verfügung. '
+ 'Wenn Sie Zugang erhalten möchten, nutzen Sie bitte die Anleitung der GWDG zum'
+ ' <a href="https://docs.gwdg.de/doku.php?id=en:services:network_services:vpn:start"'
+ 'target="_blank"> Netzwerk-Service VPN</a>.',
imageErrorTitle: 'Keine Bild Verfügbar',
imageErrorMessageNotExists: 'Für diese Seite existiert noch kein Bild.',
imageErrorTitle: 'Kein Bild verfügbar',
imageLicense: 'Bildlizenz',
imageNotes: 'Bildnotizen',
Increase: 'Vergrössern',
......@@ -51,12 +53,12 @@ export default {
osdZoomout: 'Verkleinern',
'Place of origin': 'Herkunftsort',
prev: 'Vorh.',
projectInfo: 'Projekt info',
projectInfo: 'Projekt Informationen',
Reset: 'Zurücksetzen',
search: 'Suche',
Sheet: 'Seite',
show: 'Zeige',
showHidePanels: 'Panels ein- / ausblenden',
showHidePanels: 'Panels ein-/ausblenden',
Tabs: 'Reiter',
Text: 'Text',
Textsize: 'Textgrösse',
......
......@@ -12,16 +12,18 @@ export default {
Decrease: 'Decrease',
default: 'Default',
defaultView: 'Reset panels to default view',
defaultError: 'Something went wrong. Please relaod the page/application and/or try again later.',
Description: 'Description',
Editor: 'Editor',
Editorial: 'Editorial',
Editors: 'Editors',
hide: 'Hide',
Image: 'Image',
imageErrorMessage: 'Some images are not available outside of the VPN (Virtual Private Network)'
imageErrorMessageVPN: 'Some images are not available outside of the VPN (Virtual Private Network)'
+ ' of the Georg-August-University Goettingen. If you like to get access please refer to the '
+ 'guide at <a href="https://docs.gwdg.de/doku.php?id=en:services:network_services:vpn:start"'
+ 'target="_blank"> Network Services VPN</a>.',
imageErrorMessageNotExists: 'An image for this page does not exist yet.',
imageErrorTitle: 'No Image Available',
imageLicense: 'Image License',
imageNotes: 'Image Notes',
......
......@@ -117,6 +117,10 @@ export default {
type: Boolean,
default: () => false,
},
errorImage: {
type: Object,
default: () => null,
},
isloading: {
type: Boolean,
default: false,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment