From c732ec7f87c36ef73beee82c8a90213198c9a17c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 5 Mar 2020 19:32:34 +0100 Subject: [PATCH] Add ability to add message for participation and improve participation management interface Signed-off-by: Thomas Citharel --- CHANGELOG.md | 4 +- docs/contribute/activity_pub.md | 27 +- js/src/components/Admin/Followers.vue | 1 - .../components/Event/ParticipationButton.vue | 12 +- .../components/Event/ParticipationTable.vue | 164 +++++++ js/src/components/NavBar.vue | 6 +- .../ParticipationWithoutAccount.vue | 34 +- js/src/graphql/event.ts | 42 +- js/src/i18n/en_US.json | 15 +- js/src/i18n/es.json | 1 - js/src/i18n/fi.json | 1 - js/src/i18n/fr_FR.json | 19 +- js/src/i18n/oc.json | 1 - js/src/i18n/pt_BR.json | 1 - js/src/plugins/notifier.ts | 18 + js/src/router/event.ts | 2 +- js/src/types/event.model.ts | 10 +- js/src/utils/asyncForEach.ts | 7 + js/src/views/Event/Event.vue | 50 ++- js/src/views/Event/Participants.vue | 148 ++++--- lib/federation/activity_pub/activity_pub.ex | 5 +- lib/federation/activity_pub/transmogrifier.ex | 11 +- lib/federation/activity_pub/utils.ex | 4 + .../activity_stream/converter/participant.ex | 3 +- lib/graphql/resolvers/event.ex | 2 +- lib/graphql/resolvers/participant.ex | 7 +- lib/graphql/schema/event.ex | 2 +- lib/graphql/schema/events/participant.ex | 10 + lib/mobilizon/events/events.ex | 5 +- lib/mobilizon/events/participant.ex | 9 +- schema.graphql | 405 +++++++++--------- .../activity_pub/transmogrifier_test.exs | 11 +- test/graphql/resolvers/participant_test.exs | 60 ++- test/mobilizon/events/events_test.exs | 7 +- 34 files changed, 736 insertions(+), 368 deletions(-) create mode 100644 js/src/components/Event/ParticipationTable.vue create mode 100644 js/src/utils/asyncForEach.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c2fb1be..81a615e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,9 @@ A minimal file template [is available](https://framagit.org/framasoft/mobilizon/ Also make sure to remove the `EnvironmentFile=` line from the systemd service and set `Environment=MIX_ENV=prod` instead. See [the updated file](https://framagit.org/framasoft/mobilizon/blob/master/support/systemd/mobilizon.service). ### Added -- Possibility to participate anonymously to an event +- Possibility to participate to an event without an account - Possibility to participate to a remote event (being redirected by providing federated identity) +- Possibility to add a note as a participant when event participation is manually validated (required when participating without an account) - Possibility to change email address for the account - Possibility to delete your account @@ -26,6 +27,7 @@ Also make sure to remove the `EnvironmentFile=` line from the systemd service an - Signature validation also now checks if `Date` header has acceptable values - Actor profiles are now stale after two days and have to be refetched - Actor keys are rotated some time after sending a `Delete` activity +- Improved event participations managing interface ### Fixed - Fixed URL search diff --git a/docs/contribute/activity_pub.md b/docs/contribute/activity_pub.md index 8f8b901c..da275668 100644 --- a/docs/contribute/activity_pub.md +++ b/docs/contribute/activity_pub.md @@ -21,7 +21,8 @@ Supported Activity | Supported Object `Create` | `Note`, `Event` `Delete` | `Object` `Flag` | `Object` -`Follow` | `Object` +`Follow` | `Object` +`Join` | `Event` `Reject` | `Follow`, `Join` `Remove` | `Note`, `Event` `Undo` | `Announce`, `Follow` @@ -155,4 +156,28 @@ We add [an `address` property](https://schema.org/address), which we assume to b }, "type": "Event" } +``` + +### Join + +#### participationMessage + +We add a `participationMessage` property on a `Join` activity so that participants may transmit a note to event organizers, to motivate their participation when event participations are manually approved. This field is restricted to plain text. + +```json +{ + "type": "Join", + "object": "http://mobilizon.test/events/some-uuid", + "id": "http://mobilizon2.test/@admin/join/event/1", + "actor": "http://mobilizon2.test/@admin", + "participationMessage": "I want to join !", + "@context": [ + { + "participationMessage": { + "@id": "mz:participationMessage", + "@type": "sc:Text" + } + } + ] +} ``` \ No newline at end of file diff --git a/js/src/components/Admin/Followers.vue b/js/src/components/Admin/Followers.vue index bda7bbc6..7f44e940 100644 --- a/js/src/components/Admin/Followers.vue +++ b/js/src/components/Admin/Followers.vue @@ -6,7 +6,6 @@ :loading="$apollo.queries.relayFollowers.loading" ref="table" :checked-rows.sync="checkedRows" - :is-row-checkable="(row) => row.id !== 3" detailed :show-detail-icon="false" paginated diff --git a/js/src/components/Event/ParticipationButton.vue b/js/src/components/Event/ParticipationButton.vue index 9af50321..6e59e01c 100644 --- a/js/src/components/Event/ParticipationButton.vue +++ b/js/src/components/Event/ParticipationButton.vue @@ -1,3 +1,4 @@ +import {EventJoinOptions} from "@/types/event.model"; A button to set your participation @@ -80,7 +81,7 @@ A button to set your participation
- {{ $t('as {identity}', {identity: currentActor.preferredUsername }) }} + {{ $t('as {identity}', {identity: currentActor.name || `@${currentActor.preferredUsername}` }) }}
@@ -96,14 +97,13 @@ A button to set your participation + \ No newline at end of file diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index 922f9d2c..9af4041f 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -29,7 +29,7 @@
- +
@@ -180,6 +180,10 @@ nav { background: $secondary; } + span.icon.is-medium { + display: flex; + } + img { max-height: 2.5em; } diff --git a/js/src/components/Participation/ParticipationWithoutAccount.vue b/js/src/components/Participation/ParticipationWithoutAccount.vue index 73d333b4..1c4c8602 100644 --- a/js/src/components/Participation/ParticipationWithoutAccount.vue +++ b/js/src/components/Participation/ParticipationWithoutAccount.vue @@ -7,18 +7,24 @@ {{ $t("Your email will only be used to confirm that you're a real person and send you eventual updates for this event. It will NOT be transmitted to other instances or to the event organizer.") }} {{ error }} - - - -

- {{ $t('Send email') }} -

-
+ +
+

{{ $t("The event organizer manually approves participations. Since you've chosen to participate without an account, please explain why you want to participate to this event.") }}

+

{{ $t("If you want, you may send a message to the event organizer here.") }}

+ + + + + {{ $t('Send email') }}
{{ $t('Back to previous page') }} @@ -31,7 +37,7 @@