-
Notifications
You must be signed in to change notification settings - Fork 2
Live page and comments
Each comment is related to a single channel, which identify where it should be displayed. Possible values are 'live', 'alerts' (raise a Push Notification) or 'item_[HERE THE ITEM ID]'.
On future release could be used to chat, providing 'chatroom id' as channel.
export class Comment {
_id?: string;
channel: string;
type: string;
data?: Object;
created: any;
published: any;
modified: any;
isPublished: boolean;
site_id: number;
constructor(type: string) {
this.type = type;
this.channel = "live";
this.created = firebase.firestore.FieldValue.serverTimestamp();
this.published = firebase.firestore.FieldValue.serverTimestamp();
this.modified = firebase.firestore.FieldValue.serverTimestamp();
this.isPublished = true;
this.data = new Object();
}
}
Could be clickable if user.picture (live-comment or item-comment for example), and lead to user profile.
Except if title equals user.displayName, need to be translated.
Is an Object who keeps the specific information about the comments. On Anniversaries for example, it contains a list of contacts.
Setting the comment type, ex.: {'anniversaries', 'message','ranking'}
Each type uses a different component, so according with the field value we render the correctly component. Ex: type=Message => MessageComponent, type=Anniversaries => AnniversariesComponent.
export interface Message {
author: Contact,
description: string,
itemDetails: {
title: string,
id: string
}
media: [
{
url: string
}
]
}
Could add params to track open link utm_source, utm_medium, utm_campaign.
export interface Anniversaries {
picture: string,
title: string,
contacts: Array<Contact>
}
Define data for each comment types
/!\ use camelCase for firebase fields name and snake_case for meumobi fields name
Any comment could be deleted by user.admin or its author
On ./src/models/comment-types/
folder add one file per type (anniversaries.ts
, message.ts
, etc.)