From 8e55967db3f6c74079e6fce5c24578a3129aec9e Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 14 Jul 2021 20:53:45 +0530 Subject: [PATCH] Create UI to open memberlist from details panel Signed-off-by: RMidhunSuresh --- src/domain/session/rightpanel/RoomDetailsViewModel.js | 7 +++++++ .../web/ui/session/rightpanel/RoomDetailsView.js | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/domain/session/rightpanel/RoomDetailsViewModel.js b/src/domain/session/rightpanel/RoomDetailsViewModel.js index 896fab54..a2dff761 100644 --- a/src/domain/session/rightpanel/RoomDetailsViewModel.js +++ b/src/domain/session/rightpanel/RoomDetailsViewModel.js @@ -62,4 +62,11 @@ export class RoomDetailsViewModel extends ViewModel { super.dispose(); this._room.off("change", this._onRoomChange); } + + openPanel(segment) { + let path = this.navigation.path.until("room"); + path = path.with(this.navigation.segment("right-panel", true)); + path = path.with(this.navigation.segment(segment, true)); + this.navigation.applyPath(path); + } } diff --git a/src/platform/web/ui/session/rightpanel/RoomDetailsView.js b/src/platform/web/ui/session/rightpanel/RoomDetailsView.js index 8357b722..7e7fa363 100644 --- a/src/platform/web/ui/session/rightpanel/RoomDetailsView.js +++ b/src/platform/web/ui/session/rightpanel/RoomDetailsView.js @@ -16,7 +16,8 @@ export class RoomDetailsView extends TemplateView { this._createRoomAliasDisplay(vm), t.div({className: "RoomDetailsView_rows"}, [ - this._createRightPanelRow(t, vm.i18n`People`, {MemberCount: true}, vm => vm.memberCount), + this._createRightPanelButtonRow(t, vm.i18n`People`, { MemberCount: true }, vm => vm.memberCount, + () => vm.openPanel("members")), this._createRightPanelRow(t, vm.i18n`Encryption`, {EncryptionStatus: true}, encryptionString) ]) ]); @@ -35,6 +36,14 @@ export class RoomDetailsView extends TemplateView { ]); } + _createRightPanelButtonRow(t, label, labelClass, value, onClick) { + const labelClassString = classNames({RoomDetailsView_label: true, ...labelClass}); + return t.button({className: "RoomDetailsView_row", onClick}, [ + t.div({className: labelClassString}, [label]), + t.div({className: "RoomDetailsView_value"}, value) + ]); + } + _createButton(t, vm) { return t.div({className: "RoomDetailsView_buttons"}, [