Skip to content

Commit

Permalink
[FIX] Direct Message names not visible on Admin panel (#15114)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored and sampaiodiego committed Aug 7, 2019
1 parent 8cd4b0f commit 4b937c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
4 changes: 0 additions & 4 deletions app/lib/lib/roomTypes/direct.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ export class DirectMessageRoomType extends RoomTypeConfig {
return Session.get(`user_${ subscription.name }_status_text`);
}

getDisplayName(room) {
return room.usernames.join(' x ');
}

allowRoomSettingChange(room, setting) {
switch (setting) {
case RoomSettingsEnum.NAME:
Expand Down
8 changes: 3 additions & 5 deletions app/ui-admin/client/rooms/adminRooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ import { SideNav, RocketChatTabBar, TabBar } from '../../../ui-utils';
import { t, roomTypes } from '../../../utils';
import { hasAllPermission } from '../../../authorization';
import { ChannelSettings } from '../../../channel-settings';
import { getAvatarURL } from '../../../utils/lib/getAvatarURL';

export const AdminChatRoom = new Mongo.Collection('rocketchat_room');

Template.adminRooms.helpers({
url() {
return roomTypes.getConfig(this.t).getAvatarPath(this);
return this.t === 'd' ? getAvatarURL({ username: `@${ this.usernames[0] }` }) : roomTypes.getConfig(this.t).getAvatarPath(this);
},
getIcon() {
return roomTypes.getIcon(this);
},
roomName() {
return roomTypes.getRoomName(this.t, this);
return this.t === 'd' ? this.usernames.join(' x ') : roomTypes.getRoomName(this.t, this);
},
searchText() {
const instance = Template.instance();
Expand Down Expand Up @@ -52,9 +53,6 @@ Template.adminRooms.helpers({
const rooms = Template.instance().rooms();
return rooms && rooms.count();
},
name() {
return roomTypes.roomTypes[this.t].getDisplayName(this);
},
type() {
return TAPi18n.__(roomTypes.roomTypes[this.t].label);
},
Expand Down
9 changes: 0 additions & 9 deletions app/utils/lib/RoomTypeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,6 @@ export class RoomTypeConfig {
return this._route;
}

/**
* Gets the room's name to display in the UI.
*
* @param {object} room
*/
getDisplayName(room) {
return room.name;
}

allowRoomSettingChange(/* room, setting */) {
return true;
}
Expand Down

0 comments on commit 4b937c6

Please sign in to comment.