Browse Source

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

master
Mihaela Dumitru 3 years ago
parent
commit
e062c394e8
No account linked to committer's email address

+ 1
- 1
lang/main.json View File

841
     "raisedHandsLabel": "Number of raised hands",
841
     "raisedHandsLabel": "Number of raised hands",
842
     "record": {
842
     "record": {
843
         "already": {
843
         "already": {
844
-            "linked": "Record is already linked to this session."
844
+            "linked": "The meeting is already linked to this Salesforce object."
845
         },
845
         },
846
         "type": {
846
         "type": {
847
             "account": "Account",
847
             "account": "Account",

+ 0
- 4
react/features/base/conference/middleware.any.js View File

15
     NOTIFICATION_TIMEOUT_TYPE,
15
     NOTIFICATION_TIMEOUT_TYPE,
16
     showErrorNotification
16
     showErrorNotification
17
 } from '../../notifications';
17
 } from '../../notifications';
18
-import { showSalesforceNotification } from '../../salesforce';
19
 import { CONNECTION_ESTABLISHED, CONNECTION_FAILED, connectionDisconnected } from '../connection';
18
 import { CONNECTION_ESTABLISHED, CONNECTION_FAILED, connectionDisconnected } from '../connection';
20
 import { validateJwt } from '../jwt';
19
 import { validateJwt } from '../jwt';
21
 import { JitsiConferenceErrors } from '../lib-jitsi-meet';
20
 import { JitsiConferenceErrors } from '../lib-jitsi-meet';
240
         dispatch(openDisplayNamePrompt(undefined));
239
         dispatch(openDisplayNamePrompt(undefined));
241
     }
240
     }
242
 
241
 
243
-
244
-    dispatch(showSalesforceNotification());
245
-
246
     return result;
242
     return result;
247
 }
243
 }
248
 
244
 

+ 40
- 6
react/features/conference/middleware.js View File

12
 import { SET_REDUCED_UI } from '../base/responsive-ui';
12
 import { SET_REDUCED_UI } from '../base/responsive-ui';
13
 import { FeedbackDialog } from '../feedback';
13
 import { FeedbackDialog } from '../feedback';
14
 import { setFilmstripEnabled } from '../filmstrip';
14
 import { setFilmstripEnabled } from '../filmstrip';
15
+import { showSalesforceNotification } from '../salesforce/actions';
15
 import { setToolboxEnabled } from '../toolbox/actions';
16
 import { setToolboxEnabled } from '../toolbox/actions';
16
 
17
 
17
 import { notifyKickedOut } from './actions';
18
 import { notifyKickedOut } from './actions';
21
 
22
 
22
     switch (action.type) {
23
     switch (action.type) {
23
     case CONFERENCE_JOINED:
24
     case CONFERENCE_JOINED:
24
-    case SET_REDUCED_UI: {
25
-        const { dispatch, getState } = store;
26
-        const state = getState();
27
-        const { reducedUI } = state['features/base/responsive-ui'];
25
+        _conferenceJoined(store);
26
+
27
+        break;
28
 
28
 
29
-        dispatch(setToolboxEnabled(!reducedUI));
30
-        dispatch(setFilmstripEnabled(!reducedUI));
29
+    case SET_REDUCED_UI: {
30
+        _setReducedUI(store);
31
 
31
 
32
         break;
32
         break;
33
     }
33
     }
80
             }
80
             }
81
         }
81
         }
82
     });
82
     });
83
+
84
+/**
85
+ * Configures the UI. In reduced UI mode some components will
86
+ * be hidden if there is no space to render them.
87
+ *
88
+ * @param {Store} store - The redux store in which the specified {@code action}
89
+ * is being dispatched.
90
+ * @private
91
+ * @returns {void}
92
+ */
93
+function _setReducedUI({ dispatch, getState }) {
94
+    const { reducedUI } = getState()['features/base/responsive-ui'];
95
+
96
+    dispatch(setToolboxEnabled(!reducedUI));
97
+    dispatch(setFilmstripEnabled(!reducedUI));
98
+}
99
+
100
+/**
101
+ * Does extra sync up on properties that may need to be updated after the
102
+ * conference was joined.
103
+ *
104
+ * @param {Store} store - The redux store in which the specified {@code action}
105
+ * is being dispatched.
106
+ * @private
107
+ * @returns {void}
108
+ */
109
+function _conferenceJoined({ dispatch, getState }) {
110
+    _setReducedUI({
111
+        dispatch,
112
+        getState
113
+    });
114
+
115
+    dispatch(showSalesforceNotification());
116
+}

+ 2
- 3
react/features/salesforce/actions.js View File

10
 } from '../notifications';
10
 } from '../notifications';
11
 
11
 
12
 import { SalesforceLinkDialog } from './components';
12
 import { SalesforceLinkDialog } from './components';
13
+import { isSalesforceEnabled } from './functions';
13
 
14
 
14
 /**
15
 /**
15
  * Displays the notification for linking the meeting to Salesforce.
16
  * Displays the notification for linking the meeting to Salesforce.
18
  */
19
  */
19
 export function showSalesforceNotification() {
20
 export function showSalesforceNotification() {
20
     return (dispatch: Object, getState: Function) => {
21
     return (dispatch: Object, getState: Function) => {
21
-        const { salesforceUrl } = getState()['features/base/config'];
22
-
23
-        if (!salesforceUrl) {
22
+        if (!isSalesforceEnabled(getState())) {
24
             return;
23
             return;
25
         }
24
         }
26
 
25
 

+ 15
- 0
react/features/salesforce/functions.js View File

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

+ 0
- 2
react/features/salesforce/index.js View File

1
-export * from './components';
2
-export * from './actions';

+ 2
- 1
react/features/toolbox/components/native/LinkToSalesforceButton.js View File

8
 import { navigate }
8
 import { navigate }
9
     from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
9
     from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
10
 import { screen } from '../../../mobile/navigation/routes';
10
 import { screen } from '../../../mobile/navigation/routes';
11
+import { isSalesforceEnabled } from '../../../salesforce/functions';
11
 
12
 
12
 /**
13
 /**
13
  * Implementation of a button for opening the Salesforce link dialog.
14
  * Implementation of a button for opening the Salesforce link dialog.
39
  */
40
  */
40
 function mapStateToProps(state) {
41
 function mapStateToProps(state) {
41
     return {
42
     return {
42
-        visible: Boolean(state['features/base/config'].salesforceUrl)
43
+        visible: isSalesforceEnabled(state)
43
     };
44
     };
44
 }
45
 }
45
 
46
 

+ 1
- 1
react/features/toolbox/components/web/LinkToSalesforceButton.js View File

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

+ 3
- 3
react/features/toolbox/components/web/Toolbox.js View File

52
     LiveStreamButton,
52
     LiveStreamButton,
53
     RecordButton
53
     RecordButton
54
 } from '../../../recording';
54
 } from '../../../recording';
55
+import { isSalesforceEnabled } from '../../../salesforce/functions';
55
 import {
56
 import {
56
     isScreenAudioSupported,
57
     isScreenAudioSupported,
57
     isScreenVideoShared,
58
     isScreenVideoShared,
1391
         disableProfile,
1392
         disableProfile,
1392
         enableFeaturesBasedOnToken,
1393
         enableFeaturesBasedOnToken,
1393
         iAmRecorder,
1394
         iAmRecorder,
1394
-        iAmSipGateway,
1395
-        salesforceUrl
1395
+        iAmSipGateway
1396
     } = state['features/base/config'];
1396
     } = state['features/base/config'];
1397
     const {
1397
     const {
1398
         fullScreen,
1398
         fullScreen,
1441
         _isIosMobile: isIosMobileBrowser(),
1441
         _isIosMobile: isIosMobileBrowser(),
1442
         _isMobile: isMobileBrowser(),
1442
         _isMobile: isMobileBrowser(),
1443
         _isVpaasMeeting: isVpaasMeeting(state),
1443
         _isVpaasMeeting: isVpaasMeeting(state),
1444
-        _hasSalesforce: Boolean(salesforceUrl),
1444
+        _hasSalesforce: isSalesforceEnabled(state),
1445
         _localParticipantID: localParticipant?.id,
1445
         _localParticipantID: localParticipant?.id,
1446
         _localVideo: localVideo,
1446
         _localVideo: localVideo,
1447
         _overflowMenuVisible: overflowMenuVisible,
1447
         _overflowMenuVisible: overflowMenuVisible,

Loading…
Cancel
Save