{{ $t("Allow all comments from users with accounts") }}
-
+
@@ -238,7 +238,7 @@
{{ $t("Close comments for all (except for admins)") }}
- {{
+ {{
$t("Show the time when the event begins")
}}
- {{
+ {{
$t("Show the time when the event ends")
}}
@@ -481,7 +481,12 @@ import {
EVENT_PERSON_PARTICIPATION,
FETCH_EVENT,
} from "../../graphql/event";
-import { EventModel, IEvent, toEditJSON } from "../../types/event.model";
+import {
+ EventModel,
+ IEvent,
+ removeTypeName,
+ toEditJSON,
+} from "../../types/event.model";
import {
CURRENT_ACTOR_CLIENT,
IDENTITIES,
@@ -513,6 +518,7 @@ import {
InternalRefetchQueriesInclude,
} from "@apollo/client/core";
import cloneDeep from "lodash/cloneDeep";
+import { IEventOptions } from "@/types/event-options.model";
const DEFAULT_LIMIT_NUMBER_OF_PLACES = 10;
@@ -668,6 +674,14 @@ export default class EditEvent extends Vue {
return this.event.attributedTo?.id !== undefined;
}
+ get eventOptions(): IEventOptions {
+ return removeTypeName(cloneDeep(this.event.options));
+ }
+
+ set eventOptions(options: IEventOptions) {
+ this.event.options = options;
+ }
+
async mounted(): Promise {
this.observer = new IntersectionObserver(
(entries) => {
@@ -685,7 +699,7 @@ export default class EditEvent extends Vue {
this.observer.observe(this.$refs.bottomObserver as Element);
this.pictureFile = await buildFileFromIMedia(this.event.picture);
- this.limitedPlaces = this.event.options.maximumAttendeeCapacity > 0;
+ this.limitedPlaces = this.eventOptions.maximumAttendeeCapacity > 0;
if (!(this.isUpdate || this.isDuplicate)) {
this.initializeEvent();
} else {
@@ -913,7 +927,10 @@ export default class EditEvent extends Vue {
* Build variables for Event GraphQL creation query
*/
private async buildVariables() {
- let res = toEditJSON(new EventModel(this.event));
+ let res = {
+ ...toEditJSON(new EventModel(this.event)),
+ options: this.eventOptions,
+ };
const organizerActor = this.event.organizerActor?.id
? this.event.organizerActor
: this.organizerActor;
@@ -956,12 +973,12 @@ export default class EditEvent extends Vue {
@Watch("limitedPlaces")
updatedEventCapacityOptions(limitedPlaces: boolean): void {
if (!limitedPlaces) {
- this.event.options.maximumAttendeeCapacity = 0;
- this.event.options.remainingAttendeeCapacity = 0;
- this.event.options.showRemainingAttendeeCapacity = false;
+ this.eventOptions.maximumAttendeeCapacity = 0;
+ this.eventOptions.remainingAttendeeCapacity = 0;
+ this.eventOptions.showRemainingAttendeeCapacity = false;
} else {
- this.event.options.maximumAttendeeCapacity =
- this.event.options.maximumAttendeeCapacity ||
+ this.eventOptions.maximumAttendeeCapacity =
+ this.eventOptions.maximumAttendeeCapacity ||
DEFAULT_LIMIT_NUMBER_OF_PLACES;
}
}