FIX: Groups were not being displayed in the map of private messages

This commit is contained in:
Robin Ward
2017-10-23 13:11:36 -04:00
parent 17e5fb0dc0
commit 48314d04f7

View File

@ -18,17 +18,17 @@ createWidget('pm-remove-group-link', {
createWidget('pm-map-user-group', { createWidget('pm-map-user-group', {
tagName: 'div.user.group', tagName: 'div.user.group',
html(attrs) { transform(attrs) {
const link = h('a', { attributes: { href: Discourse.getURL(`/groups/${attrs.group.name}`) } }, attrs.group.name); return { href: Discourse.getURL(`/groups/${attrs.group.name}`) };
const result = [iconNode('users'), ' ', link]; },
if (attrs.canRemoveAllowedUsers) { template: hbs`
result.push(' '); {{fa-icon 'users'}}
result.push(this.attach('pm-remove-group-link', attrs.group)); <a href={{transformed.href}}>{{attrs.group.name}}</a>
} {{#if attrs.canRemoveAllowedUsers}}
{{attach widget="pm-remove-group-link" attrs=attrs.group}}
return result; {{/if}}
} `
}); });
createWidget('pm-remove-link', { createWidget('pm-remove-link', {
@ -72,9 +72,9 @@ export default createWidget('private-message-map', {
const participants = []; const participants = [];
if (attrs.allowedGroups.length) { if (attrs.allowedGroups.length) {
participants.push(attrs.allowedGroups.map(ag => { participants.push(attrs.allowedGroups.map(group => {
this.attach('pm-map-user-group', { return this.attach('pm-map-user-group', {
group: ag, group,
canRemoveAllowedUsers: attrs.canRemoveAllowedUsers canRemoveAllowedUsers: attrs.canRemoveAllowedUsers
}); });
})); }));