From 84f8e16cd03c25274bb180922942ac8992926434 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 9 Oct 2019 19:41:17 +0200 Subject: [PATCH] Fix event creation/updating having a popup Also change translation on the warning Signed-off-by: Thomas Citharel --- js/src/i18n/en_US.json | 1 + js/src/i18n/fr_FR.json | 1 + js/src/views/Event/Edit.vue | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 873a2c93f..879a337f1 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -1,6 +1,7 @@ { "A user-friendly, emancipatory and ethical tool for gathering, organising, and mobilising.": "A user-friendly, emancipatory and ethical tool for gathering, organising, and mobilising.", "A validation email was sent to {email}": "A validation email was sent to {email}", + "Abandon edition": "Abandon edition", "About Mobilizon": "About Mobilizon", "About this event": "About this event", "About this instance": "About this instance", diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 8db73a79f..c69a5e08b 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -1,5 +1,6 @@ { "A validation email was sent to {email}": "Un email de validation a été envoyé à {email}", + "Abandon edition": "Abandonner l'édition", "About this event": "À propos de cet événement", "About this instance": "À propos de cette instance", "About": "À propos", diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue index f735b85f9..e6f09e42d 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -254,6 +254,7 @@ import { ITag } from '@/types/tag.model'; import AddressAutoComplete from '@/components/Event/AddressAutoComplete.vue'; import { buildFileFromIPicture, buildFileVariable } from '@/utils/image'; import IdentityPickerWrapper from '@/views/Account/IdentityPickerWrapper.vue'; +import { RouteName } from '@/router'; @Component({ components: { IdentityPickerWrapper, AddressAutoComplete, TagInput, DateTimePicker, PictureUpload, Editor }, @@ -514,7 +515,7 @@ export default class EditEvent extends Vue { this.$buefy.dialog.confirm({ title, message, - confirmText: this.$t('Cancel') as string, + confirmText: this.$t('Abandon edition') as string, cancelText: this.$t('Continue editing') as string, type: 'is-warning', hasIcon: true, @@ -530,6 +531,7 @@ export default class EditEvent extends Vue { } beforeRouteLeave(to, from, next) { + if (to.name === RouteName.EVENT) return next(); this.confirmGoElsewhere(() => next()); }