From d49c5a6d8cc296774119a00a044eadc843cd71e2 Mon Sep 17 00:00:00 2001 From: Tudor-Ovidiu Avram Date: Thu, 7 Jan 2021 15:31:53 +0200 Subject: [PATCH] feat(jaas) add config for displaying participants stats and conference subject --- config.js | 6 ++++++ react/features/base/config/configWhitelist.js | 2 ++ .../components/native/NavigationBar.js | 7 +++++-- .../conference/components/web/Subject.js | 16 ++++++++++++---- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/config.js b/config.js index 9f8c20cde..71d659fc9 100644 --- a/config.js +++ b/config.js @@ -623,9 +623,15 @@ var config = { // otherwise the app doesn't render it. // moderatedRoomServiceUrl: 'https://moderated.jitsi-meet.example.com', + // Hides the conference subject + // hideConferenceSubject: true + // Hides the conference timer. // hideConferenceTimer: true, + // Hides the participants stats + // hideParticipantsStats: true + // Sets the conference subject // subject: 'Conference Subject', diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js index de13119b9..76c819412 100644 --- a/react/features/base/config/configWhitelist.js +++ b/react/features/base/config/configWhitelist.js @@ -117,6 +117,8 @@ export default [ 'forceTurnRelay', 'gatherStats', 'googleApiApplicationClientID', + 'hideConferenceSubject', + 'hideParticipantsStats', 'hideConferenceTimer', 'hiddenDomain', 'hideLobbyButton', diff --git a/react/features/conference/components/native/NavigationBar.js b/react/features/conference/components/native/NavigationBar.js index 2b8a085af..a94e2eff7 100644 --- a/react/features/conference/components/native/NavigationBar.js +++ b/react/features/conference/components/native/NavigationBar.js @@ -95,11 +95,14 @@ class NavigationBar extends Component { * @returns {Props} */ function _mapStateToProps(state) { + const { hideConferenceTimer, hideConferenceSubject } = state['features/base/config']; + return { _conferenceTimerEnabled: - getFeatureFlag(state, CONFERENCE_TIMER_ENABLED, true) && !state['features/base/config'].hideConferenceTimer, + getFeatureFlag(state, CONFERENCE_TIMER_ENABLED, true) && !hideConferenceTimer, _meetingName: getConferenceName(state), - _meetingNameEnabled: getFeatureFlag(state, MEETING_NAME_ENABLED, true), + _meetingNameEnabled: + getFeatureFlag(state, MEETING_NAME_ENABLED, true) && !hideConferenceSubject, _visible: isToolboxVisible(state) }; } diff --git a/react/features/conference/components/web/Subject.js b/react/features/conference/components/web/Subject.js index a8e2f8730..de2883e96 100644 --- a/react/features/conference/components/web/Subject.js +++ b/react/features/conference/components/web/Subject.js @@ -25,6 +25,11 @@ type Props = { */ _showParticipantCount: boolean, + /** + * Whether the conference subject should be shown or not. + */ + _showSubject: boolean, + /** * The subject or the of the conference. * Falls back to conference name. @@ -51,11 +56,11 @@ class Subject extends Component { * @returns {ReactElement} */ render() { - const { _hideConferenceTimer, _showParticipantCount, _subject, _visible } = this.props; + const { _hideConferenceTimer, _showParticipantCount, _showSubject, _subject, _visible } = this.props; return (
- { _subject } + { _showSubject && { _subject }} { _showParticipantCount && } { !_hideConferenceTimer && }
@@ -72,16 +77,19 @@ class Subject extends Component { * @returns {{ * _hideConferenceTimer: boolean, * _showParticipantCount: boolean, + * _showSubject: boolean, * _subject: string, * _visible: boolean * }} */ function _mapStateToProps(state) { const participantCount = getParticipantCount(state); + const { hideConferenceTimer, hideConferenceSubject, hideParticipantsStats } = state['features/base/config']; return { - _hideConferenceTimer: Boolean(state['features/base/config'].hideConferenceTimer), - _showParticipantCount: participantCount > 2, + _hideConferenceTimer: Boolean(hideConferenceTimer), + _showParticipantCount: participantCount > 2 && !hideParticipantsStats, + _showSubject: !hideConferenceSubject, _subject: getConferenceName(state), _visible: isToolboxVisible(state) && participantCount > 1 };