diff --git a/CHANGELOG.md b/CHANGELOG.md index 249c044ac..ebd0c391c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.0.6 - 04-02-2020 + +### Added + +- Handle frontend errors nicely when mounting components + +### Fixed + +- Fixed displaying a remote event when organizer is a group +- Fixed sending events & posts to group followers +- Fixed redirection after deleting an event + ## 1.0.5 - 27-01-2020 ### Fixed diff --git a/js/package.json b/js/package.json index 9aea87136..f0e91abb3 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "mobilizon", - "version": "1.0.5", + "version": "1.0.6", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/js/src/App.vue b/js/src/App.vue index a0b85b0f8..b8c29a98a 100644 --- a/js/src/App.vue +++ b/js/src/App.vue @@ -20,7 +20,9 @@

-
+ + +
@@ -57,6 +59,8 @@ import { ICurrentUser } from "./types/current-user.model"; components: { Logo, NavBar, + error: () => + import(/* webpackChunkName: "editor" */ "./components/Error.vue"), "mobilizon-footer": Footer, }, }) @@ -65,12 +69,18 @@ export default class App extends Vue { currentUser!: ICurrentUser; + error: Error | null = null; + async created(): Promise { if (await this.initializeCurrentUser()) { await initializeCurrentActor(this.$apollo.provider.defaultClient); } } + errorCaptured(error: Error): void { + this.error = error; + } + private async initializeCurrentUser() { const userId = localStorage.getItem(AUTH_USER_ID); const userEmail = localStorage.getItem(AUTH_USER_EMAIL); diff --git a/js/src/components/About/InstanceContactLink.vue b/js/src/components/About/InstanceContactLink.vue new file mode 100644 index 000000000..80d17ecea --- /dev/null +++ b/js/src/components/About/InstanceContactLink.vue @@ -0,0 +1,52 @@ + + diff --git a/js/src/components/Error.vue b/js/src/components/Error.vue new file mode 100644 index 000000000..3a0375860 --- /dev/null +++ b/js/src/components/Error.vue @@ -0,0 +1,219 @@ + + + diff --git a/js/src/graphql/config.ts b/js/src/graphql/config.ts index 3dd903581..6e514ef35 100644 --- a/js/src/graphql/config.ts +++ b/js/src/graphql/config.ts @@ -112,6 +112,15 @@ export const ABOUT = gql` } `; +export const CONTACT = gql` + query Contact { + config { + name + contact + } + } +`; + export const RULES = gql` query Rules { config { diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index fe0b9e625..669100da6 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -836,5 +836,19 @@ "No follower matches the filters": "No follower matches the filters", "@{username}'s follow request was rejected": "@{username}'s follow request was rejected", "Followers will receive new public events and posts.": "Followers will receive new public events and posts.", - "Manually approve new followers": "Manually approve new followers" + "Manually approve new followers": "Manually approve new followers", + "An error has occured. Sorry about that. You may try to reload the page.": "An error has occured. Sorry about that. You may try to reload the page.", + "What can I do to help?": "What can I do to help?", + "We improve this software thanks to your feedback. To let us know about this issue, two possibilities (both unfortunately require user account creation):": "We improve this software thanks to your feedback. To let us know about this issue, two possibilities (both unfortunately require user account creation):'", + "Please add as many details as possible to help identify the problem.": "Please add as many details as possible to help identify the problem.", + "Technical details": "Technical details", + "Error message": "Error message", + "Error stacktrace": "Error stacktrace", + "The technical details of the error can help developers solve the problem more easily. Please add them to your feedback.": "The technical details of the error can help developers solve the problem more easily. Please add them to your feedback.", + "Error details copied!": "Error details copied!", + "Copy details to clipboard": "Copy details to clipboard", + "{instanceName} is an instance of {mobilizon_link}, a free software built with the community.": "{instanceName} is an instance of {mobilizon_link}, a free software built with the community.", + "Open a topic on our forum": "Open a topic on our forum", + "Open an issue on our bug tracker (advanced users)": "Open an issue on our bug tracker (advanced users)", + "Unable to copy to clipboard": "Unable to copy to clipboard" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 4433842b5..30038166f 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -931,5 +931,19 @@ "No follower matches the filters": "Aucun⋅e abonné⋅e ne correspond aux filtres", "@{username}'s follow request was rejected": "La demande de suivi de @{username} a été rejettée", "Followers will receive new public events and posts.": "Les abonnée⋅s recevront les nouveaux événements et billets publics.", - "Manually approve new followers": "Approuver les nouvelles demandes de suivi manuellement" + "Manually approve new followers": "Approuver les nouvelles demandes de suivi manuellement", + "An error has occured. Sorry about that. You may try to reload the page.": "Une erreur est survenue. Nous en sommes désolé⋅es. Vous pouvez essayer de rafraîchir la page.", + "What can I do to help?": "Que puis-je faire pour aider ?", + "We improve this software thanks to your feedback. To let us know about this issue, two possibilities (both unfortunately require user account creation):": "Nous améliorons ce logiciel grâce à vos retours. Pour nous avertir de ce problème, vous avez deux possibilités (les deux requièrent toutefois la création d'un compte) :", + "Please add as many details as possible to help identify the problem.": "Merci d'ajouter un maximum de détails afin d'aider à identifier le problème.", + "Technical details": "Détails techniques", + "Error message": "Message d'erreur", + "Error stacktrace": "Trace d'appels de l'erreur", + "The technical details of the error can help developers solve the problem more easily. Please add them to your feedback.": "Les détails techniques de l'erreur peuvent aider les développeur⋅ices à résoudre le problème plus facilement. Merci de les inclure dans vos retours.", + "Error details copied!": "Détails de l'erreur copiés !", + "Copy details to clipboard": "Copier les détails dans le presse-papiers", + "{instanceName} is an instance of {mobilizon_link}, a free software built with the community.": "{instanceName} est une instance de {mobilizon_link}, un logiciel libre construit de manière communautaire.", + "Open a topic on our forum": "Ouvrir un sujet sur notre forum", + "Open an issue on our bug tracker (advanced users)": "Ouvrir un ticket sur notre système de suivi des bugs (utilisateur⋅ices avancé⋅es)", + "Unable to copy to clipboard": "Impossible de copier dans le presse-papiers" } diff --git a/js/src/router/index.ts b/js/src/router/index.ts index e6313a39f..0a8b0534d 100644 --- a/js/src/router/index.ts +++ b/js/src/router/index.ts @@ -157,5 +157,10 @@ const router = new Router({ }); router.beforeEach(authGuardIfNeeded); +router.afterEach(() => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + router.app.$children[0].error = null; +}); export default router; diff --git a/js/src/views/About/AboutInstance.vue b/js/src/views/About/AboutInstance.vue index 86b75262f..9aa1d9d26 100644 --- a/js/src/views/About/AboutInstance.vue +++ b/js/src/views/About/AboutInstance.vue @@ -25,16 +25,7 @@

{{ $t("Contact") }}

-

- {{ generateConfigLink().text }} - {{ config.contact }} - {{ $t("contact uninformed") }} -

+

@@ -85,6 +76,7 @@ diff --git a/js/src/views/Event/Event.vue b/js/src/views/Event/Event.vue index 290dee24f..811c4f8f7 100755 --- a/js/src/views/Event/Event.vue +++ b/js/src/views/Event/Event.vue @@ -1,6 +1,5 @@ -