Browse Source

Comply w/ coding style

j8
Lyubo Marinov 8 years ago
parent
commit
87b488a12b

+ 1
- 1
react/features/base/conference/middleware.js View File

113
         pin = !localParticipant || !localParticipant.pinned;
113
         pin = !localParticipant || !localParticipant.pinned;
114
     }
114
     }
115
     if (pin) {
115
     if (pin) {
116
-        const conference = state['features/base/conference'].conference;
116
+        const { conference } = state['features/base/conference'];
117
 
117
 
118
         try {
118
         try {
119
             conference.pinParticipant(id);
119
             conference.pinParticipant(id);

+ 7
- 7
react/features/conference/route.js View File

23
 });
23
 });
24
 
24
 
25
 /**
25
 /**
26
- *  Initialization of the app.
26
+ * Initialization of the app.
27
  *
27
  *
28
- *  @private
29
- *  @returns {void}
28
+ * @private
29
+ * @returns {void}
30
  */
30
  */
31
 function _initConference() {
31
 function _initConference() {
32
     _setTokenData();
32
     _setTokenData();
79
                 .catch(err => {
79
                 .catch(err => {
80
                     // Show obtain config error.
80
                     // Show obtain config error.
81
                     APP.UI.messageHandler.openReportDialog(
81
                     APP.UI.messageHandler.openReportDialog(
82
-                        null, 'dialog.connectError', err);
82
+                        null,
83
+                        'dialog.connectError',
84
+                        err);
83
                 });
85
                 });
84
         } else {
86
         } else {
85
             chooseBOSHAddress(config, room);
87
             chooseBOSHAddress(config, room);
112
     const { caller } = state['features/jwt'];
114
     const { caller } = state['features/jwt'];
113
 
115
 
114
     if (caller) {
116
     if (caller) {
115
-        const email = caller.email;
116
-        const avatarUrl = caller.avatarUrl;
117
-        const name = caller.name;
117
+        const { avatarUrl, email, name } = caller;
118
 
118
 
119
         APP.settings.setEmail((email || '').trim(), true);
119
         APP.settings.setEmail((email || '').trim(), true);
120
         APP.settings.setAvatarUrl((avatarUrl || '').trim());
120
         APP.settings.setAvatarUrl((avatarUrl || '').trim());

+ 6
- 6
react/features/invite/components/DialInNumbersForm.js View File

10
 
10
 
11
 const logger = require('jitsi-meet-logger').getLogger(__filename);
11
 const logger = require('jitsi-meet-logger').getLogger(__filename);
12
 
12
 
13
-const EXPAND_ICON = <ExpandIcon label = 'expand' />;
14
-
15
 /**
13
 /**
16
  * React {@code Component} responsible for fetching and displaying telephone
14
  * React {@code Component} responsible for fetching and displaying telephone
17
- * numbers for dialing into the conference. Also supports copying a selected
15
+ * numbers for dialing into a conference. Also supports copying a selected
18
  * dial-in number to the clipboard.
16
  * dial-in number to the clipboard.
19
  *
17
  *
20
  * @extends Component
18
  * @extends Component
105
      * returns {void}
103
      * returns {void}
106
      */
104
      */
107
     componentWillMount() {
105
     componentWillMount() {
108
-        if (this.props._dialIn.numbers) {
109
-            this._setDefaultNumber(this.props._dialIn.numbers);
106
+        const { numbers } = this.props._dialIn;
107
+
108
+        if (numbers) {
109
+            this._setDefaultNumber(numbers);
110
         } else {
110
         } else {
111
             this.props.dispatch(updateDialInNumbers());
111
             this.props.dispatch(updateDialInNumbers());
112
         }
112
         }
209
                     type = 'text'
209
                     type = 'text'
210
                     value = { triggerText || '' } />
210
                     value = { triggerText || '' } />
211
                 <span className = 'dial-in-numbers-trigger-icon'>
211
                 <span className = 'dial-in-numbers-trigger-icon'>
212
-                    { EXPAND_ICON }
212
+                    <ExpandIcon label = 'expand' />
213
                 </span>
213
                 </span>
214
             </div>
214
             </div>
215
         );
215
         );

+ 2
- 5
react/features/invite/components/InviteDialog.js View File

4
 import { Dialog } from '../../base/dialog';
4
 import { Dialog } from '../../base/dialog';
5
 import { translate } from '../../base/i18n';
5
 import { translate } from '../../base/i18n';
6
 import JitsiMeetJS from '../../base/lib-jitsi-meet';
6
 import JitsiMeetJS from '../../base/lib-jitsi-meet';
7
-import {
8
-    getLocalParticipant,
9
-    PARTICIPANT_ROLE
10
-} from '../../base/participants';
7
+import { getLocalParticipant, PARTICIPANT_ROLE } from '../../base/participants';
11
 
8
 
9
+import DialInNumbersForm from './DialInNumbersForm';
12
 import PasswordContainer from './PasswordContainer';
10
 import PasswordContainer from './PasswordContainer';
13
 import ShareLinkForm from './ShareLinkForm';
11
 import ShareLinkForm from './ShareLinkForm';
14
-import DialInNumbersForm from './DialInNumbersForm';
15
 
12
 
16
 /**
13
 /**
17
  * A React {@code Component} for displaying other components responsible for
14
  * A React {@code Component} for displaying other components responsible for

+ 1
- 3
react/features/invite/reducer.js View File

1
-import {
2
-    ReducerRegistry
3
-} from '../base/redux';
1
+import { ReducerRegistry } from '../base/redux';
4
 
2
 
5
 import {
3
 import {
6
     UPDATE_DIAL_IN_NUMBERS_FAILED,
4
     UPDATE_DIAL_IN_NUMBERS_FAILED,

+ 2
- 2
react/features/overlay/actions.js View File

9
  * @param {boolean} isVisible - If the value is true - the prompt for media
9
  * @param {boolean} isVisible - If the value is true - the prompt for media
10
  * permission is visible otherwise the value is false/undefined.
10
  * permission is visible otherwise the value is false/undefined.
11
  * @param {string} browser - The name of the current browser.
11
  * @param {string} browser - The name of the current browser.
12
+ * @public
12
  * @returns {{
13
  * @returns {{
13
  *     type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
14
  *     type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
14
  *     browser: {string},
15
  *     browser: {string},
15
  *     isVisible: {boolean}
16
  *     isVisible: {boolean}
16
  * }}
17
  * }}
17
- * @public
18
  */
18
  */
19
 export function mediaPermissionPromptVisibilityChanged(isVisible, browser) {
19
 export function mediaPermissionPromptVisibilityChanged(isVisible, browser) {
20
     return {
20
     return {
27
 /**
27
 /**
28
  * Signals that suspend was detected.
28
  * Signals that suspend was detected.
29
  *
29
  *
30
+ * @public
30
  * @returns {{
31
  * @returns {{
31
  *     type: SUSPEND_DETECTED
32
  *     type: SUSPEND_DETECTED
32
  * }}
33
  * }}
33
- * @public
34
  */
34
  */
35
 export function suspendDetected() {
35
 export function suspendDetected() {
36
     return {
36
     return {

+ 108
- 78
react/features/overlay/components/AbstractPageReloadOverlay.js View File

1
+/* @flow */
2
+
1
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
2
 
4
 
3
 import { randomInt } from '../../base/util';
5
 import { randomInt } from '../../base/util';
36
          * @public
38
          * @public
37
          * @type {string}
39
          * @type {string}
38
          */
40
          */
39
-        reason: React.PropTypes.string
41
+        reason: React.PropTypes.string,
42
+
43
+        /**
44
+         * The function to translate human-readable text.
45
+         *
46
+         * @public
47
+         * @type {Function}
48
+         */
49
+        t: React.PropTypes.func
40
     };
50
     };
41
 
51
 
52
+    _interval: ?number
53
+
54
+    state: {
55
+
56
+        /**
57
+         * The translation key for the title of the overlay.
58
+         *
59
+         * @type {string}
60
+         */
61
+        message: string,
62
+
63
+        /**
64
+         * Current value(time) of the timer.
65
+         *
66
+         * @type {number}
67
+         */
68
+        timeLeft: number,
69
+
70
+        /**
71
+         * How long the overlay dialog will be displayed before the
72
+         * conference will be reloaded.
73
+         *
74
+         * @type {number}
75
+         */
76
+        timeoutSeconds: number,
77
+
78
+        /**
79
+         * The translation key for the title of the overlay.
80
+         *
81
+         * @type {string}
82
+         */
83
+        title: string
84
+    }
85
+
42
     /**
86
     /**
43
      * Initializes a new AbstractPageReloadOverlay instance.
87
      * Initializes a new AbstractPageReloadOverlay instance.
44
      *
88
      *
46
      * instance is to be initialized.
90
      * instance is to be initialized.
47
      * @public
91
      * @public
48
      */
92
      */
49
-    constructor(props) {
93
+    constructor(props: Object) {
50
         super(props);
94
         super(props);
51
 
95
 
52
         /**
96
         /**
68
         }
112
         }
69
 
113
 
70
         this.state = {
114
         this.state = {
71
-            /**
72
-             * The translation key for the title of the overlay.
73
-             *
74
-             * @type {string}
75
-             */
76
             message,
115
             message,
77
-
78
-            /**
79
-             * Current value(time) of the timer.
80
-             *
81
-             * @type {number}
82
-             */
83
             timeLeft: timeoutSeconds,
116
             timeLeft: timeoutSeconds,
84
-
85
-            /**
86
-             * How long the overlay dialog will be displayed before the
87
-             * conference will be reloaded.
88
-             *
89
-             * @type {number}
90
-             */
91
             timeoutSeconds,
117
             timeoutSeconds,
92
-
93
-            /**
94
-             * The translation key for the title of the overlay.
95
-             *
96
-             * @type {string}
97
-             */
98
             title
118
             title
99
         };
119
         };
100
     }
120
     }
101
 
121
 
102
-    /**
103
-     * Renders the button for relaod the page if necessary.
104
-     *
105
-     * @returns {ReactElement|null}
106
-     * @private
107
-     */
108
-    _renderButton() {
109
-        if (this.props.isNetworkFailure) {
110
-            return (
111
-                <ReloadButton textKey = 'dialog.rejoinNow' />
112
-            );
113
-        }
114
-
115
-        return null;
116
-    }
117
-
118
-    /**
119
-     * Renders the progress bar.
120
-     *
121
-     * @returns {ReactElement|null}
122
-     * @protected
123
-     */
124
-    _renderProgressBar() {
125
-        return (
126
-            <div
127
-                className = 'aui-progress-indicator'
128
-                id = 'reloadProgressBar'>
129
-                <span className = 'aui-progress-indicator-value' />
130
-            </div>
131
-        );
132
-    }
133
-
134
     /**
122
     /**
135
      * React Component method that executes once component is mounted.
123
      * React Component method that executes once component is mounted.
136
      *
124
      *
137
      * @inheritdoc
125
      * @inheritdoc
138
      * @returns {void}
126
      * @returns {void}
139
-     * @protected
140
      */
127
      */
141
     componentDidMount() {
128
     componentDidMount() {
142
         // FIXME (CallStats - issue) This event will not make it to CallStats
129
         // FIXME (CallStats - issue) This event will not make it to CallStats
148
                 /* value */ undefined,
135
                 /* value */ undefined,
149
                 /* label */ this.props.reason);
136
                 /* label */ this.props.reason);
150
         logger.info(
137
         logger.info(
151
-                'The conference will be reloaded after '
152
-                    + `${this.state.timeoutSeconds} seconds.`);
138
+                `The conference will be reloaded after ${
139
+                    this.state.timeoutSeconds} seconds.`);
153
 
140
 
154
         AJS.progressBars.update('#reloadProgressBar', 0);
141
         AJS.progressBars.update('#reloadProgressBar', 0);
155
 
142
 
156
-        this.intervalId = setInterval(() => {
157
-            if (this.state.timeLeft === 0) {
158
-                clearInterval(this.intervalId);
159
-                reconnectNow();
160
-            } else {
161
-                this.setState(prevState => {
162
-                    return {
163
-                        timeLeft: prevState.timeLeft - 1
164
-                    };
165
-                });
166
-            }
167
-        }, 1000);
143
+        this._interval
144
+            = setInterval(
145
+                    () => {
146
+                        if (this.state.timeLeft === 0) {
147
+                            if (this._interval) {
148
+                                clearInterval(this._interval);
149
+                                this._interval = undefined;
150
+                            }
151
+
152
+                            reconnectNow();
153
+                        } else {
154
+                            this.setState(prevState => {
155
+                                return {
156
+                                    timeLeft: prevState.timeLeft - 1
157
+                                };
158
+                            });
159
+                        }
160
+                    },
161
+                    1000);
168
     }
162
     }
169
 
163
 
170
     /**
164
     /**
172
      *
166
      *
173
      * @inheritdoc
167
      * @inheritdoc
174
      * @returns {void}
168
      * @returns {void}
175
-     * @protected
176
      */
169
      */
177
     componentDidUpdate() {
170
     componentDidUpdate() {
178
-        AJS.progressBars.update('#reloadProgressBar',
179
-            (this.state.timeoutSeconds - this.state.timeLeft)
180
-                / this.state.timeoutSeconds);
171
+        const { timeLeft, timeoutSeconds } = this.state;
172
+
173
+        AJS.progressBars.update(
174
+            '#reloadProgressBar',
175
+            (timeoutSeconds - timeLeft) / timeoutSeconds);
181
     }
176
     }
182
 
177
 
183
     /**
178
     /**
187
      * @returns {void}
182
      * @returns {void}
188
      */
183
      */
189
     componentWillUnmount() {
184
     componentWillUnmount() {
190
-        clearInterval(this.intervalId);
185
+        if (this._interval) {
186
+            clearInterval(this._interval);
187
+            this._interval = undefined;
188
+        }
189
+    }
190
+
191
+    /**
192
+     * Renders the button for relaod the page if necessary.
193
+     *
194
+     * @protected
195
+     * @returns {ReactElement|null}
196
+     */
197
+    _renderButton() {
198
+        if (this.props.isNetworkFailure) {
199
+            return (
200
+                <ReloadButton textKey = 'dialog.rejoinNow' />
201
+            );
202
+        }
203
+
204
+        return null;
205
+    }
206
+
207
+    /**
208
+     * Renders the progress bar.
209
+     *
210
+     * @protected
211
+     * @returns {ReactElement}
212
+     */
213
+    _renderProgressBar() {
214
+        return (
215
+            <div
216
+                className = 'aui-progress-indicator'
217
+                id = 'reloadProgressBar'>
218
+                <span className = 'aui-progress-indicator-value' />
219
+            </div>
220
+        );
191
     }
221
     }
192
 }
222
 }

+ 2
- 23
react/features/overlay/components/PageReloadFilmstripOnlyOverlay.js View File

11
  * counts down towards the reload.
11
  * counts down towards the reload.
12
  */
12
  */
13
 class PageReloadFilmstripOnlyOverlay extends AbstractPageReloadOverlay {
13
 class PageReloadFilmstripOnlyOverlay extends AbstractPageReloadOverlay {
14
-    /**
15
-     * PageReloadFilmstripOnlyOverlay component's property types.
16
-     *
17
-     * @static
18
-     */
19
-    static propTypes = {
20
-        ...AbstractPageReloadOverlay.propTypes,
21
-
22
-        /**
23
-         * The function to translate human-readable text.
24
-         *
25
-         * @public
26
-         * @type {Function}
27
-         */
28
-        t: React.PropTypes.func
29
-    };
30
-
31
     /**
14
     /**
32
      * Implements React's {@link Component#render()}.
15
      * Implements React's {@link Component#render()}.
33
      *
16
      *
48
                         { t(message, { seconds: timeLeft }) }
31
                         { t(message, { seconds: timeLeft }) }
49
                     </div>
32
                     </div>
50
                 </div>
33
                 </div>
51
-                {
52
-                    this._renderButton()
53
-                }
54
-                {
55
-                    this._renderProgressBar()
56
-                }
34
+                { this._renderButton() }
35
+                { this._renderProgressBar() }
57
             </FilmstripOnlyOverlayFrame>
36
             </FilmstripOnlyOverlayFrame>
58
         );
37
         );
59
     }
38
     }

+ 0
- 17
react/features/overlay/components/PageReloadOverlay.js View File

11
  * reload.
11
  * reload.
12
  */
12
  */
13
 class PageReloadOverlay extends AbstractPageReloadOverlay {
13
 class PageReloadOverlay extends AbstractPageReloadOverlay {
14
-    /**
15
-     * PageReloadOverlay component's property types.
16
-     *
17
-     * @static
18
-     */
19
-    static propTypes = {
20
-        ...AbstractPageReloadOverlay.propTypes,
21
-
22
-        /**
23
-         * The function to translate human-readable text.
24
-         *
25
-         * @public
26
-         * @type {Function}
27
-         */
28
-        t: React.PropTypes.func
29
-    };
30
-
31
     /**
14
     /**
32
      * Implements React's {@link Component#render()}.
15
      * Implements React's {@link Component#render()}.
33
      *
16
      *

+ 2
- 1
react/features/overlay/components/ReloadButton.js View File

34
     /**
34
     /**
35
      * Renders the button for relaod the page if necessary.
35
      * Renders the button for relaod the page if necessary.
36
      *
36
      *
37
-     * @returns {ReactElement|null}
38
      * @private
37
      * @private
38
+     * @returns {ReactElement}
39
      */
39
      */
40
     render() {
40
     render() {
41
         const className
41
         const className
54
 
54
 
55
         /* eslint-enable react/jsx-handler-names */
55
         /* eslint-enable react/jsx-handler-names */
56
     }
56
     }
57
+}
57
 
58
 
58
 }
59
 }
59
 
60
 

+ 1
- 2
react/features/overlay/components/SuspendedOverlay.js View File

48
                             translateToHTML(t, 'suspendedoverlay.title')
48
                             translateToHTML(t, 'suspendedoverlay.title')
49
                         }
49
                         }
50
                     </span>
50
                     </span>
51
-                    <ReloadButton
52
-                        textKey = 'suspendedoverlay.rejoinKeyTitle' />
51
+                    <ReloadButton textKey = 'suspendedoverlay.rejoinKeyTitle' />
53
                 </div>
52
                 </div>
54
             </OverlayFrame>
53
             </OverlayFrame>
55
         );
54
         );

+ 4
- 6
react/features/toolbox/components/Toolbar.web.js View File

3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
 
5
 
6
-import {
7
-    setToolbarHovered
8
-} from '../actions';
6
+import { setToolbarHovered } from '../actions';
9
 import ToolbarButton from './ToolbarButton';
7
 import ToolbarButton from './ToolbarButton';
10
 
8
 
11
 /**
9
 /**
108
      * @param {Array} keyValuePair - Key value pair containing button and its
106
      * @param {Array} keyValuePair - Key value pair containing button and its
109
      * key.
107
      * key.
110
      * @param {number} index - Index of the key value pair in the array.
108
      * @param {number} index - Index of the key value pair in the array.
111
-     * @returns {Array} Array of toolbar buttons and splitter if it's on.
112
      * @private
109
      * @private
110
+     * @returns {Array} Array of toolbar buttons and splitter if it's on.
113
      */
111
      */
114
     _renderToolbarButton(acc: Array<*>, keyValuePair: Array<*>,
112
     _renderToolbarButton(acc: Array<*>, keyValuePair: Array<*>,
115
                          index: number): Array<ReactElement<*>> {
113
                          index: number): Array<ReactElement<*>> {
153
  * Maps part of Redux actions to component's props.
151
  * Maps part of Redux actions to component's props.
154
  *
152
  *
155
  * @param {Function} dispatch - Redux action dispatcher.
153
  * @param {Function} dispatch - Redux action dispatcher.
156
- * @returns {Object}
157
  * @private
154
  * @private
155
+ * @returns {Object}
158
  */
156
  */
159
 function _mapDispatchToProps(dispatch: Function): Object {
157
 function _mapDispatchToProps(dispatch: Function): Object {
160
     return {
158
     return {
180
     };
178
     };
181
 }
179
 }
182
 
180
 
183
-export default connect(null, _mapDispatchToProps)(Toolbar);
181
+export default connect(undefined, _mapDispatchToProps)(Toolbar);

Loading…
Cancel
Save