From 7ebb77d0c933de750cc742ed36b6dc2a7cebd66a Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 21 Jul 2017 11:22:54 -0300 Subject: [PATCH] Add header property to roomTypes --- packages/rocketchat-lib/startup/defaultRoomTypes.js | 1 + packages/rocketchat-ui-sidenav/client/roomList.js | 4 +++- packages/rocketchat-ui-sidenav/client/sideNav.html | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-lib/startup/defaultRoomTypes.js b/packages/rocketchat-lib/startup/defaultRoomTypes.js index a206f6386fdc..005d7739cd8c 100644 --- a/packages/rocketchat-lib/startup/defaultRoomTypes.js +++ b/packages/rocketchat-lib/startup/defaultRoomTypes.js @@ -1,5 +1,6 @@ /* globals openRoom */ RocketChat.roomTypes.add(null, 0, { + header: 'favorite', icon: 'icon-star', label: 'Favorites' }); diff --git a/packages/rocketchat-ui-sidenav/client/roomList.js b/packages/rocketchat-ui-sidenav/client/roomList.js index 6c9387525462..cd319ebf99b8 100644 --- a/packages/rocketchat-ui-sidenav/client/roomList.js +++ b/packages/rocketchat-ui-sidenav/client/roomList.js @@ -73,7 +73,9 @@ Template.roomList.helpers({ }, roomType(room) { - return room.identifier; + if (room.header || room.identifier) { + return `type-${ room.header || room.identifier }`; + } } }); diff --git a/packages/rocketchat-ui-sidenav/client/sideNav.html b/packages/rocketchat-ui-sidenav/client/sideNav.html index 3df52a7246d4..51fc6e6619d4 100644 --- a/packages/rocketchat-ui-sidenav/client/sideNav.html +++ b/packages/rocketchat-ui-sidenav/client/sideNav.html @@ -14,7 +14,7 @@ {{#each roomType}} {{#if canShowRoomType}} - {{> roomList identifier=identifier label=label isCombined=isCombined }} + {{> roomList identifier=identifier label=label isCombined=isCombined header=header }} {{/if}} {{/each}}