#215 better server error handling - dialogue box

This commit is contained in:
Avris 2021-06-09 14:47:58 +02:00
parent 1cc78cf55d
commit 85ae2d54dc
14 changed files with 30 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<div :class="['modal', shown ? 'd-block' : '']" @click="hideClick">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content shadow">
<div class="modal-header">
<div class="modal-header" v-if="choice">
<p class="h5 modal-title">
<Icon v="map-marker-question"/>
{{$t('confirm.header')}}
@ -11,7 +11,7 @@
<div class="modal-body">
<p class="py-5 text-center" v-html="message"></p>
</div>
<div class="modal-footer">
<div v-if="choice" class="modal-footer">
<button class="btn btn-outline-dark" @click="cancel">
{{$t('confirm.no')}}
</button>
@ -19,6 +19,11 @@
{{$t('confirm.yes')}}
</button>
</div>
<div v-else class="modal-footer">
<button :class="'btn btn-' + (color || 'primary')" @click="confirm">
{{$t('confirm.ok')}}
</button>
</div>
</div>
</div>
</div>
@ -29,6 +34,7 @@
data() {
return {
shown: false,
choice: false,
message: undefined,
resolve: undefined,
reject: undefined,
@ -47,7 +53,8 @@
}
},
methods: {
show(message, color, resolve, reject) {
show(choice, message, color, resolve, reject) {
this.choice = choice;
this.message = message;
this.resolve = resolve;
this.reject = reject;
@ -57,6 +64,7 @@
confirm() {
const resolve = this.resolve;
this.shown = false;
this.choice = false;
this.message = undefined;
this.resolve = undefined;
this.reject = undefined;

View File

@ -10,7 +10,7 @@
<div class="container">
<Footer/>
</div>
<Confirm ref="confirm"/>
<DialogueBox ref="dialogue"/>
<Lightbox/>
</div>
</template>
@ -20,9 +20,14 @@
export default {
mounted() {
Vue.prototype.$alert = (message, color='primary') => {
return new Promise((resolve, reject) => {
this.$refs.dialogue.show(false, message, color, resolve, reject);
});
};
Vue.prototype.$confirm = (message, color='primary') => {
return new Promise((resolve, reject) => {
this.$refs.confirm.show(message, color, resolve, reject);
this.$refs.dialogue.show(true, message, color, resolve, reject);
});
};
}

View File

@ -12,6 +12,7 @@ confirm:
header: 'Are you sure?'
yes: 'Yes, I''m sure'
no: 'No, cancel'
ok: 'OK'
table:
scrollUp: 'Scroll to the top'

View File

@ -447,6 +447,7 @@ confirm:
header: 'Bist du sicher?'
yes: 'Ja, ich bin sicher'
no: 'Nein, abbrechen'
ok: 'OK'
terms:
header: 'Nutzungsbedingungen'

View File

@ -522,6 +522,7 @@ confirm:
header: 'Are you sure?'
yes: 'Yes, I''m sure'
no: 'No, cancel'
ok: 'OK'
terms:
header: 'Terms of Service'

View File

@ -456,6 +456,7 @@ confirm:
header: '¿Confirmas esta decisión?'
yes: 'Sí, lo estoy'
no: 'No, cancelar'
ok: 'OK'
terms:
header: 'Térinos de Servicio'

View File

@ -437,6 +437,7 @@ confirm:
header: 'Êtes-vous sûrs?'
yes: 'Oui, je suis sûr'
no: 'Non, annuler'
ok: 'OK'
terms:
header: 'Conditions d''Utilisation'

View File

@ -450,6 +450,7 @@ confirm:
header: 'Weet je zeker dat?'
yes: 'Ja, dat weet ik zeker'
no: 'Nee, annuleer'
ok: 'OK'
terms:
header: 'Gebruiksvoorwaarden'

View File

@ -604,7 +604,7 @@ links:
icon: 'cogs'
url: 'http://dobrerzeczy.online/femaleSwitcher/'
headline: 'Female switcher'
extra: ' apka, która zamieni formy fleksyjne wyświetlanych tekstów z rodzaju męskiego na żeński'
extra: ' apka, która zamieni formy fleksyjne wyświetlanych tekstów z rodzaju męskiego na żeński.'
people:
enabled: false

View File

@ -1055,6 +1055,7 @@ confirm:
header: 'Czy jesteś pewnx?'
yes: 'Tak, na pewno'
no: 'Nie, anuluj'
ok: 'OK'
terms:
header: 'Regulamin'

View File

@ -454,6 +454,7 @@ confirm:
header: 'Aplicar essa decisão?'
yes: 'Sim'
no: 'Não, cancelar'
ok: 'OK'
terms:
header: 'Termos de Serviço'

View File

@ -1026,6 +1026,7 @@ confirm:
header: 'Czy jesteś pewnx?'
yes: 'Tak, na pewno'
no: 'Nie, anuluj'
ok: 'OK'
terms:
header: 'Regulamin'

View File

@ -467,6 +467,7 @@ confirm:
header: 'Are you sure?'
yes: 'Yes, I''m sure'
no: 'No, cancel'
ok: 'OK'
terms:
header: 'Terms of Service'

View File

@ -435,6 +435,7 @@ confirm:
header: '你有準兒沒有?'
yes: '是的,我有準兒!'
no: '不是…'
ok: 'OK'
terms:
header: '服務條款'