From 5999252e02b4439c7e084d981a2a1fecc650a66e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 1 Sep 2023 12:14:36 +0200 Subject: [PATCH 1/7] ci: fix Gitlab CI exunit run by separating mix compile and tz_world.update Reference https://github.com/kimlai/tz_world/issues/33 Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55396be7e..27029a5a4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -132,7 +132,9 @@ exunit: variables: MIX_ENV: test before_script: - - mix deps.get && mix tz_world.update + - mix deps.get + - mix compile + - mix tz_world.update - mix ecto.create - mix ecto.migrate script: From 84f62cd043d5cf5d186fea6f24a1a9dff5fc64ce Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 1 Sep 2023 12:17:27 +0200 Subject: [PATCH 2/7] fix(front): fix behavior of local toggle for profiles & groups view depending on domain value Signed-off-by: Thomas Citharel --- js/src/views/Admin/GroupProfiles.vue | 8 ++++---- js/src/views/Admin/ProfilesView.vue | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/views/Admin/GroupProfiles.vue b/js/src/views/Admin/GroupProfiles.vue index dbd904eea..7b12c9cb1 100644 --- a/js/src/views/Admin/GroupProfiles.vue +++ b/js/src/views/Admin/GroupProfiles.vue @@ -129,11 +129,11 @@ const PROFILES_PER_PAGE = 10; const { restrictions } = useRestrictions(); -const preferredUsername = ref(""); -const name = ref(""); -const domain = ref(""); +const preferredUsername = useRouteQuery("preferredUsername", ""); +const name = useRouteQuery("name", ""); +const domain = useRouteQuery("domain", ""); -const local = useRouteQuery("local", true, booleanTransformer); +const local = useRouteQuery("local", domain.value === "", booleanTransformer); const suspended = useRouteQuery("suspended", false, booleanTransformer); const page = useRouteQuery("page", 1, integerTransformer); diff --git a/js/src/views/Admin/ProfilesView.vue b/js/src/views/Admin/ProfilesView.vue index fa754642c..27523f265 100644 --- a/js/src/views/Admin/ProfilesView.vue +++ b/js/src/views/Admin/ProfilesView.vue @@ -119,7 +119,7 @@ const preferredUsername = useRouteQuery("preferredUsername", ""); const name = useRouteQuery("name", ""); const domain = useRouteQuery("domain", ""); -const local = useRouteQuery("local", true, booleanTransformer); +const local = useRouteQuery("local", domain.value === "", booleanTransformer); const suspended = useRouteQuery("suspended", false, booleanTransformer); const page = useRouteQuery("page", 1, integerTransformer); From 4ce79f5136f42fbbc2a046bd4e604cb7e011e5f5 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 1 Sep 2023 14:08:04 +0200 Subject: [PATCH 3/7] chore(release): release 3.2.0-beta.2 Signed-off-by: Thomas Citharel --- CHANGELOG.md | 10 ++++++++++ js/package.json | 2 +- mix.exs | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8058e9310..94180ec57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ 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). +## 3.2.0-beta.2 (2023-09-01) + +Fixes a CI issue that prevented 3.2.0-beta.2 being released. + +### Bug Fixes + +* **front:** fix behavior of local toggle for profiles & groups view depending on domain value ([84f62cd](https://framagit.org/framasoft/mobilizon/commit/84f62cd043d5cf5d186fea6f24a1a9dff5fc64ce)) + + + ## 3.2.0-beta.1 (2023-09-01) ### Features diff --git a/js/package.json b/js/package.json index 7a082bf77..1603791fc 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "mobilizon", - "version": "3.2.0-beta.1", + "version": "3.2.0-beta.2", "private": true, "scripts": { "dev": "vite", diff --git a/mix.exs b/mix.exs index 14623353d..a2ee896da 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Mobilizon.Mixfile do use Mix.Project - @version "3.2.0-beta.1" + @version "3.2.0-beta.2" def project do [ From 3f60174877bbe05773b1d1b2ceb91749adec7ed7 Mon Sep 17 00:00:00 2001 From: setop Date: Fri, 1 Sep 2023 14:06:44 +0000 Subject: [PATCH 4/7] improve group creation view --- js/src/graphql/group.ts | 8 ++ js/src/types/actor/group.model.ts | 7 +- js/src/views/Admin/GroupProfiles.vue | 2 +- js/src/views/Group/CreateView.vue | 145 +++++++++++++++++++++++++-- lib/graphql/schema/actors/group.ex | 4 + lib/mobilizon/actors/actor.ex | 3 +- 6 files changed, 156 insertions(+), 13 deletions(-) diff --git a/js/src/graphql/group.ts b/js/src/graphql/group.ts index 0b1d60874..b53ac350a 100644 --- a/js/src/graphql/group.ts +++ b/js/src/graphql/group.ts @@ -295,6 +295,10 @@ export const CREATE_GROUP = gql` $summary: String $avatar: MediaInput $banner: MediaInput + $physicalAddress: AddressInput + $visibility: GroupVisibility + $openness: Openness + $manuallyApprovesFollowers: Boolean ) { createGroup( preferredUsername: $preferredUsername @@ -302,6 +306,10 @@ export const CREATE_GROUP = gql` summary: $summary banner: $banner avatar: $avatar + physicalAddress: $physicalAddress + visibility: $visibility + openness: $openness + manuallyApprovesFollowers: $manuallyApprovesFollowers ) { ...ActorFragment banner { diff --git a/js/src/types/actor/group.model.ts b/js/src/types/actor/group.model.ts index 26e20449a..e96dc485c 100644 --- a/js/src/types/actor/group.model.ts +++ b/js/src/types/actor/group.model.ts @@ -5,8 +5,7 @@ import type { IResource } from "../resource"; import type { IEvent } from "../event.model"; import type { IDiscussion } from "../discussions"; import type { IPost } from "../post.model"; -import type { IAddress } from "../address.model"; -import { Address } from "../address.model"; +import { Address, type IAddress } from "../address.model"; import { ActorType, GroupVisibility, Openness } from "../enums"; import type { IMember } from "./member.model"; import type { ITodoList } from "../todolist"; @@ -53,11 +52,11 @@ export class Group extends Actor implements IGroup { visibility: GroupVisibility = GroupVisibility.PUBLIC; activity: Paginate = { elements: [], total: 0 }; - openness: Openness = Openness.INVITE_ONLY; + openness: Openness = Openness.MODERATED; physicalAddress: IAddress = new Address(); - manuallyApprovesFollowers = true; + manuallyApprovesFollowers = false; patch(hash: IGroup | Record): void { Object.assign(this, hash); diff --git a/js/src/views/Admin/GroupProfiles.vue b/js/src/views/Admin/GroupProfiles.vue index 7b12c9cb1..21ab50f32 100644 --- a/js/src/views/Admin/GroupProfiles.vue +++ b/js/src/views/Admin/GroupProfiles.vue @@ -120,7 +120,7 @@ import { } from "vue-use-route-query"; import { useI18n } from "vue-i18n"; import { useHead } from "@vueuse/head"; -import { computed, ref } from "vue"; +import { computed } from "vue"; import { Paginate } from "@/types/paginate"; import { IGroup } from "@/types/actor"; import AccountGroup from "vue-material-design-icons/AccountGroup.vue"; diff --git a/js/src/views/Group/CreateView.vue b/js/src/views/Group/CreateView.vue index 6d231376b..d3d9aaed8 100644 --- a/js/src/views/Group/CreateView.vue +++ b/js/src/views/Group/CreateView.vue @@ -69,11 +69,25 @@ :message="summaryErrors[0]" :type="summaryErrors[1]" > - + -
- {{ t("Avatar") }} + + +
+ {{ t("Avatar") }}
-
- {{ t("Banner") }} +
+ {{ t("Banner") }}
- +
+ + {{ t("Group visibility") }} + + + {{ $t("Visible everywhere on the web") }}
+ {{ + $t( + "The group will be publicly listed in search results and may be suggested in the explore section. Only public informations will be shown on it's page." + ) + }} +
+ {{ $t("Only accessible through link") }}
+ {{ + $t( + "You'll need to transmit the group URL so people may access the group's profile. The group won't be findable in Mobilizon's search or regular search engines." + ) + }} +
+
+
+ + {{ t("New members") }} + + {{ + t( + "Members will also access private sections like discussions, resources and restricted posts." + ) + }} + + + + + {{ $t("Anyone can join freely") }}
+ {{ + $t( + "Anyone wanting to be a member from your group will be able to from your group page." + ) + }} +
+
+ + {{ $t("Moderate new members") }}
+ {{ + $t( + "Anyone can request being a member, but an administrator needs to approve the membership." + ) + }} +
+
+ + {{ $t("Manually invite new members") }}
+ {{ + $t( + "The only way for your group to get new members is if an admininistrator invites them." + ) + }} +
+
+
+
+ + + {{ t("Followers") }} + + + {{ t("Followers will receive new public events and posts.") }} + + + + {{ t("Manually approve new followers") }} + +
+ + {{ t("Create my group") }} @@ -105,7 +213,14 @@ import PictureUpload from "../../components/PictureUpload.vue"; import { ErrorResponse } from "@/types/errors.model"; import { ServerParseError } from "@apollo/client/link/http"; import { useCurrentActorClient } from "@/composition/apollo/actor"; -import { computed, inject, reactive, ref, watch } from "vue"; +import { + computed, + defineAsyncComponent, + inject, + reactive, + ref, + watch, +} from "vue"; import { useRouter } from "vue-router"; import { useI18n } from "vue-i18n"; import { useCreateGroup } from "@/composition/apollo/group"; @@ -116,6 +231,12 @@ import { } from "@/composition/config"; import { Notifier } from "@/plugins/notifier"; import { useHead } from "@vueuse/head"; +import { Openness, GroupVisibility } from "@/types/enums"; +import FullAddressAutoComplete from "@/components/Event/FullAddressAutoComplete.vue"; + +const Editor = defineAsyncComponent( + () => import("@/components/TextEditor.vue") +); const { currentActor } = useCurrentActorClient(); @@ -156,10 +277,20 @@ const buildVariables = computed(() => { let avatarObj = {}; let bannerObj = {}; + const cloneGroup = group.value; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + delete cloneGroup.physicalAddress.__typename; + delete cloneGroup.physicalAddress.pictureInfo; + const groupBasic = { preferredUsername: group.value.preferredUsername, name: group.value.name, summary: group.value.summary, + physicalAddress: cloneGroup.physicalAddress, + visibility: group.value.visibility, + openness: group.value.openness, + manuallyApprovesFollowers: group.value.manuallyApprovesFollowers, }; if (avatarFile.value) { diff --git a/lib/graphql/schema/actors/group.ex b/lib/graphql/schema/actors/group.ex index 3b0122a11..eed6b889b 100644 --- a/lib/graphql/schema/actors/group.ex +++ b/lib/graphql/schema/actors/group.ex @@ -305,6 +305,10 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do description: "Whether the group can be join freely, with approval or is invite-only." ) + arg(:manually_approves_followers, :boolean, + description: "Whether this group approves new followers manually" + ) + arg(:avatar, :media_input, description: "The avatar for the group, either as an object or directly the ID of an existing media" diff --git a/lib/mobilizon/actors/actor.ex b/lib/mobilizon/actors/actor.ex index 36ec653b8..9db86aab7 100644 --- a/lib/mobilizon/actors/actor.ex +++ b/lib/mobilizon/actors/actor.ex @@ -146,7 +146,8 @@ defmodule Mobilizon.Actors.Actor do :domain, :summary, :visibility, - :openness + :openness, + :manually_approves_followers ] @group_creation_attrs @group_creation_required_attrs ++ @group_creation_optional_attrs From 2de6937407743100daba1d397db4da32d4cb606b Mon Sep 17 00:00:00 2001 From: Luca Eichler Date: Tue, 19 Oct 2021 15:56:18 +0200 Subject: [PATCH 5/7] feat: Add option to link an external registration provider for events Signed-off-by: Thomas Citharel --- .../components/Event/EventActionSection.vue | 14 ++++++- .../Event/ExternalParticipationButton.vue | 30 ++++++++++++++ js/src/graphql/event.ts | 6 +++ js/src/i18n/en_US.json | 6 ++- js/src/i18n/fr_FR.json | 6 ++- js/src/types/enums.ts | 1 + js/src/types/event.model.ts | 6 +++ js/src/views/Event/EditView.vue | 41 +++++++++++++++++-- .../activity_stream/converter/event.ex | 2 + lib/graphql/schema/event.ex | 6 +++ lib/mobilizon/events/event.ex | 3 ++ lib/mobilizon/events/events.ex | 3 +- ...0901160000_add_external_url_for_events.exs | 33 +++++++++++++++ schema.graphql | 12 ++++++ 14 files changed, 160 insertions(+), 9 deletions(-) create mode 100644 js/src/components/Event/ExternalParticipationButton.vue create mode 100644 priv/repo/migrations/20230901160000_add_external_url_for_events.exs diff --git a/js/src/components/Event/EventActionSection.vue b/js/src/components/Event/EventActionSection.vue index 7a5dff456..396efc615 100644 --- a/js/src/components/Event/EventActionSection.vue +++ b/js/src/components/Event/EventActionSection.vue @@ -1,7 +1,13 @@