ref: move 'jwt' feature to 'base'

pull/2048/head
paweldomas 7 years ago committed by Lyubo Marinov
parent 887e1b6828
commit 122be9e0e0
  1. 2
      conference.js
  2. 4
      connection.js
  3. 2
      modules/API/API.js
  4. 2
      modules/UI/authentication/AuthHandler.js
  5. 2
      react/features/analytics/functions.js
  6. 2
      react/features/base/connection/actions.native.js
  7. 0
      react/features/base/jwt/actionTypes.js
  8. 3
      react/features/base/jwt/actions.js
  9. 10
      react/features/base/jwt/components/CallOverlay.js
  10. 0
      react/features/base/jwt/components/index.js
  11. 2
      react/features/base/jwt/components/styles.native.js
  12. 0
      react/features/base/jwt/components/styles.web.js
  13. 2
      react/features/base/jwt/functions.js
  14. 0
      react/features/base/jwt/index.js
  15. 14
      react/features/base/jwt/middleware.js
  16. 5
      react/features/base/jwt/reducer.js
  17. 2
      react/features/base/react/components/web/Watermarks.js
  18. 2
      react/features/conference/route.js
  19. 6
      react/features/filmstrip/middleware.js
  20. 2
      react/features/invite/components/AddPeopleDialog.web.js
  21. 2
      react/features/invite/components/InfoDialog.web.js
  22. 2
      react/features/invite/components/InviteButton.web.js
  23. 2
      react/features/mobile/callkit/middleware.js
  24. 2
      react/features/notifications/components/NotificationsContainer.web.js
  25. 5
      react/features/overlay/components/OverlayContainer.js
  26. 2
      react/features/toolbox/actions.web.js
  27. 2
      react/features/toolbox/components/ProfileButton.web.js
  28. 2
      react/features/toolbox/components/SecondaryToolbar.web.js

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

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

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

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

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

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

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

@ -4,10 +4,10 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Audio } from '../../base/media';
import { Avatar } from '../../base/participants';
import { Container, Text } from '../../base/react';
import UIEvents from '../../../../service/UI/UIEvents';
import { Audio } from '../../media';
import { Avatar } from '../../participants';
import { Container, Text } from '../../react';
import UIEvents from '../../../../../service/UI/UIEvents';
import styles from './styles';
@ -335,7 +335,7 @@ function _mapStateToProps(state) {
* @private
* @type {Object}
*/
_callee: state['features/jwt'].callee
_callee: state['features/base/jwt'].callee
};
}

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

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

@ -5,16 +5,16 @@ import {
CONFERENCE_LEFT,
CONFERENCE_WILL_LEAVE,
SET_ROOM
} from '../base/conference';
import { SET_CONFIG } from '../base/config';
import { SET_LOCATION_URL } from '../base/connection';
import { LIB_INIT_ERROR } from '../base/lib-jitsi-meet';
} from '../conference';
import { SET_CONFIG } from '../config';
import { SET_LOCATION_URL } from '../connection';
import { LIB_INIT_ERROR } from '../lib-jitsi-meet';
import {
getLocalParticipant,
getParticipantCount,
PARTICIPANT_JOINED
} from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
} from '../participants';
import { MiddlewareRegistry } from '../redux';
import { setCallOverlayVisible, setJWT } from './actions';
import { SET_JWT } from './actionTypes';
@ -72,7 +72,7 @@ function _maybeSetCallOverlayVisible({ dispatch, getState }, next, action) {
const result = next(action);
const state = getState();
const stateFeaturesJWT = state['features/jwt'];
const stateFeaturesJWT = state['features/base/jwt'];
let callOverlayVisible;
if (stateFeaturesJWT.callee) {

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

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

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

@ -1,7 +1,7 @@
/* @flow */
import { MiddlewareRegistry } from '../base/redux';
import { SET_CALL_OVERLAY_VISIBLE } from '../jwt';
import { SET_CALL_OVERLAY_VISIBLE } from '../base/jwt';
import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
@ -13,10 +13,10 @@ MiddlewareRegistry.register(({ getState }) => next => action => {
case SET_CALL_OVERLAY_VISIBLE:
if (typeof APP !== 'undefined') {
const oldValue
= Boolean(getState()['features/jwt'].callOverlayVisible);
= Boolean(getState()['features/base/jwt'].callOverlayVisible);
const result = next(action);
const newValue
= Boolean(getState()['features/jwt'].callOverlayVisible);
= Boolean(getState()['features/base/jwt'].callOverlayVisible);
oldValue === newValue

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save