Переглянути джерело

feat: Profile tab does not depend on isGuest.

Introduced a config property to disable profile.
master
damencho 4 роки тому
джерело
коміт
9fa29d7353

+ 3
- 0
config.js Переглянути файл

359
     // Default language for the user interface.
359
     // Default language for the user interface.
360
     // defaultLanguage: 'en',
360
     // defaultLanguage: 'en',
361
 
361
 
362
+    // Disables profile and the edit of all fields from the profile settings (display name and email)
363
+    // disableProfile: false,
364
+
362
     // If true all users without a token will be considered guests and all users
365
     // If true all users without a token will be considered guests and all users
363
     // with token will be considered non-guests. Only guests will be allowed to
366
     // with token will be considered non-guests. Only guests will be allowed to
364
     // edit their profile.
367
     // edit their profile.

+ 1
- 1
modules/UI/videolayout/LocalVideo.js Переглянути файл

104
         }
104
         }
105
 
105
 
106
         this._renderDisplayName({
106
         this._renderDisplayName({
107
-            allowEditing: APP.store.getState()['features/base/jwt'].isGuest,
107
+            allowEditing: !config.disableProfile,
108
             displayNameSuffix: interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME,
108
             displayNameSuffix: interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME,
109
             elementID: 'localDisplayName',
109
             elementID: 'localDisplayName',
110
             participantID: this.id
110
             participantID: this.id

+ 1
- 0
react/features/base/config/configWhitelist.js Переглянути файл

85
     'disableInviteFunctions',
85
     'disableInviteFunctions',
86
     'disableLocalVideoFlip',
86
     'disableLocalVideoFlip',
87
     'disableNS',
87
     'disableNS',
88
+    'disableProfile',
88
     'disableRemoteControl',
89
     'disableRemoteControl',
89
     'disableRemoteMute',
90
     'disableRemoteMute',
90
     'disableRtx',
91
     'disableRtx',

+ 2
- 4
react/features/base/jwt/functions.js Переглянути файл

1
 /* @flow */
1
 /* @flow */
2
 
2
 
3
-import jwtDecode from 'jwt-decode';
4
-
5
 import { parseURLParams } from '../util';
3
 import { parseURLParams } from '../util';
6
 
4
 
7
 /**
5
 /**
24
  * @returns {string}
22
  * @returns {string}
25
  */
23
  */
26
 export function getJwtName(state: Object) {
24
 export function getJwtName(state: Object) {
27
-    const jwtData = jwtDecode(state['features/base/jwt'].jwt);
25
+    const { user } = state['features/base/jwt'];
28
 
26
 
29
-    return jwtData?.context?.user?.name || '';
27
+    return user?.name || '';
30
 }
28
 }

+ 1
- 2
react/features/settings/components/web/SettingsDialog.js Переглянути файл

126
  */
126
  */
127
 function _mapStateToProps(state) {
127
 function _mapStateToProps(state) {
128
     const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
128
     const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
129
-    const jwt = state['features/base/jwt'];
130
 
129
 
131
     // The settings sections to display.
130
     // The settings sections to display.
132
     const showDeviceSettings = configuredTabs.includes('devices');
131
     const showDeviceSettings = configuredTabs.includes('devices');
133
     const moreTabProps = getMoreTabProps(state);
132
     const moreTabProps = getMoreTabProps(state);
134
     const { showModeratorSettings, showLanguageSettings, showPrejoinSettings } = moreTabProps;
133
     const { showModeratorSettings, showLanguageSettings, showPrejoinSettings } = moreTabProps;
135
     const showProfileSettings
134
     const showProfileSettings
136
-        = configuredTabs.includes('profile') && jwt.isGuest;
135
+        = configuredTabs.includes('profile') && !state['features/base/config'].disableProfile;
137
     const showCalendarSettings
136
     const showCalendarSettings
138
         = configuredTabs.includes('calendar') && isCalendarEnabled(state);
137
         = configuredTabs.includes('calendar') && isCalendarEnabled(state);
139
     const tabs = [];
138
     const tabs = [];

+ 1
- 1
react/features/toolbox/components/web/OverflowMenuProfileItem.js Переглянути файл

120
 function _mapStateToProps(state) {
120
 function _mapStateToProps(state) {
121
     return {
121
     return {
122
         _localParticipant: getLocalParticipant(state),
122
         _localParticipant: getLocalParticipant(state),
123
-        _unclickable: !state['features/base/jwt'].isGuest
123
+        _unclickable: state['features/base/config'].disableProfile
124
             || !interfaceConfig.SETTINGS_SECTIONS.includes('profile')
124
             || !interfaceConfig.SETTINGS_SECTIONS.includes('profile')
125
     };
125
     };
126
 }
126
 }

+ 6
- 6
react/features/toolbox/components/web/Toolbox.js Переглянути файл

129
     _fullScreen: boolean,
129
     _fullScreen: boolean,
130
 
130
 
131
     /**
131
     /**
132
-     * Whether or not the tile view is enabled.
132
+     * Whether or not the profile is disabled.
133
      */
133
      */
134
-    _tileViewEnabled: boolean,
134
+    _isProfileDisabled: boolean,
135
 
135
 
136
     /**
136
     /**
137
-     * Whether or not the current user is logged in through a JWT.
137
+     * Whether or not the tile view is enabled.
138
      */
138
      */
139
-    _isGuest: boolean,
139
+    _tileViewEnabled: boolean,
140
 
140
 
141
     /**
141
     /**
142
      * Whether or not the current meeting belongs to a JaaS user.
142
      * Whether or not the current meeting belongs to a JaaS user.
993
      * @returns {boolean}
993
      * @returns {boolean}
994
      */
994
      */
995
     _isProfileVisible() {
995
     _isProfileVisible() {
996
-        return this.props._isGuest && this._shouldShowButton('profile');
996
+        return !this.props._isProfileDisabled && this._shouldShowButton('profile');
997
     }
997
     }
998
 
998
 
999
     /**
999
     /**
1448
         _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
1448
         _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
1449
         _dialog: Boolean(state['features/base/dialog'].component),
1449
         _dialog: Boolean(state['features/base/dialog'].component),
1450
         _feedbackConfigured: Boolean(callStatsID),
1450
         _feedbackConfigured: Boolean(callStatsID),
1451
-        _isGuest: state['features/base/jwt'].isGuest,
1451
+        _isProfileDisabled: Boolean(state['features/base/config'].disableProfile),
1452
         _isVpaasMeeting: isVpaasMeeting(state),
1452
         _isVpaasMeeting: isVpaasMeeting(state),
1453
         _fullScreen: fullScreen,
1453
         _fullScreen: fullScreen,
1454
         _tileViewEnabled: shouldDisplayTileView(state),
1454
         _tileViewEnabled: shouldDisplayTileView(state),

Завантаження…
Відмінити
Зберегти