mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
UX: Link post ids in staff action logs to the post
This commit is contained in:
22
app/assets/javascripts/admin/components/staff-actions.js.es6
Normal file
22
app/assets/javascripts/admin/components/staff-actions.js.es6
Normal 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;
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user