mirror of
https://github.com/wassname/talk.git
synced 2026-07-24 13:20:47 +08:00
Merge branch 'master' into open-source-docs
This commit is contained in:
@@ -25,9 +25,7 @@ export default class CommentList extends React.Component {
|
||||
loading: PropTypes.bool,
|
||||
|
||||
// list of actions (flags, etc) associated with the comments
|
||||
actions: PropTypes.shape({
|
||||
ids: PropTypes.arrayOf(PropTypes.string)
|
||||
}),
|
||||
actions: PropTypes.arrayOf(PropTypes.string),
|
||||
suspectWords: PropTypes.arrayOf(PropTypes.string)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,9 @@ export default class Dialog extends Component {
|
||||
|
||||
componentWillUnmount() {
|
||||
const dialog = this.dialog;
|
||||
dialog.removeEventListener('cancel', this.props.onCancel);
|
||||
if (dialog) {
|
||||
dialog.removeEventListener('cancel', this.props.onCancel);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -137,7 +137,7 @@ router.post('/', wordlist.filter('body'), (req, res, next) => {
|
||||
.then((comment) => {
|
||||
if (req.wordlist.suspect) {
|
||||
return Comment
|
||||
.addAction(comment.id, null, 'flag', 'body', 'Matched suspect word filters.')
|
||||
.addAction(comment.id, null, 'flag', {field: 'body', details: 'Matched suspect word filters.'})
|
||||
.then(() => comment);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,8 +225,9 @@ describe('/api/v1/comments', () => {
|
||||
let action = actions[0];
|
||||
|
||||
expect(action).to.have.property('item_id', comment.id);
|
||||
expect(action).to.have.property('field', 'body');
|
||||
expect(action).to.have.property('detail', 'Matched suspect word filters.');
|
||||
expect(action).to.have.property('metadata');
|
||||
expect(action.metadata).to.have.property('field', 'body');
|
||||
expect(action.metadata).to.have.property('details', 'Matched suspect word filters.');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user