Multiples fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-06-15 18:12:49 +02:00
parent c3ba3b26d8
commit 918dc6f10b
14 changed files with 108 additions and 85 deletions

View File

@@ -444,11 +444,6 @@ export default class EditEvent extends Vue {
endsOnNull = false;
created() {
this.initializeEvent();
this.unmodifiedEvent = JSON.parse(JSON.stringify(this.event.toEditJSON()));
}
@Watch("eventId", { immediate: true })
resetFormForCreation(eventId: string) {
if (eventId === undefined) {
@@ -486,10 +481,12 @@ export default class EditEvent extends Vue {
}
);
this.observer.observe(this.$refs.bottomObserver as Element);
this.unmodifiedEvent = JSON.parse(JSON.stringify(this.event.toEditJSON()));
this.pictureFile = await buildFileFromIPicture(this.event.picture);
this.limitedPlaces = this.event.options.maximumAttendeeCapacity > 0;
if (!(this.isUpdate || this.isDuplicate)) {
this.initializeEvent();
}
}
createOrUpdateDraft(e: Event) {
@@ -513,6 +510,13 @@ export default class EditEvent extends Vue {
this.event.organizerActor = this.currentActor;
}
@Watch("event")
setInitialData() {
if (this.isUpdate && this.unmodifiedEvent === undefined && this.event && this.event.uuid) {
this.unmodifiedEvent = JSON.parse(JSON.stringify(this.event.toEditJSON()));
}
}
resetAttributedToOnOrganizerChange() {
this.event.attributedTo = new Group();
}
@@ -621,21 +625,24 @@ export default class EditEvent extends Vue {
person: {
__typename: "Person",
id: organizerActor.id,
participations: [
{
__typename: "Participant",
id: "unknown",
role: ParticipantRole.CREATOR,
actor: {
__typename: "Actor",
id: organizerActor.id,
participations: {
total: 1,
elements: [
{
__typename: "Participant",
id: "unknown",
role: ParticipantRole.CREATOR,
actor: {
__typename: "Actor",
id: organizerActor.id,
},
event: {
__typename: "Event",
id: updateEvent.id,
},
},
event: {
__typename: "Event",
id: updateEvent.id,
},
},
],
],
},
},
},
});

View File

@@ -592,7 +592,7 @@ import PopoverActorCard from "../../components/Account/PopoverActorCard.vue";
},
},
update: (data) => {
if (data && data.person) return data.person.participations;
if (data && data.person) return data.person.participations.elements;
return [];
},
skip() {
@@ -809,7 +809,8 @@ export default class Event extends EventMixin {
console.error("Cannot update participation cache, because of null value.");
return;
}
person.participations.push(data.joinEvent);
person.participations.elements.push(data.joinEvent);
person.participations.total += 1;
store.writeQuery({
query: EVENT_PERSON_PARTICIPATION,
variables: { eventId: this.event.id, actorId: identity.id },