瀏覽代碼

ref: move 'jwt' feature to 'base'

master
paweldomas 7 年之前
父節點
當前提交
122be9e0e0

+ 1
- 1
conference.js 查看文件

@@ -217,7 +217,7 @@ function muteLocalVideo(muted) {
217 217
 function maybeRedirectToWelcomePage(options) {
218 218
     // if close page is enabled redirect to it, without further action
219 219
     if (config.enableClosePage) {
220
-        const { isGuest } = APP.store.getState()['features/jwt'];
220
+        const { isGuest } = APP.store.getState()['features/base/jwt'];
221 221
 
222 222
         // save whether current user is guest or not, before navigating
223 223
         // to close page

+ 2
- 2
connection.js 查看文件

@@ -62,7 +62,7 @@ function checkForAttachParametersAndConnect(id, password, connection) {
62 62
  */
63 63
 function connect(id, password, roomName) {
64 64
     const connectionConfig = Object.assign({}, config);
65
-    const { issuer, jwt } = APP.store.getState()['features/jwt'];
65
+    const { issuer, jwt } = APP.store.getState()['features/base/jwt'];
66 66
 
67 67
     connectionConfig.bosh += '?room=' + roomName;
68 68
 
@@ -147,7 +147,7 @@ export function openConnection({id, password, retry, roomName}) {
147 147
 
148 148
     return connect(id, password, roomName).catch(err => {
149 149
         if (retry) {
150
-            const { issuer, jwt } = APP.store.getState()['features/jwt'];
150
+            const { issuer, jwt } = APP.store.getState()['features/base/jwt'];
151 151
 
152 152
             if (err === ConnectionErrors.PASSWORD_REQUIRED
153 153
                     && (!jwt || issuer === 'anonymous')) {

+ 1
- 1
modules/API/API.js 查看文件

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';
4
-import { parseJWTFromURLParams } from '../../react/features/jwt';
4
+import { parseJWTFromURLParams } from '../../react/features/base/jwt';
5 5
 import { getJitsiMeetTransport } from '../transport';
6 6
 
7 7
 import { API_ID } from './constants';

+ 1
- 1
modules/UI/authentication/AuthHandler.js 查看文件

@@ -1,7 +1,7 @@
1 1
 /* global APP, config, JitsiMeetJS, Promise */
2 2
 
3 3
 import { openConnection } from '../../../connection';
4
-import { setJWT } from '../../../react/features/jwt';
4
+import { setJWT } from '../../../react/features/base/jwt';
5 5
 import UIUtil from '../util/UIUtil';
6 6
 
7 7
 import LoginDialog from './LoginDialog';

+ 1
- 1
react/features/analytics/functions.js 查看文件

@@ -43,7 +43,7 @@ export function initAnalytics({ getState }: { getState: Function }) {
43 43
                 roomName: state['features/base/conference'].room,
44 44
                 userAgent: navigator.userAgent
45 45
             };
46
-            const { group, server } = state['features/jwt'];
46
+            const { group, server } = state['features/base/jwt'];
47 47
 
48 48
             if (server) {
49 49
                 permanentProperties.server = server;

+ 1
- 1
react/features/base/connection/actions.native.js 查看文件

@@ -26,7 +26,7 @@ export function connect(id: ?string, password: ?string) {
26 26
     return (dispatch: Dispatch<*>, getState: Function) => {
27 27
         const state = getState();
28 28
         const options = _constructOptions(state);
29
-        const { issuer, jwt } = state['features/jwt'];
29
+        const { issuer, jwt } = state['features/base/jwt'];
30 30
         const connection
31 31
             = new JitsiMeetJS.JitsiConnection(
32 32
                 options.appId,

react/features/jwt/actionTypes.js → react/features/base/jwt/actionTypes.js 查看文件


react/features/jwt/actions.js → react/features/base/jwt/actions.js 查看文件

@@ -15,7 +15,8 @@ import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
15 15
  */
16 16
 export function setCallOverlayVisible(callOverlayVisible: boolean) {
17 17
     return (dispatch: Dispatch<*>, getState: Function) => {
18
-        getState()['features/jwt'].callOverlayVisible === callOverlayVisible
18
+        getState()['features/base/jwt']
19
+            .callOverlayVisible === callOverlayVisible
19 20
             || dispatch({
20 21
                 type: SET_CALL_OVERLAY_VISIBLE,
21 22
                 callOverlayVisible

react/features/jwt/components/CallOverlay.js → react/features/base/jwt/components/CallOverlay.js 查看文件

@@ -4,10 +4,10 @@ import PropTypes from 'prop-types';
4 4
 import React, { Component } from 'react';
5 5
 import { connect } from 'react-redux';
6 6
 
7
-import { Audio } from '../../base/media';
8
-import { Avatar } from '../../base/participants';
9
-import { Container, Text } from '../../base/react';
10
-import UIEvents from '../../../../service/UI/UIEvents';
7
+import { Audio } from '../../media';
8
+import { Avatar } from '../../participants';
9
+import { Container, Text } from '../../react';
10
+import UIEvents from '../../../../../service/UI/UIEvents';
11 11
 
12 12
 import styles from './styles';
13 13
 
@@ -335,7 +335,7 @@ function _mapStateToProps(state) {
335 335
          * @private
336 336
          * @type {Object}
337 337
          */
338
-        _callee: state['features/jwt'].callee
338
+        _callee: state['features/base/jwt'].callee
339 339
     };
340 340
 }
341 341
 

react/features/jwt/components/index.js → react/features/base/jwt/components/index.js 查看文件


react/features/jwt/components/styles.native.js → react/features/base/jwt/components/styles.native.js 查看文件

@@ -1,4 +1,4 @@
1
-import { ColorPalette, createStyleSheet } from '../../base/styles';
1
+import { ColorPalette, createStyleSheet } from '../../styles';
2 2
 
3 3
 export default createStyleSheet({
4 4
     // XXX The names bellow were preserved for the purposes of compatibility

react/features/jwt/components/styles.web.js → react/features/base/jwt/components/styles.web.js 查看文件


react/features/jwt/functions.js → react/features/base/jwt/functions.js 查看文件

@@ -1,6 +1,6 @@
1 1
 /* @flow */
2 2
 
3
-import { parseURLParams } from '../base/config';
3
+import { parseURLParams } from '../config';
4 4
 
5 5
 /**
6 6
  * Retrieves the JSON Web Token (JWT), if any, defined by a specific

react/features/jwt/index.js → react/features/base/jwt/index.js 查看文件


react/features/jwt/middleware.js → react/features/base/jwt/middleware.js 查看文件

@@ -5,16 +5,16 @@ import {
5 5
     CONFERENCE_LEFT,
6 6
     CONFERENCE_WILL_LEAVE,
7 7
     SET_ROOM
8
-} from '../base/conference';
9
-import { SET_CONFIG } from '../base/config';
10
-import { SET_LOCATION_URL } from '../base/connection';
11
-import { LIB_INIT_ERROR } from '../base/lib-jitsi-meet';
8
+} from '../conference';
9
+import { SET_CONFIG } from '../config';
10
+import { SET_LOCATION_URL } from '../connection';
11
+import { LIB_INIT_ERROR } from '../lib-jitsi-meet';
12 12
 import {
13 13
     getLocalParticipant,
14 14
     getParticipantCount,
15 15
     PARTICIPANT_JOINED
16
-} from '../base/participants';
17
-import { MiddlewareRegistry } from '../base/redux';
16
+} from '../participants';
17
+import { MiddlewareRegistry } from '../redux';
18 18
 
19 19
 import { setCallOverlayVisible, setJWT } from './actions';
20 20
 import { SET_JWT } from './actionTypes';
@@ -72,7 +72,7 @@ function _maybeSetCallOverlayVisible({ dispatch, getState }, next, action) {
72 72
     const result = next(action);
73 73
 
74 74
     const state = getState();
75
-    const stateFeaturesJWT = state['features/jwt'];
75
+    const stateFeaturesJWT = state['features/base/jwt'];
76 76
     let callOverlayVisible;
77 77
 
78 78
     if (stateFeaturesJWT.callee) {

react/features/jwt/reducer.js → react/features/base/jwt/reducer.js 查看文件

@@ -1,4 +1,4 @@
1
-import { equals, set, ReducerRegistry } from '../base/redux';
1
+import { equals, set, ReducerRegistry } from '../redux';
2 2
 
3 3
 import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
4 4
 
@@ -37,7 +37,8 @@ const _INITIAL_STATE = {
37 37
  * @returns {Object} The next redux state which is the result of reducing the
38 38
  * specified {@code action}.
39 39
  */
40
-ReducerRegistry.register('features/jwt', (state = _INITIAL_STATE, action) => {
40
+ReducerRegistry.register(
41
+'features/base/jwt', (state = _INITIAL_STATE, action) => {
41 42
     switch (action.type) {
42 43
     case SET_CALL_OVERLAY_VISIBLE:
43 44
         return set(state, 'callOverlayVisible', action.callOverlayVisible);

+ 1
- 1
react/features/base/react/components/web/Watermarks.js 查看文件

@@ -190,7 +190,7 @@ class Watermarks extends Component {
190 190
  * }}
191 191
  */
192 192
 function _mapStateToProps(state) {
193
-    const { isGuest } = state['features/jwt'];
193
+    const { isGuest } = state['features/base/jwt'];
194 194
 
195 195
     return {
196 196
         /**

+ 1
- 1
react/features/conference/route.js 查看文件

@@ -111,7 +111,7 @@ function _obtainConfigHandler() {
111 111
  */
112 112
 function _setTokenData() {
113 113
     const state = APP.store.getState();
114
-    const { caller } = state['features/jwt'];
114
+    const { caller } = state['features/base/jwt'];
115 115
 
116 116
     if (caller) {
117 117
         const { avatarUrl, avatar, email, name } = caller;

+ 3
- 3
react/features/filmstrip/middleware.js 查看文件

@@ -1,7 +1,7 @@
1 1
 /* @flow */
2 2
 
3 3
 import { MiddlewareRegistry } from '../base/redux';
4
-import { SET_CALL_OVERLAY_VISIBLE } from '../jwt';
4
+import { SET_CALL_OVERLAY_VISIBLE } from '../base/jwt';
5 5
 
6 6
 import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
7 7
 
@@ -13,10 +13,10 @@ MiddlewareRegistry.register(({ getState }) => next => action => {
13 13
     case SET_CALL_OVERLAY_VISIBLE:
14 14
         if (typeof APP !== 'undefined') {
15 15
             const oldValue
16
-                = Boolean(getState()['features/jwt'].callOverlayVisible);
16
+                = Boolean(getState()['features/base/jwt'].callOverlayVisible);
17 17
             const result = next(action);
18 18
             const newValue
19
-                = Boolean(getState()['features/jwt'].callOverlayVisible);
19
+                = Boolean(getState()['features/base/jwt'].callOverlayVisible);
20 20
 
21 21
             oldValue === newValue
22 22
 

+ 1
- 1
react/features/invite/components/AddPeopleDialog.web.js 查看文件

@@ -349,7 +349,7 @@ function _mapStateToProps(state) {
349 349
         _conference: conference,
350 350
         _inviteServiceUrl: inviteServiceUrl,
351 351
         _inviteUrl: getInviteURL(state),
352
-        _jwt: state['features/jwt'].jwt,
352
+        _jwt: state['features/base/jwt'].jwt,
353 353
         _peopleSearchQueryTypes: peopleSearchQueryTypes,
354 354
         _peopleSearchUrl: peopleSearchUrl
355 355
     };

+ 1
- 1
react/features/invite/components/InfoDialog.web.js 查看文件

@@ -192,7 +192,7 @@ class InfoDialog extends Component {
192 192
 function _mapStateToProps(state) {
193 193
     return {
194 194
         _inviteURL: getInviteURL(state),
195
-        _showAddPeople: !state['features/jwt'].isGuest
195
+        _showAddPeople: !state['features/base/jwt'].isGuest
196 196
     };
197 197
 }
198 198
 

+ 1
- 1
react/features/invite/components/InviteButton.web.js 查看文件

@@ -219,7 +219,7 @@ class InviteButton extends Component {
219 219
 function _mapStateToProps(state) {
220 220
     const { conference } = state['features/base/conference'];
221 221
     const { enableUserRolesBasedOnToken } = state['features/base/config'];
222
-    const { isGuest } = state['features/jwt'];
222
+    const { isGuest } = state['features/base/jwt'];
223 223
 
224 224
     return {
225 225
         _isAddToCallAvailable:

+ 1
- 1
react/features/mobile/callkit/middleware.js 查看文件

@@ -220,7 +220,7 @@ function _conferenceWillJoin({ getState }, next, action) {
220 220
     CallKit.startCall(conference.callUUID, url.toString(), hasVideo)
221 221
         .then(() => {
222 222
             const { room } = state['features/base/conference'];
223
-            const { callee } = state['features/jwt'];
223
+            const { callee } = state['features/base/jwt'];
224 224
 
225 225
             CallKit.updateCall(
226 226
                 conference.callUUID,

+ 1
- 1
react/features/notifications/components/NotificationsContainer.web.js 查看文件

@@ -185,7 +185,7 @@ function _mapStateToProps(state) {
185 185
     const isAnyOverlayVisible = (connectionEstablished && haveToReload)
186 186
         || isMediaPermissionPromptVisible
187 187
         || suspendDetected
188
-        || state['features/jwt'].callOverlayVisible;
188
+        || state['features/base/jwt'].callOverlayVisible;
189 189
 
190 190
     const { enabled, notifications } = state['features/notifications'];
191 191
 

+ 3
- 2
react/features/overlay/components/OverlayContainer.js 查看文件

@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
2 2
 import React, { Component } from 'react';
3 3
 import { connect } from 'react-redux';
4 4
 
5
-import { CallOverlay } from '../../jwt';
5
+import { CallOverlay } from '../../base/jwt';
6 6
 
7 7
 import PageReloadFilmstripOnlyOverlay from './PageReloadFilmstripOnlyOverlay';
8 8
 import PageReloadOverlay from './PageReloadOverlay';
@@ -214,7 +214,8 @@ function _mapStateToProps(state) {
214 214
          * @private
215 215
          * @type {boolean}
216 216
          */
217
-        _callOverlayVisible: Boolean(state['features/jwt'].callOverlayVisible),
217
+        _callOverlayVisible:
218
+            Boolean(state['features/base/jwt'].callOverlayVisible),
218 219
 
219 220
         /**
220 221
          * The indicator which determines whether the status of the

+ 1
- 1
react/features/toolbox/actions.web.js 查看文件

@@ -187,7 +187,7 @@ export function hideToolbox(force: boolean = false): Function {
187 187
 
188 188
         if (!force
189 189
                 && (hovered
190
-                    || state['features/jwt'].callOverlayVisible
190
+                    || state['features/base/jwt'].callOverlayVisible
191 191
                     || SideContainerToggler.isVisible())) {
192 192
             dispatch(
193 193
                 setToolboxTimeout(

+ 1
- 1
react/features/toolbox/components/ProfileButton.web.js 查看文件

@@ -120,7 +120,7 @@ class ProfileButton extends Component {
120 120
  */
121 121
 function _mapStateToProps(state) {
122 122
     return {
123
-        _unclickable: !state['features/jwt'].isGuest
123
+        _unclickable: !state['features/base/jwt'].isGuest
124 124
     };
125 125
 }
126 126
 

+ 1
- 1
react/features/toolbox/components/SecondaryToolbar.web.js 查看文件

@@ -147,7 +147,7 @@ function _mapDispatchToProps(dispatch: Function): Object {
147 147
  * @private
148 148
  */
149 149
 function _mapStateToProps(state: Object): Object {
150
-    const { isGuest } = state['features/jwt'];
150
+    const { isGuest } = state['features/base/jwt'];
151 151
     const { secondaryToolbarButtons, visible } = state['features/toolbox'];
152 152
     const { callStatsID } = state['features/base/config'];
153 153
 

Loading…
取消
儲存