Allow to join an open group

Also:

* Refactor interacting with a remote event so that you can interact with
  a remote group as well
* Add a setting for group admins to pick between an open and invite-only
  group
* Fix new groups without posts/todos/resources/events/conversations URL
  set
* Repair local groups that haven't got their
  posts/todos/resources/events/conversations URL set
* Add a scheduled job to refresh remote groups every hour
* Add a user setting to pick when to receive notifications when there's
  new members to approve (will be used when this feature is available)
* Fix pagination for members

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-06 11:34:32 +01:00
parent 7baad7cafc
commit 7c11807c14
74 changed files with 1174 additions and 626 deletions

View File

@@ -67,27 +67,6 @@
/>
</p>
</div>
<!-- <div class="field" v-if="event.attributedTo.id">-->
<!-- <label class="label">{{ $t('Hide the organizer') }}</label>-->
<!-- <b-switch v-model="event.options.hideOrganizerWhenGroupEvent">-->
<!-- {{ $t("Don't show @{organizer} as event host alongside @{group}", {organizer: event.organizerActor.preferredUsername, group: event.attributedTo.preferredUsername}) }}-->
<!-- <small>-->
<!-- <br>-->
<!-- {{ $t('All group members and other eventual server admins will still be able to view this information.') }}-->
<!-- </small>-->
<!-- </b-switch>-->
<!-- </div>-->
<!--<b-field :label="$t('Category')">
<b-select placeholder="Select a category" v-model="event.category">
<option
v-for="category in categories"
:value="category"
:key="category"
>{{ $t(category) }}</option>
</b-select>
</b-field>-->
<subtitle>{{ $t("Who can view this event and participate") }}</subtitle>
<div class="field">
<b-radio
@@ -370,6 +349,8 @@ import IdentityPickerWrapper from "@/views/Account/IdentityPickerWrapper.vue";
import Subtitle from "@/components/Utils/Subtitle.vue";
import { Route } from "vue-router";
import { formatList } from "@/utils/i18n";
import { CommentModeration } from "../../types/event-options.model";
import { ParticipantRole } from "../../types/participant.model";
import OrganizerPickerWrapper from "../../components/Event/OrganizerPickerWrapper.vue";
import {
CREATE_EVENT,
@@ -378,13 +359,11 @@ import {
FETCH_EVENT,
} from "../../graphql/event";
import {
CommentModeration,
EventJoinOptions,
EventModel,
EventStatus,
EventVisibility,
IEvent,
ParticipantRole,
} from "../../types/event.model";
import {
CURRENT_ACTOR_CLIENT,

View File

@@ -88,10 +88,10 @@
:participation="participations[0]"
:event="event"
:current-actor="currentActor"
@joinEvent="joinEvent"
@joinModal="isJoinModalActive = true"
@joinEventWithConfirmation="joinEventWithConfirmation"
@confirmLeave="confirmLeave"
@join-event="joinEvent"
@join-modal="isJoinModalActive = true"
@join-event-with-confirmation="joinEventWithConfirmation"
@confirm-leave="confirmLeave"
/>
<b-button
type="is-text"
@@ -504,7 +504,6 @@
<script lang="ts">
import { Component, Prop, Watch } from "vue-property-decorator";
import BIcon from "buefy/src/components/icon/Icon.vue";
import { GraphQLError } from "graphql";
import {
EVENT_PERSON_PARTICIPATION,
EVENT_PERSON_PARTICIPATION_SUBSCRIPTION_CHANGED,
@@ -517,8 +516,6 @@ import {
EventStatus,
EventVisibility,
IEvent,
IParticipant,
ParticipantRole,
EventJoinOptions,
} from "../../types/event.model";
import { IActor, IPerson, Person, usernameWithDomain } from "../../types/actor";
@@ -549,6 +546,7 @@ import Tag from "../../components/Tag.vue";
import EventMetadataBlock from "../../components/Event/EventMetadataBlock.vue";
import ActorCard from "../../components/Account/ActorCard.vue";
import PopoverActorCard from "../../components/Account/PopoverActorCard.vue";
import { IParticipant, ParticipantRole } from "../../types/participant.model";
@Component({
components: {

View File

@@ -38,71 +38,9 @@ export default class EventList extends Vue {
locationText = "";
// created() {
// this.fetchData(this.$router.currentRoute.params.location);
// }
// beforeRouteUpdate(to, from, next) {
// this.fetchData(to.params.location);
// next();
// }
// @Watch('locationChip')
// onLocationChipChange(val) {
// if (val === false) {
// this.$router.push({ name: RouteName.EVENT_LIST });
// }
// }
// geocode(lat, lon) {
// console.log({ lat, lon });
// console.log(ngeohash.encode(lat, lon, 10));
// return ngeohash.encode(lat, lon, 10);
// }
// fetchData(location: string) {
// let queryString = '/events';
// if (location) {
// queryString += `?geohash=${location}`;
// const { latitude, longitude } = ngeohash.decode(location);
// this.locationText = `${latitude.toString()} : ${longitude.toString()}`;
// }
// this.locationChip = true;
// // FIXME: remove eventFetch
// // eventFetch(queryString, this.$store)
// // .then(response => response.json())
// // .then((response) => {
// // this.loading = false;
// // this.events = response.data;
// // console.log(this.events);
// // });
// }
// deleteEvent(event: IEvent) {
// const router = this.$router;
// // FIXME: remove eventFetch
// // eventFetch(`/events/${event.uuid}`, this.$store, { method: 'DELETE' })
// // .then(() => router.push('/events'));
// }
viewEvent(event: IEvent) {
viewEvent(event: IEvent): void {
this.$router.push({ name: RouteName.EVENT, params: { uuid: event.uuid } });
}
// downloadIcsEvent(event: IEvent) {
// // FIXME: remove eventFetch
// // eventFetch(`/events/${event.uuid}/ics`, this.$store, { responseType: 'arraybuffer' })
// // .then(response => response.text())
// // .then((response) => {
// // const blob = new Blob([ response ], { type: 'text/calendar' });
// // const link = document.createElement('a');
// // link.href = window.URL.createObjectURL(blob);
// // link.download = `${event.title}.ics`;
// // document.body.appendChild(link);
// // link.click();
// // document.body.removeChild(link);
// // });
// }
}
</script>

View File

@@ -16,7 +16,7 @@
:key="participation.id"
:participation="participation"
:options="{ hideDate: false }"
@eventDeleted="eventDeleted"
@event-deleted="eventDeleted"
class="participation"
/>
</div>
@@ -57,7 +57,7 @@
:key="participation.id"
:participation="participation"
:options="{ hideDate: false }"
@eventDeleted="eventDeleted"
@event-deleted="eventDeleted"
class="participation"
/>
</div>
@@ -88,14 +88,9 @@
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { IParticipant, Participant, ParticipantRole } from "../../types/participant.model";
import { LOGGED_USER_PARTICIPATIONS, LOGGED_USER_DRAFTS } from "../../graphql/actor";
import {
EventModel,
IEvent,
IParticipant,
Participant,
ParticipantRole,
} from "../../types/event.model";
import { EventModel, IEvent } from "../../types/event.model";
import EventListCard from "../../components/Event/EventListCard.vue";
import EventCard from "../../components/Event/EventCard.vue";
import Subtitle from "../../components/Utils/Subtitle.vue";
@@ -207,7 +202,7 @@ export default class MyEvents extends Vue {
return MyEvents.monthlyParticipations(this.pastParticipations, true);
}
loadMoreFutureParticipations() {
loadMoreFutureParticipations(): void {
this.futurePage += 1;
this.$apollo.queries.futureParticipations.fetchMore({
// New variables
@@ -236,7 +231,7 @@ export default class MyEvents extends Vue {
});
}
loadMorePastParticipations() {
loadMorePastParticipations(): void {
this.pastPage += 1;
this.$apollo.queries.pastParticipations.fetchMore({
// New variables
@@ -265,7 +260,7 @@ export default class MyEvents extends Vue {
});
}
eventDeleted(eventid: string) {
eventDeleted(eventid: string): void {
this.futureParticipations = this.futureParticipations.filter(
(participation) => participation.event.id !== eventid
);

View File

@@ -185,12 +185,8 @@
<script lang="ts">
import { Component, Prop, Vue, Watch, Ref } from "vue-property-decorator";
import {
IEvent,
IEventParticipantStats,
IParticipant,
ParticipantRole,
} from "../../types/event.model";
import { IParticipant, ParticipantRole } from "../../types/participant.model";
import { IEvent, IEventParticipantStats } from "../../types/event.model";
import { PARTICIPANTS, UPDATE_PARTICIPANT } from "../../graphql/event";
import { CURRENT_ACTOR_CLIENT } from "../../graphql/actor";
import { IPerson, usernameWithDomain } from "../../types/actor";