fabric8-planner
Version:
A planner front-end for Fabric8.
66 lines • 2.42 kB
JavaScript
import { Component, EventEmitter, Input, Output } from '@angular/core';
var CommentComponent = /** @class */ (function () {
function CommentComponent() {
/**
* This is the comment input
*/
this.comment = null;
/**
* Event to show preview in markdown
*/
this.onShowPreview = new EventEmitter();
/**
* This output is emitted when new comment is added
*/
this.onCreateRequest = new EventEmitter();
/**
* This is an output event for any update request
* to the comment or it's children
*/
this.onUpdateRequest = new EventEmitter();
this.replyActive = false;
}
CommentComponent.prototype.showPreview = function (event) {
this.onShowPreview.emit(event);
};
CommentComponent.prototype.createComment = function (event) {
var rawText = event.rawText;
var callBack = event.callBack;
callBack('', '');
var newComment = {
body: rawText,
parentId: this.comment.id
};
this.onCreateRequest.emit(newComment);
};
CommentComponent.prototype.updateComment = function (event, comment) {
var rawText = event.rawText;
var updatedComment = {
body: rawText,
id: comment.id,
selfLink: comment.selfLink
};
this.onUpdateRequest.emit(updatedComment);
};
CommentComponent.prototype.updateChildComment = function (updatedComment) {
this.onUpdateRequest.emit(updatedComment);
};
CommentComponent.decorators = [
{ type: Component, args: [{
selector: 'fabric8-comment',
template: require('./comment.component.html'),
styles: [require('./comment.component.css').toString()]
},] },
];
/** @nocollapse */
CommentComponent.ctorParameters = function () { return []; };
CommentComponent.propDecorators = {
'comment': [{ type: Input, args: ['comment',] },],
'onShowPreview': [{ type: Output, args: ['onShowPreview',] },],
'onCreateRequest': [{ type: Output, args: ['onCreateRequest',] },],
'onUpdateRequest': [{ type: Output, args: ['onUpdateRequest',] },],
};
return CommentComponent;
}());
export { CommentComponent };
//# sourceMappingURL=comment.component.js.map