Introduce comments below events

Also add tomstones

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-11-15 18:36:47 +01:00
parent 45155a3bde
commit dc07f34d78
71 changed files with 2642 additions and 879 deletions

View File

@@ -0,0 +1,50 @@
import { Actor, IActor } from '@/types/actor';
import { EventModel, IEvent } from '@/types/event.model';
export interface IComment {
id?: string;
uuid?: string;
url?: string;
text: string;
actor: IActor;
inReplyToComment?: IComment;
originComment?: IComment;
replies: IComment[];
event?: IEvent;
updatedAt?: Date;
deletedAt?: Date;
totalReplies: number;
}
export class CommentModel implements IComment {
actor: IActor = new Actor();
id?: string;
text: string = '';
url?: string;
uuid?: string;
inReplyToComment?: IComment = undefined;
originComment?: IComment = undefined;
replies: IComment[] = [];
event?: IEvent = undefined;
updatedAt?: Date = undefined;
deletedAt?: Date = undefined;
totalReplies: number = 0;
constructor(hash?: IComment) {
if (!hash) return;
this.id = hash.id;
this.uuid = hash.uuid;
this.url = hash.url;
this.text = hash.text;
this.inReplyToComment = hash.inReplyToComment;
this.originComment = hash.originComment;
this.actor = new Actor(hash.actor);
this.event = new EventModel(hash.event);
this.replies = hash.replies;
this.updatedAt = hash.updatedAt;
this.deletedAt = hash.deletedAt;
this.totalReplies = hash.totalReplies;
}
}

View File

@@ -2,6 +2,7 @@ import { Actor, IActor, IPerson } from './actor';
import { Address, IAddress } from '@/types/address.model';
import { ITag } from '@/types/tag.model';
import { IPicture } from '@/types/picture.model';
import { IComment } from '@/types/comment.model';
export enum EventStatus {
TENTATIVE = 'TENTATIVE',
@@ -129,6 +130,7 @@ export interface IEvent {
participants: IParticipant[];
relatedEvents: IEvent[];
comments: IComment[];
onlineAddress?: string;
phoneAddress?: string;
@@ -199,9 +201,10 @@ export class EventModel implements IEvent {
participants: IParticipant[] = [];
relatedEvents: IEvent[] = [];
comments: IComment[] = [];
attributedTo = new Actor();
organizerActor?: IActor;
organizerActor?: IActor = new Actor();
tags: ITag[] = [];
options: IEventOptions = new EventOptions();

View File

@@ -1,5 +1,6 @@
import { IActor, IPerson } from '@/types/actor';
import { IEvent } from '@/types/event.model';
import { IComment } from '@/types/comment.model';
export enum ReportStatusEnum {
OPEN = 'OPEN',
@@ -12,6 +13,7 @@ export interface IReport extends IActionLogObject {
reported: IActor;
reporter: IPerson;
event?: IEvent;
comments: IComment[];
content: string;
notes: IReportNote[];
insertedAt: Date;
@@ -36,6 +38,7 @@ export enum ActionLogAction {
REPORT_UPDATE_OPENED = 'REPORT_UPDATE_OPENED',
REPORT_UPDATE_RESOLVED = 'REPORT_UPDATE_RESOLVED',
EVENT_DELETION = 'EVENT_DELETION',
COMMENT_DELETION = 'COMMENT_DELETION',
}
export interface IActionLog {