Manual Reference Source Test
public class | source

Commentable

A mixin for threads and comments. Currently the following types are commentable: data_collection__captured_values, data_collection__linked_steps, dynamic_content__content, profile, question

Method Summary

Public Methods
public

addComment(text: String, author: User, cacheMode: String): Promise<Thread>

This is a quick way of creating a thread and a comment for this particular object

public

getComments(cacheMode: String): Promise<Thread[]>

Returns comments based on the current object.

public

Initializer for the mixin class

public

reply(text: *, thread: *, author: *, cacheMode: *): *

Public Methods

public addComment(text: String, author: User, cacheMode: String): Promise<Thread> source

This is a quick way of creating a thread and a comment for this particular object

Params:

NameTypeAttributeDescription
text String

The text used for the comment

author User

The user making the coment

cacheMode String

The cache method used

Return:

Promise<Thread>

The thread created with an attached comment

Example:

// obj is an instantiated Object inheriting the mixin Commentable
obj.addComment('hello world');

// using other options
import { User } from 'clinical6';

const someOtherUser = new User();
obj.addComment('hello world', someOtherUser, 'networkFirst');

public getComments(cacheMode: String): Promise<Thread[]> source

Returns comments based on the current object.

Params:

NameTypeAttributeDescription
cacheMode String

The cache mode for this call

Return:

Promise<Thread[]>

Promise a thread

public initializer() source

Initializer for the mixin class

public reply(text: *, thread: *, author: *, cacheMode: *): * source

Params:

NameTypeAttributeDescription
text *
thread *
author *
  • optional
  • default: undefined
cacheMode *
  • optional
  • default: undefined

Return:

*