fix(salesforce) use salesforce only in the main room (#11245) (#11316)

This commit is contained in:
Mihaela Dumitru 2022-04-05 10:47:34 +03:00 committed by GitHub
parent 331bd2014b
commit 41e790771f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 64 additions and 21 deletions

View File

@ -841,7 +841,7 @@
"raisedHandsLabel": "Number of raised hands",
"record": {
"already": {
"linked": "Record is already linked to this session."
"linked": "The meeting is already linked to this Salesforce object."
},
"type": {
"account": "Account",

View File

@ -15,7 +15,6 @@ import {
NOTIFICATION_TIMEOUT_TYPE,
showErrorNotification
} from '../../notifications';
import { showSalesforceNotification } from '../../salesforce';
import { CONNECTION_ESTABLISHED, CONNECTION_FAILED, connectionDisconnected } from '../connection';
import { validateJwt } from '../jwt';
import { JitsiConferenceErrors } from '../lib-jitsi-meet';
@ -240,9 +239,6 @@ function _conferenceJoined({ dispatch, getState }, next, action) {
dispatch(openDisplayNamePrompt(undefined));
}
dispatch(showSalesforceNotification());
return result;
}

View File

@ -12,6 +12,7 @@ import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
import { SET_REDUCED_UI } from '../base/responsive-ui';
import { FeedbackDialog } from '../feedback';
import { setFilmstripEnabled } from '../filmstrip';
import { showSalesforceNotification } from '../salesforce/actions';
import { setToolboxEnabled } from '../toolbox/actions';
import { notifyKickedOut } from './actions';
@ -21,13 +22,12 @@ MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
case CONFERENCE_JOINED:
case SET_REDUCED_UI: {
const { dispatch, getState } = store;
const state = getState();
const { reducedUI } = state['features/base/responsive-ui'];
_conferenceJoined(store);
dispatch(setToolboxEnabled(!reducedUI));
dispatch(setFilmstripEnabled(!reducedUI));
break;
case SET_REDUCED_UI: {
_setReducedUI(store);
break;
}
@ -80,3 +80,37 @@ StateListenerRegistry.register(
}
}
});
/**
* Configures the UI. In reduced UI mode some components will
* be hidden if there is no space to render them.
*
* @param {Store} store - The redux store in which the specified {@code action}
* is being dispatched.
* @private
* @returns {void}
*/
function _setReducedUI({ dispatch, getState }) {
const { reducedUI } = getState()['features/base/responsive-ui'];
dispatch(setToolboxEnabled(!reducedUI));
dispatch(setFilmstripEnabled(!reducedUI));
}
/**
* Does extra sync up on properties that may need to be updated after the
* conference was joined.
*
* @param {Store} store - The redux store in which the specified {@code action}
* is being dispatched.
* @private
* @returns {void}
*/
function _conferenceJoined({ dispatch, getState }) {
_setReducedUI({
dispatch,
getState
});
dispatch(showSalesforceNotification());
}

View File

@ -10,6 +10,7 @@ import {
} from '../notifications';
import { SalesforceLinkDialog } from './components';
import { isSalesforceEnabled } from './functions';
/**
* Displays the notification for linking the meeting to Salesforce.
@ -18,9 +19,7 @@ import { SalesforceLinkDialog } from './components';
*/
export function showSalesforceNotification() {
return (dispatch: Object, getState: Function) => {
const { salesforceUrl } = getState()['features/base/config'];
if (!salesforceUrl) {
if (!isSalesforceEnabled(getState())) {
return;
}

View File

@ -1,6 +1,21 @@
// @flow
import { doGetJSON } from '../base/util';
import { isInBreakoutRoom } from '../breakout-rooms/functions';
/**
* Determines whether Salesforce is enabled for the current conference.
*
* @param {Function|Object} state - The redux store, the redux
* {@code getState} function, or the redux state itself.
* @returns {boolean}
*/
export const isSalesforceEnabled = (state: Function | Object) => {
const { salesforceUrl } = state['features/base/config'];
const isBreakoutRoom = isInBreakoutRoom(state);
return Boolean(salesforceUrl) && !isBreakoutRoom;
};
/**
* Fetches the Salesforce records that were most recently interacted with.

View File

@ -1,2 +0,0 @@
export * from './components';
export * from './actions';

View File

@ -8,6 +8,7 @@ import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/
import { navigate }
from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
import { screen } from '../../../mobile/navigation/routes';
import { isSalesforceEnabled } from '../../../salesforce/functions';
/**
* Implementation of a button for opening the Salesforce link dialog.
@ -39,7 +40,7 @@ class LinkToSalesforceButton extends AbstractButton<AbstractButtonProps, *> {
*/
function mapStateToProps(state) {
return {
visible: Boolean(state['features/base/config'].salesforceUrl)
visible: isSalesforceEnabled(state)
};
}

View File

@ -6,7 +6,7 @@ import { translate } from '../../../base/i18n';
import { IconSalesforce } from '../../../base/icons';
import { connect } from '../../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
import { SalesforceLinkDialog } from '../../../salesforce';
import { SalesforceLinkDialog } from '../../../salesforce/components';
/**
* The type of the React {@code Component} props of {@link LinkToSalesforce}.

View File

@ -52,6 +52,7 @@ import {
LiveStreamButton,
RecordButton
} from '../../../recording';
import { isSalesforceEnabled } from '../../../salesforce/functions';
import {
isScreenAudioSupported,
isScreenVideoShared,
@ -1391,8 +1392,7 @@ function _mapStateToProps(state, ownProps) {
disableProfile,
enableFeaturesBasedOnToken,
iAmRecorder,
iAmSipGateway,
salesforceUrl
iAmSipGateway
} = state['features/base/config'];
const {
fullScreen,
@ -1441,7 +1441,7 @@ function _mapStateToProps(state, ownProps) {
_isIosMobile: isIosMobileBrowser(),
_isMobile: isMobileBrowser(),
_isVpaasMeeting: isVpaasMeeting(state),
_hasSalesforce: Boolean(salesforceUrl),
_hasSalesforce: isSalesforceEnabled(state),
_localParticipantID: localParticipant?.id,
_localVideo: localVideo,
_overflowMenuVisible: overflowMenuVisible,