Introduce comments below events
Also add tomstones Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
50
js/src/types/comment.model.ts
Normal file
50
js/src/types/comment.model.ts
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user