UX: Link post ids in staff action logs to the post

This commit is contained in:
Robin Ward
2018-02-13 15:58:32 -05:00
parent 7348513848
commit 713993d150
3 changed files with 32 additions and 5 deletions

View File

@ -0,0 +1,22 @@
import DiscourseURL from 'discourse/lib/url';
export default Ember.Component.extend({
classNames: ['table', 'staff-actions'],
willDestroyElement() {
this.$().off('click.discourse-staff-logs');
},
didInsertElement() {
this._super();
this.$().on('click.discourse-staff-logs', '[data-link-post-id]', e => {
let postId = $(e.target).attr('data-link-post-id');
this.store.find('post', postId).then(p => {
DiscourseURL.routeTo(p.get('url'));
});
return false;
});
}
});