Fix accessing group event unlogged
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
5b737e2e5b
commit
c4b997bc52
|
@ -296,11 +296,9 @@ export default class Comment extends Vue {
|
||||||
}
|
}
|
||||||
|
|
||||||
get commentFromOrganizer(): boolean {
|
get commentFromOrganizer(): boolean {
|
||||||
return (
|
const organizerId =
|
||||||
this.event.organizerActor !== undefined &&
|
this.event?.organizerActor?.id || this.event?.attributedTo?.id;
|
||||||
this.comment.actor != null &&
|
return organizerId !== undefined && this.comment?.actor?.id === organizerId;
|
||||||
this.comment.actor.id === this.event.organizerActor.id
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get commentId(): string {
|
get commentId(): string {
|
||||||
|
|
|
@ -320,11 +320,9 @@ export default class CommentTree extends Vue {
|
||||||
}
|
}
|
||||||
|
|
||||||
get isEventOrganiser(): boolean {
|
get isEventOrganiser(): boolean {
|
||||||
return (
|
const organizerId =
|
||||||
this.currentActor.id !== undefined &&
|
this.event?.organizerActor?.id || this.event?.attributedTo?.id;
|
||||||
this.event.organizerActor !== undefined &&
|
return organizerId !== undefined && this.currentActor?.id === organizerId;
|
||||||
this.currentActor.id === this.event.organizerActor.id
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get areCommentsClosed(): boolean {
|
get areCommentsClosed(): boolean {
|
||||||
|
@ -335,7 +333,7 @@ export default class CommentTree extends Vue {
|
||||||
}
|
}
|
||||||
|
|
||||||
get isAbleToComment(): boolean {
|
get isAbleToComment(): boolean {
|
||||||
if (this.currentActor && this.currentActor.id) {
|
if (this.currentActor?.id) {
|
||||||
return this.areCommentsClosed || this.isEventOrganiser;
|
return this.areCommentsClosed || this.isEventOrganiser;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -579,7 +579,7 @@ export default class EditEvent extends Vue {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDefaultActor() {
|
private getDefaultActor() {
|
||||||
if (this.event.organizerActor && this.event.organizerActor.id) {
|
if (this.event.organizerActor?.id) {
|
||||||
return this.event.organizerActor;
|
return this.event.organizerActor;
|
||||||
}
|
}
|
||||||
return this.currentActor;
|
return this.currentActor;
|
||||||
|
@ -725,7 +725,7 @@ export default class EditEvent extends Vue {
|
||||||
get isCurrentActorOrganizer(): boolean {
|
get isCurrentActorOrganizer(): boolean {
|
||||||
return !(
|
return !(
|
||||||
this.eventId &&
|
this.eventId &&
|
||||||
this.event.organizerActor &&
|
this.event.organizerActor?.id !== undefined &&
|
||||||
this.currentActor.id !== this.event.organizerActor.id
|
this.currentActor.id !== this.event.organizerActor.id
|
||||||
) as boolean;
|
) as boolean;
|
||||||
}
|
}
|
||||||
|
@ -822,17 +822,15 @@ export default class EditEvent extends Vue {
|
||||||
}
|
}
|
||||||
|
|
||||||
get attributedToEqualToOrganizerActor(): boolean {
|
get attributedToEqualToOrganizerActor(): boolean {
|
||||||
return (this.event.organizerActor &&
|
return (this.event.organizerActor?.id !== undefined &&
|
||||||
this.event.attributedTo &&
|
this.event.attributedTo?.id === this.event.organizerActor?.id) as boolean;
|
||||||
this.event.attributedTo.id === this.event.organizerActor.id) as boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build variables for Event GraphQL creation query
|
* Build variables for Event GraphQL creation query
|
||||||
*/
|
*/
|
||||||
private async buildVariables() {
|
private async buildVariables() {
|
||||||
this.event.organizerActor =
|
this.event.organizerActor = this.event.organizerActor?.id
|
||||||
this.event.organizerActor && this.event.organizerActor.id
|
|
||||||
? this.event.organizerActor
|
? this.event.organizerActor
|
||||||
: this.currentActor;
|
: this.currentActor;
|
||||||
let res = this.event.toEditJSON();
|
let res = this.event.toEditJSON();
|
||||||
|
|
Loading…
Reference in a new issue