diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7beac896a..79f02f5cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -205,15 +205,13 @@ build-docker-tag: package-app: stage: package - before_script: - - apt update - - apt install -y --no-install-recommends build-essential git cmake variables: MIX_ENV: "prod" script: - mix local.hex --force - mix local.rebar --force - cp docker/production/releases.exs ./config/ + - mix deps.get - mix phx.digest - mix release artifacts: @@ -240,18 +238,17 @@ release-upload: when: on_success paths: - mobilizon_*.tar.gz +# release-create: +# stage: deploy +# image: registry.gitlab.com/gitlab-org/release-cli:latest +# rules: +# - if: $CI_COMMIT_TAG +# dependencies: [] +# cache: {} +# script: | +# APP_VERSION="${CI_COMMIT_TAG}" +# APP_ASSET="${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz" -release-create: - stage: deploy - image: registry.gitlab.com/gitlab-org/release-cli:latest - rules: - - if: $CI_COMMIT_TAG - dependencies: [] - cache: {} - script: | - APP_VERSION="${CI_COMMIT_TAG}" - APP_ASSET="${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz" - - release-cli create --name "$CI_PROJECT_TITLE v$CI_COMMIT_TAG" \ - --tag-name "$CI_COMMIT_TAG" \ - --assets-link "{\"name\":\"${APP_ASSET}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${APP_VERSION}/${APP_ASSET}\"}" +# release-cli create --name "$CI_PROJECT_TITLE v$CI_COMMIT_TAG" \ +# --tag-name "$CI_COMMIT_TAG" \ +# --assets-link "{\"name\":\"${APP_ASSET}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${APP_VERSION}/${APP_ASSET}\"}" diff --git a/CHANGELOG.md b/CHANGELOG.md index d9f71341a..d7d2e712f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,35 @@ 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.5 - 27-01-2020 +## 1.0.7 - 27-02-2021 + +### Fixed + +- Fixed accessing group event unlogged +- Fixed broken redirection with Webfinger due to strict connect-src +- Fixed editing group discussions +- Fixed search form display +- Fixed wrong year in CHANGELOG.md + +## 1.0.6 - 04-02-2021 + +### 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-2021 ### Fixed - Fixed duplicate entries in search with empty search query -## 1.0.4 - 26-01-2020 +## 1.0.4 - 26-01-2021 ### Added diff --git a/js/package.json b/js/package.json index 9aea87136..6087d6a50 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "mobilizon", - "version": "1.0.5", + "version": "1.0.7", "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/Comment/Comment.vue b/js/src/components/Comment/Comment.vue index 8040a2c8b..8d86dc9b6 100644 --- a/js/src/components/Comment/Comment.vue +++ b/js/src/components/Comment/Comment.vue @@ -296,11 +296,9 @@ export default class Comment extends Vue { } get commentFromOrganizer(): boolean { - return ( - this.event.organizerActor !== undefined && - this.comment.actor != null && - this.comment.actor.id === this.event.organizerActor.id - ); + const organizerId = + this.event?.organizerActor?.id || this.event?.attributedTo?.id; + return organizerId !== undefined && this.comment?.actor?.id === organizerId; } get commentId(): string { diff --git a/js/src/components/Comment/CommentTree.vue b/js/src/components/Comment/CommentTree.vue index 10c5bbc44..363f517a8 100644 --- a/js/src/components/Comment/CommentTree.vue +++ b/js/src/components/Comment/CommentTree.vue @@ -320,11 +320,9 @@ export default class CommentTree extends Vue { } get isEventOrganiser(): boolean { - return ( - this.currentActor.id !== undefined && - this.event.organizerActor !== undefined && - this.currentActor.id === this.event.organizerActor.id - ); + const organizerId = + this.event?.organizerActor?.id || this.event?.attributedTo?.id; + return organizerId !== undefined && this.currentActor?.id === organizerId; } get areCommentsClosed(): boolean { @@ -335,7 +333,7 @@ export default class CommentTree extends Vue { } get isAbleToComment(): boolean { - if (this.currentActor && this.currentActor.id) { + if (this.currentActor?.id) { return this.areCommentsClosed || this.isEventOrganiser; } return false; 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/Edit.vue b/js/src/views/Event/Edit.vue index 86304b3de..e88e2f946 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -579,7 +579,7 @@ export default class EditEvent extends Vue { } private getDefaultActor() { - if (this.event.organizerActor && this.event.organizerActor.id) { + if (this.event.organizerActor?.id) { return this.event.organizerActor; } return this.currentActor; @@ -725,7 +725,7 @@ export default class EditEvent extends Vue { get isCurrentActorOrganizer(): boolean { return !( this.eventId && - this.event.organizerActor && + this.event.organizerActor?.id !== undefined && this.currentActor.id !== this.event.organizerActor.id ) as boolean; } @@ -822,19 +822,17 @@ export default class EditEvent extends Vue { } get attributedToEqualToOrganizerActor(): boolean { - return (this.event.organizerActor && - this.event.attributedTo && - this.event.attributedTo.id === this.event.organizerActor.id) as boolean; + return (this.event.organizerActor?.id !== undefined && + this.event.attributedTo?.id === this.event.organizerActor?.id) as boolean; } /** * Build variables for Event GraphQL creation query */ private async buildVariables() { - this.event.organizerActor = - this.event.organizerActor && this.event.organizerActor.id - ? this.event.organizerActor - : this.currentActor; + this.event.organizerActor = this.event.organizerActor?.id + ? this.event.organizerActor + : this.currentActor; let res = this.event.toEditJSON(); if (this.event.organizerActor) { res = Object.assign(res, { 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 @@ -