mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 19:11:14 +08:00
UX: Clicking a participant in the topic map should just show the card
This commit is contained in:
@ -100,7 +100,6 @@
|
|||||||
unhidePost="unhidePost"
|
unhidePost="unhidePost"
|
||||||
replyToPost="replyToPost"
|
replyToPost="replyToPost"
|
||||||
toggleWiki="toggleWiki"
|
toggleWiki="toggleWiki"
|
||||||
toggleParticipant="toggleParticipant"
|
|
||||||
toggleSummary="toggleSummary"
|
toggleSummary="toggleSummary"
|
||||||
removeAllowedUser="removeAllowedUser"
|
removeAllowedUser="removeAllowedUser"
|
||||||
showInvite="showInvite"
|
showInvite="showInvite"
|
||||||
|
@ -33,13 +33,10 @@ createWidget('topic-participant', {
|
|||||||
linkContents.push(h('span.post-count', attrs.post_count.toString()));
|
linkContents.push(h('span.post-count', attrs.post_count.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return h('a.poster', { className: state.toggled ? 'toggled' : null, attributes: { title: attrs.username } },
|
return h('a.poster.trigger-user-card', {
|
||||||
linkContents
|
className: state.toggled ? 'toggled' : null,
|
||||||
);
|
attributes: { title: attrs.username, 'data-user-card': attrs.username }
|
||||||
},
|
}, linkContents);
|
||||||
|
|
||||||
click() {
|
|
||||||
this.sendWidgetAction('toggleParticipant', this.attrs);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -677,7 +677,7 @@ widgetTest("topic map - few posts", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
widgetTest("topic map - participants", {
|
widgetTest("topic map - participants", {
|
||||||
template: '{{mount-widget widget="post" args=args toggleParticipant="toggleParticipant"}}',
|
template: '{{mount-widget widget="post" args=args}}',
|
||||||
setup() {
|
setup() {
|
||||||
this.set('args', {
|
this.set('args', {
|
||||||
showTopicMap: true,
|
showTopicMap: true,
|
||||||
@ -690,8 +690,6 @@ widgetTest("topic map - participants", {
|
|||||||
],
|
],
|
||||||
userFilters: ['sam', 'codinghorror']
|
userFilters: ['sam', 'codinghorror']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on('toggleParticipant', () => this.participantToggled = true);
|
|
||||||
},
|
},
|
||||||
test(assert) {
|
test(assert) {
|
||||||
assert.equal(this.$('li.avatars a.poster').length, 3, 'limits to three participants');
|
assert.equal(this.$('li.avatars a.poster').length, 3, 'limits to three participants');
|
||||||
@ -702,9 +700,6 @@ widgetTest("topic map - participants", {
|
|||||||
assert.equal(this.$('.topic-map-expanded a.poster').length, 4, 'shows all when expanded');
|
assert.equal(this.$('.topic-map-expanded a.poster').length, 4, 'shows all when expanded');
|
||||||
assert.equal(this.$('a.poster.toggled').length, 2, 'two are toggled');
|
assert.equal(this.$('a.poster.toggled').length, 2, 'two are toggled');
|
||||||
});
|
});
|
||||||
|
|
||||||
click('.topic-map-expanded a.poster:eq(0)');
|
|
||||||
andThen(() => assert.ok(this.participantToggled));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user