From 4cd31dc50c98bb1118fefb2d3bf459be4944d34a Mon Sep 17 00:00:00 2001 From: Kautilya Tripathi Date: Sun, 28 Apr 2019 02:02:48 +0530 Subject: [PATCH] [FIX] View All members button now not in direct room (#14081) * Fixed #14036 * Pass parameter from memberList to userInfo to show back button * Set membersList title from userInfo * Add a back button to userInfo --- .../client/imports/components/contextual-bar.css | 12 ++++++++++++ app/ui-flextab/client/index.js | 1 - app/ui-flextab/client/tabs/membersList.js | 15 ++++++++++----- app/ui-flextab/client/tabs/userInfo.html | 8 +++++--- app/ui-flextab/client/tabs/userInfo.js | 9 ++++++--- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/app/theme/client/imports/components/contextual-bar.css b/app/theme/client/imports/components/contextual-bar.css index e288f0def187..43c1801d3f3c 100644 --- a/app/theme/client/imports/components/contextual-bar.css +++ b/app/theme/client/imports/components/contextual-bar.css @@ -83,6 +83,18 @@ } } + &-back-btn { + position: absolute; + left: 0; + + width: auto; + height: auto; + margin: 0; + padding: 0; + + font-size: 22px; + } + &-title { overflow: hidden; diff --git a/app/ui-flextab/client/index.js b/app/ui-flextab/client/index.js index 70e83cef3b3b..6d8ec3d8af87 100644 --- a/app/ui-flextab/client/index.js +++ b/app/ui-flextab/client/index.js @@ -3,7 +3,6 @@ import './tabs/inviteUsers.html'; import './tabs/membersList.html'; import './tabs/uploadedFilesList.html'; import './tabs/userEdit.html'; -import './tabs/userInfo.html'; import './flexTabBar'; import './tabs/inviteUsers'; import './tabs/membersList'; diff --git a/app/ui-flextab/client/tabs/membersList.js b/app/ui-flextab/client/tabs/membersList.js index 05de342aeb30..2702e37b09c8 100644 --- a/app/ui-flextab/client/tabs/membersList.js +++ b/app/ui-flextab/client/tabs/membersList.js @@ -140,7 +140,8 @@ Template.membersList.helpers({ clear: Template.instance().clearUserDetail, showAll: roomTypes.roomTypes[room.t].userDetailShowAll(room) || false, hideAdminControls: roomTypes.roomTypes[room.t].userDetailShowAdmin(room) || false, - video: ['d'].includes(room != null ? room.t : undefined), + video: ['d'].includes(room && room.t), + showBackButton: roomTypes.roomTypes[room.t].isGroupChat(), }; }, displayName() { @@ -274,7 +275,7 @@ Template.membersList.onCreated(function() { this.loading = new ReactiveVar(true); this.loadingMore = new ReactiveVar(false); - this.tabBar = Template.instance().tabBar; + this.tabBar = this.data.tabBar; this.autorun(() => { if (this.data.rid == null) { return; } @@ -282,18 +283,22 @@ Template.membersList.onCreated(function() { return Meteor.call('getUsersOfRoom', this.data.rid, this.showAllUsers.get(), { limit: 100, skip: 0 }, (error, users) => { if (error) { console.error(error); - return this.loading.set(false); + this.loading.set(false); } this.users.set(users.records); this.total.set(users.total); - return this.loading.set(false); + this.loading.set(false); }); }); this.clearUserDetail = () => { this.showDetail.set(false); - return setTimeout(() => this.clearRoomUserDetail(), 500); + this.tabBar.setData({ + label: 'Members_List', + icon: 'team', + }); + setTimeout(() => this.clearRoomUserDetail(), 100); }; this.showUserDetail = (username, group) => { diff --git a/app/ui-flextab/client/tabs/userInfo.html b/app/ui-flextab/client/tabs/userInfo.html index 7d3197e1a4fe..f529ebef5c72 100644 --- a/app/ui-flextab/client/tabs/userInfo.html +++ b/app/ui-flextab/client/tabs/userInfo.html @@ -2,6 +2,11 @@ {{#unless hideHeader}}
+ {{#if showBackButton}} + + {{/if}} {{> icon icon="user" block="contextual-bar__header-icon"}}

{{_ "User_Info"}}

@@ -111,9 +116,6 @@